@pqina/pintura 8.86.1 → 8.88.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/package.json +1 -1
- package/pintura-iife.js +2 -2
- package/pintura-umd.js +2 -2
- package/pintura.css +2 -2
- package/pintura.d.ts +2 -0
- package/pintura.js +2 -2
- package/pintura.module.css +2 -2
package/pintura-iife.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Pintura v8.
|
|
2
|
+
* Pintura v8.88.0 - Test version
|
|
3
3
|
* (c) 2018-2024 PQINA Inc. - All Rights Reserved
|
|
4
4
|
* License: https://pqina.nl/pintura/license/
|
|
5
5
|
*
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
*/
|
|
9
9
|
/* eslint-disable */
|
|
10
10
|
|
|
11
|
-
var pintura=function(e){"use strict";const t=[{value:65504,name:"jfif"},{value:65498,name:"sos"},{value:65505,subvalue:17784,name:"exif"},{value:65505,subvalue:26740,name:"xmp"},{value:65506,subvalue:19792,name:"mpf"},{value:65506,name:"app2"}];var o=(e,o,i)=>{if(!e)return;const r=new DataView(e),n=(e=>{if(65496!==e.getUint16(0))return;const o=e.byteLength;let i,r=2,n=void 0;for(;r<o&&255===e.getUint8(r);){i=e.getUint16(r);const o=t.find((t=>t.value===i&&(!t.subvalue||t.subvalue===e.getUint16(r+2+2))));if(o){const{name:t}=o;n||(n={}),n[t]||(n[t]={offset:r,size:e.getUint16(r+2)})}if(65498===i)break;r+=2+e.getUint16(r+2)}return n})(r);if(!n||!n.exif)return;const a=((e,t)=>{if(65505!==e.getUint16(t))return;const o=e.getUint16(t+2);if(t+=4,1165519206!==e.getUint32(t))return;t+=6;const i=e.getUint16(t);if(18761!==i&&19789!==i)return;const r=18761===i;if(t+=2,42!==e.getUint16(t,r))return;t+=e.getUint32(t+2,r);const n=i=>{const n=[];let a=t;const s=Math.min(e.byteLength,t+o-16);for(;a<s;a+=12){const t=a;e.getUint16(t,r)===i&&n.push(t)}return n};return{read:t=>{const o=n(t);if(o.length)return e.getUint16(o[0]+8,r)},write:(t,o)=>{const i=n(t);return!!i.length&&(i.forEach((t=>e.setUint16(t+8,o,r))),!0)}}})(r,n.exif.offset);return a?void 0===i?a.read(o):a.write(o,i):void 0};const i="__pqina_webapi__";var r=e=>window[i]?window[i][e]:window[e],n=(...e)=>{};const a={ArrayBuffer:"readAsArrayBuffer"};var s=(e,t=n,o={})=>new Promise(((i,n)=>{const{dataFormat:s=a.ArrayBuffer}=o,l=new(r("FileReader"));l.onload=()=>i(l.result),l.onerror=()=>n(l.error),l.onprogress=t,l[s](e)})),l=async(e,t)=>{const i=await(async(e,t=[0,e.size],o)=>await s(e.slice(...t),o))(e,[0,262144],t);return o(i,274)||1};let c=null;var d=()=>(null===c&&(c="undefined"!=typeof window&&void 0!==window.document),c);let u=null;var p=()=>new Promise((e=>{if(null===u){const t="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4QA6RXhpZgAATU0AKgAAAAgAAwESAAMAAAABAAYAAAEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wAALCAABAAIBASIA/8QAJgABAAAAAAAAAAAAAAAAAAAAAxABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAAPwBH/9k=";let o=d()?new Image:{};return o.onload=()=>{u=1===o.naturalWidth,o=void 0,e(u)},void(o.src=t)}return e(u)})),h=e=>e.getContext("2d").getImageData(0,0,e.width,e.height),m=e=>"string"==typeof e;function g(e,t){t.split(";").forEach((t=>{const[o,i]=t.split(":");if(!o.length||!i)return;const[r,n]=i.split("!important");e.style.setProperty(o,r,m(n)?"important":void 0)}))}var $=(e,t,o=[])=>{const i=document.createElement(e),r=Object.getOwnPropertyDescriptors(i.__proto__);for(const e in t)"style"===e?g(i,t[e]):r[e]&&r[e].set||/textContent|innerHTML/.test(e)||"function"==typeof t[e]?i[e]=t[e]:i.setAttribute(e,t[e]);return o.forEach((e=>i.appendChild(e))),i};const f={1:()=>[1,0,0,1,0,0],2:e=>[-1,0,0,1,e,0],3:(e,t)=>[-1,0,0,-1,e,t],4:(e,t)=>[1,0,0,-1,0,t],5:()=>[0,1,1,0,0,0],6:(e,t)=>[0,1,-1,0,t,0],7:(e,t)=>[0,-1,-1,0,t,e],8:e=>[0,-1,1,0,0,e]};var y=e=>{e.width=1,e.height=1;const t=e.getContext("2d");t&&t.clearRect(0,0,1,1)},b=e=>"data"in e,x=e=>d()?RegExp(e).test(window.navigator.userAgent):void 0;let v=null;var w=()=>(null===v&&(v=x(/Android/)),v),S=(e,t)=>{const o=$("canvas",{width:e.width,height:e.height});return o.getContext("2d",t).drawImage(e,0,0),o},k=async(e,t=1)=>{const o=await p(),[i,r]=o||t<5?[e.width,e.height]:[e.height,e.width],n=$("canvas",{width:i,height:r}),a=n.getContext("2d",{willReadFrequently:!0});if(b(e)&&!o&&t>1){const t=$("canvas",{width:e.width,height:e.height});t.getContext("2d",{willReadFrequently:!0}).putImageData(e,0,0),e=t}if(!o&&t>1&&a.transform.apply(a,((e,t,o=-1)=>(-1===o&&(o=1),f[o](e,t)))(e.width,e.height,t)),b(e)){if(a.putImageData(e,0,0),w())return S(n)}else a.drawImage(e,0,0);return e instanceof HTMLCanvasElement&&y(e),n},C=async(e,t=1)=>1===t||await p()?e:h(await k(e,t)),T=e=>"object"==typeof e;const M=e=>e instanceof HTMLElement?e:T(e)?P(e):e,P=e=>{let t;return Array.isArray(e)?(t=[],e.forEach(((e,o)=>{t[o]=M(e)}))):(t={},null!==e&&Object.keys(e).forEach((o=>{const i=e[o];t[o]=M(i)}))),t};var R=e=>"function"==typeof e,I=(e,t)=>new Promise(((o,i)=>{const r=()=>o(((e,{width:t,height:o,canvasMemoryLimit:i,contextOptions:r})=>{let n=t||e.naturalWidth,a=o||e.naturalHeight;n||a||(n=300,a=150);const s=n*a;if(i&&s>i){const e=Math.sqrt(i)/Math.sqrt(s);n=Math.floor(n*e),a=Math.floor(a*e)}const l=$("canvas");return l.width=n,l.height=a,l.getContext("2d",r).drawImage(e,0,0,n,a),l})(e,t));e.complete&&e.width?r():(e.onload=r,e.onerror=()=>i(new Error("Failed to load image")))})),E=()=>"createImageBitmap"in window,A=e=>/svg/.test(e.type),L=()=>Math.random().toString(36).substring(2,9);const F=new Map;var z=(e,t,o)=>new Promise(((i,r)=>{const n=e.toString();let a=F.get(n);if(!a){const t=(e=>`function () {self.onmessage = function (message) {(${e.toString()}).apply(null, message.data.content.concat([function (err, response) {\n response = response || {};\n const transfer = 'data' in response ? [response.data.buffer] : 'width' in response ? [response] : [];\n return self.postMessage({ id: message.data.id, content: response, error: err }, transfer);\n}]))}}`)(e),o=URL.createObjectURL((e=>new Blob(["(","function"==typeof e?e.toString():e,")()"],{type:"application/javascript"}))(t)),i=new Map,r=new Worker(o);a={url:o,worker:r,messages:i,terminationTimeout:void 0,terminate:()=>{clearTimeout(a.terminationTimeout),a.worker.terminate(),URL.revokeObjectURL(o),F.delete(n)}},r.onmessage=function(e){const{id:t,content:o,error:r}=e.data;if(clearTimeout(a.terminationTimeout),a.terminationTimeout=setTimeout((()=>{i.size>0||a.terminate()}),500),!i.has(t))return;const n=i.get(t);i.delete(t),null!=r?n.reject(r):n.resolve(o)},F.set(n,a)}const s=L();a.messages.set(s,{resolve:i,reject:r}),a.worker.postMessage({id:s,content:t},o)}));let D=null;var O=()=>(null===D&&(D=x(/Firefox/)),D);const B=async(e,t)=>{const o=await(async(e,t)=>{const o=$("img",{src:URL.createObjectURL(e)}),i=await I(o,t);return URL.revokeObjectURL(o.src),i})(e,{canvasMemoryLimit:t,contextOptions:{willReadFrequently:!0}}),i=h(o);return y(o),i};var W=async(e,t)=>{if(w()&&!O())return await B(e,t);let o;if(E()&&!A(e)&&"OffscreenCanvas"in window)try{o=await z(((e,t,o)=>{createImageBitmap(e).then((e=>{let i=e.width,r=e.height;const n=i*r;if(t&&n>t){const e=Math.sqrt(t)/Math.sqrt(n);i=Math.floor(i*e),r=Math.floor(r*e)}const a=new OffscreenCanvas(i,r),s=a.getContext("2d",{willReadFrequently:!0});s.drawImage(e,0,0,i,r);const l=s.getImageData(0,0,a.width,a.height);o(null,l)})).catch((e=>{o(e)}))}),[e,t])}catch(e){}return o&&o.width?o:await B(e,t)},_=(e,t,o)=>new Promise(((i,r)=>{try{e.toBlob((e=>{if(!e)return r(new Error("Failed to create blob"));i(e)}),t,o)}catch(e){r(e)}})),V=async(e,t,o)=>{const i=await k(e),r=await _(i,t,o);return y(i),r};const N={matroska:"mkv"};var H=e=>{const t=(e.match(/\/([a-z0-9]+)/)||[])[1];if(/^x/.test(t)){const[,t=""]=e.split("/x-");return N[t]}return t},j=e=>e.substring(0,e.lastIndexOf("."))||e;const U=/avif|bmp|gif|jpg|jpeg|jpe|jif|jfif|png|svg|tiff|webp/;var G=e=>{return e&&(t=(o=e,o.split(".").pop()).toLowerCase(),U.test(t)?"image/"+(/jfif|jif|jpe|jpg/.test(t)?"jpeg":"svg"===t?"svg+xml":t):"");var t,o},Z=(e,t,o)=>{const i=(new Date).getTime(),n=e.type.length&&!/null|text/.test(e.type),a=n?e.type:o,s=((e,t)=>{const o=G(e);if(o===t)return e;const i=H(t)||o;return`${j(e)}.${i}`})(t,a);try{return new(r("File"))([e],s,{lastModified:i,type:n?e.type:a})}catch(t){const o=n?e.slice():e.slice(0,e.size,a);return o.lastModified=i,o.name=s,o}},X=(e,t)=>e/t,Y=e=>e;const q=Math.PI,K=Math.PI/2,J=K/2;var Q=e=>{const t=Math.abs(e)%Math.PI;return t>J&&t<Math.PI-J};const ee={Top:"t",Right:"r",Bottom:"b",Left:"l",TopLeft:"tl",TopRight:"tr",BottomRight:"br",BottomLeft:"bl"},{Top:te,Right:oe,Bottom:ie,Left:re,TopLeft:ne,TopRight:ae,BottomRight:se,BottomLeft:le}=ee;var ce={[te]:[.5,0],[oe]:[1,.5],[ie]:[.5,1],[re]:[0,.5],[ne]:[0,0],[ae]:[1,0],[se]:[1,1],[le]:[0,1]},de=(e,t=12)=>parseFloat(e.toFixed(t));const ue=(e,t,o)=>o+(e-o)*t,pe=e=>({x:e.x+.5*e.width,y:e.y+.5*e.height,rx:.5*e.width,ry:.5*e.height}),he=()=>me(0,0),me=(e,t)=>({x:e,y:t}),ge=e=>me(e.pageX,e.pageY),$e=e=>me(e.x,e.y),fe=e=>(e.x=-e.x,e.y=-e.y,e),ye=(e,t,o=he())=>{const i=Math.cos(t),r=Math.sin(t),n=e.x-o.x,a=e.y-o.y;return e.x=o.x+i*n-r*a,e.y=o.y+r*n+i*a,e},be=e=>Math.sqrt(e.x*e.x+e.y*e.y),xe=e=>{const t=Math.sqrt(e.x*e.x+e.y*e.y);return 0===t?he():(e.x/=t,e.y/=t,e)},ve=(e,t)=>Math.atan2(t.y-e.y,t.x-e.x),we=(e,t)=>e.x===t.x&&e.y===t.y,Se=(e,t)=>(e.x=t(e.x),e.y=t(e.y),e),ke=(e,t)=>(e.x+=t.x,e.y+=t.y,e),Ce=(e,t)=>(e.x-=t.x,e.y-=t.y,e),Te=(e,t)=>(e.x/=t,e.y/=t,e),Me=(e,t)=>(e.x*=t,e.y*=t,e),Pe=(e,t)=>e.x*t.x+e.y*t.y,Re=(e,t)=>e.x*t.y-e.y*t.x,Ie=(e,t=he())=>{const o=e.x-t.x,i=e.y-t.y;return o*o+i*i},Ee=(e,t=he())=>Math.sqrt(Ie(e,t)),Ae=(e,t,o)=>(e.x=ue(e.x,t,o.x),e.y=ue(e.y,t,o.y),e),Le=e=>{let t=0,o=0;return e.forEach((e=>{t+=e.x,o+=e.y})),me(t/e.length,o/e.length)},Fe=(e,t,o,i,r)=>(e.forEach((e=>{e.x=t?i-(e.x-i):e.x,e.y=o?r-(e.y-r):e.y})),e),ze=(e,t,o,i)=>{const r=Math.sin(t),n=Math.cos(t);return e.forEach((e=>{e.x-=o,e.y-=i;const t=e.x*n-e.y*r,a=e.x*r+e.y*n;e.x=o+t,e.y=i+a})),e},De=(e,t)=>({width:e,height:t}),Oe=e=>De(e.width,e.height),Be=e=>De(e.width,e.height),We=e=>De(e.width,e.height),_e=e=>De(e[0],e[1]),Ve=e=>{return/img/i.test(e.nodeName)?De((t=e).naturalWidth,t.naturalHeight):Be(e);var t},Ne=(e,t)=>De(e,t),He=(e,t,o=Y)=>o(e.width)===o(t.width)&&o(e.height)===o(t.height),je=(e,t)=>(e.width*=t,e.height*=t,e),Ue=e=>me(.5*e.width,.5*e.height),Ge=(e,t)=>{const o=Math.abs(t),i=Math.abs(Math.cos(o)),r=Math.abs(Math.sin(o)),n=i*e.width+r*e.height,a=r*e.width+i*e.height;return e.width=n,e.height=a,e},Ze=(e,t)=>e.width>=t.width&&e.height>=t.height,Xe=(e,t)=>(e.width=t(e.width),e.height=t(e.height),e),Ye=(e,t)=>({start:e,end:t}),qe=e=>Ye($e(e.start),$e(e.end)),Ke=(e,t)=>{if(0===t)return e;const o=me(e.start.x-e.end.x,e.start.y-e.end.y),i=xe(o),r=Me(i,t);return e.start.x+=r.x,e.start.y+=r.y,e.end.x-=r.x,e.end.y-=r.y,e},Je=[me(-1,-1),me(-1,1),me(1,1),me(1,-1)],Qe=(e,t,o,i)=>({x:e,y:t,width:o,height:i}),et=e=>Qe(e.x,e.y,e.width,e.height),tt=()=>Qe(0,0,0,0),ot=e=>Qe(0,0,e.width,e.height),it=e=>Qe(e[3],e[0],e[1]-e[3],e[2]-e[0]),rt=e=>Qe(e.x||0,e.y||0,e.width||0,e.height||0),nt=e=>{let t=e[0].x,o=e[0].x,i=e[0].y,r=e[0].y;return e.forEach((e=>{t=Math.min(t,e.x),o=Math.max(o,e.x),i=Math.min(i,e.y),r=Math.max(r,e.y)})),Qe(t,i,o-t,r-i)},at=e=>lt(e.x-e.rx,e.y-e.ry,2*e.rx,2*e.ry),st=(e,t)=>Qe(e.x-.5*t.width,e.y-.5*t.height,t.width,t.height),lt=(e,t,o,i)=>Qe(e,t,o,i),ct=e=>me(e.x+.5*e.width,e.y+.5*e.height),dt=(e,t)=>(e.x+=t.x,e.y+=t.y,e),ut=(e,t,o)=>(o=o||ct(e),e.x=t*(e.x-o.x)+o.x,e.y=t*(e.y-o.y)+o.y,e.width=t*e.width,e.height=t*e.height,e),pt=(e,t,o,i)=>{const r=(i.x-e.x)/e.width,n=(i.y-e.y)/e.height;let a=Math.max(t.width,e.width),s=Math.max(t.height,e.height);return a=Math.min(o.width,a),s=Math.min(o.height,s),e.x=i.x-r*a,e.y=i.y-n*s,e.width=a,e.height=s,e},ht=(e,t)=>{const[o,i]=ce[t],r=o*e.width,n=i*e.height;return me(e.x+r,e.y+n)},mt=(e,t)=>(e.x*=t,e.y*=t,e.width*=t,e.height*=t,e),gt=(e,t,o=Y)=>o(e.x)===o(t.x)&&o(e.y)===o(t.y)&&o(e.width)===o(t.width)&&o(e.height)===o(t.height),$t=e=>X(e.width,e.height),ft=(e,t,o,i,r)=>(e.x=t,e.y=o,e.width=i,e.height=r,e),yt=(e,t)=>(e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e),bt=(e,t,o)=>(o||(o=ct(e)),Ct(e).map((e=>ye(e,t,o)))),xt=(e,t)=>Qe(.5*e.width-.5*t.width,.5*e.height-.5*t.height,t.width,t.height),vt=(e,t)=>!(t.x<e.x)&&(!(t.y<e.y)&&(!(t.x>e.x+e.width)&&!(t.y>e.y+e.height))),wt=(e,t,o=he())=>{if(0===e.width||0===e.height)return tt();const i=$t(e);t||(t=i);let r=e.width,n=e.height;return t>i?r=n*t:n=r/t,Qe(o.x+.5*(e.width-r),o.y+.5*(e.height-n),r,n)},St=(e,t=$t(e),o=he())=>{if(0===e.width||0===e.height)return tt();let i=e.width,r=i/t;return r>e.height&&(r=e.height,i=r*t),Qe(o.x+.5*(e.width-i),o.y+.5*(e.height-r),i,r)},kt=e=>[Math.min(e.y,e.y+e.height),Math.max(e.x,e.x+e.width),Math.max(e.y,e.y+e.height),Math.min(e.x,e.x+e.width)],Ct=e=>[me(e.x,e.y),me(e.x+e.width,e.y),me(e.x+e.width,e.y+e.height),me(e.x,e.y+e.height)],Tt=(e,t)=>{if(e)return e.x=t(e.x),e.y=t(e.y),e.width=t(e.width),e.height=t(e.height),e},Mt=(e,t,o=ct(e))=>Ct(e).map(((e,i)=>{const r=Je[i];return me(ue(e.x,1+r.x*t.x,o.x),ue(e.y,1+r.y*t.y,o.y))})),Pt=e=>(e.x=0,e.y=0,e),Rt=e=>{const t=e[0],o=e[e.length-1];e=we(t,o)?e:[...e,t];const i=t.x,r=t.y;let n,a,s,l=0,c=0,d=0,u=0;const p=e.length;for(;c<p;c++)n=e[c],a=e[c+1>p-1?0:c+1],s=(n.y-r)*(a.x-i)-(a.y-r)*(n.x-i),l+=s,d+=(n.x+a.x-2*i)*s,u+=(n.y+a.y-2*r)*s;return s=3*l,me(i+d/s,r+u/s)},It=(e,t)=>Et(e.start,e.end,t.start,t.end),Et=(e,t,o,i)=>{const r=(i.y-o.y)*(t.x-e.x)-(i.x-o.x)*(t.y-e.y);if(0===r)return;const n=((i.x-o.x)*(e.y-o.y)-(i.y-o.y)*(e.x-o.x))/r,a=((t.x-e.x)*(e.y-o.y)-(t.y-e.y)*(e.x-o.x))/r;return n<0||n>1||a<0||a>1?void 0:me(e.x+n*(t.x-e.x),e.y+n*(t.y-e.y))},At=(e,t,{ignoreIdenticalLines:o=!1,breakOnIntersection:i=!1}={})=>{const r=t.length,n=[];for(let a=0;a<r-1;a++){if(o&&(we(e.start,t[a])||we(e.start,t[a+1])||we(e.end,t[a])||we(e.end,t[a+1])))continue;const r=Et(e.start,e.end,t[a],t[a+1]);if(r){if(i)return[r];n.push(r)}}return n.length?n:void 0},Lt=(e,t)=>{let o=0,i=0,r=!1;const n=t.length;for(o=0,i=n-1;o<n;i=o++)t[o].y>e.y!=t[i].y>e.y&&e.x<(t[i].x-t[o].x)*(e.y-t[o].y)/(t[i].y-t[o].y)+t[o].x&&(r=!r);return r},Ft=(e,t,o,i)=>({x:(1-i)*(1-i)*e.x+2*(1-i)*i*t.x+i*i*o.x,y:(1-i)*(1-i)*e.y+2*(1-i)*i*t.y+i*i*o.y}),zt=(e,t,o,i,r)=>{const n=((e,t,o,i)=>{let r=(t.x-e.x)*i,n=(t.y-e.y)*i;return Ee(o,t)<Ee(t,e)&&(r*=.15,n*=.15),{x:t.x+r,y:t.y+n}})(e,t,o,r),a=[];for(let e=0;e<=i;e++){const r=e/i;a.push(Ft(t,n,o,r))}return a},Dt=e=>{const t=[];for(let o=0;o<e.length;o++){let i=o+1;i===e.length&&(i=0),t.push(Ye($e(e[o]),$e(e[i])))}return t},Ot=(e,t=0)=>Dt(e).map((e=>Ke(e,t))),Bt=(e,t,o,i=0,r=!1,n=!1,a=12)=>{const s=[];for(let i=0;i<a;i++)s.push(me(e.x+t*Math.cos(i*(2*Math.PI)/a),e.y+o*Math.sin(i*(2*Math.PI)/a)));return(r||n)&&Fe(s,r,n,e.x,e.y),i&&ze(s,i,e.x,e.y),s},Wt=(e,t,o,i)=>{const r=me(e.x-o.x,e.y-o.y),n=me(i.x-o.x,i.y-o.y),a=Pe(n,n);let s=Pe(r,n)/a;s=s<0?0:s,s=s>1?1:s;const l=me(n.x*s+o.x-e.x,n.y*s+o.y-e.y);return Pe(l,l)<=t*t},_t=(e,t,o)=>{const i=o.length;for(let r=0;r<i-1;r++)if(Wt(e,t,o[r],o[r+1]))return!0;return!1},Vt=(e,t,o)=>!!Lt(e,o)||(!!_t(e,t,o)||Wt(e,t,o[0],o[o.length-1])),Nt=(e,t,o,i,r)=>Vt(e,t,bt(o,i,r||ct(o)));var Ht=(e,t)=>{const o=ot(e),i=ct(o),r=bt(o,t,i);return Pt(nt(r))},jt=(e,t)=>e instanceof HTMLElement&&(!t||new RegExp(`^${t}$`,"i").test(e.nodeName)),Ut=e=>e instanceof File,Gt=async(e,t,o)=>{const i=await _(e,t,o);return Z(i,"canvas")},Zt=e=>e.split("/").pop().split(/\?|\#/).shift();const Xt=d()&&!!Node.prototype.replaceChildren?(e,t)=>e.replaceChildren(t):(e,t)=>{for(;e.lastChild;)e.removeChild(e.lastChild);void 0!==t&&e.append(t)},Yt=d()&&$("div",{class:"PinturaMeasure",style:"position:absolute;left:0;top:0;width:99999px;height:0;pointer-events:none;contain:strict;margin:0;padding:0;"});let qt;var Kt=e=>(Xt(Yt,e),Yt.parentNode||document.body.append(Yt),clearTimeout(qt),qt=setTimeout((()=>{Yt.remove()}),500),e);let Jt=null;var Qt=()=>(null===Jt&&(Jt=d()&&/^((?!chrome|android).)*(safari|iphone|ipad)/i.test(navigator.userAgent)),Jt),eo=e=>new Promise(((t,o)=>{let i=!1;!e.parentNode&&Qt()&&(i=!0,e.style.cssText="position:absolute;visibility:hidden;pointer-events:none;left:0;top:0;width:0;height:0;",Kt(e));const r=()=>{const o=e.naturalWidth,r=e.naturalHeight;o&&r&&(i&&e.remove(),clearInterval(n),t({width:o,height:r}))};e.onerror=e=>{clearInterval(n),o(e)};const n=setInterval(r,1);r()})),to=e=>new Promise(((t,o)=>{const i=()=>{t({width:e.videoWidth,height:e.videoHeight})};if(e.readyState>=1)return i();e.onloadedmetadata=i,e.onerror=()=>o(e.error)})),oo=e=>/^image/.test(e.type),io=e=>new Promise((t=>{const o=m(e)?e:URL.createObjectURL(e),i=()=>{const e=new Image;e.src=o,t(e)};if(e instanceof Blob&&oo(e))return i();const r=document.createElement("video");r.preload="metadata",r.onloadedmetadata=()=>t(r),r.onerror=i,r.src=o})),ro=e=>"VIDEO"===e.nodeName,no=async e=>{let t,o;t=e.src?e:await io(e);try{o=ro(t)?await to(t):await eo(t)}finally{Ut(e)&&URL.revokeObjectURL(t.src)}return o};var ao=async e=>{const t=await no(e),o=await(e=>new Promise(((t,o)=>{if(e.complete)return t(e);e.onload=()=>t(e),e.onerror=()=>o(new Error("Failed to load image"))})))(e),i=$("canvas",t);i.getContext("2d",{willReadFrequently:!0}).drawImage(o,0,0);const r=await _(i);return Z(r,Zt(o.src))},so=(e=0,t=!0)=>new(r("ProgressEvent"))("progress",{loaded:100*e,total:100,lengthComputable:t}),lo=(e,t,o=(e=>e))=>e.getAllResponseHeaders().indexOf(t)>=0?o(e.getResponseHeader(t)):void 0,co=e=>{if(!e)return null;const t=e.split(/filename=|filename\*=.+''/).splice(1).map((e=>e.trim().replace(/^["']|[;"']{0,2}$/g,""))).filter((e=>e.length));return t.length?decodeURI(t[t.length-1]):null};const uo="URL_REQUEST";class po extends Error{constructor(e,t,o){super(e),this.name="EditorError",this.code=t,this.metadata=o}}var ho=(e,t)=>{const{headers:o={},credentials:i}=t||{};Object.entries(o).forEach((([t,o])=>e.setRequestHeader(t,o))),i&&(e.withCredentials="omit"!==i)},mo=(e,t,o)=>/^data:/.test(e)?(async(e,t="data-uri",o=n)=>{o(so(0));const i=await fetch(e);o(so(.33));const r=await i.blob();let a;oo(r)||(a="image/"+(e.includes(",/9j/")?"jpeg":"png")),o(so(.66));const s=Z(r,t,a);return o(so(1)),s})(e,void 0,t):((e,t,o)=>new Promise(((i,r)=>{const n=()=>r(new po("Error fetching image",uo,a)),a=new XMLHttpRequest;a.onprogress=t,a.onerror=n,a.onload=()=>{if(!a.response||a.status>=300||a.status<200)return n();const t=lo(a,"Content-Type"),o=lo(a,"Content-Disposition",co)||Zt(e);i(Z(a.response,o,t||G(o)))};const{willRequest:s}=o;Promise.resolve(s&&s(e,{resourceType:"image"})).then((t=>{if(!1===t)return r("Image load rejected");a.open("GET",e,!0),ho(a,t),a.responseType="blob",a.send()})).catch(console.error)})))(e,t,o),go=e=>e instanceof Blob&&!(e instanceof File),$o=e=>"close"in e,fo=async(e,t,o)=>{if(Ut(e)||go(e))return e;if(m(e))return await mo(e,t,o);if(jt(e,"canvas"))return await Gt(e);if(jt(e,"img"))return await ao(e);if(b(e)||$o(e))return await Gt(await k(e));throw new po("Invalid image source","invalid-image-source")};let yo=null;var bo=()=>(null===yo&&(yo=d()&&/^mac/i.test(navigator.platform)),yo);let xo=null;var vo=()=>(null===xo&&(xo=d()&&(x(/iPhone|iPad|iPod/)||bo()&&navigator.maxTouchPoints>=1)),xo),wo=async(e,t=1)=>await p()||vo()||t<5?e:Ne(e.height,e.width),So=e=>/jpeg/.test(e.type),ko=e=>{return"object"!=typeof(t=e)||t.constructor!=Object?e:JSON.stringify(e);var t},Co=(e,t=0,o)=>(0===t||(e.translate(o.x,o.y),e.rotate(t),e.translate(-o.x,-o.y)),e),To=(e,t,o)=>(e.scale(t,o),e),Mo=async(e,t={})=>{const{flipX:o,flipY:i,rotation:r,crop:n}=t,a=Be(e),s=o||i,l=!!r,c=n&&(n.x||n.y||n.width||n.height),d=c&>(n,ot(a)),u=c&&!d;if(!s&&!l&&!u)return e;let p,h=$("canvas",{width:e.width,height:e.height});if(h.getContext("2d",{willReadFrequently:!0}).putImageData(e,0,0),s){const e=$("canvas",{width:h.width,height:h.height}).getContext("2d",{willReadFrequently:!0});To(e,o?-1:1,i?-1:1),e.drawImage(h,o?-h.width:0,i?-h.height:0),e.restore(),y(h),h=e.canvas}if(l){const e=Xe(We(nt(bt(rt(h),r))),Math.floor),t=$("canvas",{width:n.width,height:n.height}).getContext("2d",{willReadFrequently:!0});((e,t,o)=>{e.translate(t,o)})(t,-n.x,-n.y),Co(t,r,Ue(e)),t.drawImage(h,.5*(e.width-h.width),.5*(e.height-h.height)),t.restore(),y(h),h=t.canvas}else if(u){return p=h.getContext("2d",{willReadFrequently:!0}).getImageData(n.x,n.y,n.width,n.height),y(h),p}return p=h.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,h.width,h.height),y(h),p},Po=(e,t)=>{const{imageData:o,width:i,height:r}=e,n=o.width,a=o.height,s=Math.round(i),l=Math.round(r),c=o.data,d=new Uint8ClampedArray(s*l*4),u=n/s,p=a/l,h=Math.ceil(.5*u),m=Math.ceil(.5*p);for(let e=0;e<l;e++)for(let t=0;t<s;t++){const o=4*(t+e*s);let i=0,r=0,a=0,l=0,g=0,$=0,f=0;const y=(e+.5)*p;for(let o=Math.floor(e*p);o<(e+1)*p;o++){const e=Math.abs(y-(o+.5))/m,s=(t+.5)*u,d=e*e;for(let e=Math.floor(t*u);e<(t+1)*u;e++){let t=Math.abs(s-(e+.5))/h;const u=Math.sqrt(d+t*t);if(u<-1||u>1)continue;if(i=2*u*u*u-3*u*u+1,i<=0)continue;t=4*(e+o*n);const p=c[t+3];f+=i*p,a+=i,p<255&&(i=i*p/250),l+=i*c[t],g+=i*c[t+1],$+=i*c[t+2],r+=i}}d[o]=l/r,d[o+1]=g/r,d[o+2]=$/r,d[o+3]=f/a}t(null,{data:d,width:s,height:l})},Ro=e=>{if(e instanceof ImageData)return e;let t;try{t=new ImageData(e.width,e.height)}catch(o){t=$("canvas").getContext("2d").createImageData(e.width,e.height)}return t.data.set(e.data),t},Io=async(e,t={},o)=>{const{width:i,height:r,fit:n,upscale:a}=t;if(!i&&!r)return e;let s=i,l=r;if(i?r||(l=i):s=r,"force"!==n){const t=s/e.width,o=l/e.height;let i=1;if("cover"===n?i=Math.max(t,o):"contain"===n&&(i=Math.min(t,o)),i>1&&!1===a)return e;s=Math.round(e.width*i),l=Math.round(e.height*i)}return s=Math.max(s,1),l=Math.max(l,1),e.width===s&&e.height===l?e:o?o(e,s,l):(e=await z(Po,[{imageData:e,width:s,height:l}],[e.data.buffer]),Ro(e))},Eo=(e,t)=>{const{imageData:o,matrix:i}=e;if(!i)return t(null,o);const r=o.data,n=r.length,a=i[0],s=i[1],l=i[2],c=i[3],d=i[4],u=i[5],p=i[6],h=i[7],m=i[8],g=i[9],$=i[10],f=i[11],y=i[12],b=i[13],x=i[14],v=i[15],w=i[16],S=i[17],k=i[18],C=i[19];let T=0,M=0,P=0,R=0,I=0,E=0,A=0,L=0,F=0,z=0,D=0,O=0;for(;T<n;T+=4)M=r[T]/255,P=r[T+1]/255,R=r[T+2]/255,I=r[T+3]/255,E=M*a+P*s+R*l+I*c+d,A=M*u+P*p+R*h+I*m+g,L=M*$+P*f+R*y+I*b+x,F=M*v+P*w+R*S+I*k+C,z=Math.max(0,E*F)+(1-F),D=Math.max(0,A*F)+(1-F),O=Math.max(0,L*F)+(1-F),r[T]=255*Math.max(0,Math.min(1,z)),r[T+1]=255*Math.max(0,Math.min(1,D)),r[T+2]=255*Math.max(0,Math.min(1,O)),r[T+3]=255*I;t(null,{data:r,width:o.width,height:o.height})},Ao=(e,t)=>{const{imageData:o,matrix:i}=e;if(!i)return t(null,o);let r=i.reduce(((e,t)=>e+t));r=r<=0?1:r;const n=o.width,a=o.height,s=o.data;let l=0,c=0,d=0;const u=Math.round(Math.sqrt(i.length)),p=Math.floor(u/2);let h=0,m=0,g=0,$=0,f=0,y=0,b=0,x=0,v=0,w=0;const S=new Uint8ClampedArray(n*a*4);for(d=0;d<a;d++)for(c=0;c<n;c++){for(h=0,m=0,g=0,$=0,y=0;y<u;y++)for(f=0;f<u;f++)b=d+y-p,x=c+f-p,b<0&&(b=a-1),b>=a&&(b=0),x<0&&(x=n-1),x>=n&&(x=0),v=4*(b*n+x),w=i[y*u+f],h+=s[v]*w,m+=s[v+1]*w,g+=s[v+2]*w,$+=s[v+3]*w;S[l]=h/r,S[l+1]=m/r,S[l+2]=g/r,S[l+3]=$/r,l+=4}t(null,{data:S,width:n,height:a})},Lo=(e,t)=>{let{imageData:o,strength:i}=e;if(!i)return t(null,o);const r=o.width,n=o.height,a=o.data,s=(e,t)=>(l=e-v,c=t-w,Math.sqrt(l*l+c*c));let l,c,d,u,p,h,m,g,$,f,y,b=0,x=0,v=.5*r,w=.5*n,S=s(0,0);for(i>0?(d=0,u=0,p=0):(i=Math.abs(i),d=1,u=1,p=1),x=0;x<n;x++)for(b=0;b<r;b++)k=4*(b+x*r),C=a,T=a,M=s(b,x)*i/S,h=C[k]/255,m=C[k+1]/255,g=C[k+2]/255,$=C[k+3]/255,f=1-M,y=f*$+M,T[k]=(f*$*h+M*d)/y*255,T[k+1]=(f*$*m+M*u)/y*255,T[k+2]=(f*$*g+M*p)/y*255,T[k+3]=255*y;var k,C,T,M;t(null,{data:a,width:o.width,height:o.height})},Fo=(e,t)=>{const{imageData:o,level:i,monochrome:r=!1}=e;if(!i)return t(null,o);const n=o.data,a=n.length;let s,l,c,d=0;const u=()=>255*(2*Math.random()-1)*i,p=r?()=>{const e=u();return[e,e,e]}:()=>[u(),u(),u()];for(;d<a;d+=4)[s,l,c]=p(),n[d]=n[d]+s,n[d+1]=n[d+1]+l,n[d+2]=n[d+2]+c;t(null,{data:n,width:o.width,height:o.height})},zo=(e,t)=>{const{imageData:o,level:i}=e;if(!i)return t(null,o);const r=o.data,n=r.length;let a,s,l,c=0;for(;c<n;c+=4)a=r[c]/255,s=r[c+1]/255,l=r[c+2]/255,r[c]=255*Math.pow(a,i),r[c+1]=255*Math.pow(s,i),r[c+2]=255*Math.pow(l,i);t(null,{data:r,width:o.width,height:o.height})},Do=async(e,t={})=>{const{colorMatrix:o,convolutionMatrix:i,gamma:r,noise:n,vignette:a}=t,s=[];if(i&&s.push([Ao,{matrix:i.clarity}]),r>0&&s.push([zo,{level:1/r}]),o&&!(e=>{const t=e.length;let o;const i=t>=20?6:t>=16?5:3;for(let r=0;r<t;r++){if(o=e[r],1===o&&r%i!=0)return!1;if(0!==o&&1!==o)return!1}return!0})(o)&&s.push([Eo,{matrix:o}]),(n>0||n<0)&&s.push([Fo,{level:n}]),(a>0||a<0)&&s.push([Lo,{strength:a}]),!s.length)return e;const l=(e,t)=>`(err, imageData) => {\n (${e[t][0].toString()})(Object.assign({ imageData: imageData }, filterInstructions[${t}]), \n ${e[t+1]?l(e,t+1):"done"})\n }`,c=`function (options, done) {\n const filterInstructions = options.filterInstructions;\n const imageData = options.imageData;\n (${l(s,0)})(null, imageData)\n }`;return e=await z(c,[{imageData:e,filterInstructions:s.map((e=>e[1]))}],[e.data.buffer]),Ro(e)},Oo=e=>"number"==typeof e,Bo=e=>m(e)&&null!==e.match(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|\ud83c[\ude32-\ude3a]|\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/g),Wo=(e,t)=>e.hasOwnProperty(t),_o=e=>Array.isArray(e);let Vo=64,No=102,Ho=112,jo=!1;var Uo=(e,t)=>(!jo&&d()&&(/^win/i.test(navigator.platform)&&(No=103),(vo()||bo())&&(Vo=63.5,No=110,Ho=123),jo=!0),`<svg${t?` aria-label="${t}"`:""} width="128" height="128" viewBox="0 0 128 128" preserveAspectRatio="xMinYMin meet" xmlns="http://www.w3.org/2000/svg"><text x="${Vo}" y="${No}" alignment-baseline="text-top" dominant-baseline="text-top" text-anchor="middle" font-size="${Ho}px">${e}</text></svg>`),Go=e=>e instanceof Blob,Zo=(e,t)=>e/t*100+"%",Xo=e=>`rgba(${Math.round(255*e[0])}, ${Math.round(255*e[1])}, ${Math.round(255*e[2])}, ${Oo(e[3])?e[3]:1})`,Yo=e=>Object.values(e).join("_");const qo=async(e,t=0)=>{const o=$("canvas",{width:80,height:80}).getContext("2d");return await((e=0)=>new Promise((t=>{setTimeout(t,e)})))(t),o.drawImage(e,0,0,80,80),!((e=>!new Uint32Array(e.getImageData(0,0,e.canvas.width,e.canvas.height).data.buffer).some((e=>0!==e)))(o)&&t<=256)||await qo(e,t+16)},Ko=new Map;var Jo=e=>new Promise(((t,o)=>{const i=new FileReader;i.onerror=()=>o(i.error),i.onload=()=>t(i.result),i.readAsDataURL(e)})),Qo=()=>{let e=[];return{sub:(t,o)=>(e.push({event:t,callback:o}),()=>e=e.filter((e=>e.event!==t||e.callback!==o))),pub:(t,o)=>{e.filter((e=>e.event===t)).forEach((e=>e.callback(o)))}}};const ei=32,ti=({color:e=[0,0,0],fontSize:t=16,fontFamily:o="sans-serif",fontVariant:i="normal",fontWeight:r="normal",fontStyle:n="normal",textAlign:a="left",letterSpacing:s="normal",lineHeight:l=20},c=1)=>`font-size:${t*c}px;font-style:${n};font-weight:${r};font-family:${o};font-variant:${i};line-height:${l*c}px;text-align:${a};letter-spacing:${Oo(s)?s+"px":"normal"};color:${Xo(e)};`,oi=(e,t,o=1)=>{const{width:i,height:r,disableNewline:n}=t,a=!i,s=!1===n?((e="")=>e.split("\n").length)(e):void 0,l=a?"normal":"break-word",c=a&&!s?"nowrap":"pre-line";return`max-width:none;min-width:auto;width:${a?"auto":i*o+"px"};height:${r?r*o+"px":"auto"};margin-top:0;margin-bottom:0;padding-top:${(({fontSize:e=16,lineHeight:t=20}={})=>.5*Math.max(0,e-t))(t)*o}px;word-break:${l};word-wrap:normal;white-space:${c};`},ii=new Map,ri=e=>{const t=[];for(const o of Array.from(e.childNodes))o.nodeType===Node.TEXT_NODE?t.push(ai(o)):t.push(...ri(o));return t},ni="pointer-events:none;visibility:hidden;position:absolute;left:0;top:0;",ai=e=>{const t=e.nodeValue;if(!t)return[];const o=t.length,i=document.createRange();i.selectNodeContents(e);const r=[];for(let n=0;n<o;n++){i.setStart(e,0),i.setEnd(e,n+1);const o=i.getClientRects().length-1,a=t.charAt(n);r[o]?r[o]+=a:r.push(a)}const n=i.getClientRects();return r.map(((e,t)=>({rect:n[t],text:e})))},si=new Map,li=(e="",t)=>{const{width:o=0,height:i=0}=t;if(o&&i)return Ne(o,i);let{fontSize:r=16,fontFamily:n,lineHeight:a=20,fontWeight:s,fontStyle:l,fontVariant:c,letterSpacing:d}=t;const u=Yo({text:e,fontFamily:n,fontWeight:s,fontStyle:l,fontVariant:c,fontSize:r,letterSpacing:d,lineHeight:a,width:o});let p=si.get(u);if(p)return p;let h=1;r>1e3&&O()&&(h=r/1e3,r=1e3,a/=h);const m=Kt($("pre",{contenteditable:"true",spellcheck:"false",style:`${ni}${ti({...t,fontSize:r,lineHeight:a})};${oi(e,t)}"`,innerHTML:e})).getBoundingClientRect();return p=Be(m),p=Xe(p,(e=>e*h)),o&&(p.width=o),si.set(u,p),p},ci=new Map,di=(e,t)=>new Promise(((o,i)=>{let r=ci.get(e);void 0===r&&(r=((e,t)=>{const{sub:o,pub:i}=Qo();let r,n;return Promise.resolve(t&&t(e,{resourceType:"stylesheet"})).then((t=>{if(!1===t)return n="requestPrevented",i("error",n);const{headers:o,credentials:a}=t||{};fetch(e,{headers:o,credentials:a}).then((e=>e.text())).then((e=>{r=e,i("load",r)})).catch((e=>{n=e,i("error",n)}))})),{sub:(e,t)=>"load"===e&&r?t(r):"error"===e&&n?t(n):void o(e,t)}})(e,t),ci.set(e,r)),r.sub("load",o),r.sub("error",i)})),ui=async(e,t,o)=>{let i;try{i=await di(e,t)}catch(e){return[]}const r={innerHTML:i,id:L()};o&&(r.nonce=o);const n=$("style",r);document.head.append(n);const a=Array.from(document.styleSheets).find((e=>e.ownerNode.id===n.id));return n.remove(),Array.from(a.cssRules)},pi=new Map,hi=async(e,t,o)=>{if(pi.has(e.href))return pi.get(e.href);let i;try{i=Array.from(e.cssRules);for(const e of(e=>e.filter((e=>e instanceof CSSImportRule)))(i)){const r=e.href;if(pi.has(r)){const e=pi.get(r);i=[...i,...e];continue}const n=await ui(r,t,o);pi.set(r,n),i=[...i,...n]}}catch(r){const n=e.href;i=await ui(n,t,o),pi.set(n,i)}return(e=>e.filter((e=>e instanceof CSSFontFaceRule)))(i)},mi=(e,t)=>e.style.getPropertyValue(t),gi=(e,t)=>{if(!e.style)return!1;return mi(e,"font-family").replace(/^"|"$/g,"")==t},$i=async(e,t,o)=>{const i=((e,t)=>{const o=[];for(const i of e)gi(i,t)&&o.push(i);return o})(await(async(e,t)=>{const o=Array.from(document.styleSheets).map((o=>hi(o,e,t))),i=await Promise.all(o),r=[];return i.forEach((e=>r.push(...e))),r})(t,o),e);return i.length?i.map((e=>{const t=e.parentStyleSheet&&e.parentStyleSheet.href&&new URL(e.parentStyleSheet.href),o=t?t.origin+(e=>e.pathname.split("/").slice(0,-1).join("/"))(t)+"/":"",i=e.style.getPropertyValue("src").match(/url\("?(.*?)"?\)/)[1],r=Array.from(e.style).filter((e=>"src"!=e)).reduce(((t,o)=>t+=o+":"+mi(e,o)+";"),"");return[/^http/.test(i)?i:o+i,r]})):[]},fi=new Map,yi=new Map;var bi=async(e="",t)=>{if(!e.length)return;let{color:o,imageWidth:i=300,imageHeight:r=150,paddingTop:n=0,paddingRight:a=ei,paddingBottom:s=0,paddingLeft:l=ei,fontFamily:c,fontSize:d,pixelRatio:u=1,willRequest:p,outline:h,blur:m,styleNonce:g}=t,$=1,f="";d>1e3&&O()&&($=d/1e3,f=`transform-origin:0 0;transform:scale(${$})`);const y=u/$,b=(i+l+a)*u,x=(r+s+n)*u,v=await(async(e,t,o)=>{if(fi.get(e))return;let i=yi.get(e);if(!i){const n=await $i(e,t,o);if(!n.length)return void fi.set(e,!0);const a=[];for(const[e,t]of n){const o=await fetch(e).then((e=>e.blob())),i=!(r=o.type)||/woff2/.test(r)?"woff2":/woff/.test(r)?"woff":/ttf|truetype/.test(r)?"truetype":/otf|opentype/.test(r)?"opentype":/svg/.test(r)?"svg":"woff2",n=await Jo(o);a.push(`@font-face { src:url(${n}) format('${i}');${t};font-display:block; }`)}i=a.join(""),yi.set(e,i)}var r;return i})(c,p,g);let w="";v&&(w=`<style${g?` nonce="${g}"`:""}>${v}</style>`);const S=e.replace(/%/g,"%25").replace(/#/g,"%23").replace(/ /g," ").replace(/&(?!#\d{4};|[a-z]+;)/gi,"&").replace(/<br>|\n/g,"<br/>"),k=`top:${n*y}px;right:${a*y}px;bottom:${s*y}px;left:${l*y}px`;let C=o,T="",M="";if(h||m){const e=Xo(o);h&&(C=[0,0,0,0],T=`-webkit-text-stroke: ${2*h*y}px ${e}`),m&&(Qt()?M=`filter:blur(${m*y*.4}px)`:(C=[0,0,0,0],M=`text-shadow: 0 0 ${m*y}px ${e}`))}return((e,{safariCacheKey:t="*"}={})=>new Promise(((o,i)=>{const r=new Image;r.onerror=()=>i(new Error("Failed to load SVG")),r.onload=()=>{if(!Qt()||!e.includes("@font-face")||Ko.has(t))return o(r);qo(r).then((()=>{Ko.set(t,!0),o(r)}))},r.src="data:image/svg+xml,"+e})))(`<svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${x}" viewBox="0 0 ${b} ${x}"><foreignObject x="0" y="0" width="${b}" height="${x}"><div xmlns="http://www.w3.org/1999/xhtml">${w}<pre contenteditable="true" spellcheck="false" style="position:absolute;${k};${ti({...t,color:C,fontSize:d},y)};${oi(e,t,y)};${f};${T};${M}">${S}</pre></div></foreignObject></svg>`,{safariCacheKey:c})};const xi=e=>{const t={...e};return P(t)},vi=(e,t={})=>{const o=$t(e);let i,r;const n=t.width||t.rx,a=t.height||t.ry;if(n&&a)return Oe(t);if(n||a){i=parseFloat(n||Number.MAX_SAFE_INTEGER),r=parseFloat(a||Number.MAX_SAFE_INTEGER);const e=Math.min(i,r);m(n)||m(a)?(i=e+"%",r=e*o+"%"):(i=e,r=e)}else{const e=10;i=e+"%",r=e*o+"%"}return{[(t.width?"width":t.rx?"rx":void 0)||"width"]:i,[(t.width?"height":t.rx?"ry":void 0)||"height"]:r}},wi=(e,t={})=>{return{width:void 0,height:void 0,...t,aspectRatio:1,backgroundImage:(o=Uo(e),"data:image/svg+xml,"+o.replace("<","%3C").replace(">","%3E"))};var o},Si=(e,t={})=>({backgroundColor:[0,0,0,0],...Ei(t)?{}:{width:void 0,height:void 0,aspectRatio:void 0},...t,backgroundImage:m(e)?e:Go(e)?URL.createObjectURL(e):e}),ki=(e,t)=>{let o;if(m(e)||Go(e)){const i={...vi(t),backgroundSize:"contain"};o=Bo(e)?wi(e,i):Si(e,i)}else if(e.src){const i=vi(t,e.shape||e),r={...e.shape,...i};if(e.width&&e.height&&!Wo(r,"aspectRatio")){const e=Sr(i,"width",t),o=Sr(i,"height",t);r.aspectRatio=X(e,o)}r.backgroundSize||e.shape||e.width&&e.height||(r.backgroundSize="contain"),o=Bo(e.src)?wi(e.src,r):Si(e.src,r)}else e.shape&&(o=xi(e.shape));return Wo(o,"backgroundImage")&&(Wo(o,"backgroundColor")||(o.backgroundColor=[0,0,0,0]),Wo(o,"disableStyle")||(o.disableStyle=["cornerRadius","backgroundColor","strokeColor","strokeWidth"])),t?vr(o,t):o},Ci=e=>me(e.x1,e.y1),Ti=e=>me(e.x2,e.y2),Mi=e=>Wo(e,"text"),Pi=e=>Mi(e)&&!(Vi(e)||Wo(e,"width")),Ri=e=>Mi(e)&&(Vi(e)||Wo(e,"width")),Ii=e=>!Mi(e)&&Ni(e),Ei=e=>Wo(e,"rx"),Ai=e=>Wo(e,"x1"),Li=e=>Wo(e,"points"),Fi=e=>Mi(e)&&e.isEditing,zi=e=>!Wo(e,"opacity")||e.opacity>0,Di=e=>e.isSelected,Oi=e=>e.isEditing,Bi=e=>e._isDraft,Wi=e=>Wo(e,"width")&&Wo(e,"height"),_i=e=>{const t=Wo(e,"right"),o=Wo(e,"bottom");return t||o},Vi=e=>(Wo(e,"x")||Wo(e,"left"))&&Wo(e,"right")||(Wo(e,"y")||Wo(e,"top"))&&Wo(e,"bottom"),Ni=e=>Wi(e)||Vi(e),Hi=e=>(e._isDraft=!0,e),ji=e=>(e._isDraft=!1,e),Ui=(e,t)=>!0!==e.disableStyle&&(!_o(e.disableStyle)||!t||!e.disableStyle.includes(t)),Gi=e=>!0!==e.disableSelect,Zi=e=>!0!==e.disableRemove,Xi=e=>!0!==e.disableDuplicate&&tr(e),Yi=e=>!e.disableFlip&&(!Bi(e)&&!_i(e)&&(e=>Wo(e,"backgroundImage")||Wo(e,"text"))(e)),qi=(e,t)=>!!Mi(e)&&(!0!==e.disableInput&&(R(e.disableInput)?e.disableInput(null!=t?t:e.text):t||!0)),Ki=(e,t)=>!0!==e.disableTextLayout&&(!_o(e.disableTextLayout)||!t||!e.disableTextLayout.includes(t)),Ji=e=>Qi(e)&&e.points.length>3,Qi=e=>!!Li(e)&&(void 0!==e.disableAddPoints&&!0!==e.disableAddPoints),er=e=>!0!==e.disableManipulate&&!Bi(e)&&!_i(e),tr=e=>er(e)&&!0!==e.disableMove,or=e=>(delete e.left,delete e.right,delete e.top,delete e.bottom,e),ir=e=>(delete e.rotation,e),rr=e=>(e.strokeWidth=e.strokeWidth||1,e.strokeColor=e.strokeColor||[0,0,0],e),nr=e=>(e.backgroundColor=e.backgroundColor?e.backgroundColor:e.strokeWidth||e.backgroundImage?void 0:[0,0,0],e),ar=e=>{let t=e.text;t=t.replace(/&(#[0-9]+|[a-z]+);/gi,((e,t)=>`___${t}___`)),t=t.replace(/&/,"&"),e.text=t.replace(/___(#[0-9]+|[a-z]+)___/gi,((e,t)=>`&${t};`))},sr=e=>{if(!e.textShadow)return e;const[t,o,i,r]=e.textShadow;return e.textShadowX=t,e.textShadowY=o,e.textShadowBlur=i,e.textShadowColor=r,delete e.textShadow,e},lr=e=>{if(!e.textOutline)return e;const[t,o]=e.textOutline;e.textOutlineWidth=t,e.textOutlineColor=o,delete e.textOutline},cr=e=>(e.fontSize=e.fontSize||"4%",e.fontFamily=e.fontFamily||"sans-serif",e.fontWeight=e.fontWeight||"normal",e.fontStyle=e.fontStyle||"normal",e.fontVariant=e.fontVariant||"normal",e.lineHeight=e.lineHeight||"120%",e.color=e.color||[0,0,0],e.format="html"===e.format?"html":"text",sr(e),lr(e),"html"===e.format?ar(e):(e=>{ar(e);let t=e.text;t=t.replace(/</g,">"),t=t.replace(/>/g,"<"),e.text=t})(e),Pi(e)?dr(e):ur(e)),dr=e=>(!1!==e.disableNewline&&(delete e.textAlign,e.text=e.text.replace(/\n/g," ")),or(e)),ur=e=>(e.textAlign=e.textAlign||"left",e),pr=e=>((e=>{m(e.id)||(e.id=L()),Wo(e,"rotation")||(e.rotation=0),Wo(e,"opacity")||(e.opacity=1),Wo(e,"disableErase")||(e.disableErase=!0)})(e),Mi(e)?cr(e):Ii(e)?(e=>{e.cornerRadius=e.cornerRadius||0,e.strokeWidth=e.strokeWidth||0,e.strokeColor=e.strokeColor||[0,0,0],nr(e)})(e):Li(e)?(e=>{rr(e),ir(e),Wo(e,"pathClose")||(e.disableResize=!0,Wo(e,"disableMove")||(e.disableMove=!0)),or(e)})(e):Ai(e)?(e=>{rr(e),e.lineStart=e.lineStart||void 0,e.lineEnd=e.lineEnd||void 0,ir(e),or(e)})(e):Ei(e)&&(e=>{e.strokeWidth=e.strokeWidth||0,e.strokeColor=e.strokeColor||[0,0,0],nr(e)})(e),e),hr=e=>Mi(e)?"text":Ii(e)?"rectangle":Li(e)?"path":Ai(e)?"line":Ei(e)?"ellipse":void 0,mr=(e,t)=>parseFloat(e)/100*t,gr=new RegExp(/^x|left|right|^width|rx|fontSize|eraseRadius|feather|cornerRadius|strokeWidth|strokeDash/,"i"),$r=new RegExp(/^y|top|bottom|^height|ry/,"i"),fr=(e,t,{width:o,height:i})=>{if(Array.isArray(t))return t.map((t=>(T(t)&&xr(t,{width:o,height:i}),m(t)&&(t=fr(e,t,{width:o,height:i})),t)));if("string"!=typeof t)return t;if(!t.endsWith("%"))return t;const r=parseFloat(t)/100;return gr.test(e)?de(o*r,6):$r.test(e)?de(i*r,6):t},yr=fr,br=["lineHeight","textOutlineWidth","textShadowX","textShadowY","textShadowBlur"],xr=(e,t)=>{Object.entries(e).map((([o,i])=>{e[o]=fr(o,i,t)})),e.text&&br.filter((t=>m(e[t]))).forEach((t=>{var o,i;e[t]=(o=e[t],i=e.fontSize,Math.round(i*(parseFloat(o)/100)))}))},vr=(e,t)=>(xr(e,t),Pr(e,t),e),wr=(e,t)=>{let o;return/^x|width|rx|fontSize|strokeWidth|cornerRadius/.test(e)?o=t.width:/^y|height|ry/.test(e)&&(o=t.height),o},Sr=(e,t,o)=>Array.isArray(e[t])?e[t].map((e=>Object.entries(e).reduce(((e,[t,i])=>(e[t]=m(i)?mr(i,wr(t,o)):i,e)),{}))):m(e[t])?mr(e[t],wr(t,o)):e[t],kr=(e,t,o)=>t.reduce(((t,i)=>{const r=Sr(e,i,o);return t[i]=r,t}),{}),Cr=(e,t,o)=>(Object.keys(t).forEach((i=>((e,t,o,i)=>{if(!m(e[t]))return e[t]=o,e;const r=wr(t,i);return e[t]=void 0===r?o:Zo(o,r),e})(e,i,t[i],o))),e),Tr=(e,t)=>{const o=e.filter((e=>e.x<0||e.y<0||e.x1<0||e.y1<0)).reduce(((e,t)=>{const[o,i,r,n]=(e=>{const t=tt(),o=e.strokeWidth||0;if(Ii(e))t.x=e.x-.5*o,t.y=e.y-.5*o,t.width=e.width+o,t.height=e.height+o;else if(Ai(e)){const{x1:i,y1:r,x2:n,y2:a}=e,s=Math.abs(Math.min(i,n)),l=Math.abs(Math.max(i,n)),c=Math.abs(Math.min(r,a)),d=Math.abs(Math.min(r,a));t.x=s+.5*o,t.y=l+.5*o,t.width=l-s+o,t.height=d-c+o}else Ei(e)&&(t.x=e.x-e.rx+.5*o,t.y=e.y-e.ry+.5*o,t.width=2*e.rx+o,t.height=2*e.ry+o);return t&&Wo(e,"rotation")&&bt(t,e.rotation),kt(t)})(t);return e.top=Math.min(o,e.top),e.left=Math.min(n,e.left),e.bottom=Math.max(r,e.bottom),e.right=Math.max(i,e.right),e}),{top:0,right:0,bottom:0,left:0});return o.right>0&&(o.right-=t.width),o.bottom>0&&(o.bottom-=t.height),o},Mr=(e,t,o)=>{const i=xi(e);vr(i,t);const r=o(i);return Array.isArray(r)?r:[r]},Pr=(e,t)=>{if(Wo(e,"left")&&(e.x=e.left),Wo(e,"right")&&!m(e.right)){const o=t.width-e.right;Wo(e,"left")?(e.x=e.left,e.width=Math.max(0,o-e.left)):Wo(e,"width")&&(e.x=o-e.width)}if(Wo(e,"top")&&(e.y=e.top),Wo(e,"bottom")&&!m(e.bottom)){const o=t.height-e.bottom;Wo(e,"top")?(e.y=e.top,e.height=Math.max(0,o-e.top)):Wo(e,"height")&&(e.y=o-e.height)}return e},Rr=(e,t)=>(Li(e)&&e.points.filter((e=>Oo(e.x))).forEach((e=>{e.x*=t,e.y*=t})),Ai(e)&&Oo(e.x1)&&(e.x1*=t,e.y1*=t,e.x2*=t,e.y2*=t),Oo(e.x)&&Oo(e.y)&&(e.x*=t,e.y*=t),Oo(e.width)&&Oo(e.height)&&(e.width*=t,e.height*=t),Oo(e.rx)&&Oo(e.ry)&&(e.rx*=t,e.ry*=t),(e=>Oo(e.strokeWidth)&&e.strokeWidth>0)(e)&&(e.strokeWidth*=t),Mi(e)&&(e._scale=t,Oo(e.fontSize)&&(e.fontSize*=t),Oo(e.lineHeight)&&(e.lineHeight*=t),Oo(e.width)&&!Oo(e.height)&&(e.width*=t)),Wo(e,"cornerRadius")&&Oo(e.cornerRadius)&&(e.cornerRadius*=t),e),Ir=e=>{if(Ii(e))return me(e.x+.5*e.width,e.y+.5*e.height);if(Ei(e))return me(e.x,e.y);if(e.text){if(Ri(e)){const t=e.height||li(e.text,e).height;return me(e.x+.5*e.width,e.y+.5*t)}const t=li(e.text,e);return me(e.x+.5*t.width,e.y+.5*t.height)}return Li(e)?Le(e.points):Ai(e)?Le([Ci(e),Ti(e)]):void 0};var Er=e=>/canvas/i.test(e.nodeName),Ar=(e,t)=>new Promise(((o,i)=>{let r=e,n=!1;const a=()=>{n||(n=!0,R(t)&&Promise.resolve().then((()=>t(Ne(r.naturalWidth,r.naturalHeight)))))};if(r.src||(r=new Image,m(e)&&new URL(e,location.href).origin!==location.origin&&(r.crossOrigin="anonymous"),r.src=m(e)?e:URL.createObjectURL(e)),r.complete)return a(),o(r);R(t)&&eo(r).then(a).catch(i),r.onload=()=>{a(),o(r)},r.onerror=()=>i(new Error("Failed to load image"))}));const Lr=new Map([]),Fr=(e,t={})=>new Promise(((o,i)=>{const{onMetadata:r=n,onLoad:a=o,onError:s=i,onComplete:l=n}=t;let c=Lr.get(e);if(c||(c={loading:!1,complete:!1,error:!1,image:void 0,size:void 0,bus:Qo()},Lr.set(e,c)),c.bus.sub("meta",r),c.bus.sub("load",a),c.bus.sub("error",s),c.bus.sub("complete",l),Er(e)){const t=e,o=t.cloneNode();c.complete=!0,c.image=o,c.size=Ve(t)}if(c.complete)return c.bus.pub("meta",{size:c.size}),c.error?c.bus.pub("error",c.error):c.bus.pub("load",c.image),c.bus.pub("complete"),void(c.bus=Qo());c.loading||(c.loading=!0,Ar(e,(e=>{c.size=e,c.bus.pub("meta",{size:e})})).then((e=>{c.image=e,c.bus.pub("load",e)})).catch((e=>{c.error=e,c.bus.pub("error",e)})).finally((()=>{c.complete=!0,c.loading=!1,c.bus.pub("complete"),c.bus=Qo()})))})),zr=(e,t,o,i)=>e.drawImage(t,o.x,o.x,o.width,o.height,i.x,i.y,i.width,i.height);var Dr=async(e,t,o,i,r=zr,n)=>{e.save(),e.clip(),await r(e,t,o,i,n),e.restore()};const Or=(e,t,o,i,r)=>{const n=et(e);if(i){const e=Tt(nt(i),de);return e.x*=o.width,e.width*=o.width,e.y*=o.height,e.height*=o.height,{srcRect:e,destRect:n}}const a=lt(0,0,o.width,o.height);if("contain"===t){const t=St(e,$t(a));n.width=t.width,n.height=t.height,r?(n.x+=r.x,n.y+=r.y):(n.x+=t.x,n.y+=t.y)}else if("cover"===t){const e=wt(n,a.width/a.height);n.width=e.width,n.height=e.height,r?(n.x+=r.x,n.y+=r.y):(n.x+=e.x,n.y+=e.y)}else t?(n.width=t.width,n.height=t.height,r&&(n.x+=r.x,n.y+=r.y)):r&&(n.width=o.width,n.height=o.height,n.x+=r.x,n.y+=r.y);return{srcRect:a,destRect:n}},Br=(e,t)=>(t.cornerRadius>0?((e,t,o,i,r,n)=>{i<2*n&&(n=i/2),r<2*n&&(n=r/2),e.beginPath(),e.moveTo(t+n,o),e.arcTo(t+i,o,t+i,o+r,n),e.arcTo(t+i,o+r,t,o+r,n),e.arcTo(t,o+r,t,o,n),e.arcTo(t,o,t+i,o,n),e.closePath()})(e,t.x,t.y,t.width,t.height,t.cornerRadius):e.rect(t.x,t.y,t.width,t.height),e),Wr=(e,t)=>(t.backgroundColor&&e.fill(),e),_r=(e,t)=>(t.strokeWidth&&e.stroke(),e);var Vr=async(e,t,o={})=>{const{drawImage:i}=o;if(e.lineWidth=t.strokeWidth?t.strokeWidth:1,e.strokeStyle=t.strokeColor?Xo(t.strokeColor):"none",e.fillStyle=t.backgroundColor?Xo(t.backgroundColor):"none",e.globalAlpha=t.opacity,t.backgroundImage){let o;if(o=Er(t.backgroundImage)?t.backgroundImage:await Fr(t.backgroundImage),Br(e,t),Wr(e,t),"repeat"===t.backgroundRepeat){const r=t.backgroundPosition||{x:0,y:0},{srcRect:n,destRect:a}=Or(t,t.backgroundSize||Ve(o),Ve(o),t.backgroundCorners,{x:0,y:0}),s=document.createElement("canvas");s.width=a.width,s.height=a.height;const l=s.getContext("2d",{willReadFrequently:!1,desynchronized:!0});await i(l,o,n,{...a,x:0,y:0});const c=e.createPattern(s,"repeat");e.fillStyle=c,e.save(),e.beginPath(),e.rect(t.x+r.x,t.y+r.y,t.width-r.x,t.height-r.y),e.clip(),e.translate(a.x+r.x,a.y+r.y),e.fill(),y(s),e.restore()}else{const{srcRect:r,destRect:n}=Or(t,t.backgroundSize,Ve(o),t.backgroundCorners,t.backgroundPosition);await Dr(e,o,r,n,i,{feather:t.feather})}return e.beginPath(),Br(e,t),_r(e,t),[]}return Br(e,t),Wr(e,t),_r(e,t),[]},Nr=async(e,t,o={})=>new Promise((async(i,r)=>{const{drawImage:n}=o;if(e.lineWidth=t.strokeWidth||1,e.strokeStyle=t.strokeColor?Xo(t.strokeColor):"none",e.fillStyle=t.backgroundColor?Xo(t.backgroundColor):"none",e.globalAlpha=t.opacity,e.ellipse(t.x,t.y,t.rx,t.ry,0,0,2*Math.PI),t.backgroundColor&&e.fill(),t.backgroundImage){let o;try{o=await Fr(t.backgroundImage)}catch(e){r(e)}const a=lt(t.x-t.rx,t.y-t.ry,2*t.rx,2*t.ry),{srcRect:s,destRect:l}=Or(a,t.backgroundSize,Ve(o),t.backgroundCorners,t.backgroundPosition);await Dr(e,o,s,l,n),t.strokeWidth&&e.stroke(),i([])}else t.strokeWidth&&e.stroke(),i([])})),Hr=async(e,t,o)=>{const i=Oo(t.width)?Math.floor(t.width):void 0,r=Oo(t.height)?Math.floor(t.height):void 0,n=i&&r?Be(t):li(t.text,{...t,width:i,height:r}),a={x:t.x,y:t.y,width:n.width,height:n.height};if(Vr(e,{...t,...a,options:o}),!t.text.length)return[];const{textOutlineWidth:s=0,textShadowX:l=0,textShadowY:c=0,textShadowBlur:d=0,textShadowColor:u,outline:p,blur:h,...m}=t,g=!!t.height;if(g&&(e.rect(a.x,a.y,a.width,a.height),e.save(),e.clip()),l||c||d){e.save(),e.translate(l,c);const n={...a};g||(n.height+=ei+d),await jr(e,n,{...t,width:i,height:r},{...o,paddingLeft:ei+d,paddingRight:ei+d,paddingTop:d,paddingBottom:d+(g?-1*c:t.fontSize),shapeExtendedProps:{color:u,blur:d}}),e.restore()}if(s){const n={...a};g||(n.height+=ei+s),await jr(e,n,{...t,width:i,height:r},{...o,paddingLeft:ei+s,paddingRight:ei+s,paddingTop:s,paddingBottom:s+g?0:t.fontSize,shapeExtendedProps:{color:t.textOutlineColor,outline:s}})}return g&&e.restore(),await jr(e,a,{...m,width:i,height:r},{...o,paddingLeft:ei,paddingRight:ei,paddingTop:0,paddingBottom:g?0:t.fontSize}),[]};const jr=async(e,t,o,i)=>{const{willRequest:r,shapeExtendedProps:n,paddingLeft:a,paddingRight:s,paddingTop:l,paddingBottom:c,styleNonce:d}=i,u=Oo(o.width)?Math.floor(t.width):void 0,p=Oo(o.height)?Math.floor(t.height):void 0,h=Math.ceil(t.width),m=Math.ceil(t.height),g=await bi(o.text,{...o,...n,...t,width:u,height:p,paddingLeft:a,paddingRight:s,paddingTop:l,paddingBottom:c,imageWidth:h,imageHeight:m,willRequest:r,styleNonce:d});e.drawImage(g,o.x-a,o.y-l,g.width,g.height)};var Ur=async(e,t)=>new Promise((async o=>{e.lineWidth=t.strokeWidth||1,e.strokeStyle=t.strokeColor?Xo(t.strokeColor):"none",e.globalAlpha=t.opacity,t.bitmap&&(e.lineCap=t.strokeCap,e.lineJoin=t.strokeJoin,e.setLineDash(t.strokeDash||[]));let i=Ci(t),r=Ti(t);e.moveTo(i.x,i.y),e.lineTo(r.x,r.y),t.strokeWidth&&e.stroke(),o([])})),Gr=async(e,t)=>new Promise(((o,i)=>{if(t.bitmap&&1===t.points.length)return void Nr(e,{x:t.points[0].x,y:t.points[0].y,rx:.5*t.strokeWidth,ry:.5*t.strokeWidth,backgroundColor:t.strokeColor}).then((()=>o([])));e.lineWidth=t.strokeWidth||1,e.strokeStyle=t.strokeColor?Xo(t.strokeColor):"none",e.fillStyle=t.backgroundColor?Xo(t.backgroundColor):"none",e.globalAlpha=t.opacity;const{points:r}=t;t.bitmap&&(e.lineCap=t.strokeCap,e.lineJoin=t.strokeJoin,e.setLineDash(t.strokeDash||[])),t.pathClose&&e.beginPath(),e.moveTo(r[0].x,r[0].y);const n=r.length;for(let t=1;t<n;t++)e.lineTo(r[t].x,r[t].y);t.pathClose&&e.closePath(),t.strokeWidth&&e.stroke(),t.backgroundColor&&e.fill(),o([])})),Zr=(e,t,o,i)=>t||o?(e.translate(i.x,i.y),e.scale(t?-1:1,o?-1:1),e.translate(-i.x,-i.y),e):e;const Xr=async(e,t,o)=>{e.globalCompositeOperation="subtract"===t.drawMode?"destination-out":"source-over";const i=Ir(t);let r;if(Co(e,t.rotation,i),Zr(e,t.flipX,t.flipY,i),Ii(t)?r=Vr:Ei(t)?r=Nr:Ai(t)?r=Ur:Li(t)?r=Gr:Mi(t)&&(r=Hr),r){const i=await r(e,t,o);if(!i.length)return[];return[t,...await Yr(e,i,o)]}return[]};var Yr=async(e,t,o)=>{let i=[];for(const r of t)e.save(),e.beginPath(),i=[...i,...await Xr(e,r,o)],e.restore();return i},qr=async(e,t={})=>{const{shapes:o=[],contextBounds:i=e,transform:r=n,drawImage:a,willRequest:s,styleNonce:l,canvasMemoryLimit:c,computeShape:d=Y,preprocessShape:u=Y}=t;if(!o.length)return e;const p=$("canvas");p.width=i.width,p.height=i.height;const h=p.getContext("2d",{willReadFrequently:!0});h.putImageData(e,i.x||0,i.y||0);const m=o.map(xi).map(d).map(u).flat().filter(Boolean);r(h),await Yr(h,m,{drawImage:a,canvasMemoryLimit:c,willRequest:s,styleNonce:l});const g=h.getImageData(0,0,p.width,p.height);return y(p),g},Kr=async(e,t={})=>{const{backgroundColor:o,backgroundImage:i}=t,r=!(!o||o&&0===o[3]);if(!i&&!r)return e;const n=$("canvas");n.width=e.width,n.height=e.height;const a=n.getContext("2d",{willReadFrequently:!0});if(a.putImageData(e,0,0),a.globalCompositeOperation="destination-over",r&&(a.fillStyle=Xo(o),a.fillRect(0,0,n.width,n.height)),i){let t;t=Er(i)?i:await Fr(i);const{srcRect:o,destRect:r}=Or({x:0,y:0,width:e.width,height:e.height},"cover",{width:t.width,height:t.height});a.drawImage(t,o.x,o.y,o.width,o.height,r.x,r.y,r.width,r.height)}const s=a.getImageData(0,0,n.width,n.height);return y(n),s},Jr=e=>e.length?e.reduce(((e,t)=>((e,t)=>{const o=new Array(20);return o[0]=e[0]*t[0]+e[1]*t[5]+e[2]*t[10]+e[3]*t[15],o[1]=e[0]*t[1]+e[1]*t[6]+e[2]*t[11]+e[3]*t[16],o[2]=e[0]*t[2]+e[1]*t[7]+e[2]*t[12]+e[3]*t[17],o[3]=e[0]*t[3]+e[1]*t[8]+e[2]*t[13]+e[3]*t[18],o[4]=e[0]*t[4]+e[1]*t[9]+e[2]*t[14]+e[3]*t[19]+e[4],o[5]=e[5]*t[0]+e[6]*t[5]+e[7]*t[10]+e[8]*t[15],o[6]=e[5]*t[1]+e[6]*t[6]+e[7]*t[11]+e[8]*t[16],o[7]=e[5]*t[2]+e[6]*t[7]+e[7]*t[12]+e[8]*t[17],o[8]=e[5]*t[3]+e[6]*t[8]+e[7]*t[13]+e[8]*t[18],o[9]=e[5]*t[4]+e[6]*t[9]+e[7]*t[14]+e[8]*t[19]+e[9],o[10]=e[10]*t[0]+e[11]*t[5]+e[12]*t[10]+e[13]*t[15],o[11]=e[10]*t[1]+e[11]*t[6]+e[12]*t[11]+e[13]*t[16],o[12]=e[10]*t[2]+e[11]*t[7]+e[12]*t[12]+e[13]*t[17],o[13]=e[10]*t[3]+e[11]*t[8]+e[12]*t[13]+e[13]*t[18],o[14]=e[10]*t[4]+e[11]*t[9]+e[12]*t[14]+e[13]*t[19]+e[14],o[15]=e[15]*t[0]+e[16]*t[5]+e[17]*t[10]+e[18]*t[15],o[16]=e[15]*t[1]+e[16]*t[6]+e[17]*t[11]+e[18]*t[16],o[17]=e[15]*t[2]+e[16]*t[7]+e[17]*t[12]+e[18]*t[17],o[18]=e[15]*t[3]+e[16]*t[8]+e[17]*t[13]+e[18]*t[18],o[19]=e[15]*t[4]+e[16]*t[9]+e[17]*t[14]+e[18]*t[19]+e[19],o})([...e],t)),e.shift()):[],Qr=(e,t)=>{const o=e.width*e.height,i=t.reduce(((e,t)=>(t.width>e.width&&t.height>e.height&&(e.width=t.width,e.height=t.height),e)),{width:0,height:0}),r=i.width*i.height;return((e,t=2)=>Math.round(e*t)/t)(Math.max(.5,.5+(1-r/o)/2),5)};function en(){}const tn=e=>e;function on(e,t){for(const o in t)e[o]=t[o];return e}function rn(e){return e()}function nn(){return Object.create(null)}function an(e){e.forEach(rn)}function sn(e){return"function"==typeof e}function ln(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}let cn;function dn(e,t){return cn||(cn=document.createElement("a")),cn.href=t,e===cn.href}function un(e,...t){if(null==e)return en;const o=e.subscribe(...t);return o.unsubscribe?()=>o.unsubscribe():o}function pn(e){let t;return un(e,(e=>t=e))(),t}function hn(e,t,o){e.$$.on_destroy.push(un(t,o))}function mn(e,t,o,i){if(e){const r=gn(e,t,o,i);return e[0](r)}}function gn(e,t,o,i){return e[1]&&i?on(o.ctx.slice(),e[1](i(t))):o.ctx}function $n(e,t,o,i){if(e[2]&&i){const r=e[2](i(o));if(void 0===t.dirty)return r;if("object"==typeof r){const e=[],o=Math.max(t.dirty.length,r.length);for(let i=0;i<o;i+=1)e[i]=t.dirty[i]|r[i];return e}return t.dirty|r}return t.dirty}function fn(e,t,o,i,r,n){if(r){const a=gn(t,o,i,n);e.p(a,r)}}function yn(e){if(e.ctx.length>32){const t=[],o=e.ctx.length/32;for(let e=0;e<o;e++)t[e]=-1;return t}return-1}function bn(e){const t={};for(const o in e)"$"!==o[0]&&(t[o]=e[o]);return t}function xn(e,t){const o={};t=new Set(t);for(const i in e)t.has(i)||"$"===i[0]||(o[i]=e[i]);return o}function vn(e,t,o){return e.set(o),t}function wn(e){return e&&sn(e.destroy)?e.destroy:en}const Sn="undefined"!=typeof window;let kn=Sn?()=>window.performance.now():()=>Date.now(),Cn=Sn?e=>requestAnimationFrame(e):en;const Tn=new Set;function Mn(e){Tn.forEach((t=>{t.c(e)||(Tn.delete(t),t.f())})),0!==Tn.size&&Cn(Mn)}function Pn(e){let t;return 0===Tn.size&&Cn(Mn),{promise:new Promise((o=>{Tn.add(t={c:e,f:o})})),abort(){Tn.delete(t)}}}function Rn(e,t){e.appendChild(t)}function In(e){if(!e)return document;const t=e.getRootNode?e.getRootNode():e.ownerDocument;return t&&t.host?t:e.ownerDocument}function En(e){const t=Fn("style");return function(e,t){Rn(e.head||e,t),t.sheet}(In(e),t),t.sheet}function An(e,t,o){e.insertBefore(t,o||null)}function Ln(e){e.parentNode.removeChild(e)}function Fn(e){return document.createElement(e)}function zn(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function Dn(e){return document.createTextNode(e)}function On(){return Dn(" ")}function Bn(){return Dn("")}function Wn(e,t,o,i){return e.addEventListener(t,o,i),()=>e.removeEventListener(t,o,i)}function _n(e){return function(t){return t.preventDefault(),e.call(this,t)}}function Vn(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function Nn(e,t,o){null==o?e.removeAttribute(t):e.getAttribute(t)!==o&&e.setAttribute(t,o)}function Hn(e,t){const o=Object.getOwnPropertyDescriptors(e.__proto__);for(const i in t)null==t[i]?e.removeAttribute(i):"style"===i?e.style.cssText=t[i]:"__value"===i?e.value=e[i]=t[i]:o[i]&&o[i].set?e[i]=t[i]:Nn(e,i,t[i])}function jn(e,t){Object.keys(t).forEach((o=>{!function(e,t,o){t in e?e[t]="boolean"==typeof e[t]&&""===o||o:Nn(e,t,o)}(e,o,t[o])}))}function Un(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function Gn(e,t){e.value=null==t?"":t}function Zn(e,t,o,i){null===o?e.style.removeProperty(t):e.style.setProperty(t,o,i?"important":"")}function Xn(e,t,{bubbles:o=!1,cancelable:i=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(e,o,i,t),r}class Yn{constructor(e=!1){this.is_svg=!1,this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,t,o=null){this.e||(this.is_svg?this.e=zn(t.nodeName):this.e=Fn(t.nodeName),this.t=t,this.c(e)),this.i(o)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.childNodes)}i(e){for(let t=0;t<this.n.length;t+=1)An(this.t,this.n[t],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(Ln)}}function qn(e,t){return new e(t)}const Kn=new Map;let Jn,Qn=0;function ea(e,t,o,i,r,n,a,s=0){const l=16.666/i;let c="{\n";for(let e=0;e<=1;e+=l){const i=t+(o-t)*n(e);c+=100*e+`%{${a(i,1-i)}}\n`}const d=c+`100% {${a(o,1-o)}}\n}`,u=`__svelte_${function(e){let t=5381,o=e.length;for(;o--;)t=(t<<5)-t^e.charCodeAt(o);return t>>>0}(d)}_${s}`,p=In(e),{stylesheet:h,rules:m}=Kn.get(p)||function(e,t){const o={stylesheet:En(t),rules:{}};return Kn.set(e,o),o}(p,e);m[u]||(m[u]=!0,h.insertRule(`@keyframes ${u} ${d}`,h.cssRules.length));const g=e.style.animation||"";return e.style.animation=`${g?g+", ":""}${u} ${i}ms linear ${r}ms 1 both`,Qn+=1,u}function ta(e,t){const o=(e.style.animation||"").split(", "),i=o.filter(t?e=>e.indexOf(t)<0:e=>-1===e.indexOf("__svelte")),r=o.length-i.length;r&&(e.style.animation=i.join(", "),Qn-=r,Qn||Cn((()=>{Qn||(Kn.forEach((e=>{const{ownerNode:t}=e.stylesheet;t&&Ln(t)})),Kn.clear())})))}function oa(e){Jn=e}function ia(){if(!Jn)throw new Error("Function called outside component initialization");return Jn}function ra(e){ia().$$.on_mount.push(e)}function na(e){ia().$$.after_update.push(e)}function aa(e){ia().$$.on_destroy.push(e)}function sa(){const e=ia();return(t,o,{cancelable:i=!1}={})=>{const r=e.$$.callbacks[t];if(r){const n=Xn(t,o,{cancelable:i});return r.slice().forEach((t=>{t.call(e,n)})),!n.defaultPrevented}return!0}}function la(e,t){return ia().$$.context.set(e,t),t}function ca(e){return ia().$$.context.get(e)}function da(e,t){const o=e.$$.callbacks[t.type];o&&o.slice().forEach((e=>e.call(this,t)))}const ua=[],pa=[],ha=[],ma=[],ga=Promise.resolve();let $a=!1;function fa(){$a||($a=!0,ga.then(ka))}function ya(){return fa(),ga}function ba(e){ha.push(e)}function xa(e){ma.push(e)}const va=new Set;let wa,Sa=0;function ka(){const e=Jn;do{for(;Sa<ua.length;){const e=ua[Sa];Sa++,oa(e),Ca(e.$$)}for(oa(null),ua.length=0,Sa=0;pa.length;)pa.pop()();for(let e=0;e<ha.length;e+=1){const t=ha[e];va.has(t)||(va.add(t),t())}ha.length=0}while(ua.length);for(;ma.length;)ma.pop()();$a=!1,va.clear(),oa(e)}function Ca(e){if(null!==e.fragment){e.update(),an(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(ba)}}function Ta(e,t,o){e.dispatchEvent(Xn(`${t?"intro":"outro"}${o}`))}const Ma=new Set;let Pa;function Ra(){Pa={r:0,c:[],p:Pa}}function Ia(){Pa.r||an(Pa.c),Pa=Pa.p}function Ea(e,t){e&&e.i&&(Ma.delete(e),e.i(t))}function Aa(e,t,o,i){if(e&&e.o){if(Ma.has(e))return;Ma.add(e),Pa.c.push((()=>{Ma.delete(e),i&&(o&&e.d(1),i())})),e.o(t)}else i&&i()}const La={duration:0};function Fa(e,t,o,i){let r=t(e,o),n=i?0:1,a=null,s=null,l=null;function c(){l&&ta(e,l)}function d(e,t){const o=e.b-n;return t*=Math.abs(o),{a:n,b:e.b,d:o,duration:t,start:e.start,end:e.start+t,group:e.group}}function u(t){const{delay:o=0,duration:i=300,easing:u=tn,tick:p=en,css:h}=r||La,m={start:kn()+o,b:t};t||(m.group=Pa,Pa.r+=1),a||s?s=m:(h&&(c(),l=ea(e,n,t,i,o,u,h)),t&&p(0,1),a=d(m,i),ba((()=>Ta(e,t,"start"))),Pn((t=>{if(s&&t>s.start&&(a=d(s,i),s=null,Ta(e,a.b,"start"),h&&(c(),l=ea(e,n,a.b,a.duration,0,u,r.css))),a)if(t>=a.end)p(n=a.b,1-n),Ta(e,a.b,"end"),s||(a.b?c():--a.group.r||an(a.group.c)),a=null;else if(t>=a.start){const e=t-a.start;n=a.a+a.d*u(e/a.duration),p(n,1-n)}return!(!a&&!s)})))}return{run(e){sn(r)?(wa||(wa=Promise.resolve(),wa.then((()=>{wa=null}))),wa).then((()=>{r=r(),u(e)})):u(e)},end(){c(),a=s=null}}}const za="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function Da(e,t){e.d(1),t.delete(e.key)}function Oa(e,t){Aa(e,1,1,(()=>{t.delete(e.key)}))}function Ba(e,t,o,i,r,n,a,s,l,c,d,u){let p=e.length,h=n.length,m=p;const g={};for(;m--;)g[e[m].key]=m;const $=[],f=new Map,y=new Map;for(m=h;m--;){const e=u(r,n,m),s=o(e);let l=a.get(s);l?i&&l.p(e,t):(l=c(s,e),l.c()),f.set(s,$[m]=l),s in g&&y.set(s,Math.abs(m-g[s]))}const b=new Set,x=new Set;function v(e){Ea(e,1),e.m(s,d),a.set(e.key,e),d=e.first,h--}for(;p&&h;){const t=$[h-1],o=e[p-1],i=t.key,r=o.key;t===o?(d=t.first,p--,h--):f.has(r)?!a.has(i)||b.has(i)?v(t):x.has(r)?p--:y.get(i)>y.get(r)?(x.add(i),v(t)):(b.add(r),p--):(l(o,a),p--)}for(;p--;){const t=e[p];f.has(t.key)||l(t,a)}for(;h;)v($[h-1]);return $}function Wa(e,t){const o={},i={},r={$$scope:1};let n=e.length;for(;n--;){const a=e[n],s=t[n];if(s){for(const e in a)e in s||(i[e]=1);for(const e in s)r[e]||(o[e]=s[e],r[e]=1);e[n]=s}else for(const e in a)r[e]=1}for(const e in i)e in o||(o[e]=void 0);return o}function _a(e){return"object"==typeof e&&null!==e?e:{}}function Va(e,t,o){const i=e.$$.props[t];void 0!==i&&(e.$$.bound[i]=o,o(e.$$.ctx[i]))}function Na(e){e&&e.c()}function Ha(e,t,o,i){const{fragment:r,after_update:n}=e.$$;r&&r.m(t,o),i||ba((()=>{const t=e.$$.on_mount.map(rn).filter(sn);e.$$.on_destroy?e.$$.on_destroy.push(...t):an(t),e.$$.on_mount=[]})),n.forEach(ba)}function ja(e,t){const o=e.$$;null!==o.fragment&&(an(o.on_destroy),o.fragment&&o.fragment.d(t),o.on_destroy=o.fragment=null,o.ctx=[])}function Ua(e,t,o,i,r,n,a,s=[-1]){const l=Jn;oa(e);const c=e.$$={fragment:null,ctx:[],props:n,update:en,not_equal:r,bound:nn(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(l?l.$$.context:[])),callbacks:nn(),dirty:s,skip_bound:!1,root:t.target||l.$$.root};a&&a(c.root);let d=!1;if(c.ctx=o?o(e,t.props||{},((t,o,...i)=>{const n=i.length?i[0]:o;return c.ctx&&r(c.ctx[t],c.ctx[t]=n)&&(!c.skip_bound&&c.bound[t]&&c.bound[t](n),d&&function(e,t){-1===e.$$.dirty[0]&&(ua.push(e),fa(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}(e,t)),o})):[],c.update(),d=!0,an(c.before_update),c.fragment=!!i&&i(c.ctx),t.target){if(t.hydrate){const e=function(e){return Array.from(e.childNodes)}(t.target);c.fragment&&c.fragment.l(e),e.forEach(Ln)}else c.fragment&&c.fragment.c();t.intro&&Ea(e.$$.fragment),Ha(e,t.target,t.anchor,t.customElement),ka()}oa(l)}class Ga{$destroy(){ja(this,1),this.$destroy=en}$on(e,t){if(!sn(t))return en;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(t),()=>{const e=o.indexOf(t);-1!==e&&o.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Za=[];function Xa(e,t){return{subscribe:Ya(e,t).subscribe}}function Ya(e,t=en){let o;const i=new Set;function r(t){if(ln(e,t)&&(e=t,o)){const t=!Za.length;for(const t of i)t[1](),Za.push(t,e);if(t){for(let e=0;e<Za.length;e+=2)Za[e][0](Za[e+1]);Za.length=0}}}return{set:r,update:function(t){r(t(e))},subscribe:function(n,a=en){const s=[n,a];return i.add(s),1===i.size&&(o=t(r)||en),n(e),()=>{i.delete(s),0===i.size&&(o(),o=null)}}}}function qa(e,t,o){const i=!Array.isArray(e),r=i?[e]:e,n=t.length<2;return Xa(o,(e=>{let o=!1;const a=[];let s=0,l=en;const c=()=>{if(s)return;l();const o=t(i?a[0]:a,e);n?e(o):l=sn(o)?o:en},d=r.map(((e,t)=>un(e,(e=>{a[t]=e,s&=~(1<<t),o&&c()}),(()=>{s|=1<<t}))));return o=!0,c(),function(){an(d),l()}}))}var Ka=e=>e.reduce(((e,t)=>Object.assign(e,t)),{});const Ja=e=>({updateValue:e}),Qa=e=>({defaultValue:e}),es=e=>({store:e}),ts=e=>({store:(t,o)=>qa(...e(o))}),os=e=>({store:(t,o)=>{const[i,r,n=(()=>!1)]=e(o);let a,s=!0;return qa(i,((e,t)=>{r(e,(e=>{!s&&n(a,e)||(a=e,s=!1,t(e))}))}))}}),is=e=>({store:(t,o)=>{const[i,r={},n]=e(o);let a=[];const s={},l=e=>i(e,s),c=e=>{(a.length||e.length)&&(a=e,d())},d=()=>{const e=a.map(l);n&&e.sort(n),a=[...e],p(e)};Object.entries(r).map((([e,t])=>t.subscribe((t=>{s[e]=t,t&&d()}))));const{subscribe:u,set:p}=Ya(t||[]);return{set:c,update:e=>c(e(a)),subscribe:u}}});var rs=e=>{const t={},o={};return e.forEach((([e,...i])=>{const r=Ka(i),a=t[e]=((e,t,o)=>{const{store:i=(e=>Ya(e)),defaultValue:r=n,updateValue:a}=o,s=i(r(),t,e),{subscribe:l,update:c=n}=s;let d;const u=e=>{let t=!0;d&&d(),d=l((o=>{if(t)return t=!1;e(o),d(),d=void 0}))},p=a?a(e):Y;return s.set=e=>c((t=>p(e,t,u))),s.defaultValue=r,s})(o,t,r),s={get:()=>pn(a),set:a.set};Object.defineProperty(o,e,s)})),{stores:t,accessors:o}};var ns=[["src",es((()=>{let e;const{subscribe:t,set:o}=Ya(),i=t=>{e!==t&&(e=t,o(e))};return{set:i,subscribe:t,update:t=>i(t(e))}}))],["imageReader"],["imageWriter"],["imageScrambler"],["imageRedactionRendering",Qa((()=>"pixelated"))],["images",Qa((()=>[]))],["shapePreprocessor"],["willRequestResource"],["willRequest"],["csp"]],as=e=>e.charAt(0).toUpperCase()+e.slice(1),ss=(e,t)=>{Object.keys(t).forEach((o=>{const i=R(t[o])?{value:t[o],writable:!1}:t[o];Object.defineProperty(e,o,i)}))};const ls=(e,t)=>{let o,i,r,n,a,s,l,c,d,u;const p=t.length;for(o=0;o<p;o++)if(i=t[o],r=t[o+1>p-1?0:o+1],n=i.x-e.x,a=i.y-e.y,s=r.x-e.x,l=r.y-e.y,c=n-s,d=a-l,u=c*a-d*n,u<-1e-5)return!1;return!0},cs=1e4;var ds=(e,t)=>{const o=Dt(t),i=he();Ct(e).forEach((e=>{ke(e,i),ls(e,t)||o.forEach((t=>{const o=Math.atan2(t.start.y-t.end.y,t.start.x-t.end.x),r=Math.sin(Math.PI-o)*cs,n=Math.cos(Math.PI-o)*cs,a=me(e.x+r,e.y+n),s=Ke(qe(t),cs),l=It(Ye(e,a),s);l&&ke(i,Ce($e(l),e))}))}));const r=et(e);ke(r,i);return!!Ct(r).every((e=>ls(e,t)))&&(yt(e,r),!0)},us=(e,t)=>{const o=Ct(e),i=Ot(t,5),r=ct(e),n=[];o.forEach((e=>{const t=((e,t)=>{if(0===t)return e;const o=me(e.start.x-e.end.x,e.start.y-e.end.y),i=xe(o),r=Me(i,t);return e.end.x+=r.x,e.end.y+=r.y,e})(Ye($e(r),$e(e)),1e6);let o=!1;i.map(qe).forEach((e=>{const i=It(t,e);i&&!o&&(n.push(i),o=!0)}))}));const a=Ee(n[0],n[2])<Ee(n[1],n[3])?[n[0],n[2]]:[n[1],n[3]],s=nt(a);return s.width<e.width&&(yt(e,s),!0)},ps=(e,t,o={x:0,y:0})=>{const i=ot(e),r=ct(i),n=Mt(i,o,r).map((e=>ye(e,t,r))),a=nt(n);return n.map((e=>Ce(e,a)))},hs=(e,t=0,o=$t(e))=>{let i,r;if(0!==t){const n=Math.atan2(1,o),a=Math.sign(t)*t,s=a%Math.PI,l=a%K;let c;c=s>J&&s<K+J?l>J?a:K-l:l>J?K-l:a;const d=Math.min(Math.abs(e.height/Math.sin(n+c)),Math.abs(e.width/Math.cos(n-c)));i=Math.cos(n)*d,r=i/o}else i=e.width,r=i/o,r>e.height&&(r=e.height,i=r*o);return Ne(i,r)},ms=(e,t,o,i,r,n,a,s)=>{const l=Oe(a),c=Oe(s),d=de(Math.max(t.width/c.width,t.height/c.height)),u=de(Math.min(t.width/l.width,t.height/l.height)),p=et(t);if(u<1||d>1){const o=ct(e),i=ct(t),r=u<1?u:d,n=(i.x+o.x)/2,a=(i.y+o.y)/2,s=p.width/r,l=p.height/r;ft(p,n-.5*s,a-.5*l,s,l)}return n?(((e,t,o=0,i=he(),r)=>{if(Oo(o)&&0!==o||i.x||i.y){const r=$t(e),n=ps(t,o,i),a=hs(t,o,r);if(!(e.width<a.width&&e.height<a.height)){const t=.5*e.width-.5*a.width,o=.5*e.height-.5*a.height;e.width>a.width&&(e.width=a.width,e.x+=t),e.height>a.height&&(e.height=a.height,e.y+=o)}ds(e,n),us(e,n)&&ds(e,n)}else{const o=$t(e);e.width=Math.min(e.width,t.width),e.height=Math.min(e.height,t.height),e.x=Math.max(e.x,0),e.x+e.width>t.width&&(e.x-=e.x+e.width-t.width),e.y=Math.max(e.y,0),e.y+e.height>t.height&&(e.y-=e.y+e.height-t.height);const i=ct(e),n=St(e,o);n.width=Math.max(r.width,n.width),n.height=Math.max(r.height,n.height),n.x=i.x-.5*n.width,n.y=i.y-.5*n.height,yt(e,n)}})(p,o,i,r,l),{crop:p}):{crop:p}},gs=(e,t,o)=>{const i=ot(e),r=ct(i),n=bt(i,o,r),a=ct(Pt(nt(n))),s=ct(t),l=ye(s,-o,a),c=Ce(l,a),d=Se(ke(r,c),de);return lt(d.x-.5*t.width,d.y-.5*t.height,t.width,t.height)},$s=(e,t,o)=>Math.max(t,Math.min(e,o));const fs=["cropLimitToImage","cropMinSize","cropMaxSize","cropAspectRatio","flipX","flipY","rotation","crop","colorMatrix","convolutionMatrix","gamma","vignette","manipulation","redaction","annotation","decoration","selection","frame","backgroundColor","backgroundImage","targetSize","metadata","trim","volume","minDuration","maxDuration","currentTime"],ys=e=>_o(e)?e.map(ys):go(e)||Ut(e)?e:T(e)?{...e}:e,bs=e=>e.map((e=>Object.entries(e).reduce(((e,[t,o])=>(t.startsWith("_")||(e[t]=o),e)),{})));const xs=(e,t)=>e===t;var vs=(e,t,o=xs)=>{if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!o(e[i],t[i]))return!1;return!0};const ws=(e,t,o)=>{const i=Se(ct(e),(e=>de(e,8))),r=ot(t),n=ct(r),a=bt(r,o,n),s=Se(Ue(nt(a)),(e=>de(e,8))),l=Math.abs(s.x-i.x),c=Math.abs(s.y-i.y);return l<1&&c<1},Ss=(e,t,o,i,r)=>{if(!r)return[-1/0,1/0];const n=Math.max(o.width/i.width,o.height/i.height),a=Ne(i.width*n,i.height*n),s=(l=a,Math.sqrt(l.width*l.width+l.height*l.height));var l;if(s<Math.min(e.width,e.height))return[-1/0,1/0];const c=t?e.height:e.width,d=t?e.width:e.height,u=Math.acos(a.height/s),p=u-Math.acos(d/s),h=Math.asin(c/s)-u;if(Number.isNaN(p)&&Number.isNaN(h))return[-1/0,1/0];const m=Number.isNaN(p)?h:Number.isNaN(h)?p:Math.min(p,h);return[-m,m]},ks=(e,t)=>{const{context:o,props:i}=t;return e._isFormatted||((e=pr(e))._isFormatted=!0,Object.assign(e,i)),e._isDraft||!Vi(e)||e._context&>(o,e._context)||(Pr(e,o),e._context={...o}),e},Cs=(e,t)=>(e._isFormatted||(e.disableMove=!0,e.disableSelect=!0,e.disableResize=!0,e.disableRotate=!0),ks(e,t));var Ts=[["file"],["size"],["loadState"],["processState"],["aspectRatio",ts((({size:e})=>[e,e=>e?$t(e):void 0]))],["perspectiveX",Qa((()=>0))],["perspectiveY",Qa((()=>0))],["perspective",ts((({perspectiveX:e,perspectiveY:t})=>[[e,t],([e,t])=>({x:e,y:t})]))],["rotation",Qa((()=>0)),Ja((e=>(t,o,i)=>{if(t===o)return t;const{loadState:r,size:n,rotationRange:a,cropMinSize:s,cropMaxSize:l,crop:c,perspective:d,cropLimitToImage:u,cropOrigin:p}=e;if(!c||!r||!r.beforeComplete)return t;const h=u&&((e,t,o)=>{const i=hs(t,o,$t(e));return He(Xe(i,Math.round),Xe(Oe(e),Math.round))})(c,n,o),m=u&&ws(c,n,o),g=((e,t,o,i,r,n,a,s,l,c)=>{const d=Oe(l),u=Oe(c);a&&(u.width=Math.min(c.width,r.width),u.height=Math.min(c.height,r.height));let p=!1;const h=(t,o)=>{const l=gs(r,i,t),c=ot(r),m=ct(c),g=Mt(c,n,m),$=Ce($e(m),Rt(g)),f=ye(ct(l),o,m),y=Ce($e(m),f);g.forEach((e=>ye(e,o,m)));const b=nt(g),x=Rt(g),v=ke(Ce(Ce(x,y),b),$),w=lt(v.x-.5*l.width,v.y-.5*l.height,l.width,l.height);if(s&&ut(w,s.width/w.width),a){const e=ps(r,o,n);us(w,e)}const S=de(Math.min(w.width/d.width,w.height/d.height),8),k=de(Math.max(w.width/u.width,w.height/u.height),8);return(S<1||k>1)&&de(Math.abs(o-t))===de(Math.PI/2)&&!p?(p=!0,h(e,e+Math.sign(o-t)*Math.PI)):{rotation:o,crop:Tt(w,(e=>de(e,8)))}},m=Math.sign(t)*Math.round(Math.abs(t)/K)*K,g=$s(t,m+o[0],m+o[1]);return h(e,g)})(o,t,a,c,n,d,u,p,s,l);if(h&&m){const e=hs(n,t,$t(g.crop));g.crop.x+=.5*g.crop.width,g.crop.y+=.5*g.crop.height,g.crop.x-=.5*e.width,g.crop.y-=.5*e.height,g.crop.width=e.width,g.crop.height=e.height}return i((()=>{e.crop=Tt(g.crop,(e=>de(e,8)))})),g.rotation}))],["flipX",Qa((()=>!1))],["flipY",Qa((()=>!1))],["flip",ts((({flipX:e,flipY:t})=>[[e,t],([e,t])=>({x:e,y:t})]))],["isRotatedSideways",os((({rotation:e})=>[[e],([e],t)=>t(Q(e)),(e,t)=>e!==t]))],["crop",Ja((e=>(t,o=t)=>{const{loadState:i,size:r,cropMinSize:n,cropMaxSize:a,cropLimitToImage:s,cropAspectRatio:l,rotation:c,perspective:d}=e;if(!t&&!o||!i||!i.beforeComplete)return t;t||(t=ot(hs(r,c,l||$t(r))));const u=ms(o,t,r,c,d,s,n,a),p=Tt(u.crop,(e=>de(e,8)));return gt(o,p)?o:p}))],["cropAspectRatio",Ja((e=>(t,o)=>{const{loadState:i,crop:r,size:n,rotation:a,cropLimitToImage:s}=e,l=(e=>{if(e){if(/:/.test(e)){const[t,o]=e.split(":");return t/o}return parseFloat(e)}})(t);if(!l)return;if(!r||!i||!i.beforeComplete)return l;const c=o?Math.abs(t-o):1;if(ws(r,n,a)&&s&&c>=.1){const o=((e,t)=>{const o=e.width,i=e.height;return Q(t)&&(e.width=i,e.height=o),e})(Oe(n),a);e.crop=Tt(St(ot(o),t),de)}else{const t={width:r.height*l,height:r.height},o=.5*(r.width-t.width),i=.5*(r.height-t.height);e.crop=Tt(lt(r.x+o,r.y+i,t.width,t.height),de)}return l}))],["cropOrigin"],["cropMinSize",Qa((()=>({width:1,height:1})))],["cropMaxSize",Qa((()=>({width:32768,height:32768})))],["cropLimitToImage",Qa((()=>!0)),Ja((e=>(t,o,i)=>{const{crop:r}=e;return r?(!o&&t&&i((()=>e.crop=et(e.crop))),t):t}))],["cropSize",os((({crop:e})=>[[e],([e],t)=>{e&&t(Ne(e.width,e.height))},(e,t)=>He(e,t)]))],["cropRectAspectRatio",ts((({cropSize:e})=>[[e],([e],t)=>{e&&t(de($t(e),5))}]))],["cropRange",os((({size:e,rotation:t,cropRectAspectRatio:o,cropMinSize:i,cropMaxSize:r,cropLimitToImage:n})=>[[e,t,o,i,r,n],([e,t,o,i,r,n],a)=>{if(!e)return;a(((e,t,o,i,r,n)=>{const a=Oe(i),s=Oe(r);return n?[a,Xe(hs(e,t,o),Math.round)]:[a,s]})(e,t,o,i,r,n))},(e,t)=>vs(e,t)]))],["rotationRange",os((({size:e,isRotatedSideways:t,cropMinSize:o,cropSize:i,cropLimitToImage:r})=>[[e,t,o,i,r],([e,t,o,i,r],n)=>{if(!e||!i)return;n(Ss(e,t,o,i,r))},(e,t)=>vs(e,t)]))],["backgroundColor",Ja((()=>e=>((e=[0,0,0,0],t=1)=>4===e.length?e:[...e,t])(e)))],["backgroundImage"],["targetSize"],["colorMatrix"],["convolutionMatrix"],["gamma"],["noise"],["vignette"],["duration"],["currentTime"],["minDuration",Qa((()=>1/24))],["maxDuration",Qa((()=>1/0))],["volume",Qa((()=>1))],["trim"],["redaction",is((({size:e})=>[ks,{context:e}]))],["manipulation",is((({size:e})=>[ks,{context:e}]))],["annotation",is((({size:e})=>[ks,{context:e}]))],["decoration",is((({crop:e})=>[ks,{context:e}]))],["selection",is((({size:e})=>[Cs,{context:e}]))],["frame",Ja((()=>e=>{if(!e)return;const t={frameStyle:void 0,x:0,y:0,width:"100%",height:"100%",disableStyle:["backgroundColor","strokeColor","strokeWidth"]};return m(e)?t.frameStyle=e:Object.assign(t,e),t}))],["metadata"],["state",es(((e,t,o)=>{const i=fs.map((e=>t[e]));let r=!1;const n=Ya({}),{subscribe:a}=qa([...i,n],((e,t)=>{if(r)return;const o=fs.reduce(((t,o,i)=>(t[o]=ys(e[i]),t)),{});o.crop&&Tt(o.crop,Math.round),o.manipulation=o.manipulation&&bs(o.manipulation),o.redaction=o.redaction&&bs(o.redaction),o.annotation=o.annotation&&bs(o.annotation),o.decoration=o.decoration&&bs(o.decoration),o.selection=o.selection&&bs(o.selection),t(o)})),s=e=>{e&&(r=!0,o.cropOrigin=void 0,fs.filter((t=>Wo(e,t))).forEach((t=>{const i=e[t];o[t]=null===i?void 0:ys(i)})),r=!1,n.set({}))};return{set:s,update:e=>s(e(null)),subscribe:a}}))]],Ms=async(e,t,o={},i)=>{const{ontaskstart:r,ontaskprogress:a,ontaskend:s,token:l}=i;let c=!1;const d={cancel:n};l.cancel=()=>{c=!0,d.cancel()};for(const[i,n]of t.entries()){if(c)return;const[t,l]=n;r(i,l);try{e=await t(e,{...o,taskCancelToken:d},(e=>a(i,l,e)))}catch(e){throw c=!0,e}s(i,l)}return e};const Ps=e=>console.warn(`Pintura: ${e} is a required prop.`),Rs=["loadstart","loadabort","loaderror","loadprogress","load","processstart","processabort","processerror","processprogress","process"],Is=["flip","cropOrigin","isRotatedSideways","perspective","perspectiveX","perspectiveY","cropRange"],Es=["images"],As=Ts.map((([e])=>e)).filter((e=>!Is.includes(e))),Ls=e=>"image"+as(e),Fs=e=>Wo(e,"crop");var zs=()=>{const{stores:e,accessors:t}=rs(ns),{sub:o,pub:i}=Qo(),r=()=>t.images?t.images[0]:{};let a={};const s={};As.forEach((e=>{Object.defineProperty(t,Ls(e),{get:()=>{const t=r();if(t)return t.accessors[e]},set:t=>{a[Ls(e)]=t,s[Ls(e)]=t;const o=r();o&&(o.accessors[e]=t)}})}));const l=()=>t.images&&t.images[0];let c;const d=e.src.subscribe((e=>{if(!e)return t.images=[];t.imageReader?(t.images.length&&(a={}),p(e)):c=setTimeout((()=>Ps("imageReader")),32)})),u=e.imageReader.subscribe((e=>{e&&(clearTimeout(c),t.images.length||t.src&&p(t.src))})),p=e=>{Promise.resolve().then((()=>g(e,a))).catch((()=>{}))};let h;const g=(e,o={})=>new Promise(((r,c)=>{let d=l();const u=!(!1===o.cropLimitToImage||!1===o.imageCropLimitToImage||!1===s.imageCropLmitedToImage),p=o.cropMinSize||o.imageCropMinSize||s.imageCropMinSize,m=u?p:d&&d.accessors.cropMinSize,g=o.minDuration||o.imageMinDuration;d&&f(),d=(({minSize:e={width:1,height:1},minDuration:t=0}={})=>{const{stores:o,accessors:i}=rs(Ts),{pub:r,sub:a}=Qo(),s=(e,t)=>{const o=()=>i[e]||{},n=t=>{i[e]={...o(),...t,timeStamp:Date.now()}},a=()=>o().error,s=e=>{a()||(n({error:e}),r(t+"error",{...o()}))};return{start(){r(t+"start")},onabort(){n({abort:!0}),r(t+"abort",{...o()})},ontaskstart(e,i){a()||(n({index:e,task:i,taskProgress:void 0,taskLengthComputable:void 0}),r(t+"taskstart",{...o()}))},ontaskprogress(e,i,s){a()||(n({index:e,task:i,taskProgress:s.loaded/s.total,taskLengthComputable:s.lengthComputable}),r(t+"taskprogress",{...o()}),r(t+"progress",{...o()}))},ontaskend(e,i){a()||(n({index:e,task:i}),r(t+"taskend",{...o()}))},ontaskerror(e){s(e)},error(e){s(e)},beforeComplete(e){a()||(n({beforeComplete:!0}),r("before"+t,e))},complete(e){a()||(n({complete:!0}),r(t,e))}}};return ss(i,{read:(o,{reader:r},a={})=>{if(!r)return;Object.assign(i,{file:void 0,size:void 0,loadState:void 0});let l={cancel:n},c=!1;const d=s("loadState","load"),u={token:l,...d},p={src:o,size:void 0,dest:void 0,duration:void 0};return Promise.resolve().then((async()=>{try{if(d.start(),c)return d.onabort();const o=await Ms(p,r,a,u);if(c)return d.onabort();const{size:n,duration:s,dest:h}=o||{};if(!n||!n.width||!n.height)throw new po("Image size missing","IMAGE_SIZE_MISSING",o);if(s>0&&s<t)throw new po("Video too short","VIDEO_TOO_SHORT",{...o,minDuration:t});if(n.width<e.width||n.height<e.height)throw new po("Image too small","IMAGE_TOO_SMALL",{...o,minWidth:e.width,minHeight:e.height});Object.assign(i,{file:h,size:n,duration:s}),d.beforeComplete(o),d.complete(o)}catch(e){d.error(e)}finally{l=void 0}})),()=>{c=!0,l&&l.cancel(),d.onabort()}},write:(e,t)=>{if(!i.loadState.complete)return;i.processState=void 0;const o=s("processState","process"),r={src:i.file,imageState:i.state,dest:void 0};if(R(e)&&(e=e(i.file,i.state)),!e)return o.start(),void o.complete(r);let a={cancel:n},l=!1;const c=t,d={token:a,...o};return Promise.resolve().then((async()=>{try{if(o.start(),l)return o.onabort();const t=await Ms(r,e,c,d);if(l)return o.onabort();o.complete(t)}catch(e){o.error(e)}finally{a=void 0}})),()=>{l=!0,a&&a.cancel()}},on:a}),{accessors:i,stores:o}})({minSize:m,minDuration:g}),Rs.map((e=>{return d.accessors.on(e,(t=e,e=>i(t,e)));var t}));const $=()=>{a={},y.forEach((e=>e()))},y=[];y.push(d.accessors.on("loaderror",(e=>{$(),c(e)}))),y.push(d.accessors.on("loadabort",(()=>{$(),c({name:"AbortError"})}))),y.push(d.accessors.on("load",(e=>{h=void 0,$(),r(e)}))),y.push(d.accessors.on("beforeload",(()=>((e,o)=>{if(Fs(o))return void(t.imageState=o);if(!o.imageCrop){const t=e.accessors.size,i=o.imageRotation||0,r=Ge(Oe(t),i),n=ot(r);n.width=de(Math.abs(n.width),6),n.height=de(Math.abs(n.height),6);const a=o.imageCropAspectRatio||(o.imageCropLimitToImage?$t(t):$t(n));let s;o.imageCropLimitToImage?s=St(n,a):(s=wt(n,a),s.x=(t.width-s.width)/2,s.y=(t.height-s.height)/2),o.imageCrop=s}if(e.accessors.duration&&!o.imageTrim&&o.imageMaxDuration){const{duration:t}=e.accessors;o.imageTrim=[[0,Math.min(o.imageMaxDuration/t,1)]]}const i=["imageCropLimitToImage","imageCrop","imageCropAspectRatio","imageRotation"];i.filter((e=>Wo(o,e))).forEach((e=>{t[e]=o[e],delete o[e]}));const r=Object.keys(o).filter((e=>!i.includes(e))).reduce(((e,t)=>(e[t]=o[t],e)),{});Object.assign(t,r)})(d,o)))),t.images=[d],o.imageReader&&(t.imageReader=o.imageReader),o.imageWriter&&(t.imageWriter=o.imageWriter),h=d.accessors.read(e,{reader:t.imageReader},{willRequest:t.willRequest})}));let $;const f=()=>{const e=l();e&&(h&&h(),e.accessors.loadState=void 0,t.images=[])};return Object.defineProperty(t,"stores",{get:()=>e}),ss(t,{on:o,loadImage:g,abortLoadImage:()=>{h&&h(),t.images=[]},editImage:(e,o)=>new Promise(((i,r)=>{g(e,o).then((()=>{const{images:e}=t,o=e[0],n=()=>{a(),s()},a=o.accessors.on("processerror",(e=>{n(),r(e)})),s=o.accessors.on("process",(e=>{n(),i(e)}))})).catch(r)})),removeImage:f,processImage:(e,o)=>new Promise(((i,r)=>{try{const n=[],a=()=>{$=void 0,n.forEach((e=>e()))};(async()=>{if((e=>m(e)||Go(e)||jt(e))(e))try{await g(e,o)}catch(e){r(e)}else e&&(Fs(e)?t.imageState=e:Object.assign(t,e));const s=l();if(!s)return r("no image");n.push(s.accessors.on("processerror",(e=>{a(),r(e)}))),n.push(s.accessors.on("processabort",(()=>{a(),r({name:"AbortError"})}))),n.push(s.accessors.on("process",(e=>{a(),i(e)}))),$=s.accessors.write(t.imageWriter,{redactionRenderStyle:t.imageRedactionRendering,shapePreprocessor:t.shapePreprocessor||Y,imageScrambler:t.imageScrambler,willRequest:t.willRequest,csp:t.csp||{},willRequestResource:t.willRequestResource})})()}catch(e){r(e)}})),abortProcessImage:()=>{const e=l();e&&($&&$(),e.accessors.processState=void 0)},destroy:()=>{d&&d(),u&&u()}}),t};const Ds=(e,t)=>{const{processImage:o}=zs();return o(e,t)};var Os=()=>Qt()?vo()?/15_|16_/.test(navigator.userAgent)?14745600:16777216:/15_/.test(navigator.userAgent)?16777216:1/0:1/0,Bs=(e,t)=>Object.keys(e).filter((e=>!t.includes(e))).reduce(((t,o)=>(t[o]=e[o],t)),{}),Ws=e=>new Promise((t=>{if(e.duration===1/0)return e.ontimeupdate=()=>{e.ontimeupdate=void 0,t(e)},void(e.currentTime=Number.MAX_SAFE_INTEGER);t(e)}));const _s=e=>new Promise((t=>{const o=new FileReader;o.onload=()=>t(o.result),o.readAsArrayBuffer(e)})),Vs=1836476516,Ns=(e,t=0,o=e.byteLength)=>{const i=[],r=t+o;for(;t<r;){const o=e.getUint32(t);if(o<0)break;const r=e.getUint32(t+4);if(i.push({type:r,size:o,offset:t,bodyOffset:t+8,bodySize:o-8}),o<8)break;t+=o}return i},Hs=(e,{limit:t=1024}={})=>{let o=0;o+=4;if(1718909296!==e.getUint32(o))return 0;o+=4;const i=e.getUint32(o);return 1836069938===i?((e,t,o)=>{let i=!1,r=-1;for(let n=t;n<o;n++)if(i||1953653099!==e.getUint32(n)||(i=!0,n+=4),i&&64==e.getUint8(n)){r=n;break}if(r<0)return 0;const n=e.getUint32(r-28),a=e.getUint32(r-20),s=e.getUint32(r-32),l=e.getUint32(r-16);return 65536===n&&4294901760===a?90:4294901760===s&&4294901760===l?180:4294901760===n&&65536===a?270:0})(e,o,t):1903435808===i?(e=>{const t=Ns(e).find((e=>1836019574===e.type));if(!t)return 0;const o=Ns(e,t.bodyOffset,t.bodySize);o.filter((e=>1953653099===e.type)).forEach((t=>{o.push(...Ns(e,t.bodyOffset,t.bodySize))}));const i=[Vs,1953196132],r=o.filter((e=>i.includes(e.type)));for(const{type:t,bodyOffset:o}of r){const i=e.getUint8(o);let r=o+4;r+=t===Vs?32:36,r+=1===i?12:0;const n=e.getInt32(r),a=e.getInt32(r+4);if(0===n&&a>0)return 90;if(n<0&&0===a)return 180;if(0===n&&a<0)return 270}return 0})(e):0};var js=e=>new Promise(((t,o)=>{(O()?(async e=>{const t=await _s(e),o=new DataView(t);return Hs(o)})(e):Promise.resolve(0)).then((i=>{const r=document.createElement("video");r.onerror=()=>o(r.error),r.playsInline=!0,r.preload="auto",r.onseeked=()=>{r.onseeked=void 0,t(r)},r.onloadeddata=()=>{r.onloadeddata=void 0,r.dataset.rotation=i?""+i:"0",Ws(r).then(t),r.currentTime=0},vo()&&Qt()?(r.srcObject=e,r.load()):r.src=URL.createObjectURL(e)}))})),Us=(e,t)=>new Promise((o=>{if(e.currentTime===t)return o(e);let i=e.onseeked;e.onseeked=()=>{e.onseeked=i,o(e)},e.currentTime=$s(t,0,e.duration)})),Gs=(e,t=0)=>new Promise(((o,i)=>{js(e).then((e=>{Us(e,t).then((e=>{const t=$("canvas");to(e).then((({width:i,height:r})=>{t.width=i,t.height=r;const n=t.getContext("2d",{willReadFrequently:!0}),a=()=>{n.drawImage(e,0,0,t.width,t.height);const i=n.getImageData(0,0,t.width,t.height);y(t),URL.revokeObjectURL(e.src),o(i)};Qt()?setTimeout(a,16):a()}))}))}))})),Zs=e=>/video/.test(e.type);const Xs=({imageDataResizer:e,canvasMemoryLimit:t}={})=>async(o,i,r,n,a)=>{r.width=Math.max(r.width,1),r.height=Math.max(r.height,1),n.width=Math.max(n.width,1),n.height=Math.max(n.height,1);const{dest:s}=await Ds(i,{imageReader:Sl(),imageWriter:Cl({format:"canvas",targetSize:{...n,upscale:!0},imageDataResizer:e,canvasMemoryLimit:t}),imageCrop:r}),{feather:l=0}=a||{};if(l>0){const e=$("canvas");e.width=s.width,e.height=s.height;const t=e.getContext("2d",{willReadFrequently:!0}),o=1/l;let i=0;for(i=0;i<l;i++){const e=i*o;t.strokeStyle=`rgba(0,0,0,${e*e})`,t.strokeRect(i+.5,i+.5,s.width-2*i-1,s.height-2*i-1)}t.fillStyle="#000",t.fillRect(i,i,s.width+.5-2*i,s.height+.5-2*i);const r=s.getContext("2d");r.globalCompositeOperation="destination-in",r.drawImage(e,0,0),y(e)}o.drawImage(s,n.x,n.y,n.width,n.height),y(s)},Ys=(e,t=((...e)=>e),o)=>async(i,r,n)=>{n(so(0,!1));let a=!1;const s=await e(...t(i,r,(e=>{a=!0,n(e)})));return o&&o(i,s),a||n(so(1,!1)),i},qs=({willRequest:e,srcProp:t="src",destProp:o="dest"}={})=>[Ys(fo,((o,i,r)=>[o[t],r,{...i,willRequest:e}]),((e,t)=>e[o]=t)),"any-to-file"],Ks=({srcProp:e="dest",destProp:t="dest"}={})=>[Ys((async e=>{if(/octet-stream/.test(e.type)){console.warn(`Pintura: File has unknown mime type "${e.type}", make sure your server sets the correct Content-Type header.`);let t="image";const o=await io(e);/video/i.test(o.nodeName)&&(t="video");const i={type:t+"/unknown"};return Ut(e)?new File([e],e.name,{...i,lastModified:e.lastModified}):new Blob([e],i)}return e}),(t=>[t[e]]),((e,o)=>e[t]=o)),"any-to-file"],Js=({srcProp:e="src",destProp:t="size"}={})=>[Ys(no,(t=>[t[e]]),((e,o)=>e[t]=o)),"read-image-size"],Qs=async e=>{const t=await io(e);if(ro(t))return await(e=>new Promise(((t,o)=>{const i=()=>{Ws(e).then((()=>{t(e.duration)}))};if(e.readyState>=1)return i();e.onloadedmetadata=i,e.onerror=()=>o(e.error)})))(t)},el=({srcProp:e="src",destProp:t="duration"}={})=>[Ys(Qs,(t=>[t[e]]),((e,o)=>e[t]=o)),"read-media-duration"],tl=({srcSize:e="size",srcOrientation:t="orientation",destSize:o="size"}={})=>[Ys(wo,(o=>[o[e],o[t]]),((e,t)=>e[o]=t)),"image-size-match-orientation"],ol=({srcProp:e="src",destProp:t="copy"}={})=>[Ys(((e,t)=>So(e)?s(e,t):void 0),(t=>[t[e],onprogress]),((e,o)=>e[t]=o)),"read-image-head"],il=({srcProp:e="copy",destProp:t="orientation"}={})=>[Ys(o,(t=>[t[e],274]),((e,o=1)=>e[t]=o)),"read-exif-orientation-tag"],rl=({srcProp:e="copy"}={})=>[Ys(o,(t=>[t[e],274,1])),"clear-exif-orientation-tag"],nl=({srcImageSize:e="size",srcCanvasSize:t="imageData",srcImageState:o="imageState",destImageSize:i="size",destScalar:r="scalar"}={})=>[Ys(((e,t)=>[Math.min(t.width/e.width,t.height/e.height),Be(t)]),(i=>[i[e],i[t],i[o]]),((e,[t,o])=>{e[r]=t,e[i]=o})),"calculate-canvas-scalar"],al=({srcProp:e="src",destProp:t="imageData",canvasMemoryLimit:o,srcImageState:i="imageState"}={})=>[Ys(((e,t,o)=>Zs(e)?Gs(e,o.currentTime):W(e,t)),(t=>[t[e],o,t[i]]),((e,o)=>e[t]=o)),"blob-to-image-data"],sl=({srcImageData:e="imageData",srcOrientation:t="orientation"}={})=>[Ys(C,(o=>[o[e],o[t]]),((e,t)=>e.imageData=t)),"image-data-match-orientation"],ll=({srcImageData:e="imageData",srcImageState:t="imageState"}={})=>[Ys(Kr,(o=>[o[e],{backgroundColor:o[t].backgroundColor,backgroundImage:o[t].backgroundImage}]),((e,t)=>e.imageData=t)),"image-data-fill"],cl=({srcImageData:e="imageData",srcImageState:t="imageState",destScalar:o="scalar"}={})=>[Ys(Mo,(i=>{const r=i[o];let{crop:n}=i[t];return n&&1!==r&&(n=ut(et(n),r,he())),[i[e],{crop:n,rotation:i[t].rotation,flipX:i[t].flipX,flipY:i[t].flipY}]}),((e,t)=>e.imageData=t)),"image-data-crop"],dl=({targetSize:e={width:void 0,height:void 0,fit:void 0,upscale:void 0},imageDataResizer:t,srcProp:o="imageData",srcImageState:i="imageState",destImageScaledSize:r="imageScaledSize"})=>[Ys(Io,(r=>{const n=Math.min(e.width||Number.MAX_SAFE_INTEGER,r[i].targetSize&&r[i].targetSize.width||Number.MAX_SAFE_INTEGER),a=Math.min(e.height||Number.MAX_SAFE_INTEGER,r[i].targetSize&&r[i].targetSize.height||Number.MAX_SAFE_INTEGER);return[r[o],{width:n,height:a,fit:e.fit||"contain",upscale:(s=r[i],!!(s.targetSize&&s.targetSize.width||s.targetSize&&s.targetSize.height)||(e.upscale||!1))},t];var s}),((e,t)=>{He(e.imageData,t)||(e[r]=Be(t)),e.imageData=t})),"image-data-resize"],ul=({srcImageData:e="imageData",srcImageState:t="imageState",destImageData:o="imageData"}={})=>[Ys(Do,(o=>{const{colorMatrix:i}=o[t],r=i&&Object.keys(i).map((e=>i[e])).filter(Boolean);return[o[e],{colorMatrix:r&&Jr(r),convolutionMatrix:o[t].convolutionMatrix,gamma:o[t].gamma,noise:o[t].noise,vignette:o[t].vignette}]}),((e,t)=>e[o]=t)),"image-data-filter"],pl=({srcImageData:e="imageData",srcImageState:t="imageState",destImageData:o="imageData",destScalar:i="scalar"}={})=>[Ys((async(e,t,o,i,r,n)=>{if(!t||!i.length)return e;let a;try{const r={dataSizeScalar:Qr(e,i)};o&&o[3]>0&&(r.backgroundColor=[...o]),a=await t(e,r)}catch(e){}const s=$("canvas");s.width=e.width,s.height=e.height;const l=s.getContext("2d",{willReadFrequently:!0});if(l.putImageData(e,0,0),"auto"===n){const t=Math.sqrt(e.width*e.height);l.filter=`blur(${Math.round(t/100)}px)`}const c=new Path2D;i.forEach((e=>{const t=lt(e.x,e.y,e.width,e.height);mt(t,r);const o=bt(et(t),e.rotation),i=new Path2D;o.forEach(((e,t)=>{if(0===t)return i.moveTo(e.x,e.y);i.lineTo(e.x,e.y)})),c.addPath(i)})),l.clip(c,"nonzero"),l.imageSmoothingEnabled=!1,l.drawImage(a,0,0,s.width,s.height),y(a);const d=l.getImageData(0,0,s.width,s.height);return y(s),d}),((o,{imageScrambler:r,redactionRenderStyle:n})=>[o[e],r,o[t].backgroundColor,o[t].redaction,o[i],n]),((e,t)=>e[o]=t)),"image-data-redact"],hl=({srcImageData:e="imageData",srcSize:t="size",srcImageState:o="imageState",srcShapes:i="annotation",destImageData:r="imageData",destImageScaledSize:n="imageScaledSize",destScalar:a="scalar",imageDataResizer:s,canvasMemoryLimit:l,shapeFilter:c=Y,shapeClip:d=!0,destImageContext:u="imageContext"}={})=>[Ys(qr,((r,{shapePreprocessor:p,willRequestResource:h,csp:m,willRequest:g})=>{const $=r[o][i].filter(c);if(!$.length)return[r[e]];const f=r[a],{crop:y}=r[o],b=r[t];let x=f;const v=r[n];v&&(x=Math.min(v.width/y.width,v.height/y.height));const w={width:b.width/f,height:b.height/f};return[r[e],{shapes:$,computeShape:e=>(e=vr(e,w),e=Bs(e,["left","right","top","bottom"]),e=Rr(e,x)),transform:e=>{const i=r[t],{rotation:a=0,flipX:s,flipY:l,cropLimitToImage:c}=r[o],{crop:p=ot(i)}=r[o];let h=1;h=r[n]?x:f;const m={width:i.width/f*h,height:i.height/f*h},g=Ht(m,a),$=g.width,y=g.height,b=.5*m.width-.5*$,v=.5*m.height-.5*y,w=Ue(m);e.translate(-b,-v),e.translate(-p.x*h,-p.y*h),e.translate(w.x,w.y),e.rotate(a),e.translate(-w.x,-w.y);const S=r[u]||{x:0,y:0};e.translate(S.x,S.y),e.scale(s?-1:1,l?-1:1),e.translate(s?-m.width*f:0,l?-m.height*f:0),c&&d&&(e.rect(0,0,m.width,m.height),e.clip())},drawImage:Xs({imageDataResizer:s,canvasMemoryLimit:l}),preprocessShape:e=>p(e,{isPreview:!1,...r[o]}),canvasMemoryLimit:l,willRequest:g||h,styleNonce:m.styleNonce}]}),((e,t)=>e[r]=t)),"image-data-annotate"],ml=({srcImageData:e="imageData",srcImageState:t="imageState",destImageData:o="imageData",destImageScaledSize:i="imageScaledSize",imageDataResizer:r,canvasMemoryLimit:n,destScalar:a="scalar",shapeFilter:s=Y,destImageContext:l="imageContext"}={})=>[Ys(qr,((o,{shapePreprocessor:c,willRequestResource:d,willRequest:u,csp:p})=>{let h=o[t].decoration.filter(s);if("undefined"!=typeof window&&(e=>{if(e&&e._dwkgrvd)return;const[i]=[[85,110,108,105,99,101,110,115,101,100,32,80,105,110,116,117,114,97,32,105,110,115,116,97,110,99,101,32]].map((e=>e.map((e=>String.fromCharCode(e))).join(""))),{width:r,height:n}=o[t].crop,a=n/15;h=[...h,{x:.5*-a,y:.5*-a,width:1.5*r,height:1.25*n,text:Array(50).fill(i).join(""),fontWeight:900,lineHeight:a,fontSize:a,color:[1,1,1,.05]}]})(window),!h.length)return[o[e]];let m=o[a];const{crop:g}=o[t],$=o[i];if($){const e=Math.min($.width/g.width,$.height/g.height);m=e}return[o[e],{shapes:h,drawImage:Xs({imageDataResizer:r,canvasMemoryLimit:n}),computeShape:e=>(e=vr(e,g),e=Bs(e,["left","right","top","bottom"]),e=Rr(e,m)),preprocessShape:e=>c(e,{isPreview:!1,...o[t]}),canvasMemoryLimit:n,willRequest:u||d,styleNonce:p.styleNonce,transform:e=>{const t=o[l]||{x:0,y:0};e.translate(t.x,t.y)}}]}),((e,t)=>e[o]=t)),"image-data-decorate"],gl=({srcImageData:e="imageData",srcImageState:t="imageState",destImageData:o="imageData",destImageScaledSize:i="imageScaledSize",imageDataResizer:r,canvasMemoryLimit:n,destScalar:a="scalar",destImageContext:s="imageContext"}={})=>[Ys(((e,t)=>new Promise((o=>{if(!t)return o([e]);qr(e,t).then((e=>{o([e,t.contextBounds])}))}))),((o,{shapePreprocessor:s,willRequestResource:l,willRequest:c,csp:d})=>{const u=o[t].frame;if(!u)return[o[e]];const p=o[a];let{crop:h}=o[t];h&&1!==p&&(h=ut(et(h),p,he()));const m={...h},g=Tr(Mr(u,m,s),m);m.x=Math.abs(g.left),m.y=Math.abs(g.top),m.width+=Math.abs(g.left)+Math.abs(g.right),m.height+=Math.abs(g.top)+Math.abs(g.bottom);const $=o[i],f=$?Math.min($.width/h.width,$.height/h.height):1;return mt(m,f),m.x=Math.floor(m.x),m.y=Math.floor(m.y),m.width=Math.floor(m.width),m.height=Math.floor(m.height),[o[e],{shapes:[u],contextBounds:m,computeShape:t=>vr(t,o[e]),transform:e=>{e.translate(m.x,m.y)},drawImage:Xs({imageDataResizer:r,canvasMemoryLimit:n}),preprocessShape:e=>s(e,{isPreview:!1,...o[t]}),canvasMemoryLimit:n,willRequest:c||l,styleNonce:d.styleNonce}]}),((e,[t,i])=>{e[s]=i,e[o]=t})),"image-data-frame"],$l=({mimeType:e,quality:t,srcImageData:o="imageData",srcFile:i="src",destBlob:r="blob"}={})=>[Ys(V,(r=>[r[o],e||G(r[i].name)||r[i].type,t]),((e,t)=>e[r]=t)),"image-data-to-blob"],fl=({srcImageData:e="imageData",srcOrientation:t="orientation",destCanvas:o="dest"}={})=>[Ys(k,(o=>[o[e],o[t]]),((e,t)=>e[o]=t)),"image-data-to-canvas"],yl=async(e,t)=>{if(!So(e)||!t)return e;const o=(e,t)=>{let o=2;const i=new DataView(e),r=i.byteLength;for(t(i.getUint8(0),0,2,r);o<r&&255==i.getUint8(o);){const e=i.getUint8(o+1),n=i.getUint16(o+2)+2;if(!1===t(e,o,n,r))break;o+=n}},i=e=>e>=224&&e<=237,r=(e=>{const t=[];return o(e,((o,r,n)=>{if(218===o)return!1;i(o)&&t.push(new Uint8Array(e,r,n))})),t})(t),n=((e,t)=>{const r=[];o(e,((o,n,a,s)=>0===n?(r.push(new Uint8Array(e,n,a)),void r.push(...t)):218===o?(r.push(new Uint8Array(e,n,s-n)),!1):void(i(o)||r.push(new Uint8Array(e,n,a)))));let n=r.reduce(((e,t)=>e+t.length),0),a=new Uint8Array(n),s=0;return r.forEach((e=>{a.set(e,s),s+=e.length})),a})(await s(e),r);return new Blob([n],{type:"image/jpeg"})},bl=(e="blob",t="copy",o="blob")=>[Ys(yl,(o=>[o[e],o[t]]),((e,t)=>e[o]=t)),"blob-write-image-head"],xl=({renameFile:e,srcBlob:t="blob",srcFile:o="src",destFile:i="dest",defaultFilename:r}={})=>[Ys(Z,(i=>[i[t],e?e(i[o]):i[o].name||`${r}.${H(i[t].type)}`]),((e,t)=>e[i]=t)),"blob-to-file"],vl=({url:e="./",dataset:t=(e=>[["dest",e.dest,e.dest.name],["imageState",e.imageState]]),destStore:o="store",credentials:i,headers:r={}})=>[Ys((async(t,o)=>await((e,t,o)=>new Promise(((i,r)=>{const{token:a={},beforeSend:s=n,onprogress:l=n}=o;a.cancel=()=>c.abort();const c=new XMLHttpRequest;c.upload.onprogress=l,c.onload=()=>c.status>=200&&c.status<300?i(c):r(c),c.onerror=()=>r(c),c.ontimeout=()=>r(c),c.open("POST",encodeURI(e)),s(c),c.send(t instanceof FormData?t:t.reduce(((e,t)=>(e.append(...t.map(ko)),e)),new FormData))})))(e,t,{onprogress:o,beforeSend:e=>ho(e,{headers:r,credentials:i})})),((e,o,i)=>[t(e),i]),((e,t)=>e[o]=t)),"store"],wl=e=>[Ys((t=>e&&e.length?(Object.keys(t).forEach((o=>{e.includes(o)||delete t[o]})),t):t)),"prop-filter"],Sl=(e={})=>{const{orientImage:t=!0,outputProps:o=["src","dest","size","duration"],preprocessImageFile:i,request:r={}}=e;return[qs({willRequest:()=>r}),Ks(),i&&[Ys(i,((e,t,o)=>[e.dest,t,o]),((e,t)=>e.dest=t)),"preprocess-image-file"],Js({srcProp:"dest"}),el({srcProp:"dest"}),t&&ol({srcProp:"dest"}),t&&il(),t&&tl(),wl(o)].filter(Boolean)},kl=e=>e&&(m(e)?vl({url:e}):R(e)?[e,"store"]:vl(e)),Cl=(e={})=>(t,o,i={})=>{let{canvasMemoryLimit:r=Os(),orientImage:n=!0,copyImageHead:a=!0,mimeType:s,quality:l,renameFile:c,targetSize:d,imageDataResizer:u,store:p,format:h="file",outputProps:m=["src","dest","imageState","store"],preprocessImageSource:g,preprocessImageState:$,postprocessImageData:f,postprocessImageBlob:y,testSrcSupport:b=!1}={...e,...i};if(!b||oo(t))return"blob"===h&&(h="file"),[g&&[Ys(g,((e,t,o)=>[e.src,t,o,e.imageState]),((e,t)=>e.src=t)),"preprocess-image-source"],(n||a)&&ol(),n&&il(),Js(),$&&[Ys($,((e,t,o,i)=>[e.imageState,t,o,{size:e.size,orientation:e.orientation}]),((e,t)=>e.imageState=t)),"preprocess-image-state"],al({canvasMemoryLimit:r}),n&&tl(),n&&sl(),nl(),pl(),cl(),dl({imageDataResizer:u,targetSize:d}),hl({imageDataResizer:u,canvasMemoryLimit:r,srcShapes:"manipulation"}),ul(),ll(),hl({imageDataResizer:u,canvasMemoryLimit:r,srcShapes:"annotation",shapeFilter:e=>!e.aboveFrame}),ml({imageDataResizer:u,canvasMemoryLimit:r,shapeFilter:e=>!e.aboveFrame}),gl({imageDataResizer:u,canvasMemoryLimit:r}),hl({imageDataResizer:u,canvasMemoryLimit:r,srcShapes:"annotation",shapeFilter:e=>e.aboveFrame,shapeClip:!1}),ml({imageDataResizer:u,canvasMemoryLimit:r,shapeFilter:e=>e.aboveFrame}),f&&[Ys(f,((e,t,o)=>[e.imageData,t,o]),((e,t)=>e.imageData=t)),"postprocess-image-data"],"file"===h?$l({mimeType:s,quality:l}):"canvas"===h?fl():[e=>(e.dest=e.imageData,e)],"file"===h&&n&&rl(),"file"===h&&a&&bl(),y&&[Ys(y,(({blob:e,imageData:t,src:o},i,r)=>[{blob:e,imageData:t,src:o},i,r]),((e,t)=>e.blob=t)),"postprocess-image-file"],"file"===h&&xl({defaultFilename:"image",renameFile:c}),"file"===h?kl(p):R(p)&&[p,"store"],wl(m)].filter(Boolean)};var Tl=(e,t,o,i,r,n,a,s,l,c,d)=>{if(!(e&&t&&o&&i&&s))return;s*=n;const u=Pt(et(t)),p=ct(u),h=ct(e),m=ot(o),g=ct(m),$=gs(o,i,l),f=ct($),y=Ce($e(g),f),b=Ce($e(h),p);y.x+=b.x,y.y+=b.y;const x=fe($e(y));x.x+=b.x,x.y+=b.y;const v=ct(dt(dt(et(r),a),e)),w=Ce(v,h);return ke(y,w),{origin:x,translation:y,rotation:{x:d?Math.PI:0,y:c?Math.PI:0,z:l},scale:s}};let Ml=null;var Pl=()=>{if(null===Ml)if("WebGL2RenderingContext"in window){let e;try{e=$("canvas"),Ml=!!e.getContext("webgl2")}catch(e){Ml=!1}e&&y(e),e=void 0}else Ml=!1;return Ml},Rl=e=>0==(e&e-1),Il=(e,t={},o="",i="")=>Object.keys(t).filter((e=>!T(t[e]))).reduce(((e,r)=>e.replace(new RegExp(o+r+i),t[r])),e);const El={head:"#version 300 es\n\nin vec4 aPosition;uniform mat4 uMatrix;",text:"\nin vec2 aTexCoord;out vec2 vTexCoord;",matrix:"\ngl_Position=uMatrix*vec4(aPosition.x,aPosition.y,0,1);"},Al={head:"#version 300 es\nprecision highp float;\n\nout vec4 fragColor;",mask:"\nuniform float uMaskFeather[8];uniform float uMaskBounds[4];uniform float uMaskOpacity;float mask(float x,float y,float bounds[4],float opacity){return 1.0-(1.0-(smoothstep(bounds[3],bounds[3]+1.0,x)*(1.0-smoothstep(bounds[1]-1.0,bounds[1],x))*(1.0-step(bounds[0],y))*step(bounds[2],y)))*(1.0-opacity);}",init:"\nfloat a=1.0;vec4 fillColor=uColor;vec4 textureColor=texture(uTexture,vTexCoord);textureColor*=(1.0-step(uRepeat.y,vTexCoord.y))*step(0.0,vTexCoord.y)*(1.0-step(uRepeat.x,vTexCoord.x))*step(0.0,vTexCoord.x);",colorize:"\nif(uTextureColor.a!=0.0&&textureColor.a>0.0){vec3 colorFlattened=textureColor.rgb/textureColor.a;if(colorFlattened.r>=.9999&&colorFlattened.g==0.0&&colorFlattened.b>=.9999){textureColor.rgb=uTextureColor.rgb*textureColor.a;}textureColor*=uTextureColor.a;}",maskapply:"\nfloat m=mask(gl_FragCoord.x,gl_FragCoord.y,uMaskBounds,uMaskOpacity);",maskfeatherapply:"\nfloat leftFeatherOpacity=step(uMaskFeather[1],gl_FragCoord.x)*uMaskFeather[0]+((1.0-uMaskFeather[0])*smoothstep(uMaskFeather[1],uMaskFeather[3],gl_FragCoord.x));float rightFeatherOpacity=(1.0-step(uMaskFeather[7],gl_FragCoord.x))*uMaskFeather[4]+((1.0-uMaskFeather[4])*smoothstep(uMaskFeather[7],uMaskFeather[5],gl_FragCoord.x));a*=leftFeatherOpacity*rightFeatherOpacity;",rectaa:"\nvec2 scaledPoint=vec2(vRectCoord.x*uSize.x,vRectCoord.y*uSize.y);a*=smoothstep(0.0,uEdgeFeather,uSize.x-scaledPoint.x);a*=smoothstep(0.0,uEdgeFeather,uSize.y-scaledPoint.y);a*=smoothstep(0.0,uEdgeFeather,scaledPoint.x);a*=smoothstep(0.0,uEdgeFeather,scaledPoint.y);",cornerradius:"\nvec2 s=(uSize-2.0)*.5;vec2 r=(vRectCoord*uSize)-1.0;vec2 p=r-s;float cornerRadius=uCornerRadius[0];bool left=r.x<s.x;bool top=r.y<s.y;if(!left&&top){cornerRadius=uCornerRadius[1];}if(!left&&!top){cornerRadius=uCornerRadius[3];}if(left&&!top){cornerRadius=uCornerRadius[2];}a*=1.0-clamp(length(max(abs(p)-(s-cornerRadius),0.0))-cornerRadius,0.0,1.0);",fragcolor:"\nif(m<=0.0)discard;fillColor.a*=a;fillColor.rgb*=fillColor.a;fillColor.rgb*=m;fillColor.rgb+=(1.0-m)*(uCanvasColor.rgb*fillColor.a);textureColor*=uTextureOpacity;textureColor.a*=a;textureColor.rgb*=m*a;textureColor.rgb+=(1.0-m)*(uCanvasColor.rgb*textureColor.a);fragColor=textureColor+(fillColor*(1.0-textureColor.a));"},Ll=(e,t,o)=>{const i=e.createShader(o),r=((e,t,o)=>(t=Il(t,o===e.VERTEX_SHADER?El:Al,"##").trim(),Pl()?t:(t=(t=t.replace(/#version.+/gm,"").trim()).replace(/^\/\/\#/gm,"#"),o===e.VERTEX_SHADER&&(t=t.replace(/in /gm,"attribute ").replace(/out /g,"varying ")),o===e.FRAGMENT_SHADER&&(t=t.replace(/in /gm,"varying ").replace(/out.*?;/gm,"").replace(/texture\(/g,"texture2D(").replace(/fragColor/g,"gl_FragColor")),""+t)))(e,t,o);return e.shaderSource(i,r),e.compileShader(i),e.getShaderParameter(i,e.COMPILE_STATUS)||console.error(e.getShaderInfoLog(i)),i},Fl=(e,t,o,i,r)=>{const n=Ll(e,t,e.VERTEX_SHADER),a=Ll(e,o,e.FRAGMENT_SHADER),s=e.createProgram();e.attachShader(s,n),e.attachShader(s,a),e.linkProgram(s);const l={};return i.forEach((t=>{l[t]=e.getAttribLocation(s,t)})),r.forEach((t=>{l[t]=e.getUniformLocation(s,t)})),{program:s,locations:l,destroy(){e.detachShader(s,n),e.detachShader(s,a),e.deleteShader(n),e.deleteShader(a),e.deleteProgram(s)}}},zl=e=>"VIDEO"!==e.nodeName&&(!!Pl()||Rl(e.width)&&Rl(e.height)),Dl=(e,t,o,i)=>(e.bindTexture(e.TEXTURE_2D,t),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,o),((e,t,o)=>{e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,zl(t)?e.LINEAR_MIPMAP_LINEAR:e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,o.filterParam),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,o.wrapParam),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,o.wrapParam),zl(t)&&e.generateMipmap(e.TEXTURE_2D)})(e,o,i),e.bindTexture(e.TEXTURE_2D,null),t),Ol=(e,t=1)=>e?[e[0],e[1],e[2],Oo(e[3])?t*e[3]:t]:[0,0,0,0],Bl=()=>{const e=new Float32Array(16);return e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},Wl=(e,t,o,i,r,n,a)=>{const s=1/(t-o),l=1/(i-r),c=1/(n-a);e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+o)*s,e[13]=(r+i)*l,e[14]=(a+n)*c,e[15]=1},_l=(e,t,o,i)=>{e[12]=e[0]*t+e[4]*o+e[8]*i+e[12],e[13]=e[1]*t+e[5]*o+e[9]*i+e[13],e[14]=e[2]*t+e[6]*o+e[10]*i+e[14],e[15]=e[3]*t+e[7]*o+e[11]*i+e[15]},Vl=(e,t)=>{e[0]*=t,e[1]*=t,e[2]*=t,e[3]*=t,e[4]*=t,e[5]*=t,e[6]*=t,e[7]*=t,e[8]*=t,e[9]*=t,e[10]*=t,e[11]*=t},Nl=(e,t)=>{const o=Math.sin(t),i=Math.cos(t),r=e[4],n=e[5],a=e[6],s=e[7],l=e[8],c=e[9],d=e[10],u=e[11];e[4]=r*i+l*o,e[5]=n*i+c*o,e[6]=a*i+d*o,e[7]=s*i+u*o,e[8]=l*i-r*o,e[9]=c*i-n*o,e[10]=d*i-a*o,e[11]=u*i-s*o},Hl=(e,t)=>{const o=Math.sin(t),i=Math.cos(t),r=e[0],n=e[1],a=e[2],s=e[3],l=e[8],c=e[9],d=e[10],u=e[11];e[0]=r*i-l*o,e[1]=n*i-c*o,e[2]=a*i-d*o,e[3]=s*i-u*o,e[8]=r*o+l*i,e[9]=n*o+c*i,e[10]=a*o+d*i,e[11]=s*o+u*i},jl=(e,t)=>{const o=Math.sin(t),i=Math.cos(t),r=e[0],n=e[1],a=e[2],s=e[3],l=e[4],c=e[5],d=e[6],u=e[7];e[0]=r*i+l*o,e[1]=n*i+c*o,e[2]=a*i+d*o,e[3]=s*i+u*o,e[4]=l*i-r*o,e[5]=c*i-n*o,e[6]=d*i-a*o,e[7]=u*i-s*o};var Ul=e=>e*Math.PI/180,Gl=(e,t)=>Pl()?e.getContext("webgl2",t):e.getContext("webgl",t)||e.getContext("experimental-webgl",t);const Zl=(e,t)=>{const o=e.length;return t>=o?e[t%o]:t<0?e[t%o+o]:e[t]},Xl=(e,t,o,i)=>{const r=me(o.x-t.x,o.y-t.y),n=me(i.x-o.x,i.y-o.y),a=me(t.x-i.x,t.y-i.y),s=me(e.x-t.x,e.y-t.y),l=me(e.x-o.x,e.y-o.y),c=me(e.x-i.x,e.y-i.y),d=Re(r,s),u=Re(n,l),p=Re(a,c);return d<=0&&u<=0&&p<=0},Yl=e=>{if(e.length<3)return[];if((e=>{const t=e.length;for(let o=0;o<t;o++){const t=Ye(e[o],Zl(e,o+1));if(At(t,e,{ignoreIdenticalLines:!0,breakOnIntersection:!0}))return!0}return!1})(e))return[];(e=>{let t,o,i,r,n,a=0;const s=e.length;for(t=0;t<s;t++)o=e[t],i=e[(t+1)%s],r=i.x-o.x,n=(i.y+o.y)/2,a+=r*n;return a})(e)<0&&e.reverse();const t=e.length,o=[...Array(t).keys()],i=[];let r,n,a,s,l,c,d,u,p,h,m,g,$=1024;for(;o.length>3;){if($<=0)return[];for($--,r=0;r<o.length;r++)if(a=o[r],s=Zl(o,r-1),l=Zl(o,r+1),c=e[a],d=e[s],u=e[l],p=me(d.x-c.x,d.y-c.y),h=me(u.x-c.x,u.y-c.y),!(Re(p,h)<0)){for(m=!0,n=0;n<t;n++)if(n!==a&&n!==s&&n!==l&&(g=e[n],Xl(g,d,c,u))){m=!1;break}if(m){i.push([d,c,u]),o.splice(r,1);break}}}return i.push([e[o[0]],e[o[1]],e[o[2]]]),i},ql=(e,t,o,i,r)=>{const n=xe(me(i.x-o.x,i.y-o.y)),a=xe(me(r.x-i.x,r.y-i.y)),s=xe(me(n.x+a.x,n.y+a.y)),l=me(-s.y,s.x),c=me(-n.y,n.x),d=Math.min(1/Pe(l,c),5);e[t]=i.x,e[t+1]=i.y,e[t+2]=l.x*d,e[t+3]=l.y*d,e[t+4]=-1,e[t+5]=i.x,e[t+6]=i.y,e[t+7]=l.x*d,e[t+8]=l.y*d,e[t+9]=1},Kl=e=>{const t=new Float32Array(8);return t[0]=e[3].x,t[1]=e[3].y,t[2]=e[0].x,t[3]=e[0].y,t[4]=e[2].x,t[5]=e[2].y,t[6]=e[1].x,t[7]=e[1].y,t},Jl=(e,t=0,o,i)=>{const r=Ct(e),n=e.x+.5*e.width,a=e.y+.5*e.height;return(o||i)&&Fe(r,o,i,n,a),0!==t&&ze(r,t,n,a),r},Ql=(e,t,o,i,r)=>{const n=Math.min(20,Math.max(4,Math.round(i/2)));let a=0,s=0,l=0,c=0,d=0;for(;d<n;d++)a=d/n,s=r*K+a*K,l=i*Math.cos(s),c=i*Math.sin(s),e.push(me(t+l,o+c))};let ec=null;var tc=()=>{if(null!==ec)return ec;let e=$("canvas");const t=Gl(e);return ec=t?t.getParameter(t.MAX_TEXTURE_SIZE):void 0,y(e),e=void 0,ec},oc=()=>d()&&!!window.chrome;const ic=new Float32Array([0,1,0,0,1,1,1,0]),rc=new Float32Array([1,0,0,0,1,1,0,1]),nc=d()&&O(),ac=[0,0,0,0,1,0,0,0,0],sc=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],lc=[0,0,0,0],cc=[0,0,0,0],dc=(e,t,o,i,r)=>{if(!o||!i)return ic;let n=i.x/o.width,a=i.y/o.height,s=e/o.width/r,l=t/o.height/r;s-=n,l-=a;return new Float32Array([-n,l,-n,-a,s,l,s,-a])};var uc=(e,t={})=>{const{alpha:o=!1}=t,i={width:0,height:0},r={width:0,height:0},n=tc()||1024;let a,s,l;const c=Bl(),d=Bl();let u,p,h,m,g,$,f,b,x,v=0,w=0,S=0,k=1;const C=new Map([]),T=()=>{R.stencilOp(R.KEEP,R.KEEP,R.KEEP),R.stencilFunc(R.ALWAYS,1,255),R.stencilMask(255)},M=Ul(30),P=Math.tan(M/2),R=Gl(e,{alpha:o,antialias:!1,premultipliedAlpha:!0,stencil:!0});if(!R)return;R.getExtension("OES_standard_derivatives"),R.disable(R.DEPTH_TEST),R.enable(R.STENCIL_TEST),R.enable(R.BLEND),R.blendFunc(R.ONE,R.ONE_MINUS_SRC_ALPHA),R.pixelStorei(R.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!(!o&&O())),T();const I=R.createTexture();R.bindTexture(R.TEXTURE_2D,I),R.texImage2D(R.TEXTURE_2D,0,R.RGBA,1,1,0,R.RGBA,R.UNSIGNED_BYTE,new Uint8Array(lc)),C.set(0,I);const E=R.createTexture();C.set(2,E);const A=R.createFramebuffer(),L=R.createTexture();C.set(1,L);const F=R.createFramebuffer(),z=Fl(R,"\n##head\n##text\nvoid main(){vTexCoord=aTexCoord;gl_Position=uMatrix*aPosition;}","\n##head\nin vec2 vTexCoord;uniform sampler2D uTexture;uniform sampler2D uTextureOverlay;uniform sampler2D uTextureBlend;uniform vec2 uTextureSize;uniform float uOpacity;uniform int uAntialias;uniform vec4 uOverlayColor;uniform mat4 uColorMatrix;uniform vec4 uColorOffset;uniform float uClarityKernel[9];uniform float uClarityKernelWeight;uniform float uColorGamma;uniform float uColorVignette;uniform float uMaskClip;uniform float uMaskOpacity;uniform float uMaskBounds[4];uniform float uMaskCornerRadius[4];uniform float uMaskFeather[8];vec4 applyGamma(vec4 c,float g){c.r=pow(c.r,g);c.g=pow(c.g,g);c.b=pow(c.b,g);return c;}vec4 applyColorMatrix(vec4 c,mat4 m,vec4 o){vec4 res=(c*m)+(o*c.a);res=clamp(res,0.0,1.0);return res;}vec4 applyConvolutionMatrix(vec4 c,float k0,float k1,float k2,float k3,float k4,float k5,float k6,float k7,float k8,float w){vec2 pixel=vec2(1)/uTextureSize;vec4 colorSum=texture(uTexture,vTexCoord-pixel)*k0+texture(uTexture,vTexCoord+pixel*vec2(0.0,-1.0))*k1+texture(uTexture,vTexCoord+pixel*vec2(1.0,-1.0))*k2+texture(uTexture,vTexCoord+pixel*vec2(-1.0,0.0))*k3+texture(uTexture,vTexCoord)*k4+texture(uTexture,vTexCoord+pixel*vec2(1.0,0.0))*k5+texture(uTexture,vTexCoord+pixel*vec2(-1.0,1.0))*k6+texture(uTexture,vTexCoord+pixel*vec2(0.0,1.0))*k7+texture(uTexture,vTexCoord+pixel)*k8;vec4 color=vec4(clamp((colorSum/w),0.0,1.0).rgb,c.a);return color;}vec4 blendPremultipliedAlpha(vec4 back,vec4 front){return front+(back*(1.0-front.a));}vec4 applyVignette(vec4 c,vec2 pos,vec2 center,float v){float d=distance(pos,center)/length(center);float f=1.0-(d*abs(v));if(v>0.0){c.rgb*=f;}else if(v<0.0){c.rgb+=(1.0-f)*(1.0-c.rgb);}return c;}void main(){float x=gl_FragCoord.x;float y=gl_FragCoord.y;float a=1.0;float maskTop=uMaskBounds[0];float maskRight=uMaskBounds[1];float maskBottom=uMaskBounds[2];float maskLeft=uMaskBounds[3];float leftFeatherOpacity=step(uMaskFeather[1],x)*uMaskFeather[0]+((1.0-uMaskFeather[0])*smoothstep(uMaskFeather[1],uMaskFeather[3],x));float rightFeatherOpacity=(1.0-step(uMaskFeather[7],x))*uMaskFeather[4]+((1.0-uMaskFeather[4])*smoothstep(uMaskFeather[7],uMaskFeather[5],x));a*=leftFeatherOpacity*rightFeatherOpacity;float overlayColorAlpha=(smoothstep(maskLeft,maskLeft+1.0,x)*(1.0-smoothstep(maskRight-1.0,maskRight,x))*(1.0-step(maskTop,y))*step(maskBottom,y));if(uOverlayColor.a==0.0){a*=overlayColorAlpha;}vec2 offset=vec2(maskLeft,maskBottom);vec2 size=vec2(maskRight-maskLeft,maskTop-maskBottom)*.5;vec2 center=offset.xy+size.xy;int pixelX=int(step(center.x,x));int pixelY=int(step(y,center.y));float cornerRadius=0.0;if(pixelX==0&&pixelY==0)cornerRadius=uMaskCornerRadius[0];if(pixelX==1&&pixelY==0)cornerRadius=uMaskCornerRadius[1];if(pixelX==0&&pixelY==1)cornerRadius=uMaskCornerRadius[2];if(pixelX==1&&pixelY==1)cornerRadius=uMaskCornerRadius[3];float cornerOffset=sign(cornerRadius)*length(max(abs(gl_FragCoord.xy-size-offset)-size+cornerRadius,0.0))-cornerRadius;float cornerOpacity=1.0-smoothstep(0.0,1.0,cornerOffset);a*=cornerOpacity;if(uAntialias==1){vec2 scaledPoint=vec2(vTexCoord.x*uTextureSize.x,vTexCoord.y*uTextureSize.y);a*=smoothstep(0.0,1.0,uTextureSize.x-scaledPoint.x);a*=smoothstep(0.0,1.0,uTextureSize.y-scaledPoint.y);a*=smoothstep(0.0,1.0,scaledPoint.x);a*=smoothstep(0.0,1.0,scaledPoint.y);}vec4 color=texture(uTexture,vTexCoord);if(uClarityKernelWeight!=-1.0){color=applyConvolutionMatrix(color,uClarityKernel[0],uClarityKernel[1],uClarityKernel[2],uClarityKernel[3],uClarityKernel[4],uClarityKernel[5],uClarityKernel[6],uClarityKernel[7],uClarityKernel[8],uClarityKernelWeight);}color=blendPremultipliedAlpha(color,texture(uTextureBlend,vTexCoord));color=applyGamma(color,uColorGamma);color=applyColorMatrix(color,uColorMatrix,uColorOffset);color*=a;if(uColorVignette!=0.0){vec2 pos=gl_FragCoord.xy-offset;color=applyVignette(color,pos,center-offset,uColorVignette);}color=blendPremultipliedAlpha(color,texture(uTextureOverlay,vTexCoord));if(overlayColorAlpha<=0.0){color*=1.0-uOverlayColor.a;}color*=uOpacity;fragColor=color;}",["aPosition","aTexCoord"],["uMatrix","uTexture","uTextureBlend","uTextureOverlay","uTextureSize","uColorGamma","uColorVignette","uColorOffset","uColorMatrix","uClarityKernel","uClarityKernelWeight","uOpacity","uMaskOpacity","uMaskBounds","uMaskCornerRadius","uMaskFeather","uOverlayColor","uAntialias"]),D=R.createBuffer(),B=R.createBuffer();R.bindBuffer(R.ARRAY_BUFFER,B),R.bufferData(R.ARRAY_BUFFER,ic,R.STATIC_DRAW);const W=R.createBuffer();R.bindBuffer(R.ARRAY_BUFFER,W),R.bufferData(R.ARRAY_BUFFER,rc,R.STATIC_DRAW);const _=Fl(R,"#version 300 es\n\nin vec4 aPosition;in vec2 aNormal;in float aMiter;out vec2 vNormal;out float vMiter;out float vWidth;uniform float uWidth;uniform float uSharpness;uniform mat4 uMatrix;void main(){vMiter=aMiter;vNormal=aNormal;vWidth=(uWidth*.5)+uSharpness;gl_Position=uMatrix*vec4(aPosition.x+(aNormal.x*vWidth*aMiter),aPosition.y+(aNormal.y*vWidth*aMiter),0,1);}","\n##head\n##mask\nin vec2 vNormal;in float vMiter;in float vWidth;uniform float uWidth;uniform vec4 uColor;uniform vec4 uCanvasColor;void main(){vec4 fillColor=uColor;float m=mask(gl_FragCoord.x,gl_FragCoord.y,uMaskBounds,uMaskOpacity);if(m<=0.0)discard;fillColor.a*=clamp(smoothstep(vWidth-.5,vWidth-1.0,abs(vMiter)*vWidth),0.0,1.0);fillColor.rgb*=fillColor.a;fillColor.rgb*=m;fillColor.rgb+=(1.0-m)*(uCanvasColor.rgb*fillColor.a);fragColor=fillColor;}",["aPosition","aNormal","aMiter"],["uColor","uCanvasColor","uMatrix","uWidth","uSharpness","uMaskBounds","uMaskOpacity"]),V=R.createBuffer();oc()&&(R.bindBuffer(R.ARRAY_BUFFER,V),R.bufferData(R.ARRAY_BUFFER,1,R.DYNAMIC_DRAW));const N=(e,t,o,i=!1)=>{const{program:r,locations:n}=_;R.useProgram(r),R.enableVertexAttribArray(n.aPosition),R.enableVertexAttribArray(n.aNormal),R.enableVertexAttribArray(n.aMiter);const a=((e,t)=>{let o,i,r,n=0;const a=e.length,s=new Float32Array(10*(t?a+1:a)),l=e[0],c=e[a-1];for(n=0;n<a;n++)o=e[n-1],i=e[n],r=e[n+1],o||(o=t?c:me(i.x+(i.x-r.x),i.y+(i.y-r.y))),r||(r=t?l:me(i.x+(i.x-o.x),i.y+(i.y-o.y))),ql(s,10*n,o,i,r);return t&&ql(s,10*a,c,l,e[1]),s})(e,i),s=5*Float32Array.BYTES_PER_ELEMENT,c=2*Float32Array.BYTES_PER_ELEMENT,d=4*Float32Array.BYTES_PER_ELEMENT;R.uniform1f(n.uWidth,t),R.uniform1f(n.uSharpness,l),R.uniform4fv(n.uColor,o),R.uniformMatrix4fv(n.uMatrix,!1,u),R.uniform4f(n.uCanvasColor,v,w,S,k),R.uniform1fv(n.uMaskBounds,f),R.uniform1f(n.uMaskOpacity,$),R.bindBuffer(R.ARRAY_BUFFER,V),R.bufferData(R.ARRAY_BUFFER,a,R.STATIC_DRAW),R.vertexAttribPointer(n.aPosition,2,R.FLOAT,!1,s,0),R.vertexAttribPointer(n.aNormal,2,R.FLOAT,!1,s,c),R.vertexAttribPointer(n.aMiter,1,R.FLOAT,!1,s,d),R.drawArrays(R.TRIANGLE_STRIP,0,a.length/5),R.disableVertexAttribArray(n.aPosition),R.disableVertexAttribArray(n.aNormal),R.disableVertexAttribArray(n.aMiter)},H=Fl(R,"\n##head\nvoid main(){\n##matrix\n}","\n##head\n##mask\nuniform vec4 uColor;uniform vec4 uCanvasColor;void main(){vec4 fillColor=uColor;\n##maskapply\nfillColor.rgb*=fillColor.a;fillColor.rgb*=m;fillColor.rgb+=(1.0-m)*(uCanvasColor.rgb*fillColor.a);fragColor=fillColor;}",["aPosition"],["uColor","uCanvasColor","uMatrix","uMaskBounds","uMaskOpacity"]),j=R.createBuffer(),U=Fl(R,"\n##head\n##text\nin vec2 aRectCoord;out vec2 vRectCoord;void main(){vTexCoord=aTexCoord;vRectCoord=aRectCoord;\n##matrix\n}","\n##head\n##mask\nin vec2 vTexCoord;in vec2 vRectCoord;uniform sampler2D uTexture;uniform vec4 uTextureColor;uniform float uTextureOpacity;uniform vec2 uRepeat;uniform vec4 uColor;uniform float uCornerRadius[4];uniform vec2 uSize;uniform vec2 uPosition;uniform vec4 uCanvasColor;uniform int uInverted;uniform float uEdgeFeather;void main(){\n##init\n##colorize\n##rectaa\n##cornerradius\n##maskfeatherapply\nif(uInverted==1)a=1.0-a;\n##maskapply\n##fragcolor\n}",["aPosition","aTexCoord","aRectCoord"],["uTexture","uColor","uMatrix","uCanvasColor","uTextureColor","uTextureOpacity","uRepeat","uPosition","uSize","uMaskBounds","uMaskOpacity","uMaskFeather","uCornerRadius","uInverted","uEdgeFeather"]),G=R.createBuffer(),Z=R.createBuffer(),Y=R.createBuffer(),q=Fl(R,"\n##head\n##text\nout vec2 vTexCoordDouble;void main(){vTexCoordDouble=vec2(aTexCoord.x*2.0-1.0,aTexCoord.y*2.0-1.0);vTexCoord=aTexCoord;\n##matrix\n}","\n##head\n##mask\nin vec2 vTexCoord;in vec2 vTexCoordDouble;uniform sampler2D uTexture;uniform float uTextureOpacity;uniform vec2 uTextureAdjust;uniform vec2 uRepeat;uniform vec2 uRadius;uniform vec4 uColor;uniform int uInverted;uniform vec4 uCanvasColor;void main(){\n##init\nfloat ar=uRadius.x/uRadius.y;vec2 rAA=vec2(uRadius.x-1.0,uRadius.y-(1.0/ar));vec2 scaledPointSq=vec2((vTexCoordDouble.x*uTextureAdjust.x*uRadius.x)*(vTexCoordDouble.x*uTextureAdjust.x*uRadius.x),(vTexCoordDouble.y*uTextureAdjust.y*uRadius.y)*(vTexCoordDouble.y*uTextureAdjust.y*uRadius.y));float p=(scaledPointSq.x/(uRadius.x*uRadius.x))+(scaledPointSq.y/(uRadius.y*uRadius.y));float pAA=(scaledPointSq.x/(rAA.x*rAA.x))+(scaledPointSq.y/(rAA.y*rAA.y));a=smoothstep(1.0,p/pAA,p);if(uInverted==1)a=1.0-a;\n##maskapply\n##fragcolor\n}",["aPosition","aTexCoord"],["uTexture","uTextureOpacity","uTextureAdjust","uRepeat","uColor","uCanvasColor","uMatrix","uRadius","uInverted","uMaskBounds","uMaskOpacity"]),K=R.createBuffer(),J=R.createBuffer(),Q=new Map,ee={2:{width:0,height:0},1:{width:0,height:0}},te=(e,t,o,r=1)=>{const a=Math.min(Math.min(4096,n)/o.width,Math.min(4096,n)/o.height,r),l=Math.floor(a*o.width),c=Math.floor(a*o.height);He(o,ee[e])?R.bindFramebuffer(R.FRAMEBUFFER,t):(R.bindTexture(R.TEXTURE_2D,C.get(e)),R.texImage2D(R.TEXTURE_2D,0,R.RGBA,l,c,0,R.RGBA,R.UNSIGNED_BYTE,null),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_MIN_FILTER,R.LINEAR),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_S,R.CLAMP_TO_EDGE),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_T,R.CLAMP_TO_EDGE),R.bindFramebuffer(R.FRAMEBUFFER,t),R.framebufferTexture2D(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_2D,C.get(e),0),ee[e]=o);const p=o.width*s,h=o.height*s;var m,g;Wl(d,0,p,h,0,-1,1),_l(d,0,h,0),g=1,(m=d)[0]*=g,m[1]*=g,m[2]*=g,m[3]*=g,((e,t)=>{e[4]*=t,e[5]*=t,e[6]*=t,e[7]*=t})(d,-1),u=d,R.viewport(0,0,l,c),R.colorMask(!0,!0,!0,!0),R.clearColor(0,0,0,0),R.clear(R.COLOR_BUFFER_BIT),x=[1,0,1,0,1,Math.max(i.width,o.width),1,Math.max(i.width,o.width)]},oe=(e,t)=>{const{forceRelease:o=!1}=t||{},{src:i}=Q.get(e);i instanceof HTMLCanvasElement&&(o||i.dataset.retain||y(i)),Q.delete(e),R.deleteTexture(e)},ie=e=>Q.get(e).isRotatedVideo;return{drawPath:(e,t=0,o=!1,i=!1,r,n,a,l,c)=>{if(e.length<2)return;const d=e.map((e=>({x:e.x*s,y:e.y*s}))),p=r*s;if(p>0&&N(d,p,Ol(n,c),a),d.length<3||!l||0===l[3]||!a)return;const h=Yl(d),m=new Float32Array(6*h.length);h.forEach((([e,t,o],i)=>{const r=6*i;m[r+0]=e.x,m[r+1]=e.y,m[r+2]=t.x,m[r+3]=t.y,m[r+4]=o.x,m[r+5]=o.y})),((e,t)=>{const{program:o,locations:i}=H;R.useProgram(o),R.enableVertexAttribArray(i.aPosition),R.uniform4fv(i.uColor,t),R.uniformMatrix4fv(i.uMatrix,!1,u),R.uniform1fv(i.uMaskBounds,f),R.uniform1f(i.uMaskOpacity,$),R.uniform4f(i.uCanvasColor,v,w,S,k),R.bindBuffer(R.ARRAY_BUFFER,j),R.bufferData(R.ARRAY_BUFFER,e,R.STATIC_DRAW),R.vertexAttribPointer(i.aPosition,2,R.FLOAT,!1,0,0),R.drawArrays(R.TRIANGLES,0,e.length/2),R.disableVertexAttribArray(i.aPosition)})(m,Ol(l,c))},drawRect:(e,t=0,o=!1,i=!1,r,n,a,l,c,d=!1,p,h,m,g,y,b=1/s,C,T)=>{const M=mt(et(e),s),P=r.map((t=>((e,t)=>Math.floor($s(e,0,Math.min(.5*(t.width-1),.5*(t.height-1)))))(t||0,e))).map((e=>e*s));if(n||a){const e=et(M);e.x-=.5,e.y-=.5,e.width+=1,e.height+=1;const r=Jl(e,t,o,i),h=Kl(r);let m;C&&(m=Ol(C),0===m[3]&&(m[3]=.001));const E=l&&d?[e.width/l.width,e.height/l.height]:[1,1];((e,t,o,i,r,n=I,a,l=1,c=lc,d=ic,p=x,h=1,m)=>{const{program:g,locations:y}=U;R.useProgram(g),R.enableVertexAttribArray(y.aPosition),R.enableVertexAttribArray(y.aTexCoord),R.enableVertexAttribArray(y.aRectCoord),R.uniform4fv(y.uColor,r),R.uniform2fv(y.uSize,[t,o]),R.uniform2fv(y.uPosition,[e[2],e[3]]),R.uniform2fv(y.uRepeat,a),R.uniform1i(y.uInverted,m?1:0),R.uniform1fv(y.uCornerRadius,i),R.uniform4f(y.uCanvasColor,v,w,S,k),R.uniform1fv(y.uMaskFeather,p.map(((e,t)=>t%2==0?e:e*s))),R.uniform1fv(y.uMaskBounds,f),R.uniform1f(y.uMaskOpacity,$),R.uniform1f(y.uEdgeFeather,Math.max(0,h)),R.uniformMatrix4fv(y.uMatrix,!1,u),R.uniform1i(y.uTexture,4),R.uniform4fv(y.uTextureColor,c),R.uniform1f(y.uTextureOpacity,l),R.activeTexture(R.TEXTURE0+4),R.bindTexture(R.TEXTURE_2D,n),R.bindBuffer(R.ARRAY_BUFFER,Z),R.bufferData(R.ARRAY_BUFFER,d,R.STATIC_DRAW),R.vertexAttribPointer(y.aTexCoord,2,R.FLOAT,!1,0,0),R.bindBuffer(R.ARRAY_BUFFER,Y),R.bufferData(R.ARRAY_BUFFER,ic,R.STATIC_DRAW),R.vertexAttribPointer(y.aRectCoord,2,R.FLOAT,!1,0,0),R.bindBuffer(R.ARRAY_BUFFER,G),R.bufferData(R.ARRAY_BUFFER,e,R.STATIC_DRAW),R.vertexAttribPointer(y.aPosition,2,R.FLOAT,!1,0,0),R.drawArrays(R.TRIANGLE_STRIP,0,e.length/2),R.disableVertexAttribArray(y.aPosition),R.disableVertexAttribArray(y.aTexCoord),R.disableVertexAttribArray(y.aRectCoord)})(h,e.width,e.height,P,Ol(n,g),a,E,g,m,p?new Float32Array(p):dc(e.width,e.height,l,c,s),y,b*s,T)}h&&(h=Math.min(h,M.width,M.height),N(((e,t,o,i,r,n,a,s)=>{const l=[];if(n.every((e=>0===e)))l.push(me(e,t),me(e+o,t),me(e+o,t+i),me(e,t+i));else{const[r,a,s,c]=n,d=e,u=e+o,p=t,h=t+i;l.push(me(d+r,p)),Ql(l,u-a,p+a,a,-1),l.push(me(u,p+a)),Ql(l,u-c,h-c,c,0),l.push(me(u-c,h)),Ql(l,d+s,h-s,s,1),l.push(me(d,h-s)),Ql(l,d+r,p+r,r,2)}return(a||s)&&Fe(l,a,s,e+.5*o,t+.5*i),r&&ze(l,r,e+.5*o,t+.5*i),l})(M.x,M.y,M.width,M.height,t,P,o,i),h*s,Ol(m,g),!0))},drawEllipse:(e,t,o,i,r,n,a,l,c,d,p,h,m,g,y)=>{const b=mt(lt(e.x-t,e.y-o,2*t,2*o),s);if(a||l){const e=et(b);y||(e.x-=.5,e.y-=.5,e.width+=1,e.height+=1);const t=Jl(e,i,r,n);((e,t,o,i,r=I,n,a=ic,l=1,c=!1)=>{const{program:d,locations:p}=q;R.useProgram(d),R.enableVertexAttribArray(p.aPosition),R.enableVertexAttribArray(p.aTexCoord),R.uniformMatrix4fv(p.uMatrix,!1,u),R.uniform2fv(p.uRadius,[.5*t,.5*o]),R.uniform2fv(p.uTextureAdjust,[n.width/(t/s),n.height/(o/s)]),R.uniform1i(p.uInverted,c?1:0),R.uniform4fv(p.uColor,i),R.uniform4f(p.uCanvasColor,v,w,S,k),R.uniform2fv(p.uRepeat,[1,1]),R.uniform1fv(p.uMaskBounds,f),R.uniform1f(p.uMaskOpacity,$),R.uniform1i(p.uTexture,4),R.uniform1f(p.uTextureOpacity,l),R.activeTexture(R.TEXTURE0+4),R.bindTexture(R.TEXTURE_2D,r),R.bindBuffer(R.ARRAY_BUFFER,J),R.bufferData(R.ARRAY_BUFFER,a,R.STATIC_DRAW),R.vertexAttribPointer(p.aTexCoord,2,R.FLOAT,!1,0,0),R.bindBuffer(R.ARRAY_BUFFER,K),R.bufferData(R.ARRAY_BUFFER,e,R.STATIC_DRAW),R.vertexAttribPointer(p.aPosition,2,R.FLOAT,!1,0,0),R.drawArrays(R.TRIANGLE_STRIP,0,e.length/2),R.disableVertexAttribArray(p.aPosition),R.disableVertexAttribArray(p.aTexCoord)})(Kl(t),e.width,e.height,Ol(a,g),l,c||Ne(e.width/s,e.height/s),p?new Float32Array(p):dc(e.width,e.height,c,d,s),g,y)}h&&N(((e,t,o,i,r,n,a)=>{const s=.5*Math.abs(o),l=.5*Math.abs(i),c=Math.abs(o)+Math.abs(i),d=Math.max(20,Math.round(c/6));return Bt(me(e+s,t+l),s,l,r,n,a,d)})(b.x,b.y,b.width,b.height,i,r,n),h*s,Ol(m,g),!0)},drawImage:(e,t,o,r,n,l,c,d,u,p,h=sc,m=1,g,y=1,x=0,v=b,w=cc,S=lc,k=!1,T=!1,I=!0)=>{const E=t.width*s,A=t.height*s,L=-.5*E,F=.5*A,O=.5*E,_=-.5*A,V=new Float32Array([L,_,0,L,F,0,O,_,0,O,F,0]);R.bindBuffer(R.ARRAY_BUFFER,D),R.bufferData(R.ARRAY_BUFFER,V,R.STATIC_DRAW);const N=t.height/2/P*(i.height/t.height)*-1;n*=s,l*=s,o*=s,r*=s;const{program:H,locations:j}=z,U=Bl();((e,t,o,i,r)=>{const n=1/Math.tan(t/2),a=1/(i-r);e[0]=n/o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(r+i)*a,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*r*i*a,e[15]=0})(U,M,a,1,2*-N),_l(U,n,-l,N),_l(U,o,-r,0),jl(U,-u),Vl(U,p),_l(U,-o,r,0),Hl(U,d),Nl(U,c),R.useProgram(H),R.enableVertexAttribArray(j.aPosition),R.enableVertexAttribArray(j.aTexCoord),R.uniform1i(j.uTexture,3),R.uniform2f(j.uTextureSize,t.width,t.height),R.activeTexture(R.TEXTURE0+3),R.bindTexture(R.TEXTURE_2D,e);const G=T?1:0,Z=C.get(G);R.uniform1i(j.uTextureBlend,G),R.activeTexture(R.TEXTURE0+G),R.bindTexture(R.TEXTURE_2D,Z);const X=k?2:0,Y=C.get(X);R.uniform1i(j.uTextureOverlay,X),R.activeTexture(R.TEXTURE0+X),R.bindTexture(R.TEXTURE_2D,Y),R.bindBuffer(R.ARRAY_BUFFER,D),R.vertexAttribPointer(j.aPosition,3,R.FLOAT,!1,0,0);const q=nc&&ie(e);let K;R.bindBuffer(R.ARRAY_BUFFER,q?W:B),R.vertexAttribPointer(j.aTexCoord,2,R.FLOAT,!1,0,0),R.uniformMatrix4fv(j.uMatrix,!1,U),R.uniform4fv(j.uOverlayColor,S),!g||vs(g,ac)?(g=ac,K=-1):(K=g.reduce(((e,t)=>e+t),0),K=K<=0?1:K),R.uniform1fv(j.uClarityKernel,g),R.uniform1f(j.uClarityKernelWeight,K),R.uniform1f(j.uColorGamma,1/y),R.uniform1f(j.uColorVignette,x),R.uniform1i(j.uAntialias,I?1:0),R.uniform4f(j.uColorOffset,h[4],h[9],h[14],h[19]),R.uniformMatrix4fv(j.uColorMatrix,!1,[h[0],h[1],h[2],h[3],h[5],h[6],h[7],h[8],h[10],h[11],h[12],h[13],h[15],h[16],h[17],h[18]]),R.uniform1f(j.uOpacity,m),R.uniform1f(j.uMaskOpacity,$),R.uniform1fv(j.uMaskBounds,f),R.uniform1fv(j.uMaskCornerRadius,w.map((e=>e*s))),R.uniform1fv(j.uMaskFeather,v.map(((e,t)=>t%2==0?e:e*s))),R.drawArrays(R.TRIANGLE_STRIP,0,4),R.disableVertexAttribArray(j.aPosition),R.disableVertexAttribArray(j.aTexCoord)},textureFilterNearest:R.NEAREST,textureFilterLinear:R.LINEAR,textureClamp:R.CLAMP_TO_EDGE,textureRepeat:R.REPEAT,textureCreate:()=>R.createTexture(),textureUpdate:(e,t,o)=>(Q.set(e,{src:t,options:o,isRotatedVideo:"VIDEO"===t.nodeName&&(t.dataset&&90==t.dataset.rotation||270==t.dataset.rotation)}),Dl(R,e,t,o)),textureGetSize:e=>{const{src:t,options:o}=Q.get(e),i=Be(t);return o.scalar?Xe(i,(e=>e/o.scalar)):i},textureDelete:oe,enablePreviewStencil:()=>{R.stencilOp(R.KEEP,R.KEEP,R.REPLACE),R.stencilFunc(R.ALWAYS,1,255),R.stencilMask(255)},applyPreviewStencil:()=>{R.stencilFunc(R.EQUAL,1,255),R.stencilMask(0)},disablePreviewStencil:T,setCanvasColor(e){v=e[0],w=e[1],S=e[2],k=o?e[3]:1,R.clear(R.COLOR_BUFFER_BIT)},resetCanvasMatrix:()=>{Wl(c,0,i.width,i.height,0,-1,1)},updateCanvasMatrix(e,t,o,r,n){const a=e.width,l=e.height,d=i.width*(.5/s),u=i.height*(.5/s),p={x:d+(o.x+t.x),y:u+(o.y+t.y)},h={x:p.x-t.x,y:p.y-t.y},m=.5*a,g=.5*l;ye(h,n.z,p),Ae(h,r,p);_l(c,(h.x-m)*s,(h.y-g)*s,0),_l(c,m*s,g*s,0),jl(c,n.z);const $=n.x>Math.PI/2;Nl(c,$?Math.PI:0);const f=n.y>Math.PI/2;Hl(c,f?Math.PI:0),Vl(c,r),_l(c,-m*s,-g*s,0)},drawToCanvas(){R.bindFramebuffer(R.FRAMEBUFFER,null),u=c,R.viewport(0,0,R.drawingBufferWidth,R.drawingBufferHeight),R.colorMask(!0,!0,!0,!0),R.clearColor(v,w,S,k),R.clear(R.COLOR_BUFFER_BIT),x=[1,0,1,0,1,i.width,1,i.width]},drawToImageBlendBuffer(e,t){te(1,F,e,t)},drawToImageOverlayBuffer(e,t){te(2,A,e,t)},enableMask(e,t){const o=e.x*s,r=e.y*s,n=e.width*s,a=e.height*s;g=o,h=g+n,p=i.height-r,m=i.height-(r+a),$=1-t,f=[p,h,m,g]},disableMask(){g=0,h=i.width,p=i.height,m=0,$=1,f=[p,h,m,g]},resize:(t,o,n)=>{s=Math.max(1,n),l=1===s?.75:1,r.width=t,r.height=o,i.width=t*s,i.height=o*s,a=X(i.width,i.height),e.width=i.width,e.height=i.height,Wl(c,0,i.width,i.height,0,-1,1),b=[1,0,1,0,1,r.width,1,r.width]},release(){Array.from(Q.keys()).forEach((e=>oe(e,{forceRelease:!0}))),Q.clear(),C.forEach((e=>{R.deleteTexture(e)})),C.clear(),z.destroy(),_.destroy(),H.destroy(),U.destroy(),q.destroy(),e.width=1,e.height=1,e=void 0}}},pc=e=>e%2==0?e:e+1;var hc=(e,t)=>{const{imageData:o,amount:i=1}=e,r=Math.round(2*Math.max(1,i)),n=Math.round(.5*r),a=o.width,s=o.height,l=new Uint8ClampedArray(a*s*4),c=o.data;let d,u,p,h,m,g=0,$=0,f=0;const y=a*s*4-4;for(p=0;p<s;p++)for(d=crypto.getRandomValues(new Uint8ClampedArray(s)),u=0;u<a;u++)h=d[p]/255,$=0,f=0,h<.5&&($=4*(-n+Math.round(Math.random()*r))),h>.5&&(f=(-n+Math.round(Math.random()*r))*(4*a)),m=Math.min(Math.max(0,g+$+f),y),l[g]=c[m],l[g+1]=c[m+1],l[g+2]=c[m+2],l[g+3]=c[m+3],g+=4;t(null,{data:l,width:o.width,height:o.height})};const mc=[.0625,.125,.0625,.125,.25,.125,.0625,.125,.0625];function gc(e){return Math.sqrt(1- --e*e)}function $c(e){return"[object Date]"===Object.prototype.toString.call(e)}function fc(e,t){if(e===t||e!=e)return()=>e;const o=typeof e;if(o!==typeof t||Array.isArray(e)!==Array.isArray(t))throw new Error("Cannot interpolate values of different type");if(Array.isArray(e)){const o=t.map(((t,o)=>fc(e[o],t)));return e=>o.map((t=>t(e)))}if("object"===o){if(!e||!t)throw new Error("Object cannot be null");if($c(e)&&$c(t)){e=e.getTime();const o=(t=t.getTime())-e;return t=>new Date(e+t*o)}const o=Object.keys(t),i={};return o.forEach((o=>{i[o]=fc(e[o],t[o])})),e=>{const t={};return o.forEach((o=>{t[o]=i[o](e)})),t}}if("number"===o){const o=t-e;return t=>e+t*o}throw new Error(`Cannot interpolate ${o} values`)}function yc(e,t={}){const o=Ya(e);let i,r=e;function n(n,a){if(null==e)return o.set(e=n),Promise.resolve();r=n;let s=i,l=!1,{delay:c=0,duration:d=400,easing:u=tn,interpolate:p=fc}=on(on({},t),a);if(0===d)return s&&(s.abort(),s=null),o.set(e=r),Promise.resolve();const h=kn()+c;let m;return i=Pn((t=>{if(t<h)return!0;l||(m=p(e,n),"function"==typeof d&&(d=d(e,n)),l=!0),s&&(s.abort(),s=null);const i=t-h;return i>d?(o.set(e=n),!1):(o.set(e=m(u(i/d))),!0)})),i.promise}return{set:n,update:(t,o)=>n(t(r,e),o),subscribe:o.subscribe}}function bc(e,t,o,i){if("number"==typeof o){const r=i-o,n=(o-t)/(e.dt||1/60),a=(n+(e.opts.stiffness*r-e.opts.damping*n)*e.inv_mass)*e.dt;return Math.abs(a)<e.opts.precision&&Math.abs(r)<e.opts.precision?i:(e.settled=!1,o+a)}if(_o(o))return o.map(((r,n)=>bc(e,t[n],o[n],i[n])));if("object"==typeof o){const r={};for(const n in o)r[n]=bc(e,t[n],o[n],i[n]);return r}throw new Error(`Cannot spring ${typeof o} values`)}function xc(e,t={}){const o=Ya(e),{stiffness:i=.15,damping:r=.8,precision:n=.01}=t;let a,s,l,c=e,d=e,u=1,p=0,h=!1;function m(t,i={}){d=t;const r=l={};if(null==e||i.hard||g.stiffness>=1&&g.damping>=1)return h=!0,a=null,c=t,o.set(e=d),Promise.resolve();if(i.soft){const e=!0===i.soft?.5:+i.soft;p=1/(60*e),u=0}if(!s){a=null,h=!1;const t={inv_mass:void 0,opts:g,settled:!0,dt:void 0};s=Pn((i=>{if(null===a&&(a=i),h)return h=!1,s=null,!1;u=Math.min(u+p,1),t.inv_mass=u,t.opts=g,t.settled=!0,t.dt=60*(i-a)/1e3;const r=bc(t,c,e,d);return a=i,c=e,o.set(e=r),t.settled&&(s=null),!t.settled}))}return new Promise((e=>{s.promise.then((()=>{r===l&&e()}))}))}const g={set:m,update:(t,o)=>m(t(d,e),o),subscribe:o.subscribe,stiffness:i,damping:r,precision:n};return g}var vc=Xa(!1,(e=>{const t=window.matchMedia("(prefers-reduced-motion:reduce)"),o=()=>e(t.matches);return o(),t.addListener(o),()=>t.removeListener(o)})),wc=()=>"ResizeObserver"in window;const Sc=tt(),kc=(e,t,o,i,r)=>{e.rect||(e.rect=tt());const n=e.rect;ft(Sc,t,o,i,r),gt(n,Sc)||(yt(n,Sc),e.dispatchEvent(new CustomEvent("measure",{detail:n})))},Cc=Math.round,Tc=e=>{const t=e.getBoundingClientRect();Ec&&kc(e,Cc(t.x),Cc(t.y),Cc(t.width),Cc(t.height))},Mc=e=>{Ec&&kc(e,e.offsetLeft,e.offsetTop,e.offsetWidth,e.offsetHeight)},Pc=[];let Rc,Ic,Ec=void 0;function Ac(){Pc.length?(Pc.forEach((e=>e.measure(e))),Ec=requestAnimationFrame(Ac)):Ec=void 0}let Lc=new Map([]),Fc=0,zc=0;var Dc=(e,t={})=>{const{observePosition:o=!1,observeViewRect:i=!1,once:r=!1,disabled:n=!1,isMeasureRoot:a=!1}=t;if(wc()&&a&&(Ic||(Ic=new ResizeObserver((e=>{e.forEach((e=>{Lc.set(e.target,e.contentRect)}));const t=Array.from(Lc.values()).some((({width:e,height:t})=>e>0&&t>0));t?t&&!1===Ec&&Ac():(Ec&&cancelAnimationFrame(Ec),Ec=!1)}))),Ic.observe(e),Fc++),!n)return!wc()||o||i?(e.measure=i?Tc:Mc,Pc.push(e),void 0===Ec&&(Ec=requestAnimationFrame(Ac)),e.measure(e),{destroy(){a&&Ic&&(Lc.delete(e),Ic.unobserve(e),Fc--,0===Fc&&(Ic.disconnect(),Ic=void 0));const t=Pc.indexOf(e);Pc.splice(t,1),delete e.measure}}):(Rc||(Rc=new ResizeObserver((e=>{e.forEach((e=>{Ec&&Mc(e.target)}))}))),Rc.observe(e),Mc(e),r?Rc.unobserve(e):zc++,{destroy(){a&&Ic&&(Lc.delete(e),Ic.unobserve(e),Fc--,0===Fc&&(Ic.disconnect(),Ic=void 0)),r||(Rc.unobserve(e),zc--,0===zc&&(Rc.disconnect(),Rc=void 0))}})},Oc=e=>{let t=!1;const o={pointerdown:()=>{t=!1},keydown:()=>{t=!0},keyup:()=>{t=!1},focus:e=>{t&&(e.target.dataset.focusVisible="")},blur:e=>{delete e.target.dataset.focusVisible}};return Object.keys(o).forEach((t=>e.addEventListener(t,o[t],!0))),{destroy(){Object.keys(o).forEach((t=>e.removeEventListener(t,o[t],!0)))}}};const Bc=e=>/^http/.test(e),Wc=e=>new Promise(((t,o)=>"file"===e.kind?t(e.getAsFile()):"string"===e.kind?e.getAsString(t):void o()));var _c=(e,t={})=>{const o=e=>{e.preventDefault()},i=async o=>{o.preventDefault(),o.stopPropagation();try{const i=await(e=>new Promise(((t,o)=>{const{items:i}=e.dataTransfer;if(!i)return t([]);const r=Array.from(i).some((e=>"text/uri-list"===e.type)),n=Array.from(i).filter((e=>("file"===e.kind||"string"===e.kind)&&"text/x-moz-url"!==e.type)).map(Wc);Promise.all(n).then((e=>{if(r)return t([e.find(Bc)].filter(Boolean));const o=e.filter((e=>Go(e)&&oo(e)||Bc(e)));t(o)})).catch(o)})))(o);e.dispatchEvent(new CustomEvent("dropfiles",{detail:{event:o,resources:i},...t}))}catch(e){}};return e.addEventListener("drop",i),e.addEventListener("dragover",o),{destroy(){e.removeEventListener("drop",i),e.removeEventListener("dragover",o)}}};let Vc=null;var Nc=()=>{if(null===Vc)if(d()){const e=$("canvas");Vc=!Gl(e,{failIfMajorPerformanceCaveat:!0}),y(e)}else Vc=!1;return Vc},Hc=e=>e instanceof WebGLTexture,jc=([e,t,o,i])=>[i.x,i.y,e.x,e.y,o.x,o.y,t.x,t.y];function Uc(e){let t,o,i,r;return{c(){t=Fn("div"),o=Fn("canvas"),Nn(t,"class","PinturaCanvas")},m(n,a){An(n,t,a),Rn(t,o),e[37](o),i||(r=[Wn(o,"measure",e[38]),wn(Dc.call(null,o))],i=!0)},p:en,i:en,o:en,d(o){o&&Ln(t),e[37](null),i=!1,an(r)}}}function Gc(e,t,o){let i,r,a,s,l,c,u;const p=[0,0,0,0],h=he(),g=d()&&(e=>{const t=.5*e,o=$("canvas",{"data-retain":!0,width:e,height:e}),i=o.getContext("2d");return i.fillStyle="#f0f",i.fillRect(0,0,t,t),i.fillRect(t,t,t,t),o})(128),f=sa();let x,{isAnimated:v}=t,{isTransparent:w}=t,{maskRect:S}=t,{maskOpacity:k=1}=t,{maskFrameOpacity:C=.95}=t,{maskMarkupOpacity:T=1}=t,{clipAnnotationsToImage:M=!0}=t,{pixelRatio:P=1}=t,{textPixelRatio:R=P}=t,{backgroundColor:I}=t,{willRender:E=Y}=t,{didRender:A=Y}=t,{willRequest:L}=t,{csp:F}=t,{loadImageData:z=Y}=t,{enableGrid:D=!1}=t,{gridColors:B}=t,{gridSize:W}=t,{gridOpacity:_=0}=t,{images:V=[]}=t,{interfaceImages:N=[]}=t,{selectionColor:H}=t,j=null,U=null,G=null;const Z=(e,t)=>e.set(t,{hard:!v}),q={precision:1e-4*.01};let K=0;const J=yc(void 0,{duration:0});hn(e,J,(e=>o(36,u=e)));const Q=xc(1,q);hn(e,Q,(e=>o(35,l=e)));const ee=xc(1,q);hn(e,ee,(e=>o(51,a=e)));const te=Ya();hn(e,te,(e=>o(53,c=e)));const oe=Ya();hn(e,oe,(e=>o(52,s=e)));const ie={},re=(e,t)=>{let o=ie[e.id];const i=Math.min(1,2048/t.width);let r=o?o.element:$("canvas",{width:t.width*i,height:t.height*i,"data-retain":!0});if(!o||((e,t)=>{if(e.total!==t.length)return!0;const o=e.last,i=t[t.length-1];return o.drawMode!==i.drawMode||!(!Ii(o)||Ii(i)&>(o,i))||!(!Ei(o)||Ei(i)&&o.x===i.x&&o.y===i.y&&o.rx===i.rx&&o.ry===i.ry)||!(!Li(o)||Li(i)&&i.points.length===o.points.length)})(o,e.actions)){r=r.cloneNode(),((e,t,o)=>{const{selectionColor:i=[1,1,1],scalar:r=1}=o||{};let n=!1;for(const o of t){const t="subtract"===o.drawMode;if(t&&!n)continue;e.globalCompositeOperation=t?"destination-out":"source-over",e.save(),e.beginPath();const a=Ir(o);To(e,r,r),Co(e,o.rotation,a),Zr(e,o.flipX,o.flipY,a),o.width?Vr(e,{...o,backgroundColor:i}):o.points?Gr(e,Object.assign({},o,o.pathClose?{backgroundColor:i,strokeColor:[0,0,0,0]}:{strokeColor:i,strokeJoin:"round",strokeCap:"round"})):o.rx&&Nr(e,{...o,backgroundColor:i,strokeColor:[0,0,0,0],strokeJoin:"round",strokeCap:"round"}),e.restore(),n=!0}})(r.getContext("2d"),e.actions,{selectionColor:[1,0,1],scalar:i});const t=e.actions.length;ie[e.id]={total:t,last:{...e.actions[t-1]},element:r}}return{x:0,y:0,...t,fillColor:e.color||[1,1,1],backgroundImage:r}};let ne;const ae=()=>{cancelAnimationFrame(ne),ne=requestAnimationFrame((()=>{Pe=!0,Ve=0,r()}))},se=new Map([]),le=new Map([]),ce=(e,t)=>({filterParam:"pixelated"===e?j.textureFilterNearest:j.textureFilterLinear,wrapParam:"repeat"===t?j.textureRepeat:j.textureClamp}),de=(e,t,o)=>{if(!se.has(e)){se.set(e,e);const r=ce(t,o);if(!m(i=e)&&($o(i)||b(i)||Er(i)||ro(i))){const t=j.textureCreate();j.textureUpdate(t,e,r),se.set(e,t)}else z(e).then((t=>{if(!j||!t)return;const o=j.textureCreate();j.textureUpdate(o,t,r),se.set(e,o),ae()})).catch((t=>{se.set(e,t)}))}var i,r;if(ro(e)&&((r=e).currentTime>0&&!r.paused&&!r.ended&&r.readyState>2||"true"===e.dataset.redraw)){const i=se.get(e),r=ce(t,o);return j.textureUpdate(i,e,r),e.dataset.redraw=!1,i}return se.get(e)},ue=(e,t={})=>{const o=t.id||e.id;if(e.width&&e.width<1||e.height&&e.height<1||!e.text.length)return void le.delete(o);let{text:i,textAlign:r,fontFamily:n,fontSize:a=16,fontWeight:s,fontVariant:l,fontStyle:c,letterSpacing:d,lineHeight:u=a,width:p,height:h}=e,{outline:m=0,blur:g=0,paddingTop:f=0,paddingRight:y=0,paddingBottom:b=0,paddingLeft:x=0}=t;p=Oo(p)?Math.floor(p):p,h=Oo(h)?Math.floor(h):h;const{textSize:v,signature:w}=((e="",t)=>{let{width:o=0,height:i="auto",fontSize:r,fontFamily:n,lineHeight:a,fontWeight:s,fontStyle:l,fontVariant:c,letterSpacing:d}=t;const u=Yo({text:e,fontFamily:n,fontWeight:s,fontStyle:l,fontVariant:c,fontSize:r,lineHeight:a,letterSpacing:d,width:o,height:i});let p=ii.get(u);if(p)return p;let h=1;r>1e3&&O()&&(h=r/1e3,r=1e3,a*=h);const m=Kt($("pre",{contenteditable:"true",spellcheck:"false",style:`${ni}${ti({fontFamily:n,fontWeight:s,fontStyle:l,fontVariant:c,fontSize:r,letterSpacing:d,lineHeight:a})};${oi(e,t)}"`,innerHTML:e})),g=m.getBoundingClientRect();return p={signature:ri(m).flat().map((e=>e.text)).join("_;_"),textSize:Xe(Be(g),(e=>Math.ceil(e*h)))},ii.set(u,p),m.remove(),p})(i,{...e,width:p,height:void 0}),S=Yo({text:i,textAlign:r,fontFamily:n,fontSize:a,fontWeight:s,fontVariant:l,fontStyle:c,lineHeight:u,letterSpacing:d,outline:m,blur:g,signature:w});if(!se.has(S)){se.set(S,i);const e=Math.ceil(v.width),t=Math.ceil(v.height);if(0===e||0===t)return;const $=tc(),w=Math.min(1,($-(x+y)*R)/(e*R),($-(f+b)*R)/(t*R));bi(i,{fontSize:a,fontFamily:n,fontWeight:s,fontVariant:l,fontStyle:c,letterSpacing:d,textAlign:r,lineHeight:u,width:p,height:h,imageWidth:e,imageHeight:t,paddingLeft:x,paddingTop:f,paddingRight:y,paddingBottom:b,pixelRatio:R*w,willRequest:L,outline:m,blur:g,styleNonce:F.styleNonce,color:[1,0,1]}).then((e=>{if(!j)return;const t=j.textureCreate();j.textureUpdate(t,e,{filterParam:j.textureFilterLinear,wrapParam:j.textureClamp,scalar:w}),se.set(S,t),le.set(o,t),ae()})).catch(console.error)}const k=se.get(S);return Hc(k)?k:le.get(o)},pe=new Map,ge=e=>{let t;return e.backgroundImage?t=de(e.backgroundImage,e.backgroundImageRendering,"repeat"===e.backgroundRepeat?"repeat":void 0):e.bitmap&&e.points&&(t=(e=>{const{id:t,points:o,strokeWidth:i,strokeCap:r,strokeJoin:n,strokeColor:a,strokeDash:s}=e;let l=se.get(t),c=pe.get(t);const d=Yo({points:o.map((e=>`${e.x},${e.y}`)).join(","),strokeWidth:i,strokeCap:r,strokeJoin:n,strokeColor:a,strokeDash:(s||[]).join(",")});if(c){const{hash:e}=c;if(se.has(t)){if(d===e)return se.get(t)}else c=void 0}if(!c){const o=$("canvas",{width:1,height:1});c={canvas:o,hash:void 0},pe.set(e.id,c),l=j.textureCreate(),j.textureUpdate(l,o,{filterParam:j.textureFilterLinear,wrapParam:j.textureClamp}),se.set(t,l)}const{canvas:u}=c,p=Math.ceil(e.strokeWidth),h=nt(o),m=Math.floor(h.x)-.5*p,g=Math.floor(h.y)-.5*p,f=Math.ceil(h.width+p),y=Math.ceil(h.height+p);u.width=Math.max(f,1),u.height=Math.max(y,1);const b=u.getContext("2d");return b.clearRect(0,0,u.width,u.height),f>=1&&y>=1&&(b.translate(-m,-g),Gr(b,e),b.resetTransform()),j.textureUpdate(l,u,{filterParam:j.textureFilterLinear,wrapParam:j.textureClamp}),pe.set(t,{canvas:u,hash:d}),se.get(t)})(e)),t},$e=({texture:e,size:t,origin:o,translation:i,rotation:r,scale:n,colorMatrix:a,opacity:s,convolutionMatrix:l,gamma:c,vignette:d,maskFeather:u,maskCornerRadius:p,overlayColor:h,enableOverlay:m,enableManipulation:g,enableAntialiasing:$})=>{let f=0,y=0;if(1===P){const e=Math.abs(1-n)<Number.EPSILON;f=e&&U%2!=0?.5:0,y=e&&G%2!=0?.5:0}return j.drawImage(e,t,o.x,o.y,i.x+f,i.y+y,r.x,r.y,r.z,n,a,$s(s,0,1),l,c,d,u,p,h,m,g,$),e},fe=(e,t,o)=>{const i=ct(t),r=ct(e),n=i.x-r.x,a=i.y-r.y,s=ye(i,o,r);return{x:s.x-r.x-n,y:s.y-r.y-a}},be=(e,t,o)=>{let i=void 0,r=void 0;const n=X(o.width,o.height);if("repeat"===e.backgroundRepeat&&(i={...o},r={x:0,y:0}),"contain"===e.backgroundSize){const o=St(t,n,t);i=We(o),r=e.backgroundPosition?e.backgroundPosition:me(.5*(t.width-i.width),.5*(t.height-i.height))}else if("cover"===e.backgroundSize){const o=wt(t,n,t);i=We(o),e.backgroundPosition?r=e.backgroundPosition:(r=me(o.x,o.y),r=me(.5*(t.width-i.width),.5*(t.height-i.height)))}else e.backgroundSize?(i=e.backgroundSize,r=e.backgroundPosition||{x:0,y:0}):e.backgroundPosition&&(i={...o},r=e.backgroundPosition);return{backgroundSize:i,backgroundPosition:r}},xe=(e=[],t)=>{e.forEach((e=>{let o=ge(e);const i="complete"!==e.status&&("loading"===e.status||e.backgroundImage&&o===e.backgroundImage);i&&ae();const r="error"===e.status||e.backgroundImage&&o instanceof Error;let n=Hc(o)?o:void 0;const a=e._scale||1,s=e._translate||h,l=e.strokeWidth&&e.strokeWidth*a,c=e.cornerRadius?((e,t)=>[e,e,e,e].map((e=>e*t)))(e.cornerRadius,a):p,d=!!e.width,u=m(e.text),g=_o(e.points),$=Ei(e);if(g){const i=e.points.map((e=>me(e.x*a+s.x,e.y*a+s.y)));if(e.bitmap){o&&t.push(o);const r=nt(i),s=Math.ceil(e.strokeWidth*a);j.drawRect({x:Math.floor(r.x)-.5*s,y:Math.floor(r.y)-.5*s,width:Math.ceil(r.width+s),height:Math.ceil(r.height+s)},e.rotation,e.flipX,e.flipY,[0,0,0,0],void 0,n,void 0,void 0,void 0,void 0,void 0,void 0,e.opacity,void 0,void 0,!1,!1)}else j.drawPath(i,e.rotation,e.flipX,e.flipY,l,e.strokeColor,e.pathClose,e.backgroundColor,e.opacity)}else if($){let c=e.x,d=e.y;c*=a,d*=a,c+=s.x,d+=s.y;const u=at({x:c,y:d,rx:e.rx*a,ry:e.ry*a}),p=me(c,d),h=n&&j.textureGetSize(n);let m,g;if(h&&e.backgroundImage&&(e.backgroundSize||e.backgroundPosition||e.backgroundRepeat)){const t=be(e,u,h);m=t.backgroundSize,g=t.backgroundPosition}if(j.drawEllipse(p,e.rx*a,e.ry*a,e.rotation,e.flipX,e.flipY,e.backgroundColor,n,m,g,e.backgroundCorners&&jc(e.backgroundCorners),l,e.strokeColor,e.opacity,e.inverted),o&&t.push(o),i||r){if(!(e.backgroundColor||e.strokeColor&&e.strokeWidth)){const t=e.opacity||1;j.drawEllipse(p,e.rx*a,e.ry*a,e.rotation,e.flipX,e.flipY,r?[1,.2549,.2118,.25*t]:[0,0,0,.25*t])}r&&Te(p),i&&Ce(p)}}else if(u){const{fontSize:o=16}=e,i=o>1e3&&O()?o/1e3:1,r=Math.max(16,Math.ceil(o/i*.25)),n=Math.abs(e.rotation)>0,d=Oo(e.width)?Math.floor(e.width):e.width,u=Oo(e.height)?Math.floor(e.height):e.height,h=li(e.text,{...e,width:d,height:u}),m=Math.ceil(h.width),g=Math.ceil(h.height),$={x:e.x*a+s.x,y:e.y*a+s.y,width:m*a,height:g*a},f=!!e.height;(e.backgroundColor||e.strokeColor)&&j.drawRect($,e.rotation,e.flipX,e.flipY,c,e.backgroundColor,void 0,void 0,void 0,!1,void 0,l,e.strokeColor,e.opacity,void 0,void 0,void 0,e.inverted);const{textShadowX:y,textShadowY:b,textShadowBlur:x}=e;if(y||b||x){const o=Math.ceil(.5*x),l=Math.max(r,f?0:o),c=ue(e,{id:e.id+"shadow",blur:x,paddingTop:l,paddingRight:l,paddingBottom:l,paddingLeft:l});if(c&&!e._prerender){t.push(c);const o=j.textureGetSize(c),l={x:0,y:0},d={width:o.width/R*a,height:o.height/R*a},u=r*a/i;let p;if(f)p={...$},l.x=y-u,l.y=b-u;else if(p={x:e.x*a+s.x-u,y:e.y*a+s.y-u,width:d.width,height:d.height},n){const t=fe($,p,e.rotation);p.x+=t.x,p.y+=t.y;const o=ye(me(y,b),e.rotation);p.x+=o.x,p.y+=o.y}else p.x+=y,p.y+=b;j.drawRect(p,e.rotation,e.flipX,e.flipY,[0,0,0,0],void 0,c,d,l,!1,void 0,void 0,void 0,e.opacity,void 0,0,e.textShadowColor)}}if(e.textOutlineWidth){const o=Math.ceil(.5*e.textOutlineWidth),l=r+o,c=ue(e,{id:e.id+"outline",outline:e.textOutlineWidth,paddingTop:l,paddingRight:l,paddingBottom:l,paddingLeft:l});if(c&&!e._prerender){t.push(c);const l=j.textureGetSize(c),d={x:0,y:0},u={width:l.width/R*a,height:l.height/R*a},p=(r+o)*a/i,h={x:e.x*a+s.x-p,y:e.y*a+s.y-p,width:u.width,height:e.height?g+p:u.height};if(n){const t=fe($,h,e.rotation);h.x+=t.x,h.y+=t.y}j.drawRect(h,e.rotation,e.flipX,e.flipY,[0,0,0,0],void 0,c,u,d,!1,void 0,void 0,void 0,e.opacity,void 0,0,e.textOutlineColor)}}const v=ue(e,{id:e.id+"text",paddingTop:r,paddingRight:r,paddingBottom:r,paddingLeft:r});if(v&&!e._prerender){t.push(v);const o=j.textureGetSize(v),l={x:0,y:0},c={width:o.width/R*a,height:o.height/R*a},d=r*a/i,u={x:e.x*a+s.x-d,y:e.y*a+s.y-d,width:c.width,height:e.height?g+d:c.height};if(n){const t=fe($,u,e.rotation);u.x+=t.x,u.y+=t.y}const h=e.color||[0,0,0];e._prerender&&(h[3]=0),j.drawRect(u,e.rotation,e.flipX,e.flipY,p,!1,v,c,l,!1,!1,void 0,void 0,e.opacity,void 0,e.feather,h,e.inverted)}}else if(d){o&&t.push(o);const d=rt(e);let u,p;a&&s&&(d.x*=a,d.y*=a,d.x+=s.x,d.y+=s.y,d.width*=a,d.height*=a);const{backgroundRepeat:h="no-repeat"}=e,m=n&&j.textureGetSize(n);if(m&&e.backgroundImage&&(e.backgroundSize||e.backgroundPosition||e.backgroundRepeat)){const t=be(e,d,m);u=t.backgroundSize,p=t.backgroundPosition}if(j.drawRect(d,e.rotation,e.flipX,e.flipY,c,e.backgroundColor||[0,0,0,0],n,u,p,"repeat"===h,e.backgroundCorners&&jc(e.backgroundCorners),l,e.strokeColor,e.opacity,void 0,e.feather,e.fillColor,e.inverted),i||r){if(!(e.backgroundColor&&0!==e.backgroundColor[3]||e.strokeColor&&e.strokeWidth)){const t=e.opacity||1;j.drawRect(d,e.rotation,e.flipX,e.flipY,c,r?[1,.2549,.2118,.25*t]:[0,0,0,.25*t])}const t=ct(d);r&&Te(t),i&&Ce(t)}}else o&&t.push(o)}))};let ve=0;const we=[{x:-5,y:-5},{x:5,y:5}],Se=[{x:5,y:-5},{x:-5,y:5}],ke=Bt({x:0,y:0},10,10,0,!1,!1,16);ke.length=9;const Ce=e=>{ve=Date.now()/50,j.drawEllipse(e,15,15,0,!1,!1,[0,0,0,.5]);const t=ze(ke.map((t=>({x:t.x+e.x,y:t.y+e.y}))),ve,e.x,e.y);j.drawPath(t,0,!1,!1,2,[1,1,1])},Te=e=>{j.drawEllipse(e,13,13,0,!1,!1,[1,.2549,.2118,.75]);const t=we.map((t=>({x:t.x+e.x,y:t.y+e.y}))),o=Se.map((t=>({x:t.x+e.x,y:t.y+e.y})));j.drawPath(t,0,!1,!1,3,[1,1,1]),j.drawPath(o,0,!1,!1,3,[1,1,1])},Me=(e,t,o,i,r,n)=>j.drawRect(t,0,!1,!1,p,p,e,i,o,!0,void 0,0,void 0,n,void 0,void 0,r);let Pe=!1,Re=!0,Ie=!1;const Ee=[],Ae=[],Le=[],Fe=e=>!e.aboveFrame,De=e=>e.aboveFrame,Oe=()=>{Le.length=0;const e=V[0],{manipulationShapes:t,manipulationShapesDirty:o,annotationShapes:i,annotationShapesDirty:r,interfaceShapes:n,decorationShapes:d,frameShapes:h,selectionShapes:m}=E({opacity:e.opacity,rotation:e.rotation,scale:e.scale,images:V,size:Ne(U,G),backgroundColor:[...u],selectionRect:c}),$=[...u],f=c,y=$s(l,0,1),b=s,x=Math.abs(e.rotation.x/Math.PI*2-1),v=Math.abs(e.rotation.y/Math.PI*2-1),k=x<.99||v<.99,C={...e.size},P=e.backgroundColor,I=e.backgroundImage,L=t.length>0,F=i.length>0,z=i.filter(De).length>0,O=d.filter(De).length>0,Z=P[3]>0,X=!!M&&T>=1;if(y<1&&Z){const e=$[0],t=$[1],o=$[2],i=1-y,r=P[0]*i,n=P[1]*i,a=P[2]*i,s=1-i;$[0]=r+e*s,$[1]=n+t*s,$[2]=a+o*s,$[3]=1}j.setCanvasColor(w?p:$);L&&(o||Pe)?(j.disableMask(),j.drawToImageBlendBuffer(C),Ee.length=0,xe(t,Ee)):L||(Ee.length=0),Le.push(...Ee),Re&&(j.drawToImageOverlayBuffer(C,R),Re=!1);if(k){if(F&&(r||Pe)||!Ie){j.disableMask(),j.drawToImageOverlayBuffer(C,R),Ae.length=0;const e=z?i.filter(Fe):i;xe(e,Ae)}else F||(Ae.length=0);Ie=!0}else Ie=!1;if(j.drawToCanvas(),j.enableMask(f,y),D&&W>=1&&2===B.length&&_&&((e,t,o,i,r)=>{const n=Ne(t,t),a=de(g,"pixelated","repeat"),s=me(-e.x%t,-e.y%t),l=me(s.x+.5*n.width,s.y);Me(a,e,s,n,o,r),Me(a,e,l,n,i,r)})(f,W,B[0],B[1],_),Z&&j.drawRect(f,0,!1,!1,p,P),I){j.enableMask(f,1);const e=Math.max(S.width/I.width,S.height/I.height),t=I.width*e,o=I.height*e,i={x:S.x+.5*S.width-.5*t,y:S.y+.5*S.height-.5*o,width:t,height:o};j.drawRect(i,0,!1,!1,p,p,de(I,"linear")),j.enableMask(f,y)}if(X&&j.enablePreviewStencil(),Le.push(...[...V].reverse().map((e=>$e({...e,texture:de(e.data),enableOverlay:k&&F,enableManipulation:L,enableAntialiasing:!0,mask:f,maskOpacity:y,overlayColor:b})))),j.enableMask(f,T),!k){X&&j.applyPreviewStencil(),j.resetCanvasMatrix(),j.updateCanvasMatrix(C,e.origin,e.translation,e.scale,e.rotation),Ae.length=0;const t=z?i.filter(Fe):i;xe(t,Ae),X&&j.disablePreviewStencil()}if(Le.push(...Ae),j.resetCanvasMatrix(),j.enableMask(f,T),xe(O?d.filter(Fe):d,Le),h.length){j.enableMask(f,1);const e=h.filter((e=>!e.expandsCanvas)),t=h.filter((e=>e.expandsCanvas));e.length&&xe(e,Le),t.length&&(j.enableMask({x:f.x+.5,y:f.y+.5,width:f.width-1,height:f.height-1},a),xe(t,Le))}if(z&&(j.resetCanvasMatrix(),j.updateCanvasMatrix(C,e.origin,e.translation,e.scale,e.rotation),xe(i.filter(De),Le),j.resetCanvasMatrix()),O&&(j.resetCanvasMatrix(),xe(d.filter(De),Le),j.resetCanvasMatrix()),H&&m.length&&!k){j.resetCanvasMatrix(),j.updateCanvasMatrix(C,e.origin,e.translation,e.scale,e.rotation);const t=[...H];t[3]=.5;const o=[{id:"selection",color:t,actions:[...m]}].map((e=>re(e,C)));xe(o,Le),j.resetCanvasMatrix()}j.disableMask(),xe(n,Le),N.forEach((e=>{if(j.enableMask(e.mask,e.maskOpacity),e.backgroundColor){const t=I&&wt({...e.mask},I.width/I.height),o=I&&de(I,"linear");j.drawRect(e.mask,0,!1,!1,e.maskCornerRadius,e.backgroundColor,o,t,t,void 0,void 0,void 0,void 0,e.opacity,e.maskFeather),o&&Le.push(o)}const t=$e({...e,texture:de(e.data),enableAntialiasing:!1,translation:{x:e.translation.x+e.offset.x-.5*U,y:e.translation.y+e.offset.y-.5*G}});Le.push(t)})),j.disableMask(),(e=>{se.forEach(((t,o)=>{!e.find((e=>e===t))&&Hc(t)&&(Array.from(le.values()).includes(t)||(se.delete(o),j.textureDelete(t)))}))})(Le),A(),Pe=!1};let _e,Ve=0;const He=()=>{clearTimeout(_e);const e=Date.now();e-Ve<48?_e=setTimeout(He,48):(Ve=e,Oe())};na((()=>r())),ra((()=>o(31,j=uc(x,{alpha:w})))),aa((()=>{j&&(pe.forEach((({canvas:e})=>y(e))),pe.clear(),j.release(),o(31,j=void 0),o(0,x=void 0))}));return e.$$set=e=>{"isAnimated"in e&&o(9,v=e.isAnimated),"isTransparent"in e&&o(10,w=e.isTransparent),"maskRect"in e&&o(11,S=e.maskRect),"maskOpacity"in e&&o(12,k=e.maskOpacity),"maskFrameOpacity"in e&&o(13,C=e.maskFrameOpacity),"maskMarkupOpacity"in e&&o(14,T=e.maskMarkupOpacity),"clipAnnotationsToImage"in e&&o(15,M=e.clipAnnotationsToImage),"pixelRatio"in e&&o(16,P=e.pixelRatio),"textPixelRatio"in e&&o(17,R=e.textPixelRatio),"backgroundColor"in e&&o(18,I=e.backgroundColor),"willRender"in e&&o(19,E=e.willRender),"didRender"in e&&o(20,A=e.didRender),"willRequest"in e&&o(21,L=e.willRequest),"csp"in e&&o(22,F=e.csp),"loadImageData"in e&&o(23,z=e.loadImageData),"enableGrid"in e&&o(24,D=e.enableGrid),"gridColors"in e&&o(25,B=e.gridColors),"gridSize"in e&&o(26,W=e.gridSize),"gridOpacity"in e&&o(27,_=e.gridOpacity),"images"in e&&o(28,V=e.images),"interfaceImages"in e&&o(29,N=e.interfaceImages),"selectionColor"in e&&o(30,H=e.selectionColor)},e.$$.update=()=>{if(1&e.$$.dirty[0]&&x){const e=getComputedStyle(x).getPropertyValue("--color-transition-duration");o(32,K=(e=>{let t=parseFloat(e);return/^[0-9]+s$/.test(e)?1e3*t:t})(e))}262656&e.$$.dirty[0]|2&e.$$.dirty[1]&&I&&J.set(I,{duration:v?K:0}),4096&e.$$.dirty[0]&&Z(Q,Oo(k)?k:1),8192&e.$$.dirty[0]&&Z(ee,Oo(C)?C:1),2048&e.$$.dirty[0]&&S&&te.set(S),48&e.$$.dirty[1]&&u&&oe.set([u[0],u[1],u[2],$s(l,0,1)]),268435462&e.$$.dirty[0]|1&e.$$.dirty[1]&&o(34,i=!!(j&&U&&G&&V.length)),65542&e.$$.dirty[0]|1&e.$$.dirty[1]&&U&&G&&j&&(Ve=0,j.resize(U,G,P)),8&e.$$.dirty[1]&&o(33,r=i?Nc()?He:Oe:n),12&e.$$.dirty[1]&&i&&r&&r()},[x,U,G,f,J,Q,ee,te,oe,v,w,S,k,C,T,M,P,R,I,E,A,L,F,z,D,B,W,_,V,N,H,j,K,r,i,l,u,function(e){pa[e?"unshift":"push"]((()=>{x=e,o(0,x)}))},e=>{o(1,U=e.detail.width),o(2,G=e.detail.height),f("measure",{width:U,height:G})}]}class Zc extends Ga{constructor(e){super(),Ua(this,e,Gc,Uc,ln,{isAnimated:9,isTransparent:10,maskRect:11,maskOpacity:12,maskFrameOpacity:13,maskMarkupOpacity:14,clipAnnotationsToImage:15,pixelRatio:16,textPixelRatio:17,backgroundColor:18,willRender:19,didRender:20,willRequest:21,csp:22,loadImageData:23,enableGrid:24,gridColors:25,gridSize:26,gridOpacity:27,images:28,interfaceImages:29,selectionColor:30},null,[-1,-1,-1])}}var Xc=(e,t=Boolean,o=" ")=>e.filter(t).join(o);function Yc(e,t,o){const i=e.slice();return i[17]=t[o],i}const qc=e=>({tab:4&e}),Kc=e=>({tab:e[17]});function Jc(e){let t,o,i,r=[],n=new Map,a=e[2];const s=e=>e[17].id;for(let t=0;t<a.length;t+=1){let o=Yc(e,a,t),i=s(o);n.set(i,r[t]=Qc(i,o))}return{c(){t=Fn("ul");for(let e=0;e<r.length;e+=1)r[e].c();Nn(t,"class",o=Xc(["PinturaTabList",e[0]])),Nn(t,"role","tablist"),Nn(t,"data-layout",e[1])},m(o,n){An(o,t,n);for(let e=0;e<r.length;e+=1)r[e].m(t,null);e[14](t),i=!0},p(e,l){1124&l&&(a=e[2],Ra(),r=Ba(r,l,s,1,e,a,n,t,Oa,Qc,null,Yc),Ia()),(!i||1&l&&o!==(o=Xc(["PinturaTabList",e[0]])))&&Nn(t,"class",o),(!i||2&l)&&Nn(t,"data-layout",e[1])},i(e){if(!i){for(let e=0;e<a.length;e+=1)Ea(r[e]);i=!0}},o(e){for(let e=0;e<r.length;e+=1)Aa(r[e]);i=!1},d(o){o&&Ln(t);for(let e=0;e<r.length;e+=1)r[e].d();e[14](null)}}}function Qc(e,t){let o,i,r,n,a,s,l,c,d,u,p;const h=t[11].default,m=mn(h,t,t[10],Kc);function g(...e){return t[12](t[17],...e)}function $(...e){return t[13](t[17],...e)}return{key:e,first:null,c(){o=Fn("li"),i=Fn("button"),m&&m.c(),a=On(),Nn(i,"type","button"),Nn(i,"title",r=t[17].label),i.disabled=n=t[17].disabled,Nn(o,"role","tab"),Nn(o,"aria-controls",s=t[17].href.substring(1)),Nn(o,"id",l=t[17].tabId),Nn(o,"aria-selected",c=t[17].selected),this.first=o},m(e,t){An(e,o,t),Rn(o,i),m&&m.m(i,null),Rn(o,a),d=!0,u||(p=[Wn(i,"keydown",g),Wn(i,"click",$)],u=!0)},p(e,a){t=e,m&&m.p&&(!d||1028&a)&&fn(m,h,t,t[10],d?$n(h,t[10],a,qc):yn(t[10]),Kc),(!d||4&a&&r!==(r=t[17].label))&&Nn(i,"title",r),(!d||4&a&&n!==(n=t[17].disabled))&&(i.disabled=n),(!d||4&a&&s!==(s=t[17].href.substring(1)))&&Nn(o,"aria-controls",s),(!d||4&a&&l!==(l=t[17].tabId))&&Nn(o,"id",l),(!d||4&a&&c!==(c=t[17].selected))&&Nn(o,"aria-selected",c)},i(e){d||(Ea(m,e),d=!0)},o(e){Aa(m,e),d=!1},d(e){e&&Ln(o),m&&m.d(e),u=!1,an(p)}}}function ed(e){let t,o,i=e[4]&&Jc(e);return{c(){i&&i.c(),t=Bn()},m(e,r){i&&i.m(e,r),An(e,t,r),o=!0},p(e,[o]){e[4]?i?(i.p(e,o),16&o&&Ea(i,1)):(i=Jc(e),i.c(),Ea(i,1),i.m(t.parentNode,t)):i&&(Ra(),Aa(i,1,1,(()=>{i=null})),Ia())},i(e){o||(Ea(i),o=!0)},o(e){Aa(i),o=!1},d(e){i&&i.d(e),e&&Ln(t)}}}function td(e,t,o){let i,r,n,{$$slots:a={},$$scope:s}=t,{class:l}=t,{name:c}=t,{selected:d}=t,{tabs:u=[]}=t,{layout:p}=t;const h=sa(),m=e=>{const t=n.querySelectorAll('[role="tab"] button')[e];t&&t.focus()},g=(e,t)=>{e.preventDefault(),e.stopPropagation(),h("select",t)},$=({key:e},t)=>{if(!/arrow/i.test(e))return;const o=u.findIndex((e=>e.id===t));return/right|down/i.test(e)?m(o<u.length-1?o+1:0):/left|up/i.test(e)?m(o>0?o-1:u.length-1):void 0};return e.$$set=e=>{"class"in e&&o(0,l=e.class),"name"in e&&o(7,c=e.name),"selected"in e&&o(8,d=e.selected),"tabs"in e&&o(9,u=e.tabs),"layout"in e&&o(1,p=e.layout),"$$scope"in e&&o(10,s=e.$$scope)},e.$$.update=()=>{896&e.$$.dirty&&o(2,i=u.map((e=>{const t=e.id===d;return{...e,tabId:`tab-${c}-${e.id}`,href:`#panel-${c}-${e.id}`,selected:t}}))),4&e.$$.dirty&&o(4,r=i.length>1)},[l,p,i,n,r,g,$,c,d,u,s,a,(e,t)=>$(t,e.id),(e,t)=>g(t,e.id),function(e){pa[e?"unshift":"push"]((()=>{n=e,o(3,n)}))}]}class od extends Ga{constructor(e){super(),Ua(this,e,td,ed,ln,{class:0,name:7,selected:8,tabs:9,layout:1})}}var id=(e,t)=>{if(!t)return;const o=t=>{g(e,t)};return o(t),{update:o}};const rd=e=>({panel:16&e}),nd=e=>({panel:e[4][0].id,panelIsActive:!0});function ad(e,t,o){const i=e.slice();return i[14]=t[o].id,i[15]=t[o].shouldDraw,i[16]=t[o].panelId,i[17]=t[o].tabindex,i[18]=t[o].labelledBy,i[19]=t[o].isActive,i[20]=t[o].hidden,i[3]=t[o].visible,i}const sd=e=>({panel:16&e,panelIsActive:16&e}),ld=e=>({panel:e[14],panelIsActive:e[19]});function cd(e){let t,o,i,r,n,a,s;const l=e[11].default,c=mn(l,e,e[10],nd);return{c(){t=Fn("div"),o=Fn("div"),c&&c.c(),Nn(o,"class",i=Xc([e[1]])),Nn(t,"class",e[0])},m(i,l){An(i,t,l),Rn(t,o),c&&c.m(o,null),n=!0,a||(s=[wn(r=id.call(null,t,e[2])),Wn(t,"measure",e[13]),wn(Dc.call(null,t))],a=!0)},p(e,a){c&&c.p&&(!n||1040&a)&&fn(c,l,e,e[10],n?$n(l,e[10],a,rd):yn(e[10]),nd),(!n||2&a&&i!==(i=Xc([e[1]])))&&Nn(o,"class",i),(!n||1&a)&&Nn(t,"class",e[0]),r&&sn(r.update)&&4&a&&r.update.call(null,e[2])},i(e){n||(Ea(c,e),n=!0)},o(e){Aa(c,e),n=!1},d(e){e&&Ln(t),c&&c.d(e),a=!1,an(s)}}}function dd(e){let t,o,i,r,n,a,s=[],l=new Map,c=e[4];const d=e=>e[14];for(let t=0;t<c.length;t+=1){let o=ad(e,c,t),i=d(o);l.set(i,s[t]=pd(i,o))}return{c(){t=Fn("div");for(let e=0;e<s.length;e+=1)s[e].c();Nn(t,"class",o=Xc(["PinturaTabPanels",e[0]]))},m(o,l){An(o,t,l);for(let e=0;e<s.length;e+=1)s[e].m(t,null);r=!0,n||(a=[wn(i=id.call(null,t,e[2])),Wn(t,"measure",e[12]),wn(Dc.call(null,t,{observePosition:!0}))],n=!0)},p(e,n){1042&n&&(c=e[4],Ra(),s=Ba(s,n,d,1,e,c,l,t,Oa,pd,null,ad),Ia()),(!r||1&n&&o!==(o=Xc(["PinturaTabPanels",e[0]])))&&Nn(t,"class",o),i&&sn(i.update)&&4&n&&i.update.call(null,e[2])},i(e){if(!r){for(let e=0;e<c.length;e+=1)Ea(s[e]);r=!0}},o(e){for(let e=0;e<s.length;e+=1)Aa(s[e]);r=!1},d(e){e&&Ln(t);for(let e=0;e<s.length;e+=1)s[e].d();n=!1,an(a)}}}function ud(e){let t;const o=e[11].default,i=mn(o,e,e[10],ld);return{c(){i&&i.c()},m(e,o){i&&i.m(e,o),t=!0},p(e,r){i&&i.p&&(!t||1040&r)&&fn(i,o,e,e[10],t?$n(o,e[10],r,sd):yn(e[10]),ld)},i(e){t||(Ea(i,e),t=!0)},o(e){Aa(i,e),t=!1},d(e){i&&i.d(e)}}}function pd(e,t){let o,i,r,n,a,s,l,c,d,u=t[15]&&ud(t);return{key:e,first:null,c(){o=Fn("div"),u&&u.c(),i=On(),Nn(o,"class",r=Xc(["PinturaTabPanel",t[1]])),o.hidden=n=t[20],Nn(o,"id",a=t[16]),Nn(o,"tabindex",s=t[17]),Nn(o,"aria-labelledby",l=t[18]),Nn(o,"data-inert",c=!t[3]),this.first=o},m(e,t){An(e,o,t),u&&u.m(o,null),Rn(o,i),d=!0},p(e,p){(t=e)[15]?u?(u.p(t,p),16&p&&Ea(u,1)):(u=ud(t),u.c(),Ea(u,1),u.m(o,i)):u&&(Ra(),Aa(u,1,1,(()=>{u=null})),Ia()),(!d||2&p&&r!==(r=Xc(["PinturaTabPanel",t[1]])))&&Nn(o,"class",r),(!d||16&p&&n!==(n=t[20]))&&(o.hidden=n),(!d||16&p&&a!==(a=t[16]))&&Nn(o,"id",a),(!d||16&p&&s!==(s=t[17]))&&Nn(o,"tabindex",s),(!d||16&p&&l!==(l=t[18]))&&Nn(o,"aria-labelledby",l),(!d||16&p&&c!==(c=!t[3]))&&Nn(o,"data-inert",c)},i(e){d||(Ea(u),d=!0)},o(e){Aa(u),d=!1},d(e){e&&Ln(o),u&&u.d()}}}function hd(e){let t,o,i,r;const n=[dd,cd],a=[];function s(e,t){return e[5]?0:1}return t=s(e),o=a[t]=n[t](e),{c(){o.c(),i=Bn()},m(e,o){a[t].m(e,o),An(e,i,o),r=!0},p(e,[r]){let l=t;t=s(e),t===l?a[t].p(e,r):(Ra(),Aa(a[l],1,1,(()=>{a[l]=null})),Ia(),o=a[t],o?o.p(e,r):(o=a[t]=n[t](e),o.c()),Ea(o,1),o.m(i.parentNode,i))},i(e){r||(Ea(o),r=!0)},o(e){Aa(o),r=!1},d(e){a[t].d(e),e&&Ln(i)}}}function md(e,t,o){let i,r,{$$slots:n={},$$scope:a}=t,{class:s}=t,{name:l}=t,{selected:c}=t,{panelClass:d}=t,{panels:u=[]}=t,{visible:p}=t,{style:h}=t;const m={};return e.$$set=e=>{"class"in e&&o(0,s=e.class),"name"in e&&o(6,l=e.name),"selected"in e&&o(7,c=e.selected),"panelClass"in e&&o(1,d=e.panelClass),"panels"in e&&o(8,u=e.panels),"visible"in e&&o(3,p=e.visible),"style"in e&&o(2,h=e.style),"$$scope"in e&&o(10,a=e.$$scope)},e.$$.update=()=>{968&e.$$.dirty&&o(4,i=u.map((e=>{const t=e===c;t&&o(9,m[e]=!0,m);const i=p?-1!==p.indexOf(e):t;return{id:e,panelId:`panel-${l}-${e}`,labelledBy:`tab-${l}-${e}`,isActive:t,hidden:!t,visible:i,tabindex:t?0:-1,shouldDraw:t||m[e]}}))),16&e.$$.dirty&&o(5,r=i.length>1)},[s,d,h,p,i,r,l,c,u,m,a,n,function(t){da.call(this,e,t)},function(t){da.call(this,e,t)}]}class gd extends Ga{constructor(e){super(),Ua(this,e,md,hd,ln,{class:0,name:6,selected:7,panelClass:1,panels:8,visible:3,style:2})}}var $d=e=>{const t=Object.getOwnPropertyDescriptors(e.prototype);return Object.keys(t).filter((e=>!!t[e].get))};function fd(e){let t,o,i,r;const n=[e[5],{locale:e[1]}];function a(t){e[22](t)}var s=e[10];function l(e){let t={};for(let e=0;e<n.length;e+=1)t=on(t,n[e]);return void 0!==e[3]&&(t.name=e[3]),{props:t}}return s&&(t=qn(s,l(e)),pa.push((()=>Va(t,"name",a))),e[23](t),t.$on("measure",e[11])),{c(){t&&Na(t.$$.fragment),i=Bn()},m(e,o){t&&Ha(t,e,o),An(e,i,o),r=!0},p(e,r){const c=34&r[0]?Wa(n,[32&r[0]&&_a(e[5]),2&r[0]&&{locale:e[1]}]):{};if(!o&&8&r[0]&&(o=!0,c.name=e[3],xa((()=>o=!1))),s!==(s=e[10])){if(t){Ra();const e=t;Aa(e.$$.fragment,1,0,(()=>{ja(e,1)})),Ia()}s?(t=qn(s,l(e)),pa.push((()=>Va(t,"name",a))),e[23](t),t.$on("measure",e[11]),Na(t.$$.fragment),Ea(t.$$.fragment,1),Ha(t,i.parentNode,i)):t=null}else s&&t.$set(c)},i(e){r||(t&&Ea(t.$$.fragment,e),r=!0)},o(e){t&&Aa(t.$$.fragment,e),r=!1},d(o){e[23](null),o&&Ln(i),t&&ja(t,o)}}}function yd(e){let t,o,i,r=e[6]&&fd(e);return{c(){t=Fn("div"),r&&r.c(),Nn(t,"data-util",e[3]),Nn(t,"class",o=Xc(["PinturaUtilPanel",e[2]])),Zn(t,"opacity",e[7])},m(o,n){An(o,t,n),r&&r.m(t,null),e[24](t),i=!0},p(e,n){e[6]?r?(r.p(e,n),64&n[0]&&Ea(r,1)):(r=fd(e),r.c(),Ea(r,1),r.m(t,null)):r&&(Ra(),Aa(r,1,1,(()=>{r=null})),Ia()),(!i||8&n[0])&&Nn(t,"data-util",e[3]),(!i||4&n[0]&&o!==(o=Xc(["PinturaUtilPanel",e[2]])))&&Nn(t,"class",o),128&n[0]&&Zn(t,"opacity",e[7])},i(e){i||(Ea(r),i=!0)},o(e){Aa(r),i=!1},d(o){o&&Ln(t),r&&r.d(),e[24](null)}}}function bd(e,t,o){let i,r,n,a,s;const l=sa();let{isActive:c=!0}=t,{stores:d}=t,{view:u}=t,{props:p}=t,{component:h}=t,{locale:m}=t,{class:g}=t;const $=ca("isAnimated");let f;hn(e,$,(e=>o(21,s=e)));const y=xc(0),b=qa(y,(e=>$s(e,0,1)));hn(e,b,(e=>o(20,a=e)));let x=!c;const v=Ya(c),w={isActive:qa(v,(async(e,t)=>{if(!e)return t(e);await ya(),t(e)}),!1),isActiveFraction:qa(b,(e=>e)),isVisible:qa(b,(e=>e>0))},S=u,k=$d(S),C=Object.keys(p||{}).reduce(((e,t)=>k.includes(t)?(e[t]=p[t],e):e),{}),T=Object.keys(w).reduce(((e,t)=>k.includes(t)?(e[t]=w[t],e):e),{});let M,P;const R=e=>{o(17,f={...e.detail}),E&&c&&l("measure",{...f})};la("measurable",Dc);const I=ia().$$.context;let E=!1;return ra((()=>{if(o(19,E=!0),n)return;o(0,h=new S({target:P,props:{...r,locale:m},context:I})),o(3,M=h.name);const e=h.$on("measure",R);return()=>{e(),h.$destroy()}})),e.$$set=e=>{"isActive"in e&&o(12,c=e.isActive),"stores"in e&&o(13,d=e.stores),"view"in e&&o(14,u=e.view),"props"in e&&o(15,p=e.props),"component"in e&&o(0,h=e.component),"locale"in e&&o(1,m=e.locale),"class"in e&&o(2,g=e.class)},e.$$.update=()=>{135169&e.$$.dirty[0]&&f&&c&&h&&l("measure",f),2101248&e.$$.dirty[0]&&y.set(c?1:0,{hard:!1===s}),1310720&e.$$.dirty[0]&&(a<=0&&!x?o(18,x=!0):a>0&&x&&o(18,x=!1)),786432&e.$$.dirty[0]&&E&&l(x?"hide":"show"),1048576&e.$$.dirty[0]&&l("fade",a),1048576&e.$$.dirty[0]&&o(7,i=a),4096&e.$$.dirty[0]&&v.set(c),8192&e.$$.dirty[0]&&o(5,r={...C,...T,stores:d})},o(6,n=!k.includes("external")),[h,m,g,M,P,r,n,i,$,b,S,R,c,d,u,p,y,f,x,E,a,s,function(e){M=e,o(3,M)},function(e){pa[e?"unshift":"push"]((()=>{h=e,o(0,h)}))},function(e){pa[e?"unshift":"push"]((()=>{P=e,o(4,P)}))}]}class xd extends Ga{constructor(e){super(),Ua(this,e,bd,yd,ln,{isActive:12,stores:13,view:14,props:15,component:0,locale:1,class:2,opacity:16},null,[-1,-1])}get opacity(){return this.$$.ctx[16]}}function vd(e){let t,o,i,r,n,a;const s=e[5].default,l=mn(s,e,e[4],null);return{c(){t=zn("svg"),l&&l.c(),Nn(t,"class",e[3]),Nn(t,"width",e[0]),Nn(t,"height",e[1]),Nn(t,"viewBox",o="0 0 "+e[0]+"\n "+e[1]),Nn(t,"xmlns","http://www.w3.org/2000/svg"),Nn(t,"aria-hidden","true"),Nn(t,"focusable","false"),Nn(t,"stroke-linecap","round"),Nn(t,"stroke-linejoin","round")},m(o,s){An(o,t,s),l&&l.m(t,null),r=!0,n||(a=wn(i=id.call(null,t,e[2])),n=!0)},p(e,[n]){l&&l.p&&(!r||16&n)&&fn(l,s,e,e[4],r?$n(s,e[4],n,null):yn(e[4]),null),(!r||8&n)&&Nn(t,"class",e[3]),(!r||1&n)&&Nn(t,"width",e[0]),(!r||2&n)&&Nn(t,"height",e[1]),(!r||3&n&&o!==(o="0 0 "+e[0]+"\n "+e[1]))&&Nn(t,"viewBox",o),i&&sn(i.update)&&4&n&&i.update.call(null,e[2])},i(e){r||(Ea(l,e),r=!0)},o(e){Aa(l,e),r=!1},d(e){e&&Ln(t),l&&l.d(e),n=!1,a()}}}function wd(e,t,o){let{$$slots:i={},$$scope:r}=t,{width:n=24}=t,{height:a=24}=t,{style:s}=t,{class:l}=t;return e.$$set=e=>{"width"in e&&o(0,n=e.width),"height"in e&&o(1,a=e.height),"style"in e&&o(2,s=e.style),"class"in e&&o(3,l=e.class),"$$scope"in e&&o(4,r=e.$$scope)},[n,a,s,l,r,i]}class Sd extends Ga{constructor(e){super(),Ua(this,e,wd,vd,ln,{width:0,height:1,style:2,class:3})}}var kd=(e,t)=>t===e.target||t.contains(e.target),Cd=(e,t,o)=>{const i=m(t)?t:e;return o?`${i} (${r=o,r.map((e=>"CMD"===e?bo()?"⌘":"Ctrl":e)).join("+")})`:i;var r};const{document:Td}=za;function Md(e){let t,o,i,r;return{c(){t=On(),o=Fn("button"),Nn(o,"class","PinturaImageButton"),Nn(o,"type","button"),Nn(o,"title",e[1]),o.disabled=e[2]},m(n,a){An(n,t,a),An(n,o,a),o.innerHTML=e[0],e[11](o),i||(r=[Wn(Td.body,"load",e[5],!0),Wn(Td.body,"error",e[6],!0),Wn(o,"pointerdown",e[4])],i=!0)},p(e,[t]){1&t&&(o.innerHTML=e[0]),2&t&&Nn(o,"title",e[1]),4&t&&(o.disabled=e[2])},i:en,o:en,d(n){n&&Ln(t),n&&Ln(o),e[11](null),i=!1,an(r)}}}function Pd(e,t,o){let i,{html:r}=t,{title:a}=t,{onclick:s}=t,{disabled:l=!1}=t,{ongrab:c=n}=t,{ondrag:d=n}=t,{ondrop:u=n}=t;const p=e=>Ie(h,me(e.pageX,e.pageY))<256;let h;const m=e=>{document.documentElement.removeEventListener("pointermove",g),document.documentElement.removeEventListener("pointerup",m);const t=me(e.pageX,e.pageY);if(Ie(h,t)<32)return s(e);p(e)||u(e)},g=e=>{p(e)||d(e)},$=e=>i&&i.contains(e)&&"IMG"===e.nodeName;return e.$$set=e=>{"html"in e&&o(0,r=e.html),"title"in e&&o(1,a=e.title),"onclick"in e&&o(7,s=e.onclick),"disabled"in e&&o(2,l=e.disabled),"ongrab"in e&&o(8,c=e.ongrab),"ondrag"in e&&o(9,d=e.ondrag),"ondrop"in e&&o(10,u=e.ondrop)},e.$$.update=()=>{8&e.$$.dirty&&i&&i.querySelector("img")&&o(3,i.dataset.loader=!0,i)},[r,a,l,i,e=>{h=me(e.pageX,e.pageY),c(e),document.documentElement.addEventListener("pointermove",g),document.documentElement.addEventListener("pointerup",m)},({target:e})=>{$(e)&&o(3,i.dataset.load=!0,i)},({target:e})=>{$(e)&&o(3,i.dataset.error=!0,i)},s,c,d,u,function(e){pa[e?"unshift":"push"]((()=>{i=e,o(3,i)}))}]}class Rd extends Ga{constructor(e){super(),Ua(this,e,Pd,Md,ln,{html:0,title:1,onclick:7,disabled:2,ongrab:8,ondrag:9,ondrop:10})}}function Id(e,t,o){const i=e.slice();return i[13]=t[o],i}function Ed(e,t){let o,i,r,n,a,s,l;function c(){return t[9](t[13])}function d(...e){return t[10](t[13],...e)}function u(...e){return t[11](t[13],...e)}function p(...e){return t[12](t[13],...e)}return i=new Rd({props:{onclick:c,ongrab:d,ondrag:u,ondrop:p,disabled:t[1]||t[13].disabled,title:t[13].title,html:t[13].thumb}}),{key:e,first:null,c(){o=Fn("li"),Na(i.$$.fragment),r=On(),Zn(o,"opacity",t[6]),this.first=o},m(e,c){An(e,o,c),Ha(i,o,null),Rn(o,r),a=!0,s||(l=wn(n=t[8].call(null,o,t[13])),s=!0)},p(e,r){t=e;const a={};5&r&&(a.onclick=c),9&r&&(a.ongrab=d),17&r&&(a.ondrag=u),33&r&&(a.ondrop=p),3&r&&(a.disabled=t[1]||t[13].disabled),1&r&&(a.title=t[13].title),1&r&&(a.html=t[13].thumb),i.$set(a),n&&sn(n.update)&&1&r&&n.update.call(null,t[13]),64&r&&Zn(o,"opacity",t[6])},i(e){a||(Ea(i.$$.fragment,e),a=!0)},o(e){Aa(i.$$.fragment,e),a=!1},d(e){e&&Ln(o),ja(i),s=!1,l()}}}function Ad(e){let t,o,i=[],r=new Map,n=e[0];const a=e=>e[13].id;for(let t=0;t<n.length;t+=1){let o=Id(e,n,t),s=a(o);r.set(s,i[t]=Ed(s,o))}return{c(){t=Fn("ul");for(let e=0;e<i.length;e+=1)i[e].c();Nn(t,"class","PinturaImageButtonList")},m(e,r){An(e,t,r);for(let e=0;e<i.length;e+=1)i[e].m(t,null);o=!0},p(e,[o]){127&o&&(n=e[0],Ra(),i=Ba(i,o,a,1,e,n,r,t,Oa,Ed,null,Id),Ia())},i(e){if(!o){for(let e=0;e<n.length;e+=1)Ea(i[e]);o=!0}},o(e){for(let e=0;e<i.length;e+=1)Aa(i[e]);o=!1},d(e){e&&Ln(t);for(let e=0;e<i.length;e+=1)i[e].d()}}}function Ld(e,t,o){let i,{items:r}=t,{disabled:n}=t,{onclickitem:a}=t,{ongrabitem:s}=t,{ondragitem:l}=t,{ondropitem:c}=t;const d=xc(0,{stiffness:.25,damping:.9});hn(e,d,(e=>o(6,i=e)));ra((()=>d.set(1)));return e.$$set=e=>{"items"in e&&o(0,r=e.items),"disabled"in e&&o(1,n=e.disabled),"onclickitem"in e&&o(2,a=e.onclickitem),"ongrabitem"in e&&o(3,s=e.ongrabitem),"ondragitem"in e&&o(4,l=e.ondragitem),"ondropitem"in e&&o(5,c=e.ondropitem)},[r,n,a,s,l,c,i,d,(e,t)=>t.mount&&t.mount(e.firstChild,t),e=>a(e.id),(e,t)=>s&&s(e.id,t),(e,t)=>l&&l(e.id,t),(e,t)=>c&&c(e.id,t)]}class Fd extends Ga{constructor(e){super(),Ua(this,e,Ld,Ad,ln,{items:0,disabled:1,onclickitem:2,ongrabitem:3,ondragitem:4,ondropitem:5})}}var zd=()=>d()&&window.devicePixelRatio||1;let Dd=null;var Od=e=>(null===Dd&&(Dd=1===zd()?Math.round:e=>e),Dd(e)),Bd=(e,t={})=>{if(e){if(t.preventScroll&&Qt()){const t=document.body.scrollTop;return e.focus(),void(document.body.scrollTop=t)}e.focus(t)}},Wd=e=>/date|email|number|search|text|url/.test(e.type),_d=e=>(e=>/textarea/i.test(e.nodeName))(e)||Wd(e)||e.isContentEditable;const Vd=e=>({}),Nd=e=>({}),Hd=e=>({}),jd=e=>({});function Ud(e){let t,o;const i=[e[7]];let r={$$slots:{default:[Zd]},$$scope:{ctx:e}};for(let e=0;e<i.length;e+=1)r=on(r,i[e]);return t=new vh({props:r}),e[53](t),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const r=128&o[0]?Wa(i,[_a(e[7])]):{};67108864&o[1]&&(r.$$scope={dirty:o,ctx:e}),t.$set(r)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(o){e[53](null),ja(t,o)}}}function Gd(e){let t,o;const i=[e[7]];let r={};for(let e=0;e<i.length;e+=1)r=on(r,i[e]);return t=new vh({props:r}),e[52](t),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const r=128&o[0]?Wa(i,[_a(e[7])]):{};t.$set(r)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(o){e[52](null),ja(t,o)}}}function Zd(e){let t;const o=e[51].label,i=mn(o,e,e[57],jd);return{c(){i&&i.c()},m(e,o){i&&i.m(e,o),t=!0},p(e,r){i&&i.p&&(!t||67108864&r[1])&&fn(i,o,e,e[57],t?$n(o,e[57],r,Hd):yn(e[57]),jd)},i(e){t||(Ea(i,e),t=!0)},o(e){Aa(i,e),t=!1},d(e){i&&i.d(e)}}}function Xd(e){let t,o,i,r,n,a,s;const l=e[51].details,c=mn(l,e,e[57],Nd);return{c(){t=Fn("div"),c&&c.c(),o=On(),i=Fn("span"),Nn(i,"class","PinturaPanelTip"),Nn(i,"data-top",e[10]),Zn(i,"opacity",e[14]),Zn(i,"transform",e[13]),Zn(i,"top",e[12]),Zn(i,"left",e[11]),Nn(t,"class",r=Xc(["PinturaPanel","pintura-editor-panel",e[2]])),Nn(t,"tabindex","-1"),Zn(t,"opacity",e[18]),Zn(t,"pointer-events",e[17]),Zn(t,"transform",e[16]),Zn(t,"max-height",e[15])},m(r,l){An(r,t,l),c&&c.m(t,null),Rn(t,o),Rn(t,i),e[54](t),n=!0,a||(s=[Wn(t,"close",e[55]),Wn(t,"keydown",e[25]),Wn(t,"measure",e[56]),wn(Dc.call(null,t))],a=!0)},p(e,o){c&&c.p&&(!n||67108864&o[1])&&fn(c,l,e,e[57],n?$n(l,e[57],o,Vd):yn(e[57]),Nd),(!n||1024&o[0])&&Nn(i,"data-top",e[10]),16384&o[0]&&Zn(i,"opacity",e[14]),8192&o[0]&&Zn(i,"transform",e[13]),4096&o[0]&&Zn(i,"top",e[12]),2048&o[0]&&Zn(i,"left",e[11]),(!n||4&o[0]&&r!==(r=Xc(["PinturaPanel","pintura-editor-panel",e[2]])))&&Nn(t,"class",r),262144&o[0]&&Zn(t,"opacity",e[18]),131072&o[0]&&Zn(t,"pointer-events",e[17]),65536&o[0]&&Zn(t,"transform",e[16]),32768&o[0]&&Zn(t,"max-height",e[15])},i(e){n||(Ea(c,e),n=!0)},o(e){Aa(c,e),n=!1},d(o){o&&Ln(t),c&&c.d(o),e[54](null),a=!1,an(s)}}}function Yd(e){let t,o,i,r,n,a,s,l,c;const d=[Gd,Ud],u=[];function p(e,t){return e[1]?0:1}o=p(e),i=u[o]=d[o](e);let h=e[6]&&Xd(e);return{c(){t=On(),i.c(),r=On(),h&&h.c(),n=On(),a=Bn()},m(i,d){An(i,t,d),u[o].m(i,d),An(i,r,d),h&&h.m(i,d),An(i,n,d),An(i,a,d),s=!0,l||(c=[Wn(document.body,"pointerdown",(function(){sn(e[9])&&e[9].apply(this,arguments)})),Wn(document.body,"pointerup",(function(){sn(e[8])&&e[8].apply(this,arguments)}))],l=!0)},p(t,a){let s=o;o=p(e=t),o===s?u[o].p(e,a):(Ra(),Aa(u[s],1,1,(()=>{u[s]=null})),Ia(),i=u[o],i?i.p(e,a):(i=u[o]=d[o](e),i.c()),Ea(i,1),i.m(r.parentNode,r)),e[6]?h?(h.p(e,a),64&a[0]&&Ea(h,1)):(h=Xd(e),h.c(),Ea(h,1),h.m(n.parentNode,n)):h&&(Ra(),Aa(h,1,1,(()=>{h=null})),Ia())},i(e){s||(Ea(i),Ea(h),Ea(false),s=!0)},o(e){Aa(i),Aa(h),Aa(false),s=!1},d(e){e&&Ln(t),u[o].d(e),e&&Ln(r),h&&h.d(e),e&&Ln(n),e&&Ln(a),l=!1,an(c)}}}let qd=12;function Kd(e,t,o){let i,r,a,s,l,c,d,u,p,h,m,g,$,f,y,b,x,v,w,S,k,C,T,M,P,R,{$$slots:I={},$$scope:E}=t,{buttonClass:A}=t,{buttonLabel:L}=t,{buttonLabelClass:F}=t,{buttonHideLabel:z}=t,{buttonIcon:D}=t,{buttonTitle:O}=t,{panelClass:B}=t,{isActive:W=!1}=t,{onshow:_=(({panel:e})=>Bd(e,{preventScroll:!0}))}=t,{onhide:V=n}=t;const N=ca("isAnimated");hn(e,N,(e=>o(50,R=e)));const H=ca("rootPortal");hn(e,H,(e=>o(45,k=e)));const j=ca("rootRect");let U,G,Z;hn(e,j,(e=>o(48,M=e)));const X=()=>o(33,Z=i&&i.getBoundingClientRect());let Y=he(),q=xc(0);hn(e,q,(e=>o(47,T=e)));let K=he();const J=Ya({x:0,y:0});hn(e,J,(e=>o(46,C=e)));const Q=xc(-5,{stiffness:.1,damping:.35,precision:.001});hn(e,Q,(e=>o(49,P=e)));let ee=!0;const te=e=>kd(e,k)||G.isEventTarget(e);let oe,ie,re=!1;const ne=e=>{_d(e.target)||(W||X(),o(38,ie=e),o(0,W=!W))},ae=e=>{/down/i.test(e.key)&&(o(0,W=!0),o(38,ie=e))};aa((()=>{if(!k)return;if(!oe)return;const e=oe;ya().then((()=>{e.parentNode&&e.remove()}))}));return e.$$set=e=>{"buttonClass"in e&&o(26,A=e.buttonClass),"buttonLabel"in e&&o(1,L=e.buttonLabel),"buttonLabelClass"in e&&o(27,F=e.buttonLabelClass),"buttonHideLabel"in e&&o(28,z=e.buttonHideLabel),"buttonIcon"in e&&o(29,D=e.buttonIcon),"buttonTitle"in e&&o(30,O=e.buttonTitle),"panelClass"in e&&o(2,B=e.panelClass),"isActive"in e&&o(0,W=e.isActive),"onshow"in e&&o(31,_=e.onshow),"onhide"in e&&o(32,V=e.onhide),"$$scope"in e&&o(57,E=e.$$scope)},e.$$.update=()=>{if(16&e.$$.dirty[0]&&(i=G&&G.getElement()),1&e.$$.dirty[0]|64&e.$$.dirty[1]&&o(8,w=W?e=>{re&&(o(37,re=!1),te(e)||o(0,W=!1))}:void 0),1&e.$$.dirty[0]|524288&e.$$.dirty[1]&&q.set(W?1:0,{hard:!1===R}),1&e.$$.dirty[0]|524288&e.$$.dirty[1]&&Q.set(W?0:-5,{hard:!1===R}),262144&e.$$.dirty[1]&&o(42,r=1-P/-5),1&e.$$.dirty[0]|131072&e.$$.dirty[1]&&M&&W&&X(),9&e.$$.dirty[0]|131076&e.$$.dirty[1]&&M&&U&&Z&&W){o(36,ee=!0);let e=Z.x-M.x+.5*Z.width-.5*U.width,t=Z.y-M.y+Z.height;const i=qd,r=qd,n=M.width-qd,a=M.height-qd,s=e,l=t,c=s+U.width,d=l+U.height;if(s<i&&(o(35,K.x=s-i,K),e=i),c>n&&(o(35,K.x=c-n,K),e=n-U.width),d>a){o(34,Y.y=-1,Y);r<t-U.height-Z.height?(o(35,K.y=0,K),t-=U.height+Z.height):(o(35,K.y=t-(d-a),K),t-=d-a-qd,o(36,ee=!1))}else o(34,Y.y=1,Y);vn(J,C=Se(me(e,t),Od),C)}65536&e.$$.dirty[1]&&o(6,a=T>0),294920&e.$$.dirty[1]&&o(44,s=`translateX(${Math.round(C.x)+Y.x*qd}px) translateY(${Math.round(C.y)+Y.y*qd+Y.y*P}px)`),131072&e.$$.dirty[1]&&o(43,l=`--panel-max-height:${M.height-24}px`),65536&e.$$.dirty[1]&&o(18,c=T),65536&e.$$.dirty[1]&&o(17,d=T<1?"none":"all"),8192&e.$$.dirty[1]&&o(16,u=s),4096&e.$$.dirty[1]&&o(15,p=l),2048&e.$$.dirty[1]&&o(40,h=.5+.5*r),2048&e.$$.dirty[1]&&o(41,m=r),8&e.$$.dirty[0]|32768&e.$$.dirty[1]&&o(39,g=U&&C),1312&e.$$.dirty[1]&&o(14,$=g&&ee?m:0),768&e.$$.dirty[1]&&o(13,f=g?`scaleX(${h})rotate(45deg)`:"none"),8&e.$$.dirty[0]|280&e.$$.dirty[1]&&o(12,y=g?(Y.y<0?K.y+U.height:0)+"px":"0"),8&e.$$.dirty[0]|272&e.$$.dirty[1]&&o(11,b=g?K.x+.5*U.width+"px":"0"),8&e.$$.dirty[1]&&o(10,x=Y.y>=0),1&e.$$.dirty[0]&&o(9,v=W?e=>{te(e)||o(37,re=!0)}:void 0),96&e.$$.dirty[0]|16384&e.$$.dirty[1]&&a&&k&&oe&&oe.parentNode!==k&&k.append(oe),1&e.$$.dirty[0]&&(W||o(38,ie=void 0)),97&e.$$.dirty[0]|129&e.$$.dirty[1]&&W&&a&&oe&&_({e:ie,panel:oe}),65&e.$$.dirty[0]|2&e.$$.dirty[1]&&a&&!W&&V(),2080374786&e.$$.dirty[0]&&o(7,S={label:L,icon:D,class:Xc(["PinturaPanelButton",A]),onkeydown:ae,onclick:ne,hideLabel:z,labelClass:F,title:O})},[W,L,B,U,G,oe,a,S,w,v,x,b,y,f,$,p,u,d,c,N,H,j,q,J,Q,e=>{/esc/i.test(e.key)&&(o(0,W=!1),i.focus())},A,F,z,D,O,_,V,Z,Y,K,ee,re,ie,g,h,m,r,l,s,k,C,T,M,P,R,I,function(e){pa[e?"unshift":"push"]((()=>{G=e,o(4,G)}))},function(e){pa[e?"unshift":"push"]((()=>{G=e,o(4,G)}))},function(e){pa[e?"unshift":"push"]((()=>{oe=e,o(5,oe)}))},e=>{e.stopPropagation(),o(0,W=!1)},e=>o(3,U=Be(e.detail)),E]}class Jd extends Ga{constructor(e){super(),Ua(this,e,Kd,Yd,ln,{buttonClass:26,buttonLabel:1,buttonLabelClass:27,buttonHideLabel:28,buttonIcon:29,buttonTitle:30,panelClass:2,isActive:0,onshow:31,onhide:32},null,[-1,-1,-1])}}var Qd={Up:38,Down:40,Left:37,Right:39};function eu(e){let t,o,i,r,n,a,s,l;const c=e[15].default,d=mn(c,e,e[14],null);return{c(){t=Fn("li"),o=Fn("input"),i=On(),r=Fn("label"),d&&d.c(),Nn(o,"type","radio"),Nn(o,"class","implicit"),Nn(o,"id",e[7]),Nn(o,"name",e[0]),o.value=e[3],o.disabled=e[6],o.hidden=e[5],o.checked=e[4],Nn(r,"for",e[7]),Nn(r,"title",e[2]),Nn(t,"class",n=Xc(["PinturaRadioGroupOption",e[1]])),Nn(t,"data-hidden",e[5]),Nn(t,"data-disabled",e[6]),Nn(t,"data-selected",e[4])},m(n,c){An(n,t,c),Rn(t,o),Rn(t,i),Rn(t,r),d&&d.m(r,null),a=!0,s||(l=[Wn(o,"change",Vn(e[16])),Wn(o,"keydown",e[9]),Wn(o,"click",e[10])],s=!0)},p(e,[i]){(!a||128&i)&&Nn(o,"id",e[7]),(!a||1&i)&&Nn(o,"name",e[0]),(!a||8&i)&&(o.value=e[3]),(!a||64&i)&&(o.disabled=e[6]),(!a||32&i)&&(o.hidden=e[5]),(!a||16&i)&&(o.checked=e[4]),d&&d.p&&(!a||16384&i)&&fn(d,c,e,e[14],a?$n(c,e[14],i,null):yn(e[14]),null),(!a||128&i)&&Nn(r,"for",e[7]),(!a||4&i)&&Nn(r,"title",e[2]),(!a||2&i&&n!==(n=Xc(["PinturaRadioGroupOption",e[1]])))&&Nn(t,"class",n),(!a||32&i)&&Nn(t,"data-hidden",e[5]),(!a||64&i)&&Nn(t,"data-disabled",e[6]),(!a||16&i)&&Nn(t,"data-selected",e[4])},i(e){a||(Ea(d,e),a=!0)},o(e){Aa(d,e),a=!1},d(e){e&&Ln(t),d&&d.d(e),s=!1,an(l)}}}function tu(e,t,o){let i,r,{$$slots:n={},$$scope:a}=t,{name:s}=t,{class:l}=t,{label:c}=t,{id:d}=t,{value:u}=t,{checked:p}=t,{onkeydown:h}=t,{onclick:m}=t,{hidden:g=!1}=t,{disabled:$=!1}=t;const f=Object.values(Qd),y=ca("keysPressed");hn(e,y,(e=>o(17,r=e)));return e.$$set=e=>{"name"in e&&o(0,s=e.name),"class"in e&&o(1,l=e.class),"label"in e&&o(2,c=e.label),"id"in e&&o(11,d=e.id),"value"in e&&o(3,u=e.value),"checked"in e&&o(4,p=e.checked),"onkeydown"in e&&o(12,h=e.onkeydown),"onclick"in e&&o(13,m=e.onclick),"hidden"in e&&o(5,g=e.hidden),"disabled"in e&&o(6,$=e.disabled),"$$scope"in e&&o(14,a=e.$$scope)},e.$$.update=()=>{2049&e.$$.dirty&&o(7,i=`${s}-${d}`)},[s,l,c,u,p,g,$,i,y,e=>{h(e)},e=>{r.some((e=>f.includes(e)))||m(e)},d,h,m,a,n,function(t){da.call(this,e,t)}]}class ou extends Ga{constructor(e){super(),Ua(this,e,tu,eu,ln,{name:0,class:1,label:2,id:11,value:3,checked:4,onkeydown:12,onclick:13,hidden:5,disabled:6})}}var iu=(e=[])=>e.reduce(((e,t)=>(_o(t)?_o(t[1]):!!t.options)?e.concat(_o(t)?t[1]:t.options):(e.push(t),e)),[]);const ru=(e,t,o)=>{let i;return _o(e)?i={id:t,value:e[0],label:e[1],...e[2]||{}}:(i=e,i.id=null!=i.id?i.id:t),o?o(i):i};var nu=(e,t,o)=>R(e)?e(t,o):e;const au=(e,t)=>e.map((([e,o,i])=>{if(_o(o))return[nu(e,t),au(o,t)];{const r=[e,nu(o,t)];if(i){let e={...i};i.icon&&(e.icon=nu(i.icon,t)),r.push(e)}return r}}));var su=(e,t)=>au(e,t),lu=(e,t)=>Array.isArray(e)&&Array.isArray(t)?vs(e,t):e===t;function cu(e,t,o){const i=e.slice();return i[27]=t[o],i}const du=e=>({option:1024&e[0]}),uu=e=>({option:e[27]});function pu(e,t,o){const i=e.slice();return i[27]=t[o],i}const hu=e=>({option:1024&e[0]}),mu=e=>({option:e[27]}),gu=e=>({option:1024&e[0]}),$u=e=>({option:e[27]});function fu(e){let t,o,i,r,n,a=[],s=new Map,l=e[1]&&yu(e),c=e[10];const d=e=>e[27].id;for(let t=0;t<c.length;t+=1){let o=cu(e,c,t),i=d(o);s.set(i,a[t]=Iu(i,o))}return{c(){t=Fn("fieldset"),l&&l.c(),o=On(),i=Fn("ul");for(let e=0;e<a.length;e+=1)a[e].c();Nn(i,"class","PinturaRadioGroupOptions"),Nn(t,"class",r=Xc(["PinturaRadioGroup",e[3]])),Nn(t,"data-layout",e[5]),Nn(t,"title",e[7])},m(e,r){An(e,t,r),l&&l.m(t,null),Rn(t,o),Rn(t,i);for(let e=0;e<a.length;e+=1)a[e].m(i,null);n=!0},p(e,u){e[1]?l?l.p(e,u):(l=yu(e),l.c(),l.m(t,o)):l&&(l.d(1),l=null),8419153&u[0]&&(c=e[10],Ra(),a=Ba(a,u,d,1,e,c,s,i,Oa,Iu,null,cu),Ia()),(!n||8&u[0]&&r!==(r=Xc(["PinturaRadioGroup",e[3]])))&&Nn(t,"class",r),(!n||32&u[0])&&Nn(t,"data-layout",e[5]),(!n||128&u[0])&&Nn(t,"title",e[7])},i(e){if(!n){for(let e=0;e<c.length;e+=1)Ea(a[e]);n=!0}},o(e){for(let e=0;e<a.length;e+=1)Aa(a[e]);n=!1},d(e){e&&Ln(t),l&&l.d();for(let e=0;e<a.length;e+=1)a[e].d()}}}function yu(e){let t,o,i;return{c(){t=Fn("legend"),o=Dn(e[1]),Nn(t,"class",i=e[2]&&"implicit")},m(e,i){An(e,t,i),Rn(t,o)},p(e,r){2&r[0]&&Un(o,e[1]),4&r[0]&&i!==(i=e[2]&&"implicit")&&Nn(t,"class",i)},d(e){e&&Ln(t)}}}function bu(e){let t,o;return t=new ou({props:{name:e[4],label:e[27].label,id:e[27].id,value:e[27].value,disabled:e[27].disabled,hidden:e[27].hidden,class:e[8],checked:e[12](e[27])===e[0],onkeydown:e[13](e[27]),onclick:e[14](e[27]),$$slots:{default:[ku]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};16&o[0]&&(i.name=e[4]),1024&o[0]&&(i.label=e[27].label),1024&o[0]&&(i.id=e[27].id),1024&o[0]&&(i.value=e[27].value),1024&o[0]&&(i.disabled=e[27].disabled),1024&o[0]&&(i.hidden=e[27].hidden),256&o[0]&&(i.class=e[8]),1025&o[0]&&(i.checked=e[12](e[27])===e[0]),1024&o[0]&&(i.onkeydown=e[13](e[27])),1024&o[0]&&(i.onclick=e[14](e[27])),8389696&o[0]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function xu(e){let t,o,i,r,n,a,s=[],l=new Map;const c=e[22].group,d=mn(c,e,e[23],$u),u=d||function(e){let t,o,i=e[27].label+"";return{c(){t=Fn("span"),o=Dn(i),Nn(t,"class","PinturaRadioGroupOptionGroupLabel")},m(e,i){An(e,t,i),Rn(t,o)},p(e,t){1024&t[0]&&i!==(i=e[27].label+"")&&Un(o,i)},d(e){e&&Ln(t)}}}(e);let p=e[27].options;const h=e=>e[27].id;for(let t=0;t<p.length;t+=1){let o=pu(e,p,t),i=h(o);l.set(i,s[t]=Ru(i,o))}return{c(){t=Fn("li"),u&&u.c(),o=On(),i=Fn("ul");for(let e=0;e<s.length;e+=1)s[e].c();r=On(),Nn(i,"class","PinturaRadioGroupOptions"),Nn(t,"class",n=Xc(["PinturaRadioGroupOptionGroup",e[9]]))},m(e,n){An(e,t,n),u&&u.m(t,null),Rn(t,o),Rn(t,i);for(let e=0;e<s.length;e+=1)s[e].m(i,null);Rn(t,r),a=!0},p(e,o){d?d.p&&(!a||8389632&o[0])&&fn(d,c,e,e[23],a?$n(c,e[23],o,gu):yn(e[23]),$u):u&&u.p&&(!a||1024&o[0])&&u.p(e,a?o:[-1,-1]),8418641&o[0]&&(p=e[27].options,Ra(),s=Ba(s,o,h,1,e,p,l,i,Oa,Ru,null,pu),Ia()),(!a||512&o[0]&&n!==(n=Xc(["PinturaRadioGroupOptionGroup",e[9]])))&&Nn(t,"class",n)},i(e){if(!a){Ea(u,e);for(let e=0;e<p.length;e+=1)Ea(s[e]);a=!0}},o(e){Aa(u,e);for(let e=0;e<s.length;e+=1)Aa(s[e]);a=!1},d(e){e&&Ln(t),u&&u.d(e);for(let e=0;e<s.length;e+=1)s[e].d()}}}function vu(e){let t,o;return t=new Sd({props:{$$slots:{default:[wu]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};8389632&o[0]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function wu(e){let t,o=e[27].icon+"";return{c(){t=zn("g")},m(e,i){An(e,t,i),t.innerHTML=o},p(e,i){1024&i[0]&&o!==(o=e[27].icon+"")&&(t.innerHTML=o)},d(e){e&&Ln(t)}}}function Su(e){let t,o,i=e[27].label+"";return{c(){t=Fn("span"),o=Dn(i),Nn(t,"class",e[6])},m(e,i){An(e,t,i),Rn(t,o)},p(e,r){1024&r[0]&&i!==(i=e[27].label+"")&&Un(o,i),64&r[0]&&Nn(t,"class",e[6])},d(e){e&&Ln(t)}}}function ku(e){let t;const o=e[22].option,i=mn(o,e,e[23],uu),r=i||function(e){let t,o,i,r=e[27].icon&&vu(e),n=!e[27].hideLabel&&Su(e);return{c(){r&&r.c(),t=On(),n&&n.c(),o=On()},m(e,a){r&&r.m(e,a),An(e,t,a),n&&n.m(e,a),An(e,o,a),i=!0},p(e,i){e[27].icon?r?(r.p(e,i),1024&i[0]&&Ea(r,1)):(r=vu(e),r.c(),Ea(r,1),r.m(t.parentNode,t)):r&&(Ra(),Aa(r,1,1,(()=>{r=null})),Ia()),e[27].hideLabel?n&&(n.d(1),n=null):n?n.p(e,i):(n=Su(e),n.c(),n.m(o.parentNode,o))},i(e){i||(Ea(r),i=!0)},o(e){Aa(r),i=!1},d(e){r&&r.d(e),e&&Ln(t),n&&n.d(e),e&&Ln(o)}}}(e);return{c(){r&&r.c()},m(e,o){r&&r.m(e,o),t=!0},p(e,n){i?i.p&&(!t||8389632&n[0])&&fn(i,o,e,e[23],t?$n(o,e[23],n,du):yn(e[23]),uu):r&&r.p&&(!t||1088&n[0])&&r.p(e,t?n:[-1,-1])},i(e){t||(Ea(r,e),t=!0)},o(e){Aa(r,e),t=!1},d(e){r&&r.d(e)}}}function Cu(e){let t,o;return t=new Sd({props:{$$slots:{default:[Tu]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};8389632&o[0]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Tu(e){let t,o=e[27].icon+"";return{c(){t=zn("g")},m(e,i){An(e,t,i),t.innerHTML=o},p(e,i){1024&i[0]&&o!==(o=e[27].icon+"")&&(t.innerHTML=o)},d(e){e&&Ln(t)}}}function Mu(e){let t,o,i=e[27].label+"";return{c(){t=Fn("span"),o=Dn(i),Nn(t,"class",e[6])},m(e,i){An(e,t,i),Rn(t,o)},p(e,r){1024&r[0]&&i!==(i=e[27].label+"")&&Un(o,i),64&r[0]&&Nn(t,"class",e[6])},d(e){e&&Ln(t)}}}function Pu(e){let t;const o=e[22].option,i=mn(o,e,e[23],mu),r=i||function(e){let t,o,i,r=e[27].icon&&Cu(e),n=!e[27].hideLabel&&Mu(e);return{c(){r&&r.c(),t=On(),n&&n.c(),o=On()},m(e,a){r&&r.m(e,a),An(e,t,a),n&&n.m(e,a),An(e,o,a),i=!0},p(e,i){e[27].icon?r?(r.p(e,i),1024&i[0]&&Ea(r,1)):(r=Cu(e),r.c(),Ea(r,1),r.m(t.parentNode,t)):r&&(Ra(),Aa(r,1,1,(()=>{r=null})),Ia()),e[27].hideLabel?n&&(n.d(1),n=null):n?n.p(e,i):(n=Mu(e),n.c(),n.m(o.parentNode,o))},i(e){i||(Ea(r),i=!0)},o(e){Aa(r),i=!1},d(e){r&&r.d(e),e&&Ln(t),n&&n.d(e),e&&Ln(o)}}}(e);return{c(){r&&r.c()},m(e,o){r&&r.m(e,o),t=!0},p(e,n){i?i.p&&(!t||8389632&n[0])&&fn(i,o,e,e[23],t?$n(o,e[23],n,hu):yn(e[23]),mu):r&&r.p&&(!t||1088&n[0])&&r.p(e,t?n:[-1,-1])},i(e){t||(Ea(r,e),t=!0)},o(e){Aa(r,e),t=!1},d(e){r&&r.d(e)}}}function Ru(e,t){let o,i,r;return i=new ou({props:{name:t[4],label:t[27].label,id:t[27].id,value:t[27].value,disabled:t[27].disabled,hidden:t[27].hidden,class:t[8],checked:t[12](t[27])===t[0],onkeydown:t[13](t[27]),onclick:t[14](t[27]),$$slots:{default:[Pu]},$$scope:{ctx:t}}}),{key:e,first:null,c(){o=Bn(),Na(i.$$.fragment),this.first=o},m(e,t){An(e,o,t),Ha(i,e,t),r=!0},p(e,o){t=e;const r={};16&o[0]&&(r.name=t[4]),1024&o[0]&&(r.label=t[27].label),1024&o[0]&&(r.id=t[27].id),1024&o[0]&&(r.value=t[27].value),1024&o[0]&&(r.disabled=t[27].disabled),1024&o[0]&&(r.hidden=t[27].hidden),256&o[0]&&(r.class=t[8]),1025&o[0]&&(r.checked=t[12](t[27])===t[0]),1024&o[0]&&(r.onkeydown=t[13](t[27])),1024&o[0]&&(r.onclick=t[14](t[27])),8389696&o[0]&&(r.$$scope={dirty:o,ctx:t}),i.$set(r)},i(e){r||(Ea(i.$$.fragment,e),r=!0)},o(e){Aa(i.$$.fragment,e),r=!1},d(e){e&&Ln(o),ja(i,e)}}}function Iu(e,t){let o,i,r,n,a;const s=[xu,bu],l=[];function c(e,t){return e[27].options?0:1}return i=c(t),r=l[i]=s[i](t),{key:e,first:null,c(){o=Bn(),r.c(),n=Bn(),this.first=o},m(e,t){An(e,o,t),l[i].m(e,t),An(e,n,t),a=!0},p(e,o){let a=i;i=c(t=e),i===a?l[i].p(t,o):(Ra(),Aa(l[a],1,1,(()=>{l[a]=null})),Ia(),r=l[i],r?r.p(t,o):(r=l[i]=s[i](t),r.c()),Ea(r,1),r.m(n.parentNode,n))},i(e){a||(Ea(r),a=!0)},o(e){Aa(r),a=!1},d(e){e&&Ln(o),l[i].d(e),e&&Ln(n)}}}function Eu(e){let t,o,i,r=e[11].length&&fu(e);return{c(){r&&r.c(),t=On(),o=Bn()},m(e,n){r&&r.m(e,n),An(e,t,n),An(e,o,n),i=!0},p(e,o){e[11].length?r?(r.p(e,o),2048&o[0]&&Ea(r,1)):(r=fu(e),r.c(),Ea(r,1),r.m(t.parentNode,t)):r&&(Ra(),Aa(r,1,1,(()=>{r=null})),Ia())},i(e){i||(Ea(r),Ea(false),i=!0)},o(e){Aa(r),Aa(false),i=!1},d(e){r&&r.d(e),e&&Ln(t),e&&Ln(o)}}}function Au(e,t,o){let i,r,n,{$$slots:a={},$$scope:s}=t;const l=sa();let{label:c}=t,{hideLabel:d=!0}=t,{class:u}=t,{name:p="radio-group-"+L()}=t,{selectedIndex:h=-1}=t,{options:m=[]}=t,{onchange:g}=t,{layout:$}=t,{optionMapper:f}=t,{optionFilter:y}=t,{value:b}=t,{optionLabelClass:x}=t,{title:v}=t,{locale:w}=t,{optionClass:S}=t,{optionGroupClass:k}=t;const C=e=>n.findIndex((t=>t.id===e.id)),T=(e,t)=>{o(0,h=C(e));const i={index:h,...e};((e,...t)=>{e&&e(...t)})(g,i,t),l("change",i)};return e.$$set=e=>{"label"in e&&o(1,c=e.label),"hideLabel"in e&&o(2,d=e.hideLabel),"class"in e&&o(3,u=e.class),"name"in e&&o(4,p=e.name),"selectedIndex"in e&&o(0,h=e.selectedIndex),"options"in e&&o(15,m=e.options),"onchange"in e&&o(16,g=e.onchange),"layout"in e&&o(5,$=e.layout),"optionMapper"in e&&o(17,f=e.optionMapper),"optionFilter"in e&&o(18,y=e.optionFilter),"value"in e&&o(19,b=e.value),"optionLabelClass"in e&&o(6,x=e.optionLabelClass),"title"in e&&o(7,v=e.title),"locale"in e&&o(20,w=e.locale),"optionClass"in e&&o(8,S=e.optionClass),"optionGroupClass"in e&&o(9,k=e.optionGroupClass),"$$scope"in e&&o(23,s=e.$$scope)},e.$$.update=()=>{1343488&e.$$.dirty[0]&&o(11,i=su(y?m.filter(y):m,w)),133120&e.$$.dirty[0]&&o(10,r=((e=[],t)=>{let o=0;return e.map((e=>(o++,_o(e)?_o(e[1])?{id:o,label:e[0],options:e[1].map((e=>ru(e,++o,t)))}:ru(e,o,t):e.options?{id:e.id||o,label:e.label,options:e.options.map((e=>ru(e,++o,t)))}:ru(e,o,t))))})(i,f)),1024&e.$$.dirty[0]&&o(21,n=iu(r)),2654209&e.$$.dirty[0]&&h<0&&(o(0,h=n.findIndex((e=>lu(e.value,b)))),h<0&&o(0,h=(e=>e.findIndex((e=>void 0===e[0])))(m)))},[h,c,d,u,p,$,x,v,S,k,r,i,C,e=>t=>{var o;(o=t.key,/enter| /i.test(o))&&T(e,t)},e=>t=>{T(e,t)},m,g,f,y,b,w,n,a,s]}class Lu extends Ga{constructor(e){super(),Ua(this,e,Au,Eu,ln,{label:1,hideLabel:2,class:3,name:4,selectedIndex:0,options:15,onchange:16,layout:5,optionMapper:17,optionFilter:18,value:19,optionLabelClass:6,title:7,locale:20,optionClass:8,optionGroupClass:9},null,[-1,-1])}}function Fu(e){let t,o,i,r,n,a,s,l,c,d;return{c(){t=Fn("div"),o=Fn("button"),i=Dn("▲"),n=On(),a=Fn("button"),s=Dn("▼"),Nn(o,"type","button"),Nn(o,"tabindex","-1"),Nn(o,"aria-label",r="increase "+e[7]),Nn(a,"type","button"),Nn(a,"tabindex","-1"),Nn(a,"aria-label",l="decrease "+e[7]),Nn(t,"class","PinturaInputSpinners")},m(r,l){An(r,t,l),Rn(t,o),Rn(o,i),Rn(t,n),Rn(t,a),Rn(a,s),c||(d=[Wn(o,"click",e[18]),Wn(a,"click",e[19])],c=!0)},p(e,t){128&t[0]&&r!==(r="increase "+e[7])&&Nn(o,"aria-label",r),128&t[0]&&l!==(l="decrease "+e[7])&&Nn(a,"aria-label",l)},d(e){e&&Ln(t),c=!1,an(d)}}}function zu(e){let t,o,i,r,n,a,s=e[14]&&e[9]&&Fu(e);return{c(){t=Fn("div"),o=Fn("input"),r=On(),s&&s.c(),Nn(o,"class","PinturaInputField"),Nn(o,"title",e[7]),Nn(o,"type",e[1]),Nn(o,"min",e[4]),Nn(o,"max",e[5]),Nn(o,"step",e[6]),Nn(o,"inputmode",e[3]),o.value=i=e[12]?e[15]:e[0],Nn(o,"placeholder",e[8]),Nn(o,"maxlength",e[13]),o.disabled=e[2],Nn(o,"spellcheck","false"),Nn(o,"autocorrect","off"),Nn(o,"autocapitalize","off"),Zn(o,"min-width",e[11]?e[11]+"em":void 0),Nn(t,"class","PinturaInput")},m(i,l){An(i,t,l),Rn(t,o),e[30](o),Rn(t,r),s&&s.m(t,null),n||(a=[Wn(o,"input",e[17]),Wn(o,"blur",(function(){sn(e[12]&&e[16])&&(e[12]&&e[16]).apply(this,arguments)})),Wn(o,"keydown",e[20]),Wn(o,"keyup",e[21])],n=!0)},p(r,n){e=r,128&n[0]&&Nn(o,"title",e[7]),2&n[0]&&Nn(o,"type",e[1]),16&n[0]&&Nn(o,"min",e[4]),32&n[0]&&Nn(o,"max",e[5]),64&n[0]&&Nn(o,"step",e[6]),8&n[0]&&Nn(o,"inputmode",e[3]),36865&n[0]&&i!==(i=e[12]?e[15]:e[0])&&o.value!==i&&(o.value=i),256&n[0]&&Nn(o,"placeholder",e[8]),8192&n[0]&&Nn(o,"maxlength",e[13]),4&n[0]&&(o.disabled=e[2]),2048&n[0]&&Zn(o,"min-width",e[11]?e[11]+"em":void 0),e[14]&&e[9]?s?s.p(e,n):(s=Fu(e),s.c(),s.m(t,null)):s&&(s.d(1),s=null)},i:en,o:en,d(o){o&&Ln(t),e[30](null),s&&s.d(),n=!1,an(a)}}}function Du(e,t,o){let i,r,a,s,l,c,d,u,p,{value:h}=t,{type:m="text"}=t,{disabled:g=!1}=t,{inputmode:$}=t,{min:f}=t,{max:y}=t,{step:b}=t,{onchange:x=n}=t,{onkeydown:v=n}=t,{onkeyup:w=n}=t,{title:S}=t,{stepMultiplier:k=10}=t,{placeholder:C}=t,{enableSpinButtons:T=!0}=t,{enableStopPropagation:M=!1}=t;const P=()=>{let e=u.value;return"number"===m&&(e="numeric"===$?parseInt(e,10):parseFloat(e),!Oo(e)||Number.isNaN(e)?e=f||0:r&&(e=$s(e,f,y))),e};let R=h;const I=()=>{const e=$s(P()+(p?b*k:b),f,y);e!==h&&(o(27,R=e),o(0,h=e),x(h))},E=()=>{const e=$s(P()-(p?b*k:b),f,y);e!==h&&(o(27,R=e),o(0,h=e),x(h))};return e.$$set=e=>{"value"in e&&o(0,h=e.value),"type"in e&&o(1,m=e.type),"disabled"in e&&o(2,g=e.disabled),"inputmode"in e&&o(3,$=e.inputmode),"min"in e&&o(4,f=e.min),"max"in e&&o(5,y=e.max),"step"in e&&o(6,b=e.step),"onchange"in e&&o(22,x=e.onchange),"onkeydown"in e&&o(23,v=e.onkeydown),"onkeyup"in e&&o(24,w=e.onkeyup),"title"in e&&o(7,S=e.title),"stepMultiplier"in e&&o(25,k=e.stepMultiplier),"placeholder"in e&&o(8,C=e.placeholder),"enableSpinButtons"in e&&o(9,T=e.enableSpinButtons),"enableStopPropagation"in e&&o(26,M=e.enableStopPropagation)},e.$$.update=()=>{2&e.$$.dirty[0]&&o(29,i="number"===m),48&e.$$.dirty[0]&&o(12,r=Oo(f)&&Oo(y)),64&e.$$.dirty[0]&&o(28,a=Oo(b)),805310464&e.$$.dirty[0]&&o(14,s=i&&r&&a),134218753&e.$$.dirty[0]&&o(15,l=u===document.activeElement?R:h),32&e.$$.dirty[0]&&o(11,c=y?(y+"").length:void 0),2056&e.$$.dirty[0]&&o(13,d="numeric"===$&&c?c:void 0)},[h,m,g,$,f,y,b,S,C,T,u,c,r,d,s,l,()=>{o(27,R=P()),x(h)},()=>{o(27,R=u.value),x(P())},I,E,e=>{if(v(e),!s)return;p=e.shiftKey;const{key:t}=e;M&&e.stopPropagation(),/up|down/i.test(t)&&(/up/i.test(t)&&I(),/down/i.test(t)&&E(),e.preventDefault(),e.stopPropagation())},e=>{if(w(e),!s)return;const{key:t}=e;/up|down/i.test(t)&&(e.preventDefault(),e.stopPropagation())},x,v,w,k,M,R,a,i,function(e){pa[e?"unshift":"push"]((()=>{u=e,o(10,u)}))}]}class Ou extends Ga{constructor(e){super(),Ua(this,e,Du,zu,ln,{value:0,type:1,disabled:2,inputmode:3,min:4,max:5,step:6,onchange:22,onkeydown:23,onkeyup:24,title:7,stepMultiplier:25,placeholder:8,enableSpinButtons:9,enableStopPropagation:26},null,[-1,-1])}}const Bu=e=>({}),Wu=e=>({});function _u(e){let t,o,i,r,n=(e[2]||e[20])+"",a=e[6]&&Nu(e);return{c(){a&&a.c(),t=On(),o=Fn("span"),Nn(o,"class",i=Xc(["PinturaButtonLabel",e[3],e[5]&&"implicit"]))},m(e,i){a&&a.m(e,i),An(e,t,i),An(e,o,i),o.innerHTML=n,r=!0},p(e,s){e[6]?a?(a.p(e,s),64&s[0]&&Ea(a,1)):(a=Nu(e),a.c(),Ea(a,1),a.m(t.parentNode,t)):a&&(Ra(),Aa(a,1,1,(()=>{a=null})),Ia()),(!r||1048580&s[0])&&n!==(n=(e[2]||e[20])+"")&&(o.innerHTML=n),(!r||40&s[0]&&i!==(i=Xc(["PinturaButtonLabel",e[3],e[5]&&"implicit"])))&&Nn(o,"class",i)},i(e){r||(Ea(a),r=!0)},o(e){Aa(a),r=!1},d(e){a&&a.d(e),e&&Ln(t),e&&Ln(o)}}}function Vu(e){let t,o;return t=new Ou({props:{value:e[10],onchange:e[16],enableStopPropagation:!0,type:"number",inputmode:"numeric",min:e[8].reduce(Qu,1/0),max:e[8].reduce(ep,-1/0),enableSpinButtons:!1}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};1024&o[0]&&(i.value=e[10]),65536&o[0]&&(i.onchange=e[16]),256&o[0]&&(i.min=e[8].reduce(Qu,1/0)),256&o[0]&&(i.max=e[8].reduce(ep,-1/0)),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Nu(e){let t,o;return t=new Sd({props:{class:"PinturaButtonIcon",$$slots:{default:[Hu]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};536870976&o[0]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Hu(e){let t;return{c(){t=zn("g")},m(o,i){An(o,t,i),t.innerHTML=e[6]},p(e,o){64&o[0]&&(t.innerHTML=e[6])},d(e){e&&Ln(t)}}}function ju(e){let t,o,i,r,n;const a=[Vu,_u],s=[];function l(e,t){return e[17]?0:1}return o=l(e),i=s[o]=a[o](e),{c(){t=Fn("span"),i.c(),Nn(t,"slot","label"),Nn(t,"class",r=Xc(["PinturaButtonInner",e[17]&&"PinturaComboBox",e[4]]))},m(e,i){An(e,t,i),s[o].m(t,null),n=!0},p(e,c){let d=o;o=l(e),o===d?s[o].p(e,c):(Ra(),Aa(s[d],1,1,(()=>{s[d]=null})),Ia(),i=s[o],i?i.p(e,c):(i=s[o]=a[o](e),i.c()),Ea(i,1),i.m(t,null)),(!n||131088&c[0]&&r!==(r=Xc(["PinturaButtonInner",e[17]&&"PinturaComboBox",e[4]])))&&Nn(t,"class",r)},i(e){n||(Ea(i),n=!0)},o(e){Aa(i),n=!1},d(e){e&&Ln(t),s[o].d()}}}function Uu(e){let t,o,i=e[31].label+"";return{c(){t=Fn("span"),o=Dn(i),Nn(t,"slot","group")},m(e,i){An(e,t,i),Rn(t,o)},p(e,t){1&t[1]&&i!==(i=e[31].label+"")&&Un(o,i)},d(e){e&&Ln(t)}}}function Gu(e){let t,o;return t=new Sd({props:{style:R(e[14])?e[14](e[31].value):e[14],$$slots:{default:[Zu]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};16384&o[0]|1&o[1]&&(i.style=R(e[14])?e[14](e[31].value):e[14]),536870912&o[0]|1&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Zu(e){let t,o=e[31].icon+"";return{c(){t=zn("g")},m(e,i){An(e,t,i),t.innerHTML=o},p(e,i){1&i[1]&&o!==(o=e[31].icon+"")&&(t.innerHTML=o)},d(e){e&&Ln(t)}}}function Xu(e){let t,o,i,r,n,a,s,l=e[31].label+"",c=e[31].sublabel&&Yu(e);return{c(){t=Fn("span"),o=new Yn(!1),i=On(),c&&c.c(),o.a=i,Nn(t,"class",r=Xc(["PinturaDropdownOptionLabel",e[11]]))},m(r,d){An(r,t,d),o.m(l,t),Rn(t,i),c&&c.m(t,null),a||(s=wn(n=id.call(null,t,R(e[15])?e[15](e[31].value):e[15])),a=!0)},p(e,i){1&i[1]&&l!==(l=e[31].label+"")&&o.p(l),e[31].sublabel?c?c.p(e,i):(c=Yu(e),c.c(),c.m(t,null)):c&&(c.d(1),c=null),2048&i[0]&&r!==(r=Xc(["PinturaDropdownOptionLabel",e[11]]))&&Nn(t,"class",r),n&&sn(n.update)&&32768&i[0]|1&i[1]&&n.update.call(null,R(e[15])?e[15](e[31].value):e[15])},d(e){e&&Ln(t),c&&c.d(),a=!1,s()}}}function Yu(e){let t,o=e[31].sublabel+"";return{c(){t=Fn("span"),Nn(t,"class","PinturaDropdownOptionSublabel")},m(e,i){An(e,t,i),t.innerHTML=o},p(e,i){1&i[1]&&o!==(o=e[31].sublabel+"")&&(t.innerHTML=o)},d(e){e&&Ln(t)}}}function qu(e){let t,o,i,r=e[31].icon&&Gu(e),n=!e[31].hideLabel&&Xu(e);return{c(){t=Fn("span"),r&&r.c(),o=On(),n&&n.c(),Nn(t,"slot","option")},m(e,a){An(e,t,a),r&&r.m(t,null),Rn(t,o),n&&n.m(t,null),i=!0},p(e,i){e[31].icon?r?(r.p(e,i),1&i[1]&&Ea(r,1)):(r=Gu(e),r.c(),Ea(r,1),r.m(t,o)):r&&(Ra(),Aa(r,1,1,(()=>{r=null})),Ia()),e[31].hideLabel?n&&(n.d(1),n=null):n?n.p(e,i):(n=Xu(e),n.c(),n.m(t,null))},i(e){i||(Ea(r),i=!0)},o(e){Aa(r),i=!1},d(e){e&&Ln(t),r&&r.d(),n&&n.d()}}}function Ku(e){let t,o,i,r,n,a;const s=e[27].controls,l=mn(s,e,e[29],Wu);return i=new Lu({props:{class:"PinturaOptionsList PinturaScrollableContent",name:e[7],value:e[10],selectedIndex:e[9],optionFilter:e[12],optionMapper:e[13],optionLabelClass:Xc(["PinturaDropdownOptionLabel",e[11]]),optionGroupClass:"PinturaListOptionGroup",optionClass:"PinturaListOption",options:e[18],onchange:e[21],$$slots:{option:[qu,({option:e})=>({31:e}),({option:e})=>[0,e?1:0]],group:[Uu,({option:e})=>({31:e}),({option:e})=>[0,e?1:0]]},$$scope:{ctx:e}}}),{c(){t=Fn("div"),l&&l.c(),o=On(),Na(i.$$.fragment),Nn(t,"slot","details"),Nn(t,"class","PinturaOptionsListWrapper")},m(s,c){An(s,t,c),l&&l.m(t,null),Rn(t,o),Ha(i,t,null),r=!0,n||(a=Wn(t,"keydown",e[23]),n=!0)},p(e,t){l&&l.p&&(!r||536870912&t[0])&&fn(l,s,e,e[29],r?$n(s,e[29],t,Bu):yn(e[29]),Wu);const o={};128&t[0]&&(o.name=e[7]),1024&t[0]&&(o.value=e[10]),512&t[0]&&(o.selectedIndex=e[9]),4096&t[0]&&(o.optionFilter=e[12]),8192&t[0]&&(o.optionMapper=e[13]),2048&t[0]&&(o.optionLabelClass=Xc(["PinturaDropdownOptionLabel",e[11]])),262144&t[0]&&(o.options=e[18]),536922112&t[0]|1&t[1]&&(o.$$scope={dirty:t,ctx:e}),i.$set(o)},i(e){r||(Ea(l,e),Ea(i.$$.fragment,e),r=!0)},o(e){Aa(l,e),Aa(i.$$.fragment,e),r=!1},d(e){e&&Ln(t),l&&l.d(e),ja(i),n=!1,a()}}}function Ju(e){let t,o,i;function r(t){e[28](t)}let n={onshow:e[22],buttonTitle:Cd(e[2],e[1]),buttonClass:Xc(["PinturaDropdownButton",e[0],e[5]&&"PinturaDropdownIconOnly"]),$$slots:{details:[Ku],label:[ju]},$$scope:{ctx:e}};return void 0!==e[19]&&(n.isActive=e[19]),t=new Jd({props:n}),pa.push((()=>Va(t,"isActive",r))),{c(){Na(t.$$.fragment)},m(e,o){Ha(t,e,o),i=!0},p(e,i){const r={};6&i[0]&&(r.buttonTitle=Cd(e[2],e[1])),33&i[0]&&(r.buttonClass=Xc(["PinturaDropdownButton",e[0],e[5]&&"PinturaDropdownIconOnly"])),538443772&i[0]&&(r.$$scope={dirty:i,ctx:e}),!o&&524288&i[0]&&(o=!0,r.isActive=e[19],xa((()=>o=!1))),t.$set(r)},i(e){i||(Ea(t.$$.fragment,e),i=!0)},o(e){Aa(t.$$.fragment,e),i=!1},d(e){ja(t,e)}}}const Qu=(e,[t])=>t<e?t:e,ep=(e,[t])=>t>e?t:e;function tp(e,t,o){let i,r,{$$slots:a={},$$scope:s}=t,{class:l}=t,{title:c}=t,{label:d}=t,{labelClass:u}=t,{innerClass:p}=t,{hideLabel:h=!1}=t,{icon:m}=t,{name:g}=t,{options:$=[]}=t,{selectedIndex:f=-1}=t,{value:y}=t,{optionLabelClass:b}=t,{optionFilter:x}=t,{optionMapper:v}=t,{optionIconStyle:w}=t,{optionLabelStyle:S}=t,{locale:k}=t,{onchange:C=n}=t,{onload:T=n}=t,{ondestroy:M=n}=t,{enableInput:P=!1}=t;let R;return ra((()=>T({options:$}))),aa((()=>M({options:$}))),e.$$set=e=>{"class"in e&&o(0,l=e.class),"title"in e&&o(1,c=e.title),"label"in e&&o(2,d=e.label),"labelClass"in e&&o(3,u=e.labelClass),"innerClass"in e&&o(4,p=e.innerClass),"hideLabel"in e&&o(5,h=e.hideLabel),"icon"in e&&o(6,m=e.icon),"name"in e&&o(7,g=e.name),"options"in e&&o(8,$=e.options),"selectedIndex"in e&&o(9,f=e.selectedIndex),"value"in e&&o(10,y=e.value),"optionLabelClass"in e&&o(11,b=e.optionLabelClass),"optionFilter"in e&&o(12,x=e.optionFilter),"optionMapper"in e&&o(13,v=e.optionMapper),"optionIconStyle"in e&&o(14,w=e.optionIconStyle),"optionLabelStyle"in e&&o(15,S=e.optionLabelStyle),"locale"in e&&o(24,k=e.locale),"onchange"in e&&o(16,C=e.onchange),"onload"in e&&o(25,T=e.onload),"ondestroy"in e&&o(26,M=e.ondestroy),"enableInput"in e&&o(17,P=e.enableInput),"$$scope"in e&&o(29,s=e.$$scope)},e.$$.update=()=>{16777472&e.$$.dirty[0]&&o(18,i=k?su($,k):$),263168&e.$$.dirty[0]&&o(20,r=i.reduce(((e,t)=>{if(e)return e;const o=Array.isArray(t)?t:[t,t],[i,r]=o;return lu(i,y)?r:void 0}),void 0)||(e=>{const t=e.find((e=>void 0===e[0]));if(t)return t[1]})(i)||y)},[l,c,d,u,p,h,m,g,$,f,y,b,x,v,w,S,C,P,i,R,r,e=>{o(20,r=e.value),C(e),o(19,R=!1)},({e:e,panel:t})=>{if(e&&e.key&&/up|down/i.test(e.key))return Bd(t.querySelector("input:not([disabled])"));Bd(t.querySelector("fieldset"))},e=>{/tab/i.test(e.key)&&e.preventDefault()},k,T,M,a,function(e){R=e,o(19,R)},s]}class op extends Ga{constructor(e){super(),Ua(this,e,tp,Ju,ln,{class:0,title:1,label:2,labelClass:3,innerClass:4,hideLabel:5,icon:6,name:7,options:8,selectedIndex:9,value:10,optionLabelClass:11,optionFilter:12,optionMapper:13,optionIconStyle:14,optionLabelStyle:15,locale:24,onchange:16,onload:25,ondestroy:26,enableInput:17},null,[-1,-1])}}function ip(e){let t;return{c(){t=Fn("div"),Nn(t,"slot","details")},m(o,i){An(o,t,i),e[14](t)},p:en,d(o){o&&Ln(t),e[14](null)}}}function rp(e){let t,o,i;function r(t){e[15](t)}let n={buttonLabel:e[0],buttonClass:e[1],buttonIcon:e[2],buttonHideLabel:e[3],buttonTitle:e[4],buttonLabelClass:e[5],onshow:e[6],onhide:e[7],$$slots:{details:[ip]},$$scope:{ctx:e}};return void 0!==e[9]&&(n.isActive=e[9]),t=new Jd({props:n}),pa.push((()=>Va(t,"isActive",r))),{c(){Na(t.$$.fragment)},m(e,o){Ha(t,e,o),i=!0},p(e,[i]){const r={};1&i&&(r.buttonLabel=e[0]),2&i&&(r.buttonClass=e[1]),4&i&&(r.buttonIcon=e[2]),8&i&&(r.buttonHideLabel=e[3]),16&i&&(r.buttonTitle=e[4]),32&i&&(r.buttonLabelClass=e[5]),64&i&&(r.onshow=e[6]),128&i&&(r.onhide=e[7]),65792&i&&(r.$$scope={dirty:i,ctx:e}),!o&&512&i&&(o=!0,r.isActive=e[9],xa((()=>o=!1))),t.$set(r)},i(e){i||(Ea(t.$$.fragment,e),i=!0)},o(e){Aa(t.$$.fragment,e),i=!1},d(e){ja(t,e)}}}function np(e,t,o){let{buttonLabel:i}=t,{buttonClass:r}=t,{buttonIcon:a}=t,{buttonHideLabel:s}=t,{buttonTitle:l}=t,{buttonLabelClass:c}=t,{root:d}=t,{ondestroy:u=n}=t,{onshow:p=n}=t,{onhide:h=n}=t;let m,g=!1;return aa(u),e.$$set=e=>{"buttonLabel"in e&&o(0,i=e.buttonLabel),"buttonClass"in e&&o(1,r=e.buttonClass),"buttonIcon"in e&&o(2,a=e.buttonIcon),"buttonHideLabel"in e&&o(3,s=e.buttonHideLabel),"buttonTitle"in e&&o(4,l=e.buttonTitle),"buttonLabelClass"in e&&o(5,c=e.buttonLabelClass),"root"in e&&o(10,d=e.root),"ondestroy"in e&&o(11,u=e.ondestroy),"onshow"in e&&o(6,p=e.onshow),"onhide"in e&&o(7,h=e.onhide)},e.$$.update=()=>{1280&e.$$.dirty&&m&&d&&m.firstChild!==d&&(m.hasChildNodes()?m.replaceChild(d,m.firstChild):m.append(d))},[i,r,a,s,l,c,p,h,m,g,d,u,()=>o(9,g=!1),()=>o(9,g=!0),function(e){pa[e?"unshift":"push"]((()=>{m=e,o(8,m)}))},function(e){g=e,o(9,g)}]}class ap extends Ga{constructor(e){super(),Ua(this,e,np,rp,ln,{buttonLabel:0,buttonClass:1,buttonIcon:2,buttonHideLabel:3,buttonTitle:4,buttonLabelClass:5,root:10,ondestroy:11,onshow:6,onhide:7,hide:12,show:13})}get hide(){return this.$$.ctx[12]}get show(){return this.$$.ctx[13]}}var sp=(e,t={})=>{const{direction:o,shiftMultiplier:i=10,bubbles:r=!1,preventDefault:n=!1,stopKeydownPropagation:a=!0}=t,s="horizontal"===o,l="vertical"===o,c=t=>{const{key:o}=t,c=t.shiftKey,d=/up|down/i.test(o),u=/left|right/i.test(o);if(!u&&!d)return;if(s&&d)return;if(l&&u)return;const p=c?i:1;a&&t.stopPropagation(),n&&t.preventDefault(),e.dispatchEvent(new CustomEvent("nudge",{bubbles:r,detail:me((/left/i.test(o)?-1:/right/i.test(o)?1:0)*p,(/up/i.test(o)?-1:/down/i.test(o)?1:0)*p)}))};return e.addEventListener("keydown",c),{destroy(){e.removeEventListener("keydown",c)}}},lp=(e,t,o)=>(e-t)/(o-t);const cp=e=>({}),dp=e=>({});function up(e){let t,o,i,r,n,a,s,l;return o=new Sd({props:{$$slots:{default:[pp]},$$scope:{ctx:e}}}),n=new Sd({props:{$$slots:{default:[hp]},$$scope:{ctx:e}}}),{c(){t=Fn("button"),Na(o.$$.fragment),i=On(),r=Fn("button"),Na(n.$$.fragment),Nn(t,"type","button"),Nn(t,"aria-label","Increase"),Nn(r,"type","button"),Nn(r,"aria-label","Decrease")},m(c,d){An(c,t,d),Ha(o,t,null),An(c,i,d),An(c,r,d),Ha(n,r,null),a=!0,s||(l=[Wn(t,"pointerdown",e[18](1)),Wn(r,"pointerdown",e[18](-1))],s=!0)},p(e,t){const i={};32&t[1]&&(i.$$scope={dirty:t,ctx:e}),o.$set(i);const r={};32&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){a||(Ea(o.$$.fragment,e),Ea(n.$$.fragment,e),a=!0)},o(e){Aa(o.$$.fragment,e),Aa(n.$$.fragment,e),a=!1},d(e){e&&Ln(t),ja(o),e&&Ln(i),e&&Ln(r),ja(n),s=!1,an(l)}}}function pp(e){let t;return{c(){t=zn("path"),Nn(t,"d","M8 12 h8 M12 8 v8")},m(e,o){An(e,t,o)},p:en,d(e){e&&Ln(t)}}}function hp(e){let t;return{c(){t=zn("path"),Nn(t,"d","M9 12 h6")},m(e,o){An(e,t,o)},p:en,d(e){e&&Ln(t)}}}function mp(e){let t,o,i,r,n,a,s,l,c,d,u,p,h,m,g;const $=e[34].default,f=mn($,e,e[36],null),y=e[34].knob,b=mn(y,e,e[36],dp);let x=e[7]&&up(e);return{c(){t=Fn("div"),o=Fn("div"),i=Fn("input"),r=On(),n=Fn("div"),f&&f.c(),s=On(),l=Fn("div"),c=Fn("div"),b&&b.c(),u=On(),x&&x.c(),Nn(i,"type","range"),Nn(i,"id",e[3]),Nn(i,"min",e[0]),Nn(i,"max",e[1]),Nn(i,"step",e[2]),i.value=e[12],Zn(i,"pointer-events",e[8]?"none":void 0),Nn(n,"class",a=Xc(["PinturaSliderTrack",e[4]])),Nn(c,"class",d=Xc(["PinturaSliderKnob",e[5]])),Nn(l,"class","PinturaSliderKnobController"),Zn(l,"transform",e[15]),Nn(o,"class","PinturaSliderControl"),Zn(o,"--slider-position",Math.round(e[13])),Nn(t,"class",p=Xc(["PinturaSlider",e[10]])),Nn(t,"data-direction",e[6])},m(a,d){An(a,t,d),Rn(t,o),Rn(o,i),e[35](i),Rn(o,r),Rn(o,n),f&&f.m(n,null),Rn(o,s),Rn(o,l),Rn(l,c),b&&b.m(c,null),Rn(t,u),x&&x.m(t,null),h=!0,m||(g=[Wn(i,"input",e[16]),Wn(i,"nudge",e[17]),wn(sp.call(null,i)),Wn(o,"pointerdown",(function(){sn(e[9]&&e[11])&&(e[9]&&e[11]).apply(this,arguments)}))],m=!0)},p(r,s){e=r,(!h||8&s[0])&&Nn(i,"id",e[3]),(!h||1&s[0])&&Nn(i,"min",e[0]),(!h||2&s[0])&&Nn(i,"max",e[1]),(!h||4&s[0])&&Nn(i,"step",e[2]),(!h||4096&s[0])&&(i.value=e[12]),256&s[0]&&Zn(i,"pointer-events",e[8]?"none":void 0),f&&f.p&&(!h||32&s[1])&&fn(f,$,e,e[36],h?$n($,e[36],s,null):yn(e[36]),null),(!h||16&s[0]&&a!==(a=Xc(["PinturaSliderTrack",e[4]])))&&Nn(n,"class",a),b&&b.p&&(!h||32&s[1])&&fn(b,y,e,e[36],h?$n(y,e[36],s,cp):yn(e[36]),dp),(!h||32&s[0]&&d!==(d=Xc(["PinturaSliderKnob",e[5]])))&&Nn(c,"class",d),32768&s[0]&&Zn(l,"transform",e[15]),8192&s[0]&&Zn(o,"--slider-position",Math.round(e[13])),e[7]?x?(x.p(e,s),128&s[0]&&Ea(x,1)):(x=up(e),x.c(),Ea(x,1),x.m(t,null)):x&&(Ra(),Aa(x,1,1,(()=>{x=null})),Ia()),(!h||1024&s[0]&&p!==(p=Xc(["PinturaSlider",e[10]])))&&Nn(t,"class",p),(!h||64&s[0])&&Nn(t,"data-direction",e[6])},i(e){h||(Ea(f,e),Ea(b,e),Ea(x),h=!0)},o(e){Aa(f,e),Aa(b,e),Aa(x),h=!1},d(o){o&&Ln(t),e[35](null),f&&f.d(o),b&&b.d(o),x&&x.d(),m=!1,an(g)}}}function gp(e,t,o){let i,r,a,s,l,c,d,u,p,h,g,$,f,y,b,{$$slots:x={},$$scope:v}=t,{min:w=0}=t,{max:S=100}=t,{step:k=1}=t,{id:C}=t,{value:T=0}=t,{valueMin:M}=t,{valueMax:P}=t,{trackClass:R}=t,{knobClass:I}=t,{ongrab:E=n}=t,{onchange:A=n}=t,{onrelease:L=n}=t,{onexceed:F=n}=t,{direction:z="x"}=t,{getValue:D=Y}=t,{setValue:O=Y}=t,{enableSpinButtons:B=!0}=t,{enableForceUseKnob:W=!1}=t,{enableStopPropagation:_=!0}=t,{enablePointerdownListener:V=!0}=t,{maxInteractionDistance:N=6}=t,{class:H}=t;const j=e=>O(((e,t)=>(t=1/t,Math.round(e*t)/t))($s(e,w,S),k),T),U=(e,t,i={})=>{const{grabbed:n=!1,released:a=!1}=i,s=j(w+e/t*r),l=M||w,c=P||S;o(19,T=m(s)?s:$s(s,l,c)),b!==s&&(b=s,!m(s)&&(s<l||s>c)&&F(T,s),T!==y&&(y=T,n&&E(T),A(T),a&&L(T)))};let G;let Z;const X=e=>{const t=e[u]-f;U($+t,g)},q=e=>{Z=setTimeout((()=>{g=void 0}),50),document.documentElement.removeEventListener("pointermove",X),document.documentElement.removeEventListener("pointerup",q),A(T),L(T)},K=()=>{o(19,T=j(i+Q*k)),A(T)};let J,Q=1,ee=!1;const te=e=>{clearTimeout(J),ee||K(),L(T),document.removeEventListener("pointerup",te)};return e.$$set=e=>{"min"in e&&o(0,w=e.min),"max"in e&&o(1,S=e.max),"step"in e&&o(2,k=e.step),"id"in e&&o(3,C=e.id),"value"in e&&o(19,T=e.value),"valueMin"in e&&o(20,M=e.valueMin),"valueMax"in e&&o(21,P=e.valueMax),"trackClass"in e&&o(4,R=e.trackClass),"knobClass"in e&&o(5,I=e.knobClass),"ongrab"in e&&o(22,E=e.ongrab),"onchange"in e&&o(23,A=e.onchange),"onrelease"in e&&o(24,L=e.onrelease),"onexceed"in e&&o(25,F=e.onexceed),"direction"in e&&o(6,z=e.direction),"getValue"in e&&o(26,D=e.getValue),"setValue"in e&&o(27,O=e.setValue),"enableSpinButtons"in e&&o(7,B=e.enableSpinButtons),"enableForceUseKnob"in e&&o(8,W=e.enableForceUseKnob),"enableStopPropagation"in e&&o(28,_=e.enableStopPropagation),"enablePointerdownListener"in e&&o(9,V=e.enablePointerdownListener),"maxInteractionDistance"in e&&o(29,N=e.maxInteractionDistance),"class"in e&&o(10,H=e.class),"$$scope"in e&&o(36,v=e.$$scope)},e.$$.update=()=>{67633152&e.$$.dirty[0]&&o(12,i=void 0!==T?D(T):0),3&e.$$.dirty[0]&&(r=S-w),4099&e.$$.dirty[0]&&o(31,a=lp(i,w,S)),1&e.$$.dirty[1]&&o(13,s=100*a),64&e.$$.dirty[0]&&o(32,l=z.toUpperCase()),64&e.$$.dirty[0]&&o(33,c="x"===z?"Width":"Height"),4&e.$$.dirty[1]&&(d="offset"+c),2&e.$$.dirty[1]&&(u="page"+l),8192&e.$$.dirty[0]|2&e.$$.dirty[1]&&o(15,p=`translate${l}(${s}%)`)},[w,S,k,C,R,I,z,B,W,V,H,e=>{clearTimeout(Z);let t=!1;_&&e.stopPropagation(),clearTimeout(G);const o=h.getBoundingClientRect();if(g=h[d],f=e[u],$=f-o[z],W){if(Math.abs($-a*g)>N)return;t=!0,e.stopPropagation()}return document.activeElement!==h&&h.focus(),U($,g,{grabbed:!0}),document.documentElement.addEventListener("pointermove",X),document.documentElement.addEventListener("pointerup",q),t},i,s,h,p,e=>{g||(o(19,T=O(parseFloat(e.target.value))),T!==y&&(y=T,A(T)))},e=>{const t=h[d];U(i/r*t+e.detail[z],t),clearTimeout(G),G=setTimeout((()=>{L(T)}),250)},e=>t=>{clearTimeout(G),Q=e,ee=!1,J=setInterval((()=>{ee=!0,K()}),100),document.addEventListener("pointercancel",te),document.addEventListener("pointerup",te)},T,M,P,E,A,L,F,D,O,_,N,e=>{const t=h.getBoundingClientRect(),o=e[u]-t[z],i=h[d];return Math.abs(o-a*i)},a,l,c,x,function(e){pa[e?"unshift":"push"]((()=>{h=e,o(14,h)}))},v]}class $p extends Ga{constructor(e){super(),Ua(this,e,gp,mp,ln,{min:0,max:1,step:2,id:3,value:19,valueMin:20,valueMax:21,trackClass:4,knobClass:5,ongrab:22,onchange:23,onrelease:24,onexceed:25,direction:6,getValue:26,setValue:27,enableSpinButtons:7,enableForceUseKnob:8,enableStopPropagation:28,enablePointerdownListener:9,maxInteractionDistance:29,class:10,eventDistanceToKnob:30,handlePointerDown:11},null,[-1,-1])}get eventDistanceToKnob(){return this.$$.ctx[30]}get handlePointerDown(){return this.$$.ctx[11]}}function fp(e){let t,o;return t=new Sd({props:{class:"PinturaButtonIcon",$$slots:{default:[yp]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};1048580&o&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function yp(e){let t;return{c(){t=zn("g")},m(o,i){An(o,t,i),t.innerHTML=e[2]},p(e,o){4&o&&(t.innerHTML=e[2])},d(e){e&&Ln(t)}}}function bp(e){let t,o,i=nu(e[8],e[6])+"";return{c(){t=Fn("span"),o=Dn(i),Nn(t,"class","PinturaButtonLabelPrefix")},m(e,i){An(e,t,i),Rn(t,o)},p(e,t){320&t&&i!==(i=nu(e[8],e[6])+"")&&Un(o,i)},d(e){e&&Ln(t)}}}function xp(e){let t,o,i,r,n,a,s,l,c,d=e[2]&&fp(e),u=e[8]&&bp(e);return{c(){t=Fn("span"),d&&d.c(),o=On(),u&&u.c(),i=On(),r=Fn("span"),n=Dn(e[9]),Nn(r,"class",a=Xc(["PinturaButtonLabel",e[3],e[5]&&"implicit"])),Nn(t,"slot","label"),Nn(t,"title",s=nu(e[1],e[6])),Nn(t,"class",l=Xc(["PinturaButtonInner",e[4]]))},m(e,a){An(e,t,a),d&&d.m(t,null),Rn(t,o),u&&u.m(t,null),Rn(t,i),Rn(t,r),Rn(r,n),c=!0},p(e,p){e[2]?d?(d.p(e,p),4&p&&Ea(d,1)):(d=fp(e),d.c(),Ea(d,1),d.m(t,o)):d&&(Ra(),Aa(d,1,1,(()=>{d=null})),Ia()),e[8]?u?u.p(e,p):(u=bp(e),u.c(),u.m(t,i)):u&&(u.d(1),u=null),(!c||512&p)&&Un(n,e[9]),(!c||40&p&&a!==(a=Xc(["PinturaButtonLabel",e[3],e[5]&&"implicit"])))&&Nn(r,"class",a),(!c||66&p&&s!==(s=nu(e[1],e[6])))&&Nn(t,"title",s),(!c||16&p&&l!==(l=Xc(["PinturaButtonInner",e[4]])))&&Nn(t,"class",l)},i(e){c||(Ea(d),c=!0)},o(e){Aa(d),c=!1},d(e){e&&Ln(t),d&&d.d(),u&&u.d()}}}function vp(e){let t,o,i,r,n;const a=[e[12],{value:e[7]},{onchange:e[11]}];let s={};for(let e=0;e<a.length;e+=1)s=on(s,a[e]);return o=new $p({props:s}),{c(){t=Fn("div"),Na(o.$$.fragment),Nn(t,"slot","details")},m(a,s){An(a,t,s),Ha(o,t,null),i=!0,r||(n=Wn(t,"keydown",e[10]),r=!0)},p(e,t){const i=6272&t?Wa(a,[4096&t&&_a(e[12]),128&t&&{value:e[7]},2048&t&&{onchange:e[11]}]):{};o.$set(i)},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Ln(t),ja(o),r=!1,n()}}}function wp(e){let t,o;return t=new Jd({props:{panelClass:"PinturaSliderPanel",buttonClass:Xc(["PinturaSliderButton",e[0],e[5]&&"PinturaSliderIconOnly"]),$$slots:{details:[vp],label:[xp]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,[o]){const i={};33&o&&(i.buttonClass=Xc(["PinturaSliderButton",e[0],e[5]&&"PinturaSliderIconOnly"])),1053694&o&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Sp(e,t,o){const i=["class","title","label","icon","labelClass","innerClass","hideLabel","locale","value","onchange","labelPrefix"];let r=xn(t,i),{class:a}=t,{title:s}=t,{label:l=Math.round}=t,{icon:c}=t,{labelClass:d}=t,{innerClass:u}=t,{hideLabel:p=!1}=t,{locale:h}=t,{value:m}=t,{onchange:g=n}=t,{labelPrefix:$}=t;const{min:f,max:y,getValue:b=Y}=r;let x;const v=e=>o(9,x=(e=>R(l)?l(b(e),f,y,e):l)(e));return e.$$set=e=>{t=on(on({},t),bn(e)),o(12,r=xn(t,i)),"class"in e&&o(0,a=e.class),"title"in e&&o(1,s=e.title),"label"in e&&o(13,l=e.label),"icon"in e&&o(2,c=e.icon),"labelClass"in e&&o(3,d=e.labelClass),"innerClass"in e&&o(4,u=e.innerClass),"hideLabel"in e&&o(5,p=e.hideLabel),"locale"in e&&o(6,h=e.locale),"value"in e&&o(7,m=e.value),"onchange"in e&&o(14,g=e.onchange),"labelPrefix"in e&&o(8,$=e.labelPrefix)},e.$$.update=()=>{8320&e.$$.dirty&&v(m)},[a,s,c,d,u,p,h,m,$,x,e=>{/tab/i.test(e.key)&&e.preventDefault()},e=>{v(e),g(e)},r,l,g]}class kp extends Ga{constructor(e){super(),Ua(this,e,Sp,wp,ln,{class:0,title:1,label:13,icon:2,labelClass:3,innerClass:4,hideLabel:5,locale:6,value:7,onchange:14,labelPrefix:8})}}function Cp(e){let t,o,i,r,n,a,s,l;return{c(){t=Fn("span"),o=zn("svg"),i=zn("g"),r=zn("circle"),n=zn("circle"),a=On(),s=Fn("span"),l=Dn(e[3]),Nn(r,"class","PinturaProgressIndicatorBar"),Nn(r,"r","8.5"),Nn(r,"cx","10"),Nn(r,"cy","10"),Nn(r,"stroke-linecap","round"),Nn(r,"opacity",".25"),Nn(n,"class","PinturaProgressIndicatorFill"),Nn(n,"r","8.5"),Nn(n,"stroke-dasharray",e[2]),Nn(n,"cx","10"),Nn(n,"cy","10"),Nn(n,"transform","rotate(-90) translate(-20)"),Nn(i,"fill","none"),Nn(i,"stroke","currentColor"),Nn(i,"stroke-width","2.5"),Nn(i,"stroke-linecap","round"),Nn(i,"opacity",e[1]),Nn(o,"width","20"),Nn(o,"height","20"),Nn(o,"viewBox","0 0 20 20"),Nn(o,"xmlns","http://www.w3.org/2000/svg"),Nn(o,"aria-hidden","true"),Nn(o,"focusable","false"),Nn(s,"class","implicit"),Nn(t,"class","PinturaProgressIndicator"),Nn(t,"data-status",e[0]),Zn(t,"opacity",e[4])},m(e,c){An(e,t,c),Rn(t,o),Rn(o,i),Rn(i,r),Rn(i,n),Rn(t,a),Rn(t,s),Rn(s,l)},p(e,[o]){4&o&&Nn(n,"stroke-dasharray",e[2]),2&o&&Nn(i,"opacity",e[1]),8&o&&Un(l,e[3]),1&o&&Nn(t,"data-status",e[0]),16&o&&Zn(t,"opacity",e[4])},i:en,o:en,d(e){e&&Ln(t)}}}function Tp(e,t,o){let i,r,n,a,s,l,c,d;const u=sa();let{progress:p}=t,{min:h=0}=t,{max:m=100}=t,{labelBusy:g="Busy"}=t,{opacity:$}=t;const f=ca("isAnimated");hn(e,f,(e=>o(14,s=e)));const y=xc($,{precision:.01});hn(e,y,(e=>o(4,d=e)));const b=xc(0,{precision:.01}),x=xc(0,{precision:.01});hn(e,x,(e=>o(15,l=e)));const v=qa([b],(e=>$s(e,h,m)));hn(e,v,(e=>o(16,c=e)));const w=v.subscribe((e=>{1===p&&Math.round(e)>=100&&u("complete")}));return ra((()=>{x.set(1,{hard:!s})})),aa((()=>{w()})),e.$$set=e=>{"progress"in e&&o(9,p=e.progress),"min"in e&&o(10,h=e.min),"max"in e&&o(11,m=e.max),"labelBusy"in e&&o(12,g=e.labelBusy),"opacity"in e&&o(13,$=e.opacity)},e.$$.update=()=>{24576&e.$$.dirty&&Oo($)&&y.set($,{hard:!s}),16896&e.$$.dirty&&p&&p!==1/0&&b.set(100*p,{hard:!s}),70144&e.$$.dirty&&o(3,i=p===1/0?g:Math.round(c)+"%"),66048&e.$$.dirty&&o(2,r=p===1/0?"26.5 53":c/100*53+" 53"),32768&e.$$.dirty&&o(1,n=l),512&e.$$.dirty&&o(0,a=p===1/0?"busy":"loading")},[a,n,r,i,d,f,y,x,v,p,h,m,g,$,s,l,c]}class Mp extends Ga{constructor(e){super(),Ua(this,e,Tp,Cp,ln,{progress:9,min:10,max:11,labelBusy:12,opacity:13})}}function Pp(e){let t,o,i=nu(e[0],e[1])+"";return{c(){t=Fn("span"),o=Dn(i),Nn(t,"class",e[3])},m(e,i){An(e,t,i),Rn(t,o)},p(e,r){3&r&&i!==(i=nu(e[0],e[1])+"")&&Un(o,i),8&r&&Nn(t,"class",e[3])},d(e){e&&Ln(t)}}}function Rp(e){let t,o,i,r,n=e[0]&&Pp(e);return i=new mh({props:{items:e[2]}}),{c(){t=Fn("li"),n&&n.c(),o=On(),Na(i.$$.fragment),Nn(t,"class","PinturaShapeStyle")},m(e,a){An(e,t,a),n&&n.m(t,null),Rn(t,o),Ha(i,t,null),r=!0},p(e,[r]){e[0]?n?n.p(e,r):(n=Pp(e),n.c(),n.m(t,o)):n&&(n.d(1),n=null);const a={};4&r&&(a.items=e[2]),i.$set(a)},i(e){r||(Ea(i.$$.fragment,e),r=!0)},o(e){Aa(i.$$.fragment,e),r=!1},d(e){e&&Ln(t),n&&n.d(),ja(i)}}}function Ip(e,t,o){let i,{title:r}=t,{locale:n}=t,{items:a}=t,{hideTitle:s=!1}=t;return e.$$set=e=>{"title"in e&&o(0,r=e.title),"locale"in e&&o(1,n=e.locale),"items"in e&&o(2,a=e.items),"hideTitle"in e&&o(4,s=e.hideTitle)},e.$$.update=()=>{16&e.$$.dirty&&o(3,i="PinturaShapeStyleLabel"+(s?" implicit":""))},[r,n,a,i,s]}class Ep extends Ga{constructor(e){super(),Ua(this,e,Ip,Rp,ln,{title:0,locale:1,items:2,hideTitle:4})}}var Ap=(e,t,o)=>{let i,r,n;const a=Math.floor(6*e),s=6*e-a,l=o*(1-t),c=o*(1-s*t),d=o*(1-(1-s)*t);switch(a%6){case 0:i=o,r=d,n=l;break;case 1:i=c,r=o,n=l;break;case 2:i=l,r=o,n=d;break;case 3:i=l,r=c,n=o;break;case 4:i=d,r=l,n=o;break;case 5:i=o,r=l,n=c}return[i,r,n]};function Lp(e){let t,o;return{c(){t=Fn("div"),o=Fn("span"),Nn(t,"class","PinturaColorPreview"),Nn(t,"title",e[0]),Zn(t,"--color",e[1])},m(e,i){An(e,t,i),Rn(t,o)},p(e,[o]){1&o&&Nn(t,"title",e[0]),2&o&&Zn(t,"--color",e[1])},i:en,o:en,d(e){e&&Ln(t)}}}function Fp(e,t,o){let i,{color:r}=t,{title:n}=t;return e.$$set=e=>{"color"in e&&o(2,r=e.color),"title"in e&&o(0,n=e.title)},e.$$.update=()=>{4&e.$$.dirty&&o(1,i=r?Xo(r):"transparent")},[n,i,r]}class zp extends Ga{constructor(e){super(),Ua(this,e,Fp,Lp,ln,{color:2,title:0})}}var Dp=e=>(e=e.trim(),/^rgba/.test(e)?e.substring(5).split(",").map(parseFloat).map(((e,t)=>e/(3===t?1:255))):/^rgb/.test(e)?e.substring(4).split(",").map(parseFloat).map((e=>e/255)):/^#/.test(e)?(e=>{const[,t,o,i,r]=e.split("");e=e.length>=4&&e.length<=5?`#${t}${t}${o}${o}${i}${i}${r?`${r}${r}`:""}`:e;const[n,a,s,l,c]=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i.exec(e)||[];if(n)return[a,s,l,c].filter((e=>void 0!==e)).map((e=>parseInt(e,16)/255))})(e):/[0-9]{1,3}\s?,\s?[0-9]{1,3}\s?,\s?[0-9]{1,3}/.test(e)?e.split(",").map((e=>parseInt(e,10))).map((e=>e/255)):void 0);let Op=null;function Bp(e){let t,o;return{c(){t=Fn("span"),o=Dn(e[0])},m(e,i){An(e,t,i),Rn(t,o)},p(e,t){1&t[0]&&Un(o,e[0])},d(e){e&&Ln(t)}}}function Wp(e){let t,o,i,r;o=new zp({props:{color:e[4],title:nu(e[8],e[10])}});let n=!e[9]&&Bp(e);return{c(){t=Fn("span"),Na(o.$$.fragment),i=On(),n&&n.c(),Nn(t,"slot","label"),Nn(t,"class","PinturaButtonLabel")},m(e,a){An(e,t,a),Ha(o,t,null),Rn(t,i),n&&n.m(t,null),r=!0},p(e,i){const r={};16&i[0]&&(r.color=e[4]),1280&i[0]&&(r.title=nu(e[8],e[10])),o.$set(r),e[9]?n&&(n.d(1),n=null):n?n.p(e,i):(n=Bp(e),n.c(),n.m(t,null))},i(e){r||(Ea(o.$$.fragment,e),r=!0)},o(e){Aa(o.$$.fragment,e),r=!1},d(e){e&&Ln(t),ja(o),n&&n.d()}}}function _p(e){let t,o,i,r,n,a,s,l,c,d,u,p;s=new $p({props:{class:"PinturaHuePicker",onchange:e[27],value:e[16],min:0,max:1,step:.01}});let h=e[11]&&Vp(e),m=(e[14]||e[15])&&Np(e);return{c(){t=Fn("div"),o=Fn("div"),i=Fn("div"),r=Fn("div"),n=On(),a=Fn("div"),Na(s.$$.fragment),l=On(),h&&h.c(),c=On(),m&&m.c(),Nn(r,"role","button"),Nn(r,"aria-label","Saturation slider"),Nn(r,"class","PinturaPickerKnob"),Nn(r,"tabindex","0"),Zn(r,"background-color",e[20]),Nn(i,"class","PinturaPickerKnobController"),Zn(i,"transform",`translate(${e[25]}%,${e[24]}%)`),Nn(o,"class","PinturaSaturationPicker"),Zn(o,"background-color",e[21]),Zn(a,"--knob-background",e[21]),Nn(t,"class","PinturaPicker")},m(g,$){An(g,t,$),Rn(t,o),Rn(o,i),Rn(i,r),e[41](o),Rn(t,n),Rn(t,a),Ha(s,a,null),Rn(t,l),h&&h.m(t,null),Rn(t,c),m&&m.m(t,null),d=!0,u||(p=[Wn(r,"nudge",e[30]),wn(sp.call(null,r,{preventDefault:!0})),Wn(o,"pointerdown",e[29])],u=!0)},p(e,n){1048576&n[0]&&Zn(r,"background-color",e[20]),50331648&n[0]&&Zn(i,"transform",`translate(${e[25]}%,${e[24]}%)`),2097152&n[0]&&Zn(o,"background-color",e[21]);const l={};65536&n[0]&&(l.value=e[16]),s.$set(l),2097152&n[0]&&Zn(a,"--knob-background",e[21]),e[11]?h?(h.p(e,n),2048&n[0]&&Ea(h,1)):(h=Vp(e),h.c(),Ea(h,1),h.m(t,c)):h&&(Ra(),Aa(h,1,1,(()=>{h=null})),Ia()),e[14]||e[15]?m?(m.p(e,n),49152&n[0]&&Ea(m,1)):(m=Np(e),m.c(),Ea(m,1),m.m(t,null)):m&&(Ra(),Aa(m,1,1,(()=>{m=null})),Ia())},i(e){d||(Ea(s.$$.fragment,e),Ea(h),Ea(m),d=!0)},o(e){Aa(s.$$.fragment,e),Aa(h),Aa(m),d=!1},d(o){o&&Ln(t),e[41](null),ja(s),h&&h.d(),m&&m.d(),u=!1,an(p)}}}function Vp(e){let t,o,i;return o=new $p({props:{class:"PinturaOpacityPicker",onchange:e[28],value:e[17],min:0,max:1,step:.01}}),{c(){t=Fn("div"),Na(o.$$.fragment),Zn(t,"--knob-background",e[18]),Zn(t,"--track-background",`linear-gradient(to right,${e[19]},${e[20]})`)},m(e,r){An(e,t,r),Ha(o,t,null),i=!0},p(e,i){const r={};131072&i[0]&&(r.value=e[17]),o.$set(r),262144&i[0]&&Zn(t,"--knob-background",e[18]),1572864&i[0]&&Zn(t,"--track-background",`linear-gradient(to right,${e[19]},${e[20]})`)},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Ln(t),ja(o)}}}function Np(e){let t,o,i,r,n,a,s,l=e[15]&&Hp(e);return{c(){t=Fn("div"),o=Fn("input"),r=On(),l&&l.c(),Nn(o,"class","PinturaColorPickerInput"),Nn(o,"type","text"),o.disabled=i=!e[14],o.value=e[23],Nn(t,"class","PinturColorPickerInputGroup")},m(i,c){An(i,t,c),Rn(t,o),Rn(t,r),l&&l.m(t,null),n=!0,a||(s=[Wn(o,"keydown",e[32]),Wn(o,"input",e[31])],a=!0)},p(e,r){(!n||16384&r[0]&&i!==(i=!e[14]))&&(o.disabled=i),(!n||8388608&r[0]&&o.value!==e[23])&&(o.value=e[23]),e[15]?l?(l.p(e,r),32768&r[0]&&Ea(l,1)):(l=Hp(e),l.c(),Ea(l,1),l.m(t,null)):l&&(Ra(),Aa(l,1,1,(()=>{l=null})),Ia())},i(e){n||(Ea(l),n=!0)},o(e){Aa(l),n=!1},d(e){e&&Ln(t),l&&l.d(),a=!1,an(s)}}}function Hp(e){let t,o;return t=new vh({props:{icon:'<path stroke="currentColor" stroke-linecap="square" d="m13 14-7 7a2.704 2.704 0 0 1-3 0 2.704 2.704 0 0 1 0-3l7-7"/><path fill="currentColor" d="M9.475 9.475 14.5 14.5c.263.263.69.265.955.005l.783-.767a4.209 4.209 0 0 0 1.262-3.006V10l4-4c.5-.5.375-2.125-.5-3s-2.5-1-3-.5l-4 4h-.732a4.329 4.329 0 0 0-3.03 1.238l-.758.742a.7.7 0 0 0-.005.995Z"/>',hideLabel:!0,label:"Pick a color",class:"PinturaEyeDropper",onclick:e[33]}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p:en,i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function jp(e){let t,o;return t=new Lu({props:{label:nu(e[10].labelColorPalette,e[10]),class:Xc(["PinturaColorPresets",e[9]?"PinturaColorPresetsGrid":"PinturaColorPresetsList"]),hideLabel:!1,name:e[1],value:e[4],optionGroupClass:"PinturaListOptionGroup",optionClass:"PinturaListOption",options:e[2].map(e[42]),selectedIndex:e[3],optionMapper:e[7],optionLabelClass:e[6],onchange:e[43],$$slots:{option:[Zp,({option:e})=>({59:e}),({option:e})=>[0,e?268435456:0]],group:[Up,({option:e})=>({59:e}),({option:e})=>[0,e?268435456:0]]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};1024&o[0]&&(i.label=nu(e[10].labelColorPalette,e[10])),512&o[0]&&(i.class=Xc(["PinturaColorPresets",e[9]?"PinturaColorPresetsGrid":"PinturaColorPresetsList"])),2&o[0]&&(i.name=e[1]),16&o[0]&&(i.value=e[4]),1028&o[0]&&(i.options=e[2].map(e[42])),8&o[0]&&(i.selectedIndex=e[3]),128&o[0]&&(i.optionMapper=e[7]),64&o[0]&&(i.optionLabelClass=e[6]),512&o[0]|805306368&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Up(e){let t,o,i=e[59].label+"";return{c(){t=Fn("span"),o=Dn(i),Nn(t,"slot","group")},m(e,i){An(e,t,i),Rn(t,o)},p(e,t){268435456&t[1]&&i!==(i=e[59].label+"")&&Un(o,i)},d(e){e&&Ln(t)}}}function Gp(e){let t,o,i=e[59].label+"";return{c(){t=Fn("span"),o=Dn(i),Nn(t,"class","PinturaButtonLabel")},m(e,i){An(e,t,i),Rn(t,o)},p(e,t){268435456&t[1]&&i!==(i=e[59].label+"")&&Un(o,i)},d(e){e&&Ln(t)}}}function Zp(e){let t,o,i,r;o=new zp({props:{title:e[59].label,color:e[59].value}});let n=!e[9]&&Gp(e);return{c(){t=Fn("span"),Na(o.$$.fragment),i=On(),n&&n.c(),Nn(t,"slot","option")},m(e,a){An(e,t,a),Ha(o,t,null),Rn(t,i),n&&n.m(t,null),r=!0},p(e,i){const r={};268435456&i[1]&&(r.title=e[59].label),268435456&i[1]&&(r.color=e[59].value),o.$set(r),e[9]?n&&(n.d(1),n=null):n?n.p(e,i):(n=Gp(e),n.c(),n.m(t,null))},i(e){r||(Ea(o.$$.fragment,e),r=!0)},o(e){Aa(o.$$.fragment,e),r=!1},d(e){e&&Ln(t),ja(o),n&&n.d()}}}function Xp(e){let t,o,i,r=e[13]&&_p(e),n=e[12]&&jp(e);return{c(){t=Fn("div"),r&&r.c(),o=On(),n&&n.c(),Nn(t,"slot","details"),Nn(t,"class","PinturaColorPickerPanel")},m(e,a){An(e,t,a),r&&r.m(t,null),Rn(t,o),n&&n.m(t,null),i=!0},p(e,i){e[13]?r?(r.p(e,i),8192&i[0]&&Ea(r,1)):(r=_p(e),r.c(),Ea(r,1),r.m(t,o)):r&&(Ra(),Aa(r,1,1,(()=>{r=null})),Ia()),e[12]?n?(n.p(e,i),4096&i[0]&&Ea(n,1)):(n=jp(e),n.c(),Ea(n,1),n.m(t,null)):n&&(Ra(),Aa(n,1,1,(()=>{n=null})),Ia())},i(e){i||(Ea(r),Ea(n),i=!0)},o(e){Aa(r),Aa(n),i=!1},d(e){e&&Ln(t),r&&r.d(),n&&n.d()}}}function Yp(e){let t,o;return t=new Jd({props:{buttonClass:Xc(["PinturaColorPickerButton",e[5]]),$$slots:{details:[Xp],label:[Wp]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};32&o[0]&&(i.buttonClass=Xc(["PinturaColorPickerButton",e[5]])),67108831&o[0]|536870912&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function qp(e,t,o){let i,r,n,a,s,l,c,u,p,h,m,g,$,{label:f}=t,{name:y}=t,{options:b=[]}=t,{selectedIndex:x=-1}=t,{value:v}=t,{buttonClass:w}=t,{optionLabelClass:S}=t,{optionMapper:k}=t,{onchange:C}=t,{title:T}=t,{hidePresetLabel:M=!0}=t,{locale:P}=t,{enableOpacity:I=!0}=t,{enablePresets:E=!0}=t,{enablePicker:A=!0}=t,{enableInput:L=!1}=t,{enableEyeDropper:F=!1}=t,z="transparent",D="transparent";const O=(e,t)=>{if(h=[e[0],e[1],e[2]],t){let t=((e,t,o)=>{let i=Math.max(e,t,o),r=i-Math.min(e,t,o),n=r&&(i==e?(t-o)/r:i==t?2+(o-e)/r:4+(e-t)/r);return[60*(n<0?n+6:n)/360,i&&r/i,i]})(...h),i=t[0],r=t[1],n=t[2];Oo(H)&&(i=H),Oo(V)&&(r=V),Oo(N)&&(n=N),o(16,l=i),o(36,c=r),o(37,u=n),o(17,p=Oo(e[3])?e[3]:1)}o(18,m=Xo(e)),o(19,g=Xo([...h,0])),o(20,z=Xo([...h,1])),o(21,D=Xo(Ap(l,1,1)))},B=()=>{const e=[...Ap(l,c,u),p];O(e),C(e)},W=e=>{const t=3===e.length?[...e,1]:e;_(),O(t,!0),C(t)},_=()=>{V=void 0,N=void 0,H=void 0};let V,N,H;const j=(e,t)=>{const i=$s(e.x/t.width,0,1),r=$s(e.y/t.height,0,1);var n,a;a=1-r,o(36,c=n=i),o(37,u=a),V=n,N=a,B()};let U,G,Z,X;const Y=e=>{const t=Ce(ge(e),X);j(ke($e(Z),t),G)},q=e=>{G=void 0,document.documentElement.removeEventListener("pointermove",Y),document.documentElement.removeEventListener("pointerup",q)};let K;return e.$$set=e=>{"label"in e&&o(0,f=e.label),"name"in e&&o(1,y=e.name),"options"in e&&o(2,b=e.options),"selectedIndex"in e&&o(3,x=e.selectedIndex),"value"in e&&o(4,v=e.value),"buttonClass"in e&&o(5,w=e.buttonClass),"optionLabelClass"in e&&o(6,S=e.optionLabelClass),"optionMapper"in e&&o(7,k=e.optionMapper),"onchange"in e&&o(34,C=e.onchange),"title"in e&&o(8,T=e.title),"hidePresetLabel"in e&&o(9,M=e.hidePresetLabel),"locale"in e&&o(10,P=e.locale),"enableOpacity"in e&&o(11,I=e.enableOpacity),"enablePresets"in e&&o(12,E=e.enablePresets),"enablePicker"in e&&o(13,A=e.enablePicker),"enableInput"in e&&o(14,L=e.enableInput),"enableEyeDropper"in e&&o(35,F=e.enableEyeDropper)},e.$$.update=()=>{16&e.$$.dirty[1]&&o(15,i=F&&(null===Op&&(Op=d()&&"EyeDropper"in window),Op)),16&e.$$.dirty[0]|128&e.$$.dirty[1]&&(!v||$&&vs(v,$)||(o(38,$=[...v]),O(v,!0))),32&e.$$.dirty[1]&&o(25,r=100*c),64&e.$$.dirty[1]&&o(24,n=100-100*u),256&e.$$.dirty[1]&&o(40,a=!!K&&(K.length>=4&&K.length<=5)),51216&e.$$.dirty[0]|512&e.$$.dirty[1]&&o(23,s=(L||i)&&v?((e,t,o)=>{let i=e.map((e=>Math.round(255*e).toString(16).toLowerCase().padStart(2,"0")));return(!t&&i.length>3||"ff"===i[3])&&i.pop(),o&&(i=i.map((e=>e.substring(0,1)))),"#"+i.join("")})(v,I,a):void 0)},[f,y,b,x,v,w,S,k,T,M,P,I,E,A,L,i,l,p,m,g,z,D,U,s,n,r,W,e=>{o(16,l=e),H=e,B()},e=>{o(17,p=e),B()},e=>{e.stopPropagation(),G=Ne(U.offsetWidth,U.offsetHeight),Z=(e=>me(e.offsetX,e.offsetY))(e),X=ge(e),j(Z,G),document.documentElement.addEventListener("pointermove",Y),document.documentElement.addEventListener("pointerup",q)},e=>{G=Ne(U.offsetWidth,U.offsetHeight);const t=r/100*G.width,o=n/100*G.height;j({x:t+e.detail.x,y:o+e.detail.y},G)},e=>{const{value:t}=e.target,i=t.length;if(!t.startsWith("#")||i<4||6===i||8===i||i>9)return;if(!I&&i>7)return;const r=Dp(t);r&&(o(39,K=t),_(),O(r),C(r))},e=>{e.stopPropagation()},e=>{(new EyeDropper).open().then((({sRGBHex:e})=>{const t=Dp(e);t&&(t[3]=1,o(39,K=v),_(),O(t),C(t))})).catch((e=>{}))},C,F,c,u,$,K,a,function(e){pa[e?"unshift":"push"]((()=>{U=e,o(22,U)}))},([e,t])=>[e,R(t)?t(P):t],e=>W(e.value)]}class Kp extends Ga{constructor(e){super(),Ua(this,e,qp,Yp,ln,{label:0,name:1,options:2,selectedIndex:3,value:4,buttonClass:5,optionLabelClass:6,optionMapper:7,onchange:34,title:8,hidePresetLabel:9,locale:10,enableOpacity:11,enablePresets:12,enablePicker:13,enableInput:14,enableEyeDropper:35},null,[-1,-1])}}function Jp(e){let t,o,i;return o=new mh({props:{items:e[0]}}),{c(){t=Fn("div"),Na(o.$$.fragment),Nn(t,"class","PinturaShorthandControl PinturaShapeStyle")},m(e,r){An(e,t,r),Ha(o,t,null),i=!0},p(e,[t]){const i={};1&t&&(i.items=e[0]),o.$set(i)},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Ln(t),ja(o)}}}function Qp(e,t,o){let i,r,{value:n}=t,{onchange:a}=t,{controls:s=[]}=t;return e.$$set=e=>{o(6,t=on(on({},t),bn(e))),"value"in e&&o(1,n=e.value),"onchange"in e&&o(2,a=e.onchange),"controls"in e&&o(3,s=e.controls)},e.$$.update=()=>{o(4,i=(e=>{const{controls:t,...o}=e;return o})(t)),30&e.$$.dirty&&o(0,r=s.map(((e,t)=>{const[o,r,s]=e;return[o,r,{...i,...s,value:n[t],onchange:e=>{const o=[...n];o[t]=e,a(o)}}]})))},t=bn(t),[r,n,a,s,i]}class eh extends Ga{constructor(e){super(),Ua(this,e,Qp,Jp,ln,{value:1,onchange:2,controls:3})}}function th(e){let t,o;return t=new op({props:{label:e[4],options:e[1],title:e[2],selectedIndex:e[5],onchange:e[10]}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,[o]){const i={};16&o&&(i.label=e[4]),2&o&&(i.options=e[1]),4&o&&(i.title=e[2]),32&o&&(i.selectedIndex=e[5]),9&o&&(i.onchange=e[10]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function oh(e,t,o){let i,r,n,a,{options:s}=t,{title:l}=t,{onchange:c}=t,{selectedIndex:d=-1}=t,{value:u}=t,{label:p}=t;return e.$$set=e=>{"options"in e&&o(1,s=e.options),"title"in e&&o(2,l=e.title),"onchange"in e&&o(3,c=e.onchange),"selectedIndex"in e&&o(0,d=e.selectedIndex),"value"in e&&o(6,u=e.value),"label"in e&&o(7,p=e.label)},e.$$.update=()=>{67&e.$$.dirty&&o(9,i=((e,t,o)=>{if(e)return t>-1?e[t]:void 0!==o?e.find((e=>e[0]===o)):e[0]})(s,d,u)),514&e.$$.dirty&&o(5,r=s&&s.findIndex((e=>e===i))),512&e.$$.dirty&&o(8,n=i&&i[1]),384&e.$$.dirty&&o(4,a=p||n)},[d,s,l,c,a,r,u,p,n,i,e=>{o(0,d=e.index),c&&c(e)}]}class ih extends Ga{constructor(e){super(),Ua(this,e,oh,th,ln,{options:1,title:2,onchange:3,selectedIndex:0,value:6,label:7})}}function rh(e,t,o){const i=e.slice();return i[9]=t[o][0],i[0]=t[o][1],i[10]=t[o][2],i[2]=t[o][3],i}function nh(e){let t,o,i;const r=[e[10]];var n=e[3][e[9]]||e[9];function a(e){let t={};for(let e=0;e<r.length;e+=1)t=on(t,r[e]);return{props:t}}return n&&(t=qn(n,a())),{c(){t&&Na(t.$$.fragment),o=Bn()},m(e,r){t&&Ha(t,e,r),An(e,o,r),i=!0},p(e,i){const s=4&i?Wa(r,[_a(e[10])]):{};if(n!==(n=e[3][e[9]]||e[9])){if(t){Ra();const e=t;Aa(e.$$.fragment,1,0,(()=>{ja(e,1)})),Ia()}n?(t=qn(n,a()),Na(t.$$.fragment),Ea(t.$$.fragment,1),Ha(t,o.parentNode,o)):t=null}else n&&t.$set(s)},i(e){i||(t&&Ea(t.$$.fragment,e),i=!0)},o(e){t&&Aa(t.$$.fragment,e),i=!1},d(e){e&&Ln(o),t&&ja(t,e)}}}function ah(e){let t,o=e[9],i=e[9]&&dh(e);return{c(){i&&i.c(),t=Bn()},m(e,o){i&&i.m(e,o),An(e,t,o)},p(e,r){e[9]?o?ln(o,e[9])?(i.d(1),i=dh(e),i.c(),i.m(t.parentNode,t)):i.p(e,r):(i=dh(e),i.c(),i.m(t.parentNode,t)):o&&(i.d(1),i=null),o=e[9]},i:en,o(e){Aa(i)},d(e){e&&Ln(t),i&&i.d(e)}}}function sh(e){let t,o,i=e[10].innerHTML+"";return{c(){t=new Yn(!1),o=Bn(),t.a=o},m(e,r){t.m(i,e,r),An(e,o,r)},p(e,o){4&o&&i!==(i=e[10].innerHTML+"")&&t.p(i)},i:en,o:en,d(e){e&&Ln(o),e&&t.d()}}}function lh(e){let t,o=e[10].textContent+"";return{c(){t=Dn(o)},m(e,o){An(e,t,o)},p(e,i){4&i&&o!==(o=e[10].textContent+"")&&Un(t,o)},i:en,o:en,d(e){e&&Ln(t)}}}function ch(e){let t,o;return t=new mh({props:{items:e[2],discardEmptyItems:!0}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};4&o&&(i.items=e[2]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function dh(e){let t,o,i,r,n;const a=[ch,lh,sh],s=[];function l(e,t){return e[2]&&e[2].length?0:e[10].textContent?1:e[10].innerHTML?2:-1}~(o=l(e))&&(i=s[o]=a[o](e));let c=[e[4](e[10])],d={};for(let e=0;e<c.length;e+=1)d=on(d,c[e]);return{c(){t=Fn(e[9]),i&&i.c(),r=On(),/-/.test(e[9])?jn(t,d):Hn(t,d)},m(e,i){An(e,t,i),~o&&s[o].m(t,null),Rn(t,r),n=!0},p(e,n){let u=o;o=l(e),o===u?~o&&s[o].p(e,n):(i&&(Ra(),Aa(s[u],1,1,(()=>{s[u]=null})),Ia()),~o?(i=s[o],i?i.p(e,n):(i=s[o]=a[o](e),i.c()),Ea(i,1),i.m(t,r)):i=null),d=Wa(c,[4&n&&e[4](e[10])]),/-/.test(e[9])?jn(t,d):Hn(t,d)},i(e){n||(Ea(i),n=!0)},o(e){Aa(i),n=!1},d(e){e&&Ln(t),~o&&s[o].d()}}}function uh(e,t){let o,i,r,n,a,s;const l=[ah,nh],c=[];function d(e,t){return 4&t&&(i=null),null==i&&(i=!e[5](e[9])),i?0:1}return r=d(t,-1),n=c[r]=l[r](t),{key:e,first:null,c(){o=Bn(),n.c(),a=Bn(),this.first=o},m(e,t){An(e,o,t),c[r].m(e,t),An(e,a,t),s=!0},p(e,o){let i=r;r=d(t=e,o),r===i?c[r].p(t,o):(Ra(),Aa(c[i],1,1,(()=>{c[i]=null})),Ia(),n=c[r],n?n.p(t,o):(n=c[r]=l[r](t),n.c()),Ea(n,1),n.m(a.parentNode,a))},i(e){s||(Ea(n),s=!0)},o(e){Aa(n),s=!1},d(e){e&&Ln(o),c[r].d(e),e&&Ln(a)}}}function ph(e){let t,o,i=[],r=new Map,n=e[2];const a=e=>e[0]+e[1];for(let t=0;t<n.length;t+=1){let o=rh(e,n,t),s=a(o);r.set(s,i[t]=uh(s,o))}return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=Bn()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);An(e,t,r),o=!0},p(e,[o]){62&o&&(n=e[2],Ra(),i=Ba(i,o,a,1,e,n,r,t.parentNode,Oa,uh,t,rh),Ia())},i(e){if(!o){for(let e=0;e<n.length;e+=1)Ea(i[e]);o=!0}},o(e){for(let e=0;e<i.length;e+=1)Aa(i[e]);o=!1},d(e){for(let t=0;t<i.length;t+=1)i[t].d(e);e&&Ln(t)}}}function hh(e,t,o){let i,r,{items:n}=t,{discardEmptyItems:a=!0}=t,{key:s=""}=t;const l={Button:vh,ImageButton:Rd,ImageButtonList:Fd,Dropdown:op,Select:ih,RadioGroup:Lu,Input:Ou,Panel:ap,ProgressIndicator:Mp,ShapeStyle:Ep,ToggleSlider:kp,ColorPicker:Kp,ShorthandControl:eh},c=e=>!m(e)||!!l[e],d=e=>{if(!e)return!1;const[t,,o,i=[]]=e;return!!c(t)||(i.some(d)||o.textContent||o.innerHTML)};return e.$$set=e=>{"items"in e&&o(6,n=e.items),"discardEmptyItems"in e&&o(7,a=e.discardEmptyItems),"key"in e&&o(0,s=e.key)},e.$$.update=()=>{1&e.$$.dirty&&o(1,i=s),192&e.$$.dirty&&o(2,r=(n&&a?n.filter(d):n)||[])},[s,i,r,l,(e={})=>{const{textContent:t,innerHTML:o,...i}=e;return i},c,n,a]}class mh extends Ga{constructor(e){super(),Ua(this,e,hh,ph,ln,{items:6,discardEmptyItems:7,key:0})}get items(){return this.$$.ctx[6]}set items(e){this.$$set({items:e}),ka()}get discardEmptyItems(){return this.$$.ctx[7]}set discardEmptyItems(e){this.$$set({discardEmptyItems:e}),ka()}get key(){return this.$$.ctx[0]}set key(e){this.$$set({key:e}),ka()}}function gh(e){let t,o;return t=new Sd({props:{class:"PinturaButtonIcon",$$slots:{default:[$h]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};536870920&o&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function $h(e){let t;return{c(){t=zn("g")},m(o,i){An(o,t,i),t.innerHTML=e[3]},p(e,o){8&o&&(t.innerHTML=e[3])},d(e){e&&Ln(t)}}}function fh(e){let t;return{c(){t=Fn("span"),Nn(t,"class",e[11])},m(o,i){An(o,t,i),t.innerHTML=e[0]},p(e,o){1&o&&(t.innerHTML=e[0]),2048&o&&Nn(t,"class",e[11])},i:en,o:en,d(e){e&&Ln(t)}}}function yh(e){let t,o,i;return o=new mh({props:{items:e[0]}}),{c(){t=Fn("span"),Na(o.$$.fragment),Nn(t,"class",e[11])},m(e,r){An(e,t,r),Ha(o,t,null),i=!0},p(e,r){const n={};1&r&&(n.items=e[0]),o.$set(n),(!i||2048&r)&&Nn(t,"class",e[11])},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Ln(t),ja(o)}}}function bh(e){let t,o,i,r,n,a;const s=e[27].default,l=mn(s,e,e[29],null),c=l||function(e){let t,o,i,r,n,a,s=e[3]&&gh(e);const l=[yh,fh],c=[];function d(e,t){return 1&t&&(i=null),null==i&&(i=!!_o(e[0])),i?0:1}return r=d(e,-1),n=c[r]=l[r](e),{c(){t=Fn("span"),s&&s.c(),o=On(),n.c(),Nn(t,"class",e[13])},m(e,i){An(e,t,i),s&&s.m(t,null),Rn(t,o),c[r].m(t,null),a=!0},p(e,i){e[3]?s?(s.p(e,i),8&i&&Ea(s,1)):(s=gh(e),s.c(),Ea(s,1),s.m(t,o)):s&&(Ra(),Aa(s,1,1,(()=>{s=null})),Ia());let u=r;r=d(e,i),r===u?c[r].p(e,i):(Ra(),Aa(c[u],1,1,(()=>{c[u]=null})),Ia(),n=c[r],n?n.p(e,i):(n=c[r]=l[r](e),n.c()),Ea(n,1),n.m(t,null)),(!a||8192&i)&&Nn(t,"class",e[13])},i(e){a||(Ea(s),Ea(n),a=!0)},o(e){Aa(s),Aa(n),a=!1},d(e){e&&Ln(t),s&&s.d(),c[r].d()}}}(e);return{c(){t=Fn("button"),c&&c.c(),Nn(t,"type",e[6]),t.disabled=e[5],Nn(t,"class",e[12]),Nn(t,"title",o=Cd(e[0],e[1],e[2]))},m(o,s){An(o,t,s),c&&c.m(t,null),e[28](t),r=!0,n||(a=[Wn(t,"keydown",(function(){sn(e[8])&&e[8].apply(this,arguments)})),Wn(t,"click",(function(){sn(e[7])&&e[7].apply(this,arguments)})),Wn(t,"pointerdown",(function(){sn(e[14])&&e[14].apply(this,arguments)})),wn(i=id.call(null,t,e[4])),wn(e[9].call(null,t))],n=!0)},p(n,[a]){e=n,l?l.p&&(!r||536870912&a)&&fn(l,s,e,e[29],r?$n(s,e[29],a,null):yn(e[29]),null):c&&c.p&&(!r||10249&a)&&c.p(e,r?a:-1),(!r||64&a)&&Nn(t,"type",e[6]),(!r||32&a)&&(t.disabled=e[5]),(!r||4096&a)&&Nn(t,"class",e[12]),(!r||7&a&&o!==(o=Cd(e[0],e[1],e[2])))&&Nn(t,"title",o),i&&sn(i.update)&&16&a&&i.update.call(null,e[4])},i(e){r||(Ea(c,e),r=!0)},o(e){Aa(c,e),r=!1},d(o){o&&Ln(t),c&&c.d(o),e[28](null),n=!1,an(a)}}}function xh(e,t,o){let i,r,a,s,l,c,{$$slots:d={},$$scope:u}=t,{class:p}=t,{label:h}=t,{title:m}=t,{shortcut:g}=t,{labelClass:$}=t,{innerClass:f}=t,{hideLabel:y=!1}=t,{icon:b}=t,{style:x}=t,{disabled:v}=t,{type:w="button"}=t,{onclick:S}=t,{onkeydown:k}=t,{onhold:C}=t,{action:T=(()=>{})}=t,{holdThreshold:M=500}=t,{holdSpeedUpFactor:P=.5}=t,{holdSpeedMin:R=20}=t;const I=e=>{o(25,c=setTimeout((()=>{C(),I(Math.max(e*P,R))}),e))};let E;return e.$$set=e=>{"class"in e&&o(15,p=e.class),"label"in e&&o(0,h=e.label),"title"in e&&o(1,m=e.title),"shortcut"in e&&o(2,g=e.shortcut),"labelClass"in e&&o(16,$=e.labelClass),"innerClass"in e&&o(17,f=e.innerClass),"hideLabel"in e&&o(18,y=e.hideLabel),"icon"in e&&o(3,b=e.icon),"style"in e&&o(4,x=e.style),"disabled"in e&&o(5,v=e.disabled),"type"in e&&o(6,w=e.type),"onclick"in e&&o(7,S=e.onclick),"onkeydown"in e&&o(8,k=e.onkeydown),"onhold"in e&&o(19,C=e.onhold),"action"in e&&o(9,T=e.action),"holdThreshold"in e&&o(20,M=e.holdThreshold),"holdSpeedUpFactor"in e&&o(21,P=e.holdSpeedUpFactor),"holdSpeedMin"in e&&o(22,R=e.holdSpeedMin),"$$scope"in e&&o(29,u=e.$$scope)},e.$$.update=()=>{101187584&e.$$.dirty&&o(26,r=C?()=>{c&&(clearTimeout(c),o(25,c=void 0),document.documentElement.removeEventListener("pointerup",r))}:n),68681728&e.$$.dirty&&o(14,i=C?()=>{document.documentElement.addEventListener("pointerup",r),I(M)}:n),131072&e.$$.dirty&&o(13,a=Xc(["PinturaButtonInner",f])),294912&e.$$.dirty&&o(12,s=Xc(["PinturaButton",y&&"PinturaButtonIconOnly",p])),327680&e.$$.dirty&&o(11,l=Xc([y?"implicit":"PinturaButtonLabel",$]))},[h,m,g,b,x,v,w,S,k,T,E,l,s,a,i,p,$,f,y,C,M,P,R,e=>kd(e,E),()=>E,c,r,d,function(e){pa[e?"unshift":"push"]((()=>{E=e,o(10,E)}))},u]}class vh extends Ga{constructor(e){super(),Ua(this,e,xh,bh,ln,{class:15,label:0,title:1,shortcut:2,labelClass:16,innerClass:17,hideLabel:18,icon:3,style:4,disabled:5,type:6,onclick:7,onkeydown:8,onhold:19,action:9,holdThreshold:20,holdSpeedUpFactor:21,holdSpeedMin:22,isEventTarget:23,getElement:24})}get isEventTarget(){return this.$$.ctx[23]}get getElement(){return this.$$.ctx[24]}}var wh=(e,t)=>{const o=e.findIndex(t);if(o>=0)return e.splice(o,1)};const Sh=80;var kh=(e,t={})=>{const{inertia:o=!1,inertiaDurationMultiplier:i=Sh,shouldStartInteraction:r=(()=>!0),pinch:n=!1,multiTouch:a,getEventPosition:s=(e=>me(e.clientX,e.clientY)),observeKeys:l=!1}=t;function c(t,o){e.dispatchEvent(new CustomEvent(t,{detail:o}))}function d(){w&&w(),w=void 0}const u=[],p=e=>0===e.timeStamp?Date.now():e.timeStamp,h=()=>{const e=$e(u[0].position);if(u[1]){const t=.5*(u[1].position.x-e.x),o=.5*(u[1].position.y-e.y);e.x+=t,e.y+=o}return e},m=e=>{e.origin.x=e.position.x,e.origin.y=e.position.y,e.translation.x=0,e.translation.y=0},g=e=>{const t=(e=>u.findIndex((t=>t.event.pointerId===e.pointerId)))(e);if(!(t<0))return u[t]},$=()=>1===u.length,f=()=>2===u.length,y=e=>{const t=Le(e.map((e=>e.position)));return{center:t,distance:((e,t)=>e.reduce(((e,o)=>e+Ee(t,o.position)),0)/e.length)(e,t),velocity:Le(e.map((e=>e.velocity))),translation:Le(e.map((e=>e.translation)))}};let b,x,v,w,S,k,C,T,M=0,P=void 0;e.addEventListener("pointerdown",L);const R=["Meta","Control","Alt","Shift"];function I(e){if(!R.includes(e.key))return;const{metaKey:t,ctrlKey:o,altKey:i,shiftKey:r}=e;A({metaKey:t,ctrlKey:o,altKey:i,shiftKey:r})}let E=Date.now();const A=e=>{const t=$e(u[0].translation);let o=C;if(n&&f()){o*=Ee(u[0].position,u[1].position)/S,ke(t,u[1].translation)}ke(t,k);const i=Date.now();i-E<16||(E=i,c("interactionupdate",{position:h(),translation:t,scalar:n?o:void 0,isMultiTouching:f(),...e}))};function L(t){if(!f()&&!(e=>Oo(e.button)&&0!==e.button)(t)&&r(t,e))if(d(),(e=>{const t=p(e),o={timeStamp:t,timeStampInitial:t,position:s(e),origin:s(e),velocity:he(),velocityHistory:[],velocityAverage:he(),translation:he(),interactionState:void 0,event:e};u.push(o),o.interactionState=y(u)})(t),l&&(window.addEventListener("keydown",I),window.addEventListener("keyup",I)),$())document.documentElement.addEventListener("pointermove",F),document.documentElement.addEventListener("pointerup",z),document.documentElement.addEventListener("pointercancel",z),document.addEventListener("visibilitychange",O),T=!1,C=1,k=he(),S=void 0,c("interactionstart",{origin:$e(g(t).origin)});else if(n)T=!0,S=Ee(u[0].position,u[1].position),k.x+=u[0].translation.x,k.y+=u[0].translation.y,m(u[0]);else if(!1===a)return u.length=0,W(),c("interactioncancel")}function F(e){e.preventDefault(),(e=>{const t=g(e);if(!t)return;const o=p(e),i=s(e),r=Math.max(1,o-t.timeStamp);t.velocity.x=(i.x-t.position.x)/r,t.velocity.y=(i.y-t.position.y)/r,t.velocityHistory.push($e(t.velocity)),t.velocityHistory=t.velocityHistory.slice(-3),t.velocityAverage=t.velocityHistory.reduce(((e,t,o,i)=>(e.x+=t.x/i.length,e.y+=t.y/i.length,e)),he()),t.translation.x=i.x-t.origin.x,t.translation.y=i.y-t.origin.y,t.timeStamp=o,t.position.x=i.x,t.position.y=i.y,t.event=e})(e);const{metaKey:t=!1,ctrlKey:o=!1,altKey:i=!1,shiftKey:r=!1}=l?e:{};A({metaKey:t,ctrlKey:o,altKey:i,shiftKey:r})}function z(e){if(!g(e))return;const t=h(),r=(e=>{const t=wh(u,(t=>t.event.pointerId===e.pointerId));if(t)return t[0]})(e);if(n&&$()){const e=Ee(u[0].position,r.position);C*=e/S,k.x+=u[0].translation.x+r.translation.x,k.y+=u[0].translation.y+r.translation.y,m(u[0])}let a=!1,s=!1;if(!T&&r){const e=performance.now(),t=e-r.timeStampInitial,o=Ie(r.translation);a=o<64&&t<300,s=!!(P&&a&&e-M<700&&Ie(P,r.position)<128),a&&(P=$e(r.position),M=e)}if(u.length>0)return;W();const l=$e(r.translation),d=$e(r.velocityAverage);let p=!1;c("interactionrelease",{isTap:a,isDoubleTap:s,position:t,translation:l,scalar:C,preventInertia:()=>p=!0});const f=Ee(d);if(p||!o||f<.25)return B(l,{isTap:a,isDoubleTap:s});x=$e(t),v=$e(l),b=yc($e(l),{easing:gc,duration:f*i}),b.set({x:l.x+50*d.x,y:l.y+50*d.y}).then((()=>{w&&B(pn(b),{isTap:a,isDoubleTap:s})})),w=b.subscribe(D)}function D(e){e&&c("interactionupdate",{position:me(x.x+(e.x-v.x),x.y+(e.y-v.y)),translation:e,scalar:n?C:void 0})}function O(e){if("visible"===document.visibilityState||!u.length)return;const t=y(u);d(),c("interactionend",{...t}),u.length=0,W()}function B(e,t){d(),c("interactionend",{...t,translation:e,scalar:n?C:void 0})}function W(){l&&window.removeEventListener("keydown",I),l&&window.removeEventListener("keyup",I),document.documentElement.removeEventListener("pointermove",F),document.documentElement.removeEventListener("pointerup",z),document.documentElement.removeEventListener("pointercancel",z),document.removeEventListener("visibilitychange",O)}return{destroy(){d(),e.removeEventListener("pointerdown",L)}}};function Ch(e,t){return t?t*Math.sign(e)*Math.log10(1+Math.abs(e)/t):e}const Th=(e,t,o)=>{if(!t||!o)return{...e};const i=e.x+Ch(t.x-e.x,o),r=e.x+e.width+Ch(t.x+t.width-(e.x+e.width),o),n=e.y+Ch(t.y-e.y,o);return{x:i,y:n,width:r-i,height:e.y+e.height+Ch(t.y+t.height-(e.y+e.height),o)-n}},Mh=(e,t,o)=>t&&o?me(e.x+Ch(t.x-e.x,o),e.y+Ch(t.y-e.y,o)):{...e};var Ph=(e,t)=>{if(e)return/em/.test(e)?16*parseInt(e,10):/px/.test(e)?parseInt(e,10):void 0},Rh=(e,t)=>{let o=e.detail||0;const{deltaX:i,deltaY:r,wheelDelta:n,wheelDeltaX:a,wheelDeltaY:s}=e,{fixScrollDirection:l=!1}=t||{};return Oo(a)&&Math.abs(a)>Math.abs(s)?o=a/-120:Oo(i)&&Math.abs(i)>Math.abs(r)?o=i/20:(n||s)&&(o=(n||s)/-120),o||(o=r/20),(O()||Qt())&&(o*=2),l&&bo()&&(o*=-1),o};function Ih(e){let t,o,i,r,n,a,s;const l=e[38].default,c=mn(l,e,e[37],null);return{c(){t=Fn("div"),o=Fn("div"),c&&c.c(),Zn(o,"transform",e[6]),Nn(t,"class",i=Xc(["PinturaScrollable",e[0]])),Nn(t,"data-direction",e[1]),Nn(t,"data-state",e[7]),Zn(t,"--scrollable-feather-start-opacity",e[4]),Zn(t,"--scrollable-feather-end-opacity",e[5])},m(i,l){An(i,t,l),Rn(t,o),c&&c.m(o,null),e[40](t),n=!0,a||(s=[Wn(o,"interactionstart",e[10]),Wn(o,"interactionupdate",e[12]),Wn(o,"interactionend",e[13]),Wn(o,"interactionrelease",e[11]),wn(kh.call(null,o,{inertia:!0})),Wn(o,"measure",e[39]),wn(Dc.call(null,o)),Wn(t,"wheel",e[15],{passive:!1}),Wn(t,"scroll",e[17]),Wn(t,"focusin",e[16]),Wn(t,"nudge",e[18]),Wn(t,"measure",e[14]),wn(Dc.call(null,t,{observePosition:!0})),wn(r=sp.call(null,t,{direction:"x"===e[1]?"horizontal":"vertical",stopKeydownPropagation:!1}))],a=!0)},p(e,a){c&&c.p&&(!n||64&a[1])&&fn(c,l,e,e[37],n?$n(l,e[37],a,null):yn(e[37]),null),64&a[0]&&Zn(o,"transform",e[6]),(!n||1&a[0]&&i!==(i=Xc(["PinturaScrollable",e[0]])))&&Nn(t,"class",i),(!n||2&a[0])&&Nn(t,"data-direction",e[1]),(!n||128&a[0])&&Nn(t,"data-state",e[7]),r&&sn(r.update)&&2&a[0]&&r.update.call(null,{direction:"x"===e[1]?"horizontal":"vertical",stopKeydownPropagation:!1}),16&a[0]&&Zn(t,"--scrollable-feather-start-opacity",e[4]),32&a[0]&&Zn(t,"--scrollable-feather-end-opacity",e[5])},i(e){n||(Ea(c,e),n=!0)},o(e){Aa(c,e),n=!1},d(o){o&&Ln(t),c&&c.d(o),e[40](null),a=!1,an(s)}}}function Eh(e,t,o){let i,r,a,s,l,c,d,u,p,{$$slots:h={},$$scope:m}=t;const g=sa();let $,f,y,b,x="idle",v=xc(0);hn(e,v,(e=>o(36,u=e)));let{class:w}=t,{scrollBlockInteractionDist:S=5}=t,{scrollStep:k=10}=t,{scrollFocusMargin:C=64}=t,{scrollDirection:T="x"}=t,{scrollAutoCancel:M=!1}=t,{elasticity:P=0}=t,{onscroll:R=n}=t,{maskFeatherSize:I}=t,{maskFeatherStartOpacity:E}=t,{maskFeatherEndOpacity:A}=t,{scroll:L}=t;const F=ca("fixScrollDirection");let z;hn(e,F,(e=>o(47,p=e)));let D=void 0,O=void 0,B=!0;const W=v.subscribe((e=>{const t=he();t[T]=e,R(t)})),_=e=>Math.max(Math.min(0,e),y[i]-f[i]);let V,N,H;const j=(e,t={})=>{const{elastic:i=!1,animate:r=!1,preventScrollState:n=!1}=t;Math.abs(e-$)>S&&"idle"===x&&!b&&!n&&o(29,x="scrolling");const a=_(e),s=i&&P&&!b?a+Ch(e-a,P):a;let l=!0;r?l=!1:B||(l=!b),B=!1,v.set(s,{hard:l}).then((e=>{b&&(B=!0)}))};aa((()=>{W()}));return e.$$set=e=>{"class"in e&&o(0,w=e.class),"scrollBlockInteractionDist"in e&&o(22,S=e.scrollBlockInteractionDist),"scrollStep"in e&&o(23,k=e.scrollStep),"scrollFocusMargin"in e&&o(24,C=e.scrollFocusMargin),"scrollDirection"in e&&o(1,T=e.scrollDirection),"scrollAutoCancel"in e&&o(25,M=e.scrollAutoCancel),"elasticity"in e&&o(26,P=e.elasticity),"onscroll"in e&&o(27,R=e.onscroll),"maskFeatherSize"in e&&o(21,I=e.maskFeatherSize),"maskFeatherStartOpacity"in e&&o(19,E=e.maskFeatherStartOpacity),"maskFeatherEndOpacity"in e&&o(20,A=e.maskFeatherEndOpacity),"scroll"in e&&o(28,L=e.scroll),"$$scope"in e&&o(37,m=e.$$scope)},e.$$.update=()=>{if(2&e.$$.dirty[0]&&o(33,i="x"===T?"width":"height"),2&e.$$.dirty[0]&&o(31,r=T.toUpperCase()),8&e.$$.dirty[0]&&o(35,a=z&&getComputedStyle(z)),8&e.$$.dirty[0]|16&e.$$.dirty[1]&&o(34,s=a&&Ph(a.getPropertyValue("--scrollable-feather-size"))),1075314692&e.$$.dirty[0]|44&e.$$.dirty[1]&&null!=u&&y&&null!=s&&f){const e=-1*u/s,t=-(y[i]-f[i]-u)/s;o(19,E=$s(1-e,0,1)),o(20,A=$s(1-t,0,1)),o(21,I=s),o(4,D=E),o(5,O=A)}268435464&e.$$.dirty[0]&&z&&void 0!==L&&(Oo(L)?j(L):j(L.scrollOffset,L)),1073741828&e.$$.dirty[0]|4&e.$$.dirty[1]&&o(32,l=y&&f?f[i]>y[i]:void 0),536870912&e.$$.dirty[0]|2&e.$$.dirty[1]&&o(7,c=Xc([x,l?"overflows":void 0])),35&e.$$.dirty[1]&&o(6,d=l?`translate${r}(${u}px)`:"none")},[w,T,f,z,D,O,d,c,v,F,()=>{l&&(N=!1,V=!0,H=me(0,0),b=!1,o(29,x="idle"),$=pn(v))},({detail:e})=>{l&&(b=!0,o(29,x="idle"))},({detail:e})=>{l&&(N||V&&(V=!1,Ie(e.translation)<.1)||(!M||"x"!==T||(e=>{const t=Se(me(e.x-H.x,e.y-H.y),Math.abs);H=$e(e);const o=Ie(t),i=t.x-t.y;return!(o>1&&i<-.5)})(e.translation)?j($+e.translation[T],{elastic:!0}):N=!0))},({detail:e})=>{if(!l)return;if(N)return;const t=$+e.translation[T],o=_(t);B=!1,v.set(o).then((e=>{b&&(B=!0)}))},({detail:e})=>{o(30,y=e),g("measure",{x:e.x,y:e.y,width:e.width,height:e.height})},e=>{if(!l)return;e.preventDefault(),e.stopPropagation();const t=e.shiftKey,o=Rh(e,{fixScrollDirection:p})*(t?-1:1),i=pn(v);j(i+o*k,{animate:!0})},e=>{if(!l)return;if(!b)return;let t=e.target;e.target.classList.contains("implicit")&&(t=t.parentNode);const o=t["x"===T?"offsetLeft":"offsetTop"],r=o+t["x"===T?"offsetWidth":"offsetHeight"],n=pn(v),a=C+I;n+o<a?j(-o+a):n+r>y[i]-a&&j(y[i]-r-a,{animate:!0})},()=>{o(3,z["x"===T?"scrollLeft":"scrollTop"]=0,z)},({detail:e})=>{if(z.querySelector("[data-focus-visible]"))return;const t=-2*e[T],o=pn(v);j(o+t*k,{animate:!0,preventScrollState:!0})},E,A,I,S,k,C,M,P,R,L,x,y,r,l,i,s,a,u,m,h,e=>o(2,f=e.detail),function(e){pa[e?"unshift":"push"]((()=>{z=e,o(3,z)}))}]}class Ah extends Ga{constructor(e){super(),Ua(this,e,Eh,Ih,ln,{class:0,scrollBlockInteractionDist:22,scrollStep:23,scrollFocusMargin:24,scrollDirection:1,scrollAutoCancel:25,elasticity:26,onscroll:27,maskFeatherSize:21,maskFeatherStartOpacity:19,maskFeatherEndOpacity:20,scroll:28},null,[-1,-1])}}function Lh(e){let t,o,i,r,n;return{c(){t=Fn("span"),Nn(t,"class","PinturaStatusMessage")},m(o,a){An(o,t,a),t.innerHTML=e[0],i=!0,r||(n=[Wn(t,"measure",(function(){sn(e[1])&&e[1].apply(this,arguments)})),wn(Dc.call(null,t))],r=!0)},p(o,[r]){e=o,(!i||1&r)&&(t.innerHTML=e[0])},i(r){i||(ba((()=>{o||(o=Fa(t,e[4],{duration:e[2]},!0)),o.run(1)})),i=!0)},o(r){o||(o=Fa(t,e[4],{duration:e[2]},!1)),o.run(0),i=!1},d(e){e&&Ln(t),e&&o&&o.end(),r=!1,an(n)}}}function Fh(e,t,o){let i,r,{text:a}=t,{onmeasure:s=n}=t;const l=ca("isAnimated");return hn(e,l,(e=>o(5,r=e))),e.$$set=e=>{"text"in e&&o(0,a=e.text),"onmeasure"in e&&o(1,s=e.onmeasure)},e.$$.update=()=>{32&e.$$.dirty&&o(2,i=r?500:0)},[a,s,i,l,function(e,{duration:t}){return{duration:t,tick:t=>{e.style.opacity=t}}},r]}class zh extends Ga{constructor(e){super(),Ua(this,e,Fh,Lh,ln,{text:0,onmeasure:1})}}function Dh(e){let t,o,i;const r=e[5].default,n=mn(r,e,e[4],null);return{c(){t=Fn("span"),n&&n.c(),Nn(t,"class",o="PinturaStatusAside "+e[1]),Zn(t,"transform",e[2]),Zn(t,"opacity",e[0])},m(e,o){An(e,t,o),n&&n.m(t,null),i=!0},p(e,[a]){n&&n.p&&(!i||16&a)&&fn(n,r,e,e[4],i?$n(r,e[4],a,null):yn(e[4]),null),(!i||2&a&&o!==(o="PinturaStatusAside "+e[1]))&&Nn(t,"class",o),4&a&&Zn(t,"transform",e[2]),1&a&&Zn(t,"opacity",e[0])},i(e){i||(Ea(n,e),i=!0)},o(e){Aa(n,e),i=!1},d(e){e&&Ln(t),n&&n.d(e)}}}function Oh(e,t,o){let i,{$$slots:r={},$$scope:n}=t,{offset:a=0}=t,{opacity:s=0}=t,{class:l}=t;return e.$$set=e=>{"offset"in e&&o(3,a=e.offset),"opacity"in e&&o(0,s=e.opacity),"class"in e&&o(1,l=e.class),"$$scope"in e&&o(4,n=e.$$scope)},e.$$.update=()=>{8&e.$$.dirty&&o(2,i=`translateX(${a}px)`)},[s,l,i,a,n,r]}class Bh extends Ga{constructor(e){super(),Ua(this,e,Oh,Dh,ln,{offset:3,opacity:0,class:1})}}let Wh=null;var _h=e=>{if(null===Wh&&(Wh=d()&&"visualViewport"in window),!Wh)return!1;const t=visualViewport.height,o=()=>{e(visualViewport.height<t?"visible":"hidden")};return visualViewport.addEventListener("resize",o),()=>visualViewport.removeEventListener("resize",o)};function Vh(e){let t,o;const i=[{onclick:e[1]},e[3]];let r={};for(let e=0;e<i.length;e+=1)r=on(r,i[e]);return t=new vh({props:r}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const r=10&o[0]?Wa(i,[2&o[0]&&{onclick:e[1]},8&o[0]&&_a(e[3])]):{};t.$set(r)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Nh(e){let t,o;const i=[{onclick:e[0]},{class:"PinturaInputFormButtonConfirm"},e[2]];let r={};for(let e=0;e<i.length;e+=1)r=on(r,i[e]);return t=new vh({props:r}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const r=5&o[0]?Wa(i,[1&o[0]&&{onclick:e[0]},i[1],4&o[0]&&_a(e[2])]):{};t.$set(r)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Hh(e){let t,o,i,r,n,a,s,l,c=e[3]&&Vh(e);const d=e[29].default,u=mn(d,e,e[28],null);let p=e[2]&&Nh(e);return{c(){t=Fn("div"),o=Fn("div"),c&&c.c(),i=On(),r=Fn("div"),u&&u.c(),n=On(),p&&p.c(),Nn(r,"class","PinturaInputFormFields"),Nn(o,"class","PinturaInputFormInner"),Nn(t,"class","PinturaInputForm"),Nn(t,"data-layout",e[4]),Zn(t,"opacity",e[6]),Zn(t,"left",e[7]),Zn(t,"top",e[8]),Zn(t,"right",e[9]),Zn(t,"bottom",e[10])},m(d,h){An(d,t,h),Rn(t,o),c&&c.m(o,null),Rn(o,i),Rn(o,r),u&&u.m(r,null),Rn(o,n),p&&p.m(o,null),e[30](t),a=!0,s||(l=[Wn(r,"keydown",e[14]),Wn(t,"focusin",e[11]),Wn(t,"focusout",e[12]),Wn(t,"measure",e[13]),wn(Dc.call(null,t))],s=!0)},p(e,r){e[3]?c?(c.p(e,r),8&r[0]&&Ea(c,1)):(c=Vh(e),c.c(),Ea(c,1),c.m(o,i)):c&&(Ra(),Aa(c,1,1,(()=>{c=null})),Ia()),u&&u.p&&(!a||268435456&r[0])&&fn(u,d,e,e[28],a?$n(d,e[28],r,null):yn(e[28]),null),e[2]?p?(p.p(e,r),4&r[0]&&Ea(p,1)):(p=Nh(e),p.c(),Ea(p,1),p.m(o,null)):p&&(Ra(),Aa(p,1,1,(()=>{p=null})),Ia()),(!a||16&r[0])&&Nn(t,"data-layout",e[4]),64&r[0]&&Zn(t,"opacity",e[6]),128&r[0]&&Zn(t,"left",e[7]),256&r[0]&&Zn(t,"top",e[8]),512&r[0]&&Zn(t,"right",e[9]),1024&r[0]&&Zn(t,"bottom",e[10])},i(e){a||(Ea(c),Ea(u,e),Ea(p),a=!0)},o(e){Aa(c),Aa(u,e),Aa(p),a=!1},d(o){o&&Ln(t),c&&c.d(),u&&u.d(o),p&&p.d(),e[30](null),s=!1,an(l)}}}function jh(e,t,o){let i,r,n,a,s,{$$slots:l={},$$scope:c}=t,{onconfirm:d}=t,{oncancel:u}=t,{autoFocus:p=!0}=t,{autoPositionCursor:h=!0}=t,{buttonConfirm:m}=t,{buttonCancel:g}=t,{layout:$="stack"}=t,{parentRect:f}=t,{align:y}=t,{justify:b}=t,{parentMargin:x=16}=t,{panelOffset:v=he()}=t,{willHandleKeydown:S=(()=>!0)}=t,k=!1,C=void 0,T=void 0,M={top:void 0,bottom:void 0},P=0,R=void 0,I=void 0,E=void 0,A=void 0;const L=()=>{const e=s.querySelector("input, textarea");e.focus(),P>=1||e.select()},F=()=>{k=!0,D||!vo()&&!w()||o(24,M={top:"1em",bottom:"auto"}),vo()&&(e=>{let t;const o=e=>t=e.touches[0].screenY,i=e=>{const o=e.touches[0].screenY,i=e.target;/textarea/i.test(i.nodeName)?(o>t?0==i.scrollTop&&e.preventDefault():o<t?i.scrollTop+i.offsetHeight==i.scrollHeight&&e.preventDefault():e.preventDefault(),t=o):e.preventDefault()};e.addEventListener("touchstart",o),e.addEventListener("touchmove",i)})(s),o(6,P=1)};let z;const D=_h((e=>{a?"hidden"!==e||k?(clearTimeout(T),T=void 0,o(24,M={top:visualViewport.height-C.height-v.y+"px"}),"visible"===e?(o(5,s.dataset.stick=!0,s),L(),F()):(k=!1,o(6,P=0))):L():o(24,M={top:"4.5em",bottom:"auto"})}));return ra((()=>{p&&L()})),aa((()=>{D&&D()})),e.$$set=e=>{"onconfirm"in e&&o(0,d=e.onconfirm),"oncancel"in e&&o(1,u=e.oncancel),"autoFocus"in e&&o(15,p=e.autoFocus),"autoPositionCursor"in e&&o(16,h=e.autoPositionCursor),"buttonConfirm"in e&&o(2,m=e.buttonConfirm),"buttonCancel"in e&&o(3,g=e.buttonCancel),"layout"in e&&o(4,$=e.layout),"parentRect"in e&&o(17,f=e.parentRect),"align"in e&&o(18,y=e.align),"justify"in e&&o(19,b=e.justify),"parentMargin"in e&&o(20,x=e.parentMargin),"panelOffset"in e&&o(21,v=e.panelOffset),"willHandleKeydown"in e&&o(22,S=e.willHandleKeydown),"$$scope"in e&&o(28,c=e.$$scope)},e.$$.update=()=>{8519680&e.$$.dirty[0]&&o(27,i=f&&C),144572416&e.$$.dirty[0]&&o(26,r=i?((e,t,o,i,r)=>{let n,a;return n="center"===i?e.x+.5*e.width-.5*t.width:"right"===i?e.x+e.width-t.width-r:e.x+r,a="center"===o?e.y+.5*e.height-.5*t.height:"bottom"===o?e.y+e.height-t.height-r:e.y+r,{top:a+"px",right:"auto",bottom:"auto",left:n+"px"}})(f,C,y,b,x):void 0),201326592&e.$$.dirty[0]&&o(7,R=i?r.left:void 0),218103808&e.$$.dirty[0]&&o(8,I=i?r.top:M.top),201326592&e.$$.dirty[0]&&o(9,E=i?r.right:void 0),218103808&e.$$.dirty[0]&&o(10,A=i?r.bottom:M.bottom),32&e.$$.dirty[0]&&o(25,n=s&&getComputedStyle(s)),33554432&e.$$.dirty[0]&&(a=n&&"1"===n.getPropertyValue("--editor-modal"))},[d,u,m,g,$,s,P,R,I,E,A,e=>{var t;((e=>/textarea/i.test(e))(e.target)||Wd(e.target))&&(z=Date.now(),h&&((t=e.target).selectionStart=t.selectionEnd=t.value.length),clearTimeout(T),T=setTimeout(F,200))},e=>{Date.now()-z>50||(e.stopPropagation(),L())},({detail:e})=>{o(23,C={width:e.width,height:e.height})},e=>{if(S(e))return"Enter"===e.key?d():"Escape"===e.key?u():void 0},p,h,f,y,b,x,v,S,C,M,n,r,i,c,l,function(e){pa[e?"unshift":"push"]((()=>{s=e,o(5,s)}))}]}class Uh extends Ga{constructor(e){super(),Ua(this,e,jh,Hh,ln,{onconfirm:0,oncancel:1,autoFocus:15,autoPositionCursor:16,buttonConfirm:2,buttonCancel:3,layout:4,parentRect:17,align:18,justify:19,parentMargin:20,panelOffset:21,willHandleKeydown:22},null,[-1,-1])}}var Gh=(e,t)=>{e.fastSeek&&e.fastSeek(t),e.currentTime=t};const Zh=["aspectRatio","isRotatedSideways","flip","cropSize"],Xh=Ts.map((([e])=>e)).filter((e=>!Zh.includes(e)));var Yh=(e,t)=>new CustomEvent("ping",{detail:{type:e,data:t},cancelable:!0,bubbles:!0}),qh=(e,t)=>(t?Il(e,t):e).replace(/([a-z])([A-Z])/g,"$1-$2").replace(/\s+/g,"-").toLowerCase(),Kh=(e,t=Y)=>{const{subscribe:o,set:i}=Ya(void 0);return{subscribe:o,destroy:((e,t)=>{const o=matchMedia(e);return o.addListener(t),t(o),{get matches(){return o.matches},destroy:()=>o.removeListener(t)}})(e,(({matches:e})=>i(t(e)))).destroy}},Jh=(e,t,o)=>new Promise(((i,r)=>{(async()=>{Zs(e)&&i(await Gs(e));const n=await t.read(e),a=e=>W(e,o).then((e=>t.apply(e,n))).then(i).catch(r);if(A(e)||!E()||Qt()||vo())return a(e);let s;try{s=await z(((e,t)=>createImageBitmap(e).then((e=>t(null,e))).catch(t)),[e])}catch(e){}s&&s.width?await p()?oc()&&n>1?i(await(async e=>h(await k(e)))(s)):i(s):i(t.apply(s,n)):a(e)})()})),Qh=(e,t)=>new Promise((async o=>{if(e.width<t.width&&e.height<t.height)return o(e);const i=Math.min(t.width/e.width,t.height/e.height),r=i*e.width,n=i*e.height,a=$("canvas",{width:r,height:n}),s=a.getContext("2d",{willReadFrequently:!0}),l=b(e)?await k(e):e;s.drawImage(l,0,0,r,n),o(h(a))}));let em=null;var tm=()=>{if(null===em){let e=$("canvas");em=!!Gl(e),y(e),e=void 0}return em};const om=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],im={precision:1e-4},rm={precision:.01*im.precision};var nm=()=>{const e=[],t=[],o=[],i=()=>{t.forEach((e=>e(o)))},r=t=>{t.unsub=t.subscribe((r=>((t,r)=>{const n=e.indexOf(t);n<0||(o[n]=r,i())})(t,r))),i()};return{get length(){return e.length},clear:()=>{e.forEach((e=>e.unsub())),e.length=0,o.length=0},unshift:t=>{e.unshift(t),r(t)},get:t=>e[t],push:t=>{e.push(t),r(t)},remove:t=>{t.unsub();const i=e.indexOf(t);e.splice(i,1),o.splice(i,1)},forEach:t=>e.forEach(t),filter:t=>e.filter(t),subscribe:e=>(t.push(e),e(o),()=>{t.splice(t.indexOf(e),1)})}},am=e=>e[0]<.25&&e[1]<.25&&e[2]<.25,sm=(e={})=>new Promise((t=>{const{accept:o="image/*"}=e,i=$("input",{style:"position:absolute;visibility:hidden;width:0;height:0;",type:"file",accept:o}),r=()=>{const[e]=i.files;i.parentNode&&i.remove(),i.removeEventListener("change",r),t(e)};i.addEventListener("change",r),vo()&&document.body.append(i),i.click()})),lm=e=>{try{return e()}catch(e){console.error(e)}},cm=([e,t])=>e+.5*(t-e),dm=e=>Math.round(100*e),um=e=>me(e.clientX,e.clientY),pm=(e,t,o)=>{const i=um(e);return Ce(Ce(i,t),o)};function hm(e,t,o){let i,r,n,a,s,l,c,d,u,p,h,m,g,$,f,y,b,x,v,w,S,{root:k}=t,{locale:C}=t,{stores:T}=t,{allowPan:M=!0}=t,{allowZoom:P=!0}=t,{enablePan:R=!0}=t,{enableZoom:I=!0}=t,{enableZoomControls:E=I}=t,{enableZoomInput:A=!0}=t,{enablePanInput:L=!0}=t,{enablePanLimit:F=!0}=t,{panLimitGutterScalar:z=0}=t,{zoomOptions:D=[.25,.5,1,1.25,1.5,2,3,4,6,8,16]}=t,{zoomAdjustStep:O=.25}=t,{zoomAdjustFactor:B=.1}=t,{zoomAdjustWheelFactor:W=1}=t,{elasticity:_=5}=t,{imageSelectionRectCentered:V}=t,{imageSelectionRectScalar:N}=t,{zoomLevel:H=null}=t,{zoomControls:j}=t,{zoomMultiTouching:U=!1}=t;const{isAnimated:G,isInteracting:Z,rootRect:X,stageRect:Y,stageScalar:q,imageSelectionPan:K,imageSelectionZoom:J,imageSelectionStageFitScalar:Q,imageSelectionRect:ee,imageSelectionStoredState:te,imagePreviewUpscale:oe}=T;hn(e,G,(e=>o(70,w=e))),hn(e,Z,(e=>o(69,x=e))),hn(e,X,(e=>o(66,f=e))),hn(e,Y,(e=>o(65,$=e))),hn(e,q,(e=>o(46,v=e))),hn(e,K,(e=>o(64,h=e))),hn(e,J,(e=>o(43,p=e))),hn(e,Q,(e=>o(44,m=e))),hn(e,ee,(e=>o(67,y=e))),hn(e,te,(e=>o(71,S=e))),hn(e,oe,(e=>o(45,g=e)));const ie=ca("fixScrollDirection");hn(e,ie,(e=>o(68,b=e)));let re=!1,ne=void 0,ae=void 0,se=void 0,le=void 0;const ce=e=>{const t=k.querySelector(".PinturaMain > .PinturaUtilMain")||k.querySelector('div[tabindex="0"] .PinturaUtilMain');return!!t&&(!!t.contains(e.target)&&!_d(e.target))},de=(e={})=>{const{pan:t=h,zoom:o=p}=e;vn(te,S={translation:t,zoom:o},S)},ue=()=>h&&0===h.x&&0===h.y,pe=()=>{vn(J,p=void 0,p),ue()||vn(K,h=he(),h),fe.set(void 0,{hard:!0})},ge=()=>{pe(),de()},fe=xc(void 0,{precision:.01});fe.subscribe((e=>{if(void 0===e)return vn(J,p=void 0,p),void(ue()||vn(K,h=he(),h));const t=p;e<=1?ue()||vn(K,h=he(),h):e<=t&&vn(K,h=Me(h,.8),h),vn(J,p=e,p)}));const ye=e=>{fe.update((t=>{const o=e(t||m);return de({zoom:o}),o}))},xe=e=>{e?fe.set(e,{hard:!1===w}):(e=void 0,fe.set(void 0,{hard:!0})),vn(J,p=e,p),de({zoom:e})},ve=(e,t)=>{const o=N*t,i={...V},r=1-$s(z,0,1);ut(i,o<r?o:r);const n={...V};ut(n,o),dt(n,e);const a={...n};return n.x>i.x&&(a.x=i.x),n.y>i.y&&(a.y=i.y),n.x+n.width<i.x+i.width&&(a.x=i.x+i.width-n.width),n.y+n.height<i.y+i.height&&(a.y=i.y+i.height-n.height),Ce(ct(a),ct(i))},we=({translation:e,zoom:t=1,elastify:o=!0})=>{if(!ne)return;let i=e;const r=me(ne.x+i.x,ne.y+i.y);if(!F)return r;const n=ve(r,t);return o?Mh(n,r,_):n};let Se,ke;const Pe=()=>{ke=void 0,vn(Z,x=!0,x),o(34,re=L),Se=!1,se=!1,ne={...h},ae=g?p||m:n?p||1:p||m},Re=e=>{const{scalar:t,translation:r,isMultiTouching:n}=e.detail;if(!ne||!n&&!L)return;n&&Me(r,.5),(L||n)&&(Se=!0),U||o(13,U=n);const a=i?$s(ae*t,s,l):1,c=we({translation:r,zoom:a,elastify:!0}),d=be(c);le=be(h),se=d<le,i&&J.set(a),K.set(c),ke=U&&{translation:e.detail.translation,scalar:t}},Ie=e=>{vn(Z,x=!1,x),o(34,re=!1),o(13,U=!1),se&&le<50&&(ne=void 0,ae=void 0,K.set(he()))},Ee=e=>{vn(Z,x=!1,x),o(34,re=!1),o(13,U=!1),Promise.resolve().then((()=>{if(Se&&ne){const t=ke||e.detail,o=i?$s(ae*t.scalar,s,l):1,r=we({elastify:!1,translation:t.translation,zoom:o});K.set(r)}ne=void 0,ae=void 0,L&&e.detail.isDoubleTap&&ge(),de()}))};let Ae,Le=Date.now(),Fe=0,ze=!1,De=!1;const Oe=e=>{if(!ce(e))return;if(e.preventDefault(),e.stopPropagation(),De)return;clearTimeout(Ae);const t=Rh(e,{fixScrollDirection:b}),o=Date.now(),i=o-Le;Le=o;const r=Math.abs(t/i)>.2;Fe=r?Fe+1:0;const n=1+-1*t*W/(r?50:100),a=pm(e,f,$);Be(a,n,{isZoomingFast:r})},Be=(e,t,{isZoomingFast:o})=>{const i=g?p||m:n?p||1:p||m,r=i*t,a=he(),c=h,d=g?m:n?1:m,u=Math.abs(r-d),$=r<i,f=i>d&&$||i<d&&r>i,b=Fe>=5;if(o||(ze=!1),Fe>0&&!ze&&(ze=f),b&&ze)return ge(),De=!0,void setTimeout((()=>{De=!1}),100);if(b)return;!o&&f&&u<=.05&&(Ae=setTimeout((()=>{ge()}),250)),vn(J,p=$s(r,s,l),p);const x=et(y);ut(x,i),dt(x,c);const v=ct(x),w=et(x);ut(w,p-i+1,e);const S=ct(w),k=Te(Ce(S,v),i);((e,t,o)=>{e.x=t,e.y=o})(a,c.x+k.x,c.y+k.y),vn(K,h=$&&o?Me($e(h),.85):ve(a,i),h),de()},We=e=>(e?"add":"remove")+"EventListener";let _e,Ve,Ne,He;const je=e=>{e.preventDefault(),Ve={...h},He=et(y),Ne=pm(e,f,$),_e=g?p||m:n?p||1:p||m},Ue=e=>{e.preventDefault(),vn(J,p=$s(e.scale*_e,s,l),p);const t=et(He);ut(t,_e),dt(t,Ve);const o=ct(t),i=et(t);ut(i,p-_e+1,Ne);const r=ct(i),n=Te(Ce(r,o),_e),a={x:Ve.x+n.x,y:Ve.y+n.y};vn(K,h=ve(a,p),h)},Ge=e=>{e.preventDefault()},Ze=e=>{k[We(e)]("wheel",Oe),vo()||(k[We(e)]("gesturestart",je),k[We(e)]("gesturechange",Ue),k[We(e)]("gestureend",Ge))},Xe=e=>{const t=We(e);k[t]("interactionstart",Pe),k[t]("interactionupdate",Re),k[t]("interactionrelease",Ie),k[t]("interactionend",Ee)};let Ye;return ra((()=>{Ye=kh(k,{drag:!0,pinch:!0,inertia:!0,inertiaDurationMultiplier:10,shouldStartInteraction:ce})})),aa((()=>{Ze(!1),Xe(!1),Ye.destroy(),Ye=void 0})),e.$$set=e=>{"root"in e&&o(14,k=e.root),"locale"in e&&o(15,C=e.locale),"stores"in e&&o(16,T=e.stores),"allowPan"in e&&o(17,M=e.allowPan),"allowZoom"in e&&o(18,P=e.allowZoom),"enablePan"in e&&o(19,R=e.enablePan),"enableZoom"in e&&o(20,I=e.enableZoom),"enableZoomControls"in e&&o(21,E=e.enableZoomControls),"enableZoomInput"in e&&o(22,A=e.enableZoomInput),"enablePanInput"in e&&o(23,L=e.enablePanInput),"enablePanLimit"in e&&o(24,F=e.enablePanLimit),"panLimitGutterScalar"in e&&o(25,z=e.panLimitGutterScalar),"zoomOptions"in e&&o(26,D=e.zoomOptions),"zoomAdjustStep"in e&&o(27,O=e.zoomAdjustStep),"zoomAdjustFactor"in e&&o(28,B=e.zoomAdjustFactor),"zoomAdjustWheelFactor"in e&&o(29,W=e.zoomAdjustWheelFactor),"elasticity"in e&&o(30,_=e.elasticity),"imageSelectionRectCentered"in e&&o(31,V=e.imageSelectionRectCentered),"imageSelectionRectScalar"in e&&o(32,N=e.imageSelectionRectScalar),"zoomLevel"in e&&o(33,H=e.zoomLevel),"zoomControls"in e&&o(12,j=e.zoomControls),"zoomMultiTouching"in e&&o(13,U=e.zoomMultiTouching)},e.$$.update=()=>{var t,$;5505024&e.$$.dirty[0]&&o(36,i=P&&I&&A),655360&e.$$.dirty[0]&&o(35,r=M&&R),393216&e.$$.dirty[0]&&(M||P?(vn(J,p=I?S.zoom:void 0,p),vn(K,h=R?$e(S.translation):ue()?h:he(),h),fe.set(p)):pe()),32768&e.$$.dirty[1]&&(n=v>=1),67141632&e.$$.dirty[0]|57344&e.$$.dirty[1]&&o(40,a=[(g||v<1)&&[m,dm(m)+"%",{sublabel:C.labelZoomFit}],...D.map((e=>[e,dm(e)+"%"]))].filter(Boolean).map((e=>(1===e[0]&&(e[2]={sublabel:C.labelZoomActual}),e))).sort(((e,t)=>{const o=e[0]||m,i=t[0]||m;return o<i?-1:i<o?1:0}))),8704&e.$$.dirty[1]&&o(38,s=Math.min(a.reduce(((e,[t])=>t<e?t:e),Number.MAX_SAFE_INTEGER),m)),512&e.$$.dirty[1]&&o(37,l=a.reduce(((e,[t])=>t>e?t:e),Number.MIN_SAFE_INTEGER)),4&e.$$.dirty[1]&&null!==H&&xe(H),61440&e.$$.dirty[1]&&o(42,d=p||(g||v<1?m:1)),2560&e.$$.dirty[1]&&o(39,(t=a.map((([e])=>e)),$=d,c=t.findIndex((e=>e===$)))),2048&e.$$.dirty[1]&&o(41,u=dm(d)+"%"),405045248&e.$$.dirty[0]|6080&e.$$.dirty[1]&&o(12,j=(P||P)&&E?[["Button","zoom-out",{hideLabel:!0,label:C.labelZoomOut,icon:C.iconZoomOut,disabled:p===s,onclick:()=>ye((e=>Math.max(s,e-O))),onhold:()=>ye((e=>Math.max(s,e*(1-B))))}],["Dropdown","zoom-level",{label:u,title:C.labelZoom,labelClass:"PinturaFixedWidthCharacters",options:a,selectedIndex:c,onchange:e=>xe(e.value)}],["Button","zoom-in",{hideLabel:!0,label:C.labelZoomIn,icon:C.iconZoomIn,disabled:p===l,onclick:()=>ye((e=>Math.min(l,e+O))),onhold:()=>ye((e=>Math.min(l,e*(1+B))))}]]:[]),16384&e.$$.dirty[0]|32&e.$$.dirty[1]&&k&&Ze(i),16384&e.$$.dirty[0]|16&e.$$.dirty[1]&&k&&Xe(r),8404992&e.$$.dirty[0]|24&e.$$.dirty[1]&&k&&k.style.setProperty("--cursor",r&&L?re?"grabbing":"grab":"")},[G,Z,X,Y,q,K,J,Q,ee,te,oe,ie,j,U,k,C,T,M,P,R,I,E,A,L,F,z,D,O,B,W,_,V,N,H,re,r,i,l,s,c,a,u,d,p,m,g,v]}class mm extends Ga{constructor(e){super(),Ua(this,e,hm,null,ln,{root:14,locale:15,stores:16,allowPan:17,allowZoom:18,enablePan:19,enableZoom:20,enableZoomControls:21,enableZoomInput:22,enablePanInput:23,enablePanLimit:24,panLimitGutterScalar:25,zoomOptions:26,zoomAdjustStep:27,zoomAdjustFactor:28,zoomAdjustWheelFactor:29,elasticity:30,imageSelectionRectCentered:31,imageSelectionRectScalar:32,zoomLevel:33,zoomControls:12,zoomMultiTouching:13},null,[-1,-1,-1,-1])}}const{window:gm}=za;function $m(e){let t,o,i,r=e[41]&&fm(e),n=e[38]&&Tm(e);return{c(){r&&r.c(),t=On(),n&&n.c(),o=Bn()},m(e,a){r&&r.m(e,a),An(e,t,a),n&&n.m(e,a),An(e,o,a),i=!0},p(e,i){e[41]?r?(r.p(e,i),1024&i[1]&&Ea(r,1)):(r=fm(e),r.c(),Ea(r,1),r.m(t.parentNode,t)):r&&(Ra(),Aa(r,1,1,(()=>{r=null})),Ia()),e[38]?n?(n.p(e,i),128&i[1]&&Ea(n,1)):(n=Tm(e),n.c(),Ea(n,1),n.m(o.parentNode,o)):n&&(Ra(),Aa(n,1,1,(()=>{n=null})),Ia())},i(e){i||(Ea(r),Ea(n),i=!0)},o(e){Aa(r),Aa(n),i=!1},d(e){r&&r.d(e),e&&Ln(t),n&&n.d(e),e&&Ln(o)}}}function fm(e){let t,o,i,r,n;const a=[bm,ym],s=[];function l(e,t){return e[39]?0:e[35]?1:-1}return~(i=l(e))&&(r=s[i]=a[i](e)),{c(){t=Fn("div"),o=Fn("p"),r&&r.c(),Zn(o,"transform",e[72]),Nn(t,"class","PinturaStatus"),Zn(t,"opacity",e[54])},m(e,r){An(e,t,r),Rn(t,o),~i&&s[i].m(o,null),n=!0},p(e,n){let c=i;i=l(e),i===c?~i&&s[i].p(e,n):(r&&(Ra(),Aa(s[c],1,1,(()=>{s[c]=null})),Ia()),~i?(r=s[i],r?r.p(e,n):(r=s[i]=a[i](e),r.c()),Ea(r,1),r.m(o,null)):r=null),1024&n[2]&&Zn(o,"transform",e[72]),8388608&n[1]&&Zn(t,"opacity",e[54])},i(e){n||(Ea(r),n=!0)},o(e){Aa(r),n=!1},d(e){e&&Ln(t),~i&&s[i].d()}}}function ym(e){let t,o,i,r;t=new zh({props:{text:e[35].text||"",onmeasure:e[221]}});let n=e[35].aside&&xm(e);return{c(){Na(t.$$.fragment),o=On(),n&&n.c(),i=Bn()},m(e,a){Ha(t,e,a),An(e,o,a),n&&n.m(e,a),An(e,i,a),r=!0},p(e,o){const r={};16&o[1]&&(r.text=e[35].text||""),t.$set(r),e[35].aside?n?(n.p(e,o),16&o[1]&&Ea(n,1)):(n=xm(e),n.c(),Ea(n,1),n.m(i.parentNode,i)):n&&(Ra(),Aa(n,1,1,(()=>{n=null})),Ia())},i(e){r||(Ea(t.$$.fragment,e),Ea(n),r=!0)},o(e){Aa(t.$$.fragment,e),Aa(n),r=!1},d(e){ja(t,e),e&&Ln(o),n&&n.d(e),e&&Ln(i)}}}function bm(e){let t,o,i,r;return t=new zh({props:{text:e[39],onmeasure:e[221]}}),i=new Bh({props:{class:"PinturaStatusIcon",offset:e[82],opacity:e[83],$$slots:{default:[Cm]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment),o=On(),Na(i.$$.fragment)},m(e,n){Ha(t,e,n),An(e,o,n),Ha(i,e,n),r=!0},p(e,o){const r={};256&o[1]&&(r.text=e[39]),t.$set(r);const n={};1048576&o[2]&&(n.offset=e[82]),2097152&o[2]&&(n.opacity=e[83]),8&o[0]|134217728&o[19]&&(n.$$scope={dirty:o,ctx:e}),i.$set(n)},i(e){r||(Ea(t.$$.fragment,e),Ea(i.$$.fragment,e),r=!0)},o(e){Aa(t.$$.fragment,e),Aa(i.$$.fragment,e),r=!1},d(e){ja(t,e),e&&Ln(o),ja(i,e)}}}function xm(e){let t,o;return t=new Bh({props:{class:"PinturaStatusButton",offset:e[82],opacity:e[83],$$slots:{default:[Sm]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};1048576&o[2]&&(i.offset=e[82]),2097152&o[2]&&(i.opacity=e[83]),16&o[1]|134217728&o[19]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function vm(e){let t,o;return t=new Mp({props:{progress:e[35].progressIndicator.progress}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};16&o[1]&&(i.progress=e[35].progressIndicator.progress),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function wm(e){let t,o;const i=[e[35].closeButton,{hideLabel:!0}];let r={};for(let e=0;e<i.length;e+=1)r=on(r,i[e]);return t=new vh({props:r}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const r=16&o[1]?Wa(i,[_a(e[35].closeButton),i[1]]):{};t.$set(r)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Sm(e){let t,o,i,r=e[35].progressIndicator.visible&&vm(e),n=e[35].closeButton&&e[35].text&&wm(e);return{c(){r&&r.c(),t=On(),n&&n.c(),o=Bn()},m(e,a){r&&r.m(e,a),An(e,t,a),n&&n.m(e,a),An(e,o,a),i=!0},p(e,i){e[35].progressIndicator.visible?r?(r.p(e,i),16&i[1]&&Ea(r,1)):(r=vm(e),r.c(),Ea(r,1),r.m(t.parentNode,t)):r&&(Ra(),Aa(r,1,1,(()=>{r=null})),Ia()),e[35].closeButton&&e[35].text?n?(n.p(e,i),16&i[1]&&Ea(n,1)):(n=wm(e),n.c(),Ea(n,1),n.m(o.parentNode,o)):n&&(Ra(),Aa(n,1,1,(()=>{n=null})),Ia())},i(e){i||(Ea(r),Ea(n),i=!0)},o(e){Aa(r),Aa(n),i=!1},d(e){r&&r.d(e),e&&Ln(t),n&&n.d(e),e&&Ln(o)}}}function km(e){let t,o=e[3].iconSupportError+"";return{c(){t=zn("g")},m(e,i){An(e,t,i),t.innerHTML=o},p(e,i){8&i[0]&&o!==(o=e[3].iconSupportError+"")&&(t.innerHTML=o)},d(e){e&&Ln(t)}}}function Cm(e){let t,o;return t=new Sd({props:{$$slots:{default:[km]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};8&o[0]|134217728&o[19]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Tm(e){let t,o,i,r,n,a,s,l,c,d,u,p,h,m,g=e[10]&&Mm(e),$=e[46]&&e[45]&&Pm(e);const f=[zm,Fm],y=[];function b(e,t){return e[46]?0:1}function x(t){e[444](t)}function v(t){e[445](t)}function w(t){e[446](t)}i=b(e),r=y[i]=f[i](e),a=new Zc({props:{isAnimated:e[53],isTransparent:e[20],pixelRatio:e[57],textPixelRatio:e[6],backgroundColor:e[56],maskRect:e[58],maskOpacity:e[73]?e[73].maskOpacity:1,maskMarkupOpacity:e[7],maskFrameOpacity:e[5],clipAnnotationsToImage:e[85],images:e[55],interfaceImages:e[86],loadImageData:e[28],enableGrid:e[11],gridSize:e[87],gridColors:[e[88],e[89]],gridOpacity:e[90],selectionColor:e[91],csp:e[92]||{},willRequest:e[81]||e[93],willRender:e[441],didRender:e[442]}});let S={root:e[2],locale:e[3],stores:e[202],allowPan:e[95],enablePan:e[17],enablePanLimit:e[21],panLimitGutterScalar:e[22],enablePanInput:e[96],allowZoom:e[97],enableZoom:e[18],enableZoomInput:void 0!==e[19]?e[19]:e[98],enableZoomControls:e[99],zoomOptions:e[13]||e[23],zoomAdjustStep:e[14]||e[24],zoomAdjustFactor:e[15]||e[25],zoomAdjustWheelFactor:e[16]||e[26],imageSelectionRectCentered:e[100],imageSelectionRectScalar:e[101],elasticity:Vm*e[8]};return void 0!==e[0]&&(S.zoomLevel=e[0]),void 0!==e[33]&&(S.zoomControls=e[33]),void 0!==e[34]&&(S.zoomMultiTouching=e[34]),d=new mm({props:S}),pa.push((()=>Va(d,"zoomLevel",x))),pa.push((()=>Va(d,"zoomControls",v))),pa.push((()=>Va(d,"zoomMultiTouching",w))),{c(){g&&g.c(),t=On(),$&&$.c(),o=On(),r.c(),n=On(),Na(a.$$.fragment),s=On(),l=Fn("div"),c=On(),Na(d.$$.fragment),Nn(l,"class","PinturaRootPortal")},m(r,u){g&&g.m(r,u),An(r,t,u),$&&$.m(r,u),An(r,o,u),y[i].m(r,u),An(r,n,u),Ha(a,r,u),An(r,s,u),An(r,l,u),e[443](l),An(r,c,u),Ha(d,r,u),m=!0},p(e,s){e[10]?g?(g.p(e,s),1024&s[0]&&Ea(g,1)):(g=Mm(e),g.c(),Ea(g,1),g.m(t.parentNode,t)):g&&(Ra(),Aa(g,1,1,(()=>{g=null})),Ia()),e[46]&&e[45]?$?($.p(e,s),49152&s[1]&&Ea($,1)):($=Pm(e),$.c(),Ea($,1),$.m(o.parentNode,o)):$&&(Ra(),Aa($,1,1,(()=>{$=null})),Ia());let l=i;i=b(e),i===l?y[i].p(e,s):(Ra(),Aa(y[l],1,1,(()=>{y[l]=null})),Ia(),r=y[i],r?r.p(e,s):(r=y[i]=f[i](e),r.c()),Ea(r,1),r.m(n.parentNode,n));const c={};4194304&s[1]&&(c.isAnimated=e[53]),1048576&s[0]&&(c.isTransparent=e[20]),67108864&s[1]&&(c.pixelRatio=e[57]),64&s[0]&&(c.textPixelRatio=e[6]),33554432&s[1]&&(c.backgroundColor=e[56]),134217728&s[1]&&(c.maskRect=e[58]),2048&s[2]&&(c.maskOpacity=e[73]?e[73].maskOpacity:1),128&s[0]&&(c.maskMarkupOpacity=e[7]),32&s[0]&&(c.maskFrameOpacity=e[5]),8388608&s[2]&&(c.clipAnnotationsToImage=e[85]),16777216&s[1]&&(c.images=e[55]),16777216&s[2]&&(c.interfaceImages=e[86]),268435456&s[0]&&(c.loadImageData=e[28]),2048&s[0]&&(c.enableGrid=e[11]),33554432&s[2]&&(c.gridSize=e[87]),201326592&s[2]&&(c.gridColors=[e[88],e[89]]),268435456&s[2]&&(c.gridOpacity=e[90]),536870912&s[2]&&(c.selectionColor=e[91]),1073741824&s[2]&&(c.csp=e[92]||{}),524288&s[2]|1&s[3]&&(c.willRequest=e[81]||e[93]),512&s[0]|270991424&s[1]|2&s[3]&&(c.willRender=e[441]),62&s[2]&&(c.didRender=e[442]),a.$set(c);const m={};4&s[0]&&(m.root=e[2]),8&s[0]&&(m.locale=e[3]),4&s[3]&&(m.allowPan=e[95]),131072&s[0]&&(m.enablePan=e[17]),2097152&s[0]&&(m.enablePanLimit=e[21]),4194304&s[0]&&(m.panLimitGutterScalar=e[22]),8&s[3]&&(m.enablePanInput=e[96]),16&s[3]&&(m.allowZoom=e[97]),262144&s[0]&&(m.enableZoom=e[18]),524288&s[0]|32&s[3]&&(m.enableZoomInput=void 0!==e[19]?e[19]:e[98]),64&s[3]&&(m.enableZoomControls=e[99]),8396800&s[0]&&(m.zoomOptions=e[13]||e[23]),16793600&s[0]&&(m.zoomAdjustStep=e[14]||e[24]),33587200&s[0]&&(m.zoomAdjustFactor=e[15]||e[25]),67174400&s[0]&&(m.zoomAdjustWheelFactor=e[16]||e[26]),128&s[3]&&(m.imageSelectionRectCentered=e[100]),256&s[3]&&(m.imageSelectionRectScalar=e[101]),256&s[0]&&(m.elasticity=Vm*e[8]),!u&&1&s[0]&&(u=!0,m.zoomLevel=e[0],xa((()=>u=!1))),!p&&4&s[1]&&(p=!0,m.zoomControls=e[33],xa((()=>p=!1))),!h&&8&s[1]&&(h=!0,m.zoomMultiTouching=e[34],xa((()=>h=!1))),d.$set(m)},i(e){m||(Ea(g),Ea($),Ea(r),Ea(a.$$.fragment,e),Ea(d.$$.fragment,e),m=!0)},o(e){Aa(g),Aa($),Aa(r),Aa(a.$$.fragment,e),Aa(d.$$.fragment,e),m=!1},d(r){g&&g.d(r),r&&Ln(t),$&&$.d(r),r&&Ln(o),y[i].d(r),r&&Ln(n),ja(a,r),r&&Ln(s),r&&Ln(l),e[443](null),r&&Ln(c),ja(d,r)}}}function Mm(e){let t,o,i,r,n;return o=new mh({props:{items:e[69]}}),{c(){t=Fn("div"),Na(o.$$.fragment),Nn(t,"class","PinturaNav PinturaNavTools")},m(a,s){An(a,t,s),Ha(o,t,null),i=!0,r||(n=[Wn(t,"measure",e[430]),wn(Dc.call(null,t))],r=!0)},p(e,t){const i={};128&t[2]&&(i.items=e[69]),o.$set(i)},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Ln(t),ja(o),r=!1,an(n)}}}function Pm(e){let t,o,i;return o=new Ah({props:{elasticity:e[8]*Hm,scrollDirection:e[76]?"y":"x",$$slots:{default:[Lm]},$$scope:{ctx:e}}}),{c(){t=Fn("div"),Na(o.$$.fragment),Nn(t,"class","PinturaNav PinturaNavMain")},m(e,r){An(e,t,r),Ha(o,t,null),i=!0},p(e,t){const i={};256&t[0]&&(i.elasticity=e[8]*Hm),16384&t[2]&&(i.scrollDirection=e[76]?"y":"x"),12288&t[1]|135168&t[2]|134217728&t[19]&&(i.$$scope={dirty:t,ctx:e}),o.$set(i)},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Ln(t),ja(o)}}}function Rm(e){let t,o;const i=[e[79],{tabs:e[44]}];let r={$$slots:{default:[Am,({tab:e})=>({615:e}),({tab:e})=>[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,e?67108864:0]]},$$scope:{ctx:e}};for(let e=0;e<i.length;e+=1)r=on(r,i[e]);return t=new od({props:r}),t.$on("select",e[431]),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const r=8192&o[1]|131072&o[2]?Wa(i,[131072&o[2]&&_a(e[79]),8192&o[1]&&{tabs:e[44]}]):{};201326592&o[19]&&(r.$$scope={dirty:o,ctx:e}),t.$set(r)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Im(e){let t,o;return t=new mh({props:{items:e[44]}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};8192&o[1]&&(i.items=e[44]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Em(e){let t,o=e[615].icon+"";return{c(){t=zn("g")},m(e,i){An(e,t,i),t.innerHTML=o},p(e,i){67108864&i[19]&&o!==(o=e[615].icon+"")&&(t.innerHTML=o)},d(e){e&&Ln(t)}}}function Am(e){let t,o,i,r,n,a=e[615].label+"";return t=new Sd({props:{$$slots:{default:[Em]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment),o=On(),i=Fn("span"),r=Dn(a)},m(e,a){Ha(t,e,a),An(e,o,a),An(e,i,a),Rn(i,r),n=!0},p(e,o){const i={};201326592&o[19]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i),(!n||67108864&o[19])&&a!==(a=e[615].label+"")&&Un(r,a)},i(e){n||(Ea(t.$$.fragment,e),n=!0)},o(e){Aa(t.$$.fragment,e),n=!1},d(e){ja(t,e),e&&Ln(o),e&&Ln(i)}}}function Lm(e){let t,o,i,r;const n=[Im,Rm],a=[];function s(e,t){return e[74]?0:1}return t=s(e),o=a[t]=n[t](e),{c(){o.c(),i=Bn()},m(e,o){a[t].m(e,o),An(e,i,o),r=!0},p(e,r){let l=t;t=s(e),t===l?a[t].p(e,r):(Ra(),Aa(a[l],1,1,(()=>{a[l]=null})),Ia(),o=a[t],o?o.p(e,r):(o=a[t]=n[t](e),o.c()),Ea(o,1),o.m(i.parentNode,i))},i(e){r||(Ea(o),r=!0)},o(e){Aa(o),r=!1},d(e){a[t].d(e),e&&Ln(i)}}}function Fm(e){let t,o,i;function r(t){e[437](t)}let n={locale:e[3],class:"PinturaMain",view:e[207](e[43]),props:e[206](e[43],e[27]),stores:e[202]};return void 0!==e[1][e[43]]&&(n.component=e[1][e[43]]),t=new xd({props:n}),pa.push((()=>Va(t,"component",r))),t.$on("measure",e[233]),t.$on("show",e[438]),t.$on("hide",e[439]),t.$on("fade",e[440]),{c(){Na(t.$$.fragment)},m(e,o){Ha(t,e,o),i=!0},p(e,i){const r={};8&i[0]&&(r.locale=e[3]),4096&i[1]&&(r.view=e[207](e[43])),134217728&i[0]|4096&i[1]&&(r.props=e[206](e[43],e[27])),!o&&2&i[0]|4096&i[1]&&(o=!0,r.component=e[1][e[43]],xa((()=>o=!1))),t.$set(r)},i(e){i||(Ea(t.$$.fragment,e),i=!0)},o(e){Aa(t.$$.fragment,e),i=!1},d(e){ja(t,e)}}}function zm(e){let t,o;const i=[{class:"PinturaMain"},{visible:e[62]},e[79],{panels:e[78]}];let r={$$slots:{default:[Dm,({panel:e,panelIsActive:t})=>({613:e,614:t}),({panel:e,panelIsActive:t})=>[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(e?16777216:0)|(t?33554432:0)]]},$$scope:{ctx:e}};for(let e=0;e<i.length;e+=1)r=on(r,i[e]);return t=new gd({props:r}),t.$on("measure",e[436]),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const r=196609&o[2]?Wa(i,[i[0],1&o[2]&&{visible:e[62]},131072&o[2]&&_a(e[79]),65536&o[2]&&{panels:e[78]}]):{};134217738&o[0]|184549376&o[19]&&(r.$$scope={dirty:o,ctx:e}),t.$set(r)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Dm(e){let t,o,i;function r(t){e[432](t,e[613])}let n={locale:e[3],view:e[207](e[613]),props:e[206](e[613],e[27]),isActive:e[614],stores:e[202]};return void 0!==e[1][e[613]]&&(n.component=e[1][e[613]]),t=new xd({props:n}),pa.push((()=>Va(t,"component",r))),t.$on("measure",e[233]),t.$on("show",(function(){return e[433](e[613])})),t.$on("hide",(function(){return e[434](e[613])})),t.$on("fade",(function(...t){return e[435](e[613],...t)})),{c(){Na(t.$$.fragment)},m(e,o){Ha(t,e,o),i=!0},p(i,r){e=i;const n={};8&r[0]&&(n.locale=e[3]),16777216&r[19]&&(n.view=e[207](e[613])),134217728&r[0]|16777216&r[19]&&(n.props=e[206](e[613],e[27])),33554432&r[19]&&(n.isActive=e[614]),!o&&2&r[0]|16777216&r[19]&&(o=!0,n.component=e[1][e[613]],xa((()=>o=!1))),t.$set(n)},i(e){i||(Ea(t.$$.fragment,e),i=!0)},o(e){Aa(t.$$.fragment,e),i=!1},d(e){ja(t,e)}}}function Om(e){let t;return{c(){t=Fn("span"),Nn(t,"class","PinturaEditorOverlay"),Zn(t,"opacity",e[102])},m(e,o){An(e,t,o)},p(e,o){512&o[3]&&Zn(t,"opacity",e[102])},d(e){e&&Ln(t)}}}function Bm(e){let t,o;const i=[{layout:"row"},{parentRect:e[50]},e[60]];let r={$$slots:{default:[Wm]},$$scope:{ctx:e}};for(let e=0;e<i.length;e+=1)r=on(r,i[e]);return t=new Uh({props:r}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const r=537395200&o[1]?Wa(i,[i[0],524288&o[1]&&{parentRect:e[50]},536870912&o[1]&&_a(e[60])]):{};1610612736&o[1]|134217728&o[19]&&(r.$$scope={dirty:o,ctx:e}),t.$set(r)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Wm(e){let t,o,i;return{c(){t=Fn("input"),t.value=o=e[60].text,Nn(t,"placeholder",i=e[60].placeholder),Nn(t,"type","text"),Nn(t,"spellcheck","false"),Nn(t,"autocorrect","off"),Nn(t,"autocapitalize","off")},m(o,i){An(o,t,i),e[447](t)},p(e,r){536870912&r[1]&&o!==(o=e[60].text)&&t.value!==o&&(t.value=o),536870912&r[1]&&i!==(i=e[60].placeholder)&&Nn(t,"placeholder",i)},d(o){o&&Ln(t),e[447](null)}}}function _m(e){let t,o,i,r,a,s;ba(e[429]);let l=e[40]&&$m(e),c=e[102]>0&&Om(e),d=e[60]&&Bm(e);return{c(){t=Fn("div"),l&&l.c(),o=On(),c&&c.c(),i=On(),d&&d.c(),Nn(t,"id",e[4]),Nn(t,"class",e[77]),Nn(t,"data-env",e[75]),Nn(t,"dir",e[12])},m(u,p){An(u,t,p),l&&l.m(t,null),Rn(t,o),c&&c.m(t,null),Rn(t,i),d&&d.m(t,null),e[448](t),r=!0,a||(s=[Wn(gm,"keydown",e[224]),Wn(gm,"keyup",e[225]),Wn(gm,"blur",e[226]),Wn(gm,"paste",e[230]),Wn(gm,"resize",e[429]),Wn(t,"ping",(function(){sn(e[68])&&e[68].apply(this,arguments)})),Wn(t,"contextmenu",e[227]),Wn(t,"touchstart",e[222],{passive:!1}),Wn(t,"touchmove",(function(){sn(e[71])&&e[71].apply(this,arguments)})),Wn(t,"pointermove",(function(){sn(e[70])&&e[70].apply(this,arguments)})),Wn(t,"transitionend",e[212]),Wn(t,"dropfiles",e[228]),Wn(t,"measure",e[449]),Wn(t,"click",(function(){sn(e[42]?e[229]:n)&&(e[42]?e[229]:n).apply(this,arguments)})),wn(Dc.call(null,t,{observeViewRect:!0,isMeasureRoot:!0})),wn(Oc.call(null,t)),wn(_c.call(null,t))],a=!0)},p(n,a){(e=n)[40]?l?(l.p(e,a),512&a[1]&&Ea(l,1)):(l=$m(e),l.c(),Ea(l,1),l.m(t,o)):l&&(Ra(),Aa(l,1,1,(()=>{l=null})),Ia()),e[102]>0?c?c.p(e,a):(c=Om(e),c.c(),c.m(t,i)):c&&(c.d(1),c=null),e[60]?d?(d.p(e,a),536870912&a[1]&&Ea(d,1)):(d=Bm(e),d.c(),Ea(d,1),d.m(t,null)):d&&(Ra(),Aa(d,1,1,(()=>{d=null})),Ia()),(!r||16&a[0])&&Nn(t,"id",e[4]),(!r||32768&a[2])&&Nn(t,"class",e[77]),(!r||8192&a[2])&&Nn(t,"data-env",e[75]),(!r||4096&a[0])&&Nn(t,"dir",e[12])},i(e){r||(Ea(l),Ea(d),r=!0)},o(e){Aa(l),Aa(d),r=!1},d(o){o&&Ln(t),l&&l.d(),c&&c.d(),d&&d.d(),e[448](null),a=!1,an(s)}}}const Vm=1,Nm="stage-overlay",Hm=10;function jm(e,t,o){let i,r,a,s,l,c,u,p,g,$,f,b,x,v,k,C,T,M,P,I,E,A,F,z,D,B,W,_,V,N,H,j,U,G,Z,X,q,K,J,Q,ee,te,oe,ie,re,ne,ae,se,le,ce,ue,pe,ge,$e,fe,ye,be,xe,ve,we,ke,Ce,Te,Me,Pe,Re,Ie,Ee,Ae,Le,Fe,ze,De,Oe,Be,We,_e,Ve,He,je,Ue,Ge,Ze,Xe,Ye,qe,Ke,Je,Qe,it,rt,at,st,ct,pt,ht,ft,yt,vt,wt,Ct,Mt,Rt,It,Et,At,Lt,Ft,zt,Dt,Ot,Bt,Wt,_t,Vt,Nt,Ht,Gt,Zt,Xt,Yt,qt,Kt,Jt,eo,to,oo,io,ro,no,ao,so,lo,co,uo,po,ho,mo,$o,fo,yo,bo,xo,wo,So,ko,Co,To,Mo,Po,Ro,Io,Eo,Ao,Lo,Fo,zo,Do,Bo,Wo,_o,Vo,No,Ho,jo,Uo,Zo,Xo,Yo,qo,Ko,Jo,ei,ti,oi,ii,ri,ni,ai,si,li,ci,di,ui,pi,hi,mi,gi,$i,fi,yi,bi,vi,wi,Si,ki,Ci,Ti,Ri,Ii,Ei,Li,Fi,Di,Oi,Wi,_i,Vi,Ni,Hi,ji,Ui,Gi,Zi,Xi,Yi=en,qi=en;hn(e,vc,(e=>o(417,ii=e))),e.$$.on_destroy.push((()=>Yi())),e.$$.on_destroy.push((()=>qi()));const Ki=Qo(),Ji=sa();let{class:Qi}=t,{layout:er}=t,{stores:tr}=t,{locale:or}=t,{id:ir}=t,{util:rr}=t,{utils:nr}=t,{animations:ar="auto"}=t,{disabled:sr=!1}=t,{previewUpscale:lr=!1}=t,{previewPad:cr=!1}=t,{previewMaskOpacity:dr=.95}=t,{previewImageDataMaxSize:ur}=t,{previewImageTextPixelRatio:pr}=t,{markupMaskOpacity:hr=1}=t,{zoomMaskOpacity:mr=.85}=t,{elasticityMultiplier:gr=10}=t,{willRevert:$r=(()=>Promise.resolve(!0))}=t,{willProcessImage:fr=(()=>Promise.resolve(!0))}=t,{willRenderCanvas:yr=Y}=t,{willRenderToolbar:br=Y}=t,{willRenderUtilTabs:xr=Y}=t,{willSetHistoryInitialState:wr=Y}=t,{enableButtonExport:Sr=!0}=t,{enableButtonRevert:kr=!0}=t,{enableNavigateHistory:Cr=!0}=t,{enableToolbar:Pr=!0}=t,{enableUtils:Rr=!0}=t,{enableButtonClose:Ir=!1}=t,{enableDropImage:Ar=!1}=t,{enablePasteImage:Lr=!1}=t,{enableBrowseImage:Fr=!1}=t,{enableTransparencyGrid:zr=!1}=t,{layoutDirectionPreference:Dr="auto"}=t,{layoutHorizontalUtilsPreference:Or="left"}=t,{layoutVerticalUtilsPreference:Br="bottom"}=t,{layoutVerticalToolbarPreference:Wr="top"}=t,{layoutVerticalControlGroupsPreference:_r="bottom"}=t,{layoutVerticalControlTabsPreference:Vr="bottom"}=t,{status:Nr}=t,{formatStatusImageLoading:Hr=function(e,t){const{state:o}=e;if(!o||!o.task)return t.statusImageLoadNone;if(o.error){if("IMAGE_TOO_SMALL"===o.error.code)return t.statusImageLoadMinSize;if("VIDEO_TOO_SHORT"===o.error.code){const e=Array.isArray(t.unitSeconds)?1===o.error.metadata.minDuration?t.unitSeconds[0]:t.unitSeconds[1]:t.unitSeconds;return Il(t.statusImageLoadMinDuration,{seconds:e},"{","}")}return t.statusImageLoadError}return"blob-to-bitmap"===o.task?t.statusImageLoadPrepare:t.statusImageLoadBusy}}=t,{formatStatusImageProcessing:jr=function(e,t){const{state:o}=e;if(o&&o.task)return"store"===o.task?o.error?t.statusImageUploadError:t.statusImageUploadBusy:o.error?t.statusImageProcessError:t.statusImageProcessBusy}}=t,{formatStatusSupportError:Ur=function(e,t){const{features:o}=e;return{features:o.join(", ")}}}=t,{textDirection:Gr}=t,{markupEditorZoomLevel:Zr=null}=t,{markupEditorZoomLevels:Xr}=t,{markupEditorZoomAdjustStep:Yr}=t,{markupEditorZoomAdjustFactor:qr}=t,{markupEditorZoomAdjustWheelFactor:Kr}=t,{markupEditorInteractionMode:tn=!1}=t,{muteAudio:on=!0}=t,{willSetMediaInitialTimeOffset:rn=((e,t)=>e*cm(t[0]))}=t,{enablePan:nn=!0}=t,{enableZoom:an=!0}=t,{enableZoomControls:sn=!0}=t,{enableZoomInput:ln}=t,{enablePanInput:cn}=t,{enableCanvasAlpha:dn=!1}=t,{enablePanLimit:mn}=t,{panLimitGutterScalar:gn}=t,{pan:$n=null}=t,{zoomPresetOptions:fn=[.25,.5,1,1.25,1.5,2,3,4,6,8,16]}=t,{zoomAdjustStep:yn=.25}=t,{zoomAdjustFactor:bn=.1}=t,{zoomAdjustWheelFactor:xn=1}=t,{zoomLevel:wn=null}=t,{fixScrollDirection:Sn=!1}=t;const kn=Ya(Sn);la("fixScrollDirection",kn);const Cn=d()&&"visualViewport"in window,Tn=Ya("hidden");function Mn(e){const{height:t,scale:o}=e.target,i=t*o/window.screen.height<.75?"visible":"hidden";Tn.set(i)}let Pn,Rn;la("softKeyboardState",Tn),Cn&&window.visualViewport.addEventListener("resize",Mn);let{imagePreviewSrc:In}=t,{imageOrienter:En={read:()=>1,apply:e=>e}}=t,{pluginComponents:An}=t,{pluginOptions:Ln={}}=t;const Fn=Ki.sub,zn={};let{root:Dn}=t;const On=()=>{Rt.setAttribute("data-redraw","true"),na.set({})},Bn=Ya(!0);hn(e,Bn,(e=>o(483,qt=e)));const Wn=Ya(void 0);hn(e,Wn,(e=>o(427,vi=e)));const _n=Ya(0);hn(e,_n,(e=>o(424,fi=e)));const Vn=Ya(!1),Nn=e=>{Vn.set("play"===e.type),Ki.pub(e.type)};let Hn,jn;let Un,Gn,Zn=!1;const Xn=()=>{if(!a||!qn())return;Gn=g,vn(Wn,vi=void 0,vi);const e=Rt;Zn=!1;const t=1/24,o=oa();(Math.abs(u*o-fi*o)<=t||o-o*fi<=t)&&vn(_n,fi=c,fi),ra(fi*oa()),e.play().catch((()=>{}));let i=ia();const r=()=>{if(qn())return;Un=requestAnimationFrame(r);let e=ia();e-i<=0&&(e=i+.01),i=e,vn(_n,fi=e/oa(),fi),Gn>=0&&fi>=u&&(vn(_n,fi=u,fi),Yn()),g>-1&&(Zn=!0),Zn&&-1===g&&$>0&&(vn(_n,fi=l[$][0],fi),ra(fi*oa())),vn(wa,hi=fi*oa(),hi),On()};r()},Yn=()=>{a&&!qn()&&(vn(Wn,vi=void 0,vi),Gn=void 0,Rt.pause(),cancelAnimationFrame(Un),On())},qn=()=>Rt&&Rt.paused,Kn=()=>{if(a)return qn()?Xn():Yn()},Jn=()=>{if(!a)return;Rt.muted=!0},Qn=()=>{if(!a)return;Rt.muted=!1},ea=()=>{a&&vn(ta,bi=!bi,bi)},ta=Ya(on);hn(e,ta,(e=>o(426,bi=e)));const oa=()=>{if(a)return Rt.duration},ia=()=>{if(!a)return;return Rt.currentTime},ra=e=>{a&&(Gh(Rt,e),vn(_n,fi=e/yi,fi))},na=Ya({});hn(e,na,(e=>o(52,eo=e))),la("redrawTrigger",na);const ca=Ya(gr);hn(e,ca,(e=>o(500,gi=e))),la("elasticityMultiplier",ca);let da=[];const ua=xc();hn(e,ua,(e=>o(102,Xi=e)));const ha=tc()||1024,ma=Ne(ha,ha),ga=Os(),$a=e=>Promise.resolve(mi&&mi(e,{resourceType:"image"})).then((t=>{if(!1===t)return;const{headers:o,credentials:i}=t||{};return fetch(e,{headers:o,credentials:i}).then((e=>{if(200!==e.status)throw`${e.status} (${e.statusText})`;return e.blob()})).then((e=>Jh(e,En,ga))).then((e=>Qh(e,x)))}));let{imageSourceToImageData:fa=(e=>m(e)?$a(e):jt(e)?new Promise((t=>t(h(e)))):go(e)||Ut(e)?Jh(e,En,ga).then((e=>Qh(e,x))):void 0)}=t;const ya=(()=>{let e,t;const o=Xh.reduce(((e,o)=>(e[o]=function(e,t,o){let i=[];return{set:t,update:o,publish:e=>{i.forEach((t=>t(e)))},subscribe:t=>(i.push(t),e(t),()=>{i=i.filter((e=>e!==t))})}}((e=>{if(!t)return e();t.stores[o].subscribe(e)()}),(e=>{t&&t.stores[o].set(e)}),(e=>{t&&t.stores[o].update(e)})),e)),{});return{update:i=>{if(t=i,e&&(e.forEach((e=>e())),e=void 0),!i)return o.file.publish(void 0),void o.loadState.publish(void 0);e=Xh.map((e=>i.stores[e].subscribe((t=>{o[e].publish(t)}))))},stores:o,destroy:()=>{e&&e.forEach((e=>e()))}}})(),{file:ba,size:xa,duration:va,currentTime:wa,trim:Sa,volume:ka,minDuration:Ca,maxDuration:Ta,loadState:Ma,processState:Pa,cropAspectRatio:Ra,cropLimitToImage:Ia,crop:Ea,cropMinSize:Aa,cropMaxSize:La,cropRange:Fa,cropOrigin:za,cropRectAspectRatio:Da,rotation:Oa,rotationRange:Ba,targetSize:Wa,flipX:_a,flipY:Va,backgroundColor:Na,backgroundImage:Ha,colorMatrix:ja,convolutionMatrix:Ua,gamma:Ga,vignette:Za,noise:Ka,decoration:Ja,annotation:Qa,manipulation:es,redaction:ts,frame:os,selection:is,state:rs}=ya.stores;hn(e,ba,(e=>o(401,So=e))),hn(e,xa,(e=>o(375,At=e))),hn(e,va,(e=>o(425,yi=e))),hn(e,wa,(e=>o(499,hi=e))),hn(e,Sa,(e=>o(422,pi=e))),hn(e,ka,(e=>o(423,$i=e))),hn(e,Ta,(e=>o(428,wi=e))),hn(e,Ma,(e=>o(393,uo=e))),hn(e,Pa,(e=>o(392,co=e))),hn(e,Ra,(e=>o(496,ni=e))),hn(e,Ia,(e=>o(85,Ti=e))),hn(e,Ea,(e=>o(412,No=e))),hn(e,Oa,(e=>o(378,zt=e))),hn(e,_a,(e=>o(377,Ft=e))),hn(e,Va,(e=>o(376,Lt=e))),hn(e,Na,(e=>o(383,Zt=e))),hn(e,Ja,(e=>o(48,Et=e))),hn(e,Qa,(e=>o(49,Dt=e))),hn(e,es,(e=>o(380,Nt=e))),hn(e,ts,(e=>o(381,Ht=e))),hn(e,os,(e=>o(47,It=e))),hn(e,is,(e=>o(59,ci=e))),hn(e,rs,(e=>o(485,To=e))),la("components",{DynamicComponentTree:mh}),la("previewcontrols",{play:Xn,pause:Yn,togglePlayPause:Kn,mute:Jn,unmute:Qn,toggleMute:ea,setCurrentTime:ra,getCurrentTime:ia,getDuration:oa,frameOffset:_n,framePeekOffset:Wn,isPlaying:Vn,isMuted:ta});const ns=(e,t,o=0)=>new Promise(((i,r)=>{if(Zs(e))return void js(e).then((e=>{const t=Oo(hi)?hi:rn(e.duration,pi||[[0,1]]);Us(e,t).then(i)}));let n,a=!1;t.cancel=()=>a=!0;const s=Date.now();fa(e).then((e=>{const t=Date.now()-s;clearTimeout(n),n=setTimeout((()=>{a||i(e)}),Math.max(0,o-t))})).catch(r)})),{images:as,shapePreprocessor:ss,imageScrambler:ls,imageRedactionRendering:cs,willRequest:ds,willRequestResource:us,csp:ps}=tr;let hs;hn(e,as,(e=>o(421,ui=e))),hn(e,ss,(e=>o(420,di=e))),hn(e,ls,(e=>o(384,Xt=e))),hn(e,cs,(e=>o(382,Gt=e))),hn(e,ds,(e=>o(81,mi=e))),hn(e,us,(e=>o(93,Wi=e))),hn(e,ps,(e=>o(92,Oi=e)));const ms=qa(Ha,((e,t)=>{if(!e)return t(void 0);hs&&(hs.cancel(),hs=void 0),hs={cancel:n},ns(e,hs).then(t).catch((e=>{}))})),gs=rs.subscribe((e=>Ki.pub("update",e))),fs=Ya();la("ui",Ya({})),la("selection",is);const ys=Ya(!0);hn(e,ys,(e=>o(95,Vi=e)));const bs=Ya(!0);hn(e,bs,(e=>o(97,Hi=e)));const xs=Ya(!0);hn(e,xs,(e=>o(419,li=e)));const ws=Ya(!0);hn(e,ws,(e=>o(497,ai=e)));const Ss=Ya(!0);hn(e,Ss,(e=>o(98,ji=e)));const ks=Ya();hn(e,ks,(e=>o(99,Ui=e)));const Cs=Ya();hn(e,Cs,(e=>o(498,si=e)));const Ts=qa([Cs,ws],(()=>void 0!==si?si:ai));hn(e,Ts,(e=>o(96,Ni=e)));const Ms=Ya([0,0,0]);hn(e,Ms,(e=>o(56,Eo=e)));const Rs=Ya([1,1,1]);hn(e,Rs,(e=>o(481,Vt=e)));const Is=xc([1,1,1]);hn(e,Is,(e=>o(480,_t=e)));const Es=Ya();hn(e,Es,(e=>o(91,Di=e)));const As=Ya(),Ls=Ya();hn(e,Ls,(e=>o(51,Kt=e)));const Fs=Ya();hn(e,Fs,(e=>o(373,Ct=e)));const zs=Ya(tt());hn(e,zs,(e=>o(80,Mo=e)));const Ds=Ya(0);hn(e,Ds,(e=>o(418,ri=e)));const Bs=Ya(tt());hn(e,Bs,(e=>o(84,Ci=e)));const Ws=Ya();hn(e,Ws,(e=>o(478,Mt=e)));const _s=Kh("(pointer: fine)",(e=>e?"pointer-fine":"pointer-coarse"));hn(e,_s,(e=>o(399,xo=e)));const Vs=Kh("(hover: hover)",(e=>e?"pointer-hover":"pointer-no-hover"));hn(e,Vs,(e=>o(398,bo=e)));const Ns=Ya(!1),Hs=Ya(!1);hn(e,Hs,(e=>o(379,Wt=e)));const Gs=Xa(void 0,(e=>{const t=xc(0),o=[Hs.subscribe((e=>{t.set(e?1:0,{hard:!oo})})),t.subscribe(e)];return()=>o.forEach((e=>e()))}));hn(e,Gs,(e=>o(479,Bt=e)));const Xs=Ya();hn(e,Xs,(e=>o(484,$o=e)));const Ys=Ya();let qs;hn(e,Ys,(e=>o(53,oo=e))),la("isAnimated",Ys);const Ks=Ya(lr);hn(e,Ks,(e=>o(402,ko=e)));const Js=Ya(!1);hn(e,Js,(e=>o(490,Uo=e))),la("imageIsStatic",Js);const Qs=Ya();hn(e,Qs,(e=>o(491,Zo=e)));const el=Ya();hn(e,el,(e=>o(488,Ho=e)));const tl=Xa(void 0,(e=>{const t=Ya(void 0),o=[Ea.subscribe((()=>{if(!No)return;if(Uo)return t.set(et(No));const e=Th(No,Ho,5*gr);t.set(e)})),t.subscribe(e)];return()=>o.forEach((e=>e()))})),ol=Ya();hn(e,ol,(e=>o(487,Vo=e)));const il=Ya();hn(e,il,(e=>o(489,jo=e)));const rl=Ya(void 0);hn(e,rl,(e=>o(494,ei=e)));const nl=Ya(he());hn(e,nl,(e=>o(495,ti=e)));const al=(e,t)=>{if(!t||!e)return{top:0,right:0,bottom:0,left:0};const o=Mr(t,e,v),i=Tr(o,e);return{top:Math.abs(i.top),right:Math.abs(i.right),bottom:Math.abs(i.bottom),left:Math.abs(i.left)}},sl=Ya({}),ll=qa([Ws,zs,Bs,sl],(([e,t,o,i],r)=>{if(!e)return r(void 0);let n=0;1!==N.length||f||"bottom"===Wr||(n=o.y+o.height),r(lt(e.x+t.x,e.y+t.y+n,e.width,e.height))}));let cl={left:0,right:0,top:0,bottom:0};const dl=Ya(!1),ul=qa([dl,os,ll,Hs],(([e,t,o,i],r)=>{if(!o)return r({left:0,right:0,top:0,bottom:0});if(!e)return;const n=Math.min(o.width,o.height),a=al({width:n,height:n},t);de(cl.top,4)===de(a.top,4)&&de(cl.bottom,4)===de(a.bottom,4)&&de(cl.right,4)===de(a.right,4)&&de(cl.left,4)===de(a.left,4)||(cl=a,r(a))}));hn(e,ul,(e=>o(410,Bo=e)));const pl=qa([dl,ul],(([e,t],o)=>{if(!e)return o(!1);o(Object.values(t).some((e=>e>0)))}));hn(e,pl,(e=>o(411,Wo=e)));const hl=qa([dl,Ws,pl,ul],(([e,t,o,i],r)=>{if(t)return e&&o?void r(lt(t.x+i.left,t.y+i.top,t.width-i.left-i.right,t.height-i.top-i.bottom)):r({...t})})),ml=qa([ll,pl,ul],(([e,t,o],i)=>e?t?void i(lt(e.x+o.left,e.y+o.top,e.width-o.left-o.right,e.height-o.top-o.bottom)):i(e):i(void 0)));hn(e,ml,(e=>o(50,Ot=e)));const gl=qa([Js,xa,Oa],(([e,t,o],i)=>{if(!e||!t)return i(void 0);const r=ot(t);i(bt(r,o))})),$l=qa([gl],(([e],t)=>{if(!e)return t(void 0);const o=nt(e);t(Pt(o))}));hn(e,$l,(e=>o(414,qo=e)));const fl=qa([ml,Ea,$l,Ks],(([e,t,o,i],r)=>{if(!e||!t||!(!Zo&&!Ho))return;const{width:n,height:a}=o||t,s=Math.min(e.width/n,e.height/a);r(i?s:Math.min(1,s))}));hn(e,fl,(e=>o(413,Yo=e)));la("imageStaticVisualCorners",qa([Js,xa,Oa,ml,Ws,fl],(([e,t,o,i,r,n],a)=>{if(!(e&&i&&r&&t))return a(void 0);const s=ot(t),l=Pt(ut(s,n)),c=xt(i,l);l.x=c.x,l.y=c.y;a(bt(l,o))})));const yl=Ya(void 0);hn(e,yl,(e=>o(416,oi=e)));const bl=qa([Ea,ml],(([e,t])=>{if(t&&e)return Math.min(t.width/e.width,t.height/e.height)})),xl=qa([Ea,ol],(([e,t])=>e&&t?Math.min(e.width/t.width,e.height/t.height):1));hn(e,xl,(e=>o(101,Zi=e)));const vl=qa([yl,xl],(([e,t])=>e&&t?t*e:1));hn(e,vl,(e=>o(493,Ko=e)));const wl=Ya(he());hn(e,wl,(e=>o(415,Jo=e)));const Sl=Ya({scalar:Ko,translation:Jo}),kl=()=>{Sl.set({scalar:void 0,translation:he()})},Cl=Xa(void 0,(e=>{const t=xc(void 0,{precision:1e-4}),o=1===zd()?e=>Tt(e,Math.round):Y,i=()=>{if(!Vo)return;const e=Wt||!$o;if(Uo){const o=et(Vo);return dt(o,ti),dt(o,Ot),t.set(o,{hard:e})}const i=Th(Vo,ei,Vm*gr);i.width<0&&(i.width=0,i.x=Vo.x),i.height<0&&(i.height=0,i.y=Vo.y),dt(i,Ot),dt(i,Jo),ut(i,Ko),!e&&o(i),t.set(i,{hard:e})},r=[ml.subscribe(i),ol.subscribe(i),vl.subscribe(i),wl.subscribe(i),os.subscribe(i),t.subscribe(e)];return()=>r.forEach((e=>e()))}));hn(e,Cl,(e=>o(58,Do=e)));const Ml=Ya(1);hn(e,Ml,(e=>o(486,_o=e)));const Pl=()=>{if(!No||!Ot)return;let e=mt(et(No),Yo||1);const t=xt(Ot,mt(et(qo),Yo));dt(e,t);const o=Mt.width/e.width,i=Mt.height/e.height,r=Math.min(1,o,i);Ml.set(r),ut(e,r),((e,t)=>{const[o,i,r,n]=kt(e);o<t.y&&(e.y=Math.max(t.y,e.y)),i>t.width&&(e.x=t.width-e.width),r>t.height&&(e.y=t.height-e.height),n<t.x&&(e.x=Math.max(t.x,e.x))})(e,{...Mt,x:0,y:0}),ol.set(e)},Rl=qa([ml,fl,Ea,xa],(([e,t,o,i],r)=>{e&&(o||i)&&r(El(e,t||1,o||i))}));hn(e,Rl,(e=>o(100,Gi=e)));const El=(e,t,o)=>o.width<=e.width&&o.height<=e.height?xt(e,mt(et(o),t)):St(e,$t(o));let Al,Ll;const Fl=e=>{if(f&&Al&>(Al,e)&&Ll===Yo)return;if(Uo)return Pl();Al=e,Ll=Yo;const t=El(e,Yo,No||At);ol.set(t)};let zl=!1;const Dl=fl.subscribe((e=>{!zl&&void 0!==e&&No&&(Fl(Ot),zl=!0)})),Ol=ml.subscribe((e=>{e&&void 0!==Yo&&No&&Fl(e)})),Bl=Js.subscribe((e=>{!e&&Ot&&Fl(Ot)}));let Wl;const _l=il.subscribe((e=>{if(!e)return Wl=void 0,void vn(Qs,Zo=void 0,Zo);Wl=Xo;const t=et(No);Qs.set(t)})),Vl=ol.subscribe((e=>{if(!e||!jo)return;const t=(o=et(e),i=jo,o.x-=i.x,o.y-=i.y,o.width-=i.width,o.height-=i.height,o);var o,i;((e,t)=>{e.x/=t,e.y/=t,e.width/=t,e.height/=t})(t,Wl);const r=((e,t)=>(e.x+=t.x,e.y+=t.y,e.width+=t.width,e.height+=t.height,e))(et(Zo),t);Ea.set(r)})),Nl=Ea.subscribe((e=>{if(!e||!Vo)return;if(Uo)return void(jo||Pl());if(Wt||jo||Ho)return;const t=$t(Vo),o=$t(e);if(de(t,6)===de(o,6))return;const{width:i,height:r}=No,n=Math.min(Ot.width/i,Ot.height/r),a=Ne(e.width*n,e.height*n),s=.5*(Vo.width-a.width),l=.5*(Vo.height-a.height),c=lt(Math.max(0,Math.min(Ot.width-a.width,Vo.x+s)),Math.max(0,Math.min(Ot.height-a.height,Vo.y+l)),a.width,a.height);ol.set(c)})),Hl=qa([fl,Ea,ol,Js],(([e,t,o,i],r)=>{if(!e||!t||!o)return;if(i)return r(_o);const n=o.width/t.width,a=o.height/t.height;r(Math.max(n,a)/e)})),jl=qa([fl,Hl],(([e,t],o)=>{if(!t)return;o(e*t)}));hn(e,jl,(e=>o(492,Xo=e)));let Ul={left:0,right:0,top:0,bottom:0};const Gl=qa([os,ol],(([e,t],o)=>{if(!t)return o(Ul);const i=al(t,e);de(Ul.top,4)===de(i.top,4)&&de(Ul.bottom,4)===de(i.bottom,4)&&de(Ul.right,4)===de(i.right,4)&&de(Ul.left,4)===de(i.left,4)||(Ul=i,o(i))})),Zl=qa([Gl],(([e],t)=>{t(Object.values(e).some((e=>e>0)))})),Xl=xc(.075,{stiffness:.03,damping:.4,precision:.001}),Yl=qa([Is,Ms,Xl,Cl,vl,os,Zl,Gl,pl],(([e,t,o,i,r,n,a,s,l],c)=>{if(!i||f)return c([]);let{x:d,y:u,width:p,height:h}=i;d+=.5,u+=.5,p-=.5,h-=.5;const m=[];if(n){if(a){let{left:e,right:o,top:i,bottom:n}=s;e*=r,o*=r,i*=r,n*=r;const a=am(t)?[1,1,1,.125]:[0,0,0,.075];m.push({x:d-e-.5,y:u-i-.5,width:p+e+o+1,height:h+i+n+1,strokeWidth:1,strokeColor:a,opacity:l?1:.5})}const i=am(e);n&&n.frameColor&&am(n.frameColor)||i||(m.push({x:d-1,y:u-1,width:p+2,height:h+2,strokeWidth:2,strokeColor:[0,0,0,.1],opacity:o}),m.push({x:d+1,y:u+1,width:p-2,height:h-2,strokeWidth:2,strokeColor:[0,0,0,.1],opacity:o}))}c([...m,{x:d,y:u,width:p,height:h,strokeWidth:1,strokeColor:e,opacity:o}])})),ql=Ya([]);hn(e,ql,(e=>o(404,Po=e)));const Kl=qa([Yl,ql],(([e,t],o)=>{o([...e,...t])}));hn(e,Kl,(e=>o(94,_i=e)));const Jl=xc(0,{precision:.001});hn(e,Jl,(e=>o(406,Io=e)));const Ql=xc();hn(e,Ql,(e=>o(409,Fo=e)));const ec=xc();hn(e,ec,(e=>o(408,Lo=e)));const ic=xc();hn(e,ic,(e=>o(407,Ao=e)));const rc=xc();hn(e,rc,(e=>o(405,Ro=e)));const nc=Ya(!1);hn(e,nc,(e=>o(391,lo=e)));const ac=Ya();let sc;hn(e,ac,(e=>o(394,po=e)));const lc=qa([nc,ac],(([e,t],i)=>{if(!e||!t)return void i(void 0);if(sc&&(sc.cancel(),o(295,sc=void 0)),Er(t))return i(S(t));const r=Lc.length?0:oo?250:0;o(295,sc={cancel:n}),ns(t,sc,r).then(i).catch((e=>{vn(Ma,uo.error=e,uo)})).finally((()=>{o(295,sc=void 0)}))}));Yi(),Yi=un(lc,(e=>o(374,Rt=e)));let{imagePreviewCurrent:cc}=t;const dc=Ya({});hn(e,dc,(e=>o(396,fo=e)));const uc=Ya([]);hn(e,uc,(e=>o(86,Ri=e)));const pc=qa([ml,Fs,xa,tl,ol,jl,Oa,_a,Va,vl,wl,Ns],(([e,t,o,i,r,n,a,s,l,c,d,u],p)=>{if(!e||!r)return;const h=Tl(e,t,o,i,r,c,d,n,a,s,l);!u&&B(h),p(h)}));hn(e,pc,(e=>o(397,yo=e)));const hc=qa([ja,Ua,Ga,Za,Ka],(([e,t,o,i,r],n)=>{const a=e&&Object.keys(e).map((t=>e[t])).filter(Boolean);n({gamma:o||void 0,vignette:i||void 0,noise:r||void 0,convolutionMatrix:t||void 0,colorMatrix:a&&a.length&&Jr(a)})}));let mc,gc;const $c=(()=>{if(!vo())return!1;const e=navigator.userAgent.match(/OS (\d+)_(\d+)_?(\d+)?/i)||[],[,t,o]=e.map((e=>parseInt(e,10)||0));return t>13||13===t&&o>=4})(),fc=Ya({});hn(e,fc,(e=>o(385,Jt=e))),la("env",fc);const bc=zd(),wc=Xa(bc,(e=>{const t=()=>e(zd()),o=matchMedia(`(resolution: ${bc}dppx)`);return o.addListener(t),()=>o.removeListener(t)}));hn(e,wc,(e=>o(57,zo=e)));const Sc=((e,t,o)=>{const{sub:i,pub:r}=Qo(),{willUndo:n=(()=>!0)}=o||{},a=[],s=Ya(0),l=[],c=()=>l.forEach((e=>e({index:pn(s),length:a.length}))),d={get index(){return pn(s)},set index(e){e=Number.isInteger(e)?e:0,e=$s(e,0,a.length-1),s.set(e),t(a[d.index]),c()},get state(){return a[a.length-1]},length:()=>a.length,undo(){if(!1===n())return;const e=d.index--;return r("undo",e),e},redo(){const e=d.index++;return r("redo",d.index),e},revert(){a.length=1,d.index=0,r("revert")},write(o){o&&t({...e(),...o});const i=e(),n=a[a.length-1];JSON.stringify(i)!==JSON.stringify(n)&&(a.length=d.index+1,a.push(i),s.set(a.length-1),c(),r("writehistory"))},set(e={}){a.length=0,d.index=0;const t=Array.isArray(e)?e:[e];a.push(...t),d.index=a.length-1},get:()=>[...a],subscribe:e=>(l.push(e),e({index:d.index,length:a.length}),()=>l.splice(l.indexOf(e),1)),on:i};return d})((()=>To),(e=>{vn(rs,To=e,To),zs.set(Mo)}),{willUndo:()=>!Rc()||(Pc(),!1)});qi(),qi=un(Sc,(e=>o(403,Co=e)));const kc=()=>{const e={x:0,y:0,...At},t=Tt(St(e,To.cropAspectRatio),Math.round),o=wr({...To,rotation:0,crop:t},To),i=[o];JSON.stringify(o)!==JSON.stringify(To)&&i.push({...To}),Sc.set(i)},Cc=Ma.subscribe((e=>{e&&e.complete&&kc()})),Tc=()=>$r().then((e=>e&&Sc.revert())),Mc=[Qa,Ja,ts,es],Pc=()=>{Mc.forEach((e=>{e.update((e=>e.length&&Bi(e[e.length-1])?e.slice(0,-1):e))}))},Rc=()=>V.filter((e=>e.length)).some((e=>Bi(e[e.length-1]))),Ic=Ya(!1);hn(e,Ic,(e=>o(386,to=e)));const Ec=()=>{vn(Ic,to=!0,to),fr().then((e=>{if(!e)return void vn(Ic,to=!1,to);let t;t=cd.subscribe((e=>{1===e&&(t&&t(),Ji("processImage"))}))}))},Ac=Pa.subscribe((e=>{if(!e)return void vn(Ic,to=!1,to);vn(Ic,to=!0,to);const{complete:t,abort:o}=e;(t||o)&&vn(Ic,to=!1,to)})),Lc=nm();hn(e,Lc,(e=>o(55,ho=e)));const Fc=qa([Lc],(([e],t)=>{if(!e.length)return t();const{origin:o,translation:i,rotation:r,scale:n}=e[0];t({origin:o,translation:i,rotation:r,scale:n})})),zc=Ya();hn(e,zc,(e=>o(400,wo=e)));let Dc,Oc=[];const Bc=Ya(),Wc=Ya(),_c=qa([yl,Wc,fl,bl],(([e,t,o,i])=>e||(t||o<1?i:1))),Vc={...tr,imageFile:ba,imageSize:xa,mediaDuration:va,mediaMinDuration:Ca,mediaMaxDuration:Ta,mediaTrim:Sa,imageBackgroundColor:Na,imageBackgroundImage:Ha,imageCropAspectRatio:Ra,imageCropMinSize:Aa,imageCropMaxSize:La,imageCropLimitToImage:Ia,imageCropRect:Ea,imageCropRectOrigin:za,imageCropRectSnapshot:Qs,imageCropRectAspectRatio:Da,imageCropRange:Fa,imageRotation:Oa,imageRotationRange:Ba,imageFlipX:_a,imageFlipY:Va,imageOutputSize:Wa,imageColorMatrix:ja,imageConvolutionMatrix:Ua,imageGamma:Ga,imageVignette:Za,imageNoise:Ka,imageManipulation:es,imageDecoration:Ja,imageAnnotation:Qa,imageRedaction:ts,imageFrame:os,imagePreview:lc,imagePreviewSource:ac,imageTransforms:pc,imagePreviewModifiers:dc,history:Sc,animation:Xs,pixelRatio:wc,elasticityMultiplier:gr,scrollElasticity:Hm,rangeInputElasticity:5,redrawTrigger:na,pointerAccuracy:_s,pointerHoverable:Vs,env:fc,rootRect:Fs,stageRect:ml,stageRectBase:ll,stageRecenter:sl,stageScalar:fl,stagePadding:ul,stagePadded:pl,presentationScalar:jl,imagePreviewUpscale:Wc,utilRect:Ws,utilRectPadded:hl,allowPlayPause:Bn,allowPan:ys,allowZoom:bs,allowZoomControls:xs,enableZoomInput:Ss,enablePanInput:ws,enablePanInputStatus:Ts,imageSelectionMultiTouching:Bc,rootBackgroundColor:Ms,rootForegroundColor:Rs,rootLineColor:Is,rootColorSecondary:As,imageOutlineOpacity:Xl,utilTools:zc,imageSelectionPan:wl,imageSelectionZoom:yl,imageSelectionZoomCurrent:_c,imageSelectionStageFitScalar:bl,imageSelectionStoredState:Sl,imageOverlayMarkup:ql,interfaceImages:uc,isInteracting:Hs,isTransformingImage:Ns,isInteractingFraction:Gs,imageCropRectIntent:el,imageCropRectPresentation:tl,imageSelectionRect:ol,imageSelectionRectIntent:rl,imageSelectionRectPresentation:Cl,imageSelectionRectSnapshot:il,imageScalar:Hl,imageTransformsInterpolated:Fc,imageEffects:hc};delete Vc.image;const Hc="util-"+L();let jc=[];const Uc=e=>H.find((([t])=>e===t));let Gc=[];const Zc=e=>{o(62,Gc=Gc.concat(e))},Yc=e=>{o(62,Gc=Gc.filter((t=>t!==e)))},qc=(e,t)=>{o(304,Z[e]=t,Z)};let Kc=vo();const Jc=(e,t,o)=>{let i=ke.getPropertyValue(e);i=o?o(i):/^[0-9]+$/.test(i)?parseFloat(i):void 0,t.set(i,{hard:!oo})},Qc=(e,t,o=!1)=>{const i=(e=>{const t=ke.getPropertyValue(e);return Dp(t)})(e);i&&0!==i[3]&&(o||(i.length=3),t.set(i,{hard:!oo}))},ed=Ya();hn(e,ed,(e=>o(87,Ii=e)));const td=Ya();hn(e,td,(e=>o(88,Ei=e)));const od=Ya();hn(e,od,(e=>o(89,Li=e)));const id=xc(0,{damping:.9});hn(e,id,(e=>o(90,Fi=e)));const rd=()=>{Qc("color",Rs),Qc(dn?"--color-background":"background-color",Ms),Qc("outline-color",Is),Qc("--color-primary",Es),Qc("--color-secondary",As),Qc("--grid-color-even",td,!0),Qc("--grid-color-odd",od,!0),Jc("--grid-size",ed),Jc("--editor-inset-top",Ds,(e=>parseInt(e,10)))},nd=qa([pc,hc,Na,ms],(([e,t,o,i])=>e&&{...e,...t,backgroundColor:o,backgroundImage:i}));hn(e,nd,(e=>o(395,mo=e)));const ad=()=>{const e=Lc.length?void 0:{resize:1.05},t=((e,t,o={})=>{const{resize:i=1,opacity:r=0}=o,n={opacity:[xc(r,{...im,stiffness:.1}),Y],resize:[xc(i,{...im,stiffness:.1}),Y],translation:[xc(void 0,im),Y],rotation:[xc(void 0,rm),Y],origin:[xc(void 0,im),Y],scale:[xc(void 0,rm),Y],gamma:[xc(void 0,rm),e=>e||1],vignette:[xc(void 0,rm),e=>e||0],colorMatrix:[xc([...om],im),e=>e||[...om]],convolutionMatrix:[Ya(void 0),e=>e&&e.clarity||void 0],backgroundColor:[xc(void 0,im),(e,t,o)=>{if(Array.isArray(e)){if(Array.isArray(t)){const i=[...e];0===t[3]?(i[3]=0,o(i)):0===i[3]&&((e=[...t])[3]=0)}return e}}],backgroundImage:[Ya(void 0),Y]},a=Object.entries(n).map((([e,t])=>[e,t[0]])),s=a.map((([,e])=>e)),l=Object.entries(n).reduce(((e,[t,o])=>{const[i,r]=o;return e[t]=(e,o)=>i.set(r(e,c[t],(e=>{i.set(e,{hard:!0})})),o),e}),{});let c;const d=qa(s,(o=>(c=o.reduce(((e,t,o)=>(e[a[o][0]]=t,e)),{}),c.data=e,c.size=t,c.scale*=o[1],c)));return d.get=()=>c,d.set=(e,t)=>{const o={hard:!t};Object.entries(e).forEach((([e,t])=>{l[e]&&l[e](t,o)}))},d})(Rt,At,e);Lc.unshift(t),sd(mo)},sd=e=>{Lc.forEach(((t,o)=>{const i=0===o?1:0;t.set({...e,opacity:i,resize:1},$o)}))};let ld;const cd=yc(void 0,{duration:500});let dd;hn(e,cd,(e=>o(54,ao=e)));const ud=Ya(!1);let pd;hn(e,ud,(e=>o(390,so=e)));const hd=xc(void 0,{stiffness:.1,damping:.7,precision:.25});hn(e,hd,(e=>o(82,Si=e)));const md=xc(0,{stiffness:.1,precision:.05});hn(e,md,(e=>o(83,ki=e)));const gd=xc(0,{stiffness:.02,damping:.5,precision:.25});hn(e,gd,(e=>o(388,ro=e)));const $d=xc(void 0,{stiffness:.02,damping:.5,precision:.25});hn(e,$d,(e=>o(389,no=e)));const fd=xc(void 0,{stiffness:.02,damping:.5,precision:.25});let yd;hn(e,fd,(e=>o(387,io=e)));const bd=()=>{Ji("abortLoadImage")},xd=()=>{Ji("abortProcessImage"),vn(Ic,to=!1,to)},vd=e=>{e.target&&"true"===e.target.dataset.touchScroll||e.preventDefault()},wd=$c?e=>{const t=e.touches?e.touches[0]:e;t.pageX>20&&t.pageX<window.innerWidth-20||vd(e)}:n,Sd=Ya([]);hn(e,Sd,(e=>o(482,Yt=e))),la("keysPressed",Sd);const kd=e=>{!e||Go(e)&&!(e=>/^image/.test(e.type)&&!/svg/.test(e.type))(e)||!Go(e)&&!/^http/.test(e)||Ji("loadImage",e)},Cd=e=>{e&&kd(e)};let Td=void 0,Md=void 0;let Pd,Rd=[];const Id=Ya();la("rootPortal",Id),la("rootRect",Fs);const Ed=()=>({foregroundColor:[...Vt],lineColor:[..._t],utilVisibility:{...Z},isInteracting:Wt,isInteractingFraction:Bt,rootRect:et(Ct),stageRect:et(Ot),manipulationShapesDirty:qd,annotationShapesDirty:Gd,decorationShapesDirty:Xd,frameShapesDirty:Yd}),Ad=(e,t,o)=>vr(e,Ne(Math.round(t.width/o),Math.round(t.height/o))),Ld=(e,t,o)=>{var i;return e._translate=me((i=t).x,i.y),e._scale=o,e},Fd=e=>{const t=[];return e.forEach((e=>t.push(Dd(e)))),t.filter(Boolean)},Dd=e=>Ai(e)?(e.points=[me(e.x1,e.y1),me(e.x2,e.y2)],e):(!(e=>Mi(e)&&!e.text.length)(e)||e.backgroundColor&&0!==e.backgroundColor[3]||(Pi(e)&&(e.width=5,e.height=e.lineHeight),e.strokeWidth=1,e.strokeColor=[1,1,1,.5],e.backgroundColor=[0,0,0,.1]),e);let Od,Bd=[],Wd=[],Vd=[],Nd=[],Hd=[],jd={};const Ud=(e,t,o,i,r,n,a)=>{const{manipulationShapesDirty:s,annotationShapesDirty:l,decorationShapesDirty:c,frameShapesDirty:d,selectionRect:u,scale:p}=e,h=Od!==p,m=h||!gt(jd,u);m&&(Od=p,jd=u),s&&(Vd=t.filter(zi).map(xi).map((e=>vr(e,At)))),(l||o!==Dt)&&(Bd=o.filter(zi).map(xi).sort(((e,t)=>e.alwaysOnTop?1:t.alwaysOnTop?-1:0)).map((e=>vr(e,At)))),(h||Zd||l||o!==Dt)&&(Wd=Fd(Bd.map((e=>v(e,{flipX:Ft,flipY:Lt,rotation:zt,scale:p,context:ot(At)}))).flat())),(c||i!==Et||m)&&(Nd=Fd(i.filter(zi).map(xi).sort(((e,t)=>e.alwaysOnTop?1:t.alwaysOnTop?-1:0)).map((e=>Ad(e,u,p))).map((e=>v(e,{context:u}))).flat().map((e=>Ld(e,u,p))))),(d||n!==It||m)&&(Hd=n?Fd([n].map(xi).map((e=>Ad(e,u,p))).map(v).flat().map((e=>Ld(e,u,p)))):[]);let g=Fd(r.filter(zi));return"undefined"!=typeof window&&(e=>{if(e&&e._dwkgrvd)return;const[t]=[[85,110,108,105,99,101,110,115,101,100,32,80,105,110,116,117,114,97,32,105,110,115,116,97,110,99,101]].map((e=>e.map((e=>String.fromCharCode(e))).join("")));g=[...g,{x:u.x+.5*u.width-82,y:u.y+u.height-16-12,width:164,height:16,text:t,fontWeight:900,fontSize:12,color:[1,1,1,.25]}]})(window),{manipulationShapesDirty:s,manipulationShapes:Vd,annotationShapesDirty:l,annotationShapes:Wd,decorationShapesDirty:c,decorationShapes:Nd,frameShapesDirty:d,frameShapes:Hd,interfaceShapes:g,selectionShapes:a.map(xi).map((e=>vr(e,At)))}};let Gd=!0;let Zd=!0;let Xd=!0;let Yd=!0;let qd=!0;aa((()=>{Yn(),Rt&&m(Rt.src)&&/^blob:/.test(Rt.src)&&URL.revokeObjectURL(Rt.src),gs(),Ol(),Dl(),Bl(),_l(),Vl(),Nl(),Cc(),Ac(),_s.destroy(),Vs.destroy(),ya.destroy(),Lc.clear(),Bd.length=0,Wd.length=0,Vd.length=0,Nd.length=0,Hd.length=0,Td&&y(Td),Cn&&window.visualViewport.removeEventListener("resize",Mn);try{o(235,cc=void 0),o(296,ld=void 0)}catch(e){}}));let Kd;return e.$$set=e=>{"class"in e&&o(236,Qi=e.class),"layout"in e&&o(237,er=e.layout),"stores"in e&&o(238,tr=e.stores),"locale"in e&&o(3,or=e.locale),"id"in e&&o(4,ir=e.id),"util"in e&&o(239,rr=e.util),"utils"in e&&o(240,nr=e.utils),"animations"in e&&o(241,ar=e.animations),"disabled"in e&&o(242,sr=e.disabled),"previewUpscale"in e&&o(243,lr=e.previewUpscale),"previewPad"in e&&o(244,cr=e.previewPad),"previewMaskOpacity"in e&&o(5,dr=e.previewMaskOpacity),"previewImageDataMaxSize"in e&&o(245,ur=e.previewImageDataMaxSize),"previewImageTextPixelRatio"in e&&o(6,pr=e.previewImageTextPixelRatio),"markupMaskOpacity"in e&&o(7,hr=e.markupMaskOpacity),"zoomMaskOpacity"in e&&o(246,mr=e.zoomMaskOpacity),"elasticityMultiplier"in e&&o(8,gr=e.elasticityMultiplier),"willRevert"in e&&o(247,$r=e.willRevert),"willProcessImage"in e&&o(248,fr=e.willProcessImage),"willRenderCanvas"in e&&o(9,yr=e.willRenderCanvas),"willRenderToolbar"in e&&o(249,br=e.willRenderToolbar),"willRenderUtilTabs"in e&&o(250,xr=e.willRenderUtilTabs),"willSetHistoryInitialState"in e&&o(251,wr=e.willSetHistoryInitialState),"enableButtonExport"in e&&o(252,Sr=e.enableButtonExport),"enableButtonRevert"in e&&o(253,kr=e.enableButtonRevert),"enableNavigateHistory"in e&&o(254,Cr=e.enableNavigateHistory),"enableToolbar"in e&&o(10,Pr=e.enableToolbar),"enableUtils"in e&&o(255,Rr=e.enableUtils),"enableButtonClose"in e&&o(256,Ir=e.enableButtonClose),"enableDropImage"in e&&o(257,Ar=e.enableDropImage),"enablePasteImage"in e&&o(258,Lr=e.enablePasteImage),"enableBrowseImage"in e&&o(259,Fr=e.enableBrowseImage),"enableTransparencyGrid"in e&&o(11,zr=e.enableTransparencyGrid),"layoutDirectionPreference"in e&&o(260,Dr=e.layoutDirectionPreference),"layoutHorizontalUtilsPreference"in e&&o(261,Or=e.layoutHorizontalUtilsPreference),"layoutVerticalUtilsPreference"in e&&o(262,Br=e.layoutVerticalUtilsPreference),"layoutVerticalToolbarPreference"in e&&o(263,Wr=e.layoutVerticalToolbarPreference),"layoutVerticalControlGroupsPreference"in e&&o(264,_r=e.layoutVerticalControlGroupsPreference),"layoutVerticalControlTabsPreference"in e&&o(265,Vr=e.layoutVerticalControlTabsPreference),"status"in e&&o(234,Nr=e.status),"formatStatusImageLoading"in e&&o(266,Hr=e.formatStatusImageLoading),"formatStatusImageProcessing"in e&&o(267,jr=e.formatStatusImageProcessing),"formatStatusSupportError"in e&&o(268,Ur=e.formatStatusSupportError),"textDirection"in e&&o(12,Gr=e.textDirection),"markupEditorZoomLevel"in e&&o(269,Zr=e.markupEditorZoomLevel),"markupEditorZoomLevels"in e&&o(13,Xr=e.markupEditorZoomLevels),"markupEditorZoomAdjustStep"in e&&o(14,Yr=e.markupEditorZoomAdjustStep),"markupEditorZoomAdjustFactor"in e&&o(15,qr=e.markupEditorZoomAdjustFactor),"markupEditorZoomAdjustWheelFactor"in e&&o(16,Kr=e.markupEditorZoomAdjustWheelFactor),"markupEditorInteractionMode"in e&&o(270,tn=e.markupEditorInteractionMode),"muteAudio"in e&&o(271,on=e.muteAudio),"willSetMediaInitialTimeOffset"in e&&o(272,rn=e.willSetMediaInitialTimeOffset),"enablePan"in e&&o(17,nn=e.enablePan),"enableZoom"in e&&o(18,an=e.enableZoom),"enableZoomControls"in e&&o(273,sn=e.enableZoomControls),"enableZoomInput"in e&&o(19,ln=e.enableZoomInput),"enablePanInput"in e&&o(274,cn=e.enablePanInput),"enableCanvasAlpha"in e&&o(20,dn=e.enableCanvasAlpha),"enablePanLimit"in e&&o(21,mn=e.enablePanLimit),"panLimitGutterScalar"in e&&o(22,gn=e.panLimitGutterScalar),"pan"in e&&o(275,$n=e.pan),"zoomPresetOptions"in e&&o(23,fn=e.zoomPresetOptions),"zoomAdjustStep"in e&&o(24,yn=e.zoomAdjustStep),"zoomAdjustFactor"in e&&o(25,bn=e.zoomAdjustFactor),"zoomAdjustWheelFactor"in e&&o(26,xn=e.zoomAdjustWheelFactor),"zoomLevel"in e&&o(0,wn=e.zoomLevel),"fixScrollDirection"in e&&o(276,Sn=e.fixScrollDirection),"imagePreviewSrc"in e&&o(279,In=e.imagePreviewSrc),"imageOrienter"in e&&o(280,En=e.imageOrienter),"pluginComponents"in e&&o(281,An=e.pluginComponents),"pluginOptions"in e&&o(27,Ln=e.pluginOptions),"root"in e&&o(2,Dn=e.root),"imageSourceToImageData"in e&&o(28,fa=e.imageSourceToImageData),"imagePreviewCurrent"in e&&o(235,cc=e.imagePreviewCurrent)},e.$$.update=()=>{if(268435456&e.$$.dirty[8]&&kn.set(Sn),8&e.$$.dirty[0]&&o(302,i=!!or),1&e.$$.dirty[0]|2097152&e.$$.dirty[8]&&o(0,wn=null===wn?Zr:wn),2&e.$$.dirty[0]|4&e.$$.dirty[9]){let e=!1;An.forEach((([t])=>{zn[t]||(o(1,zn[t]={},zn),e=!0)})),e&&o(293,da=[...An])}var t,d,h,w;if(8388608&e.$$.dirty[7]|8404992&e.$$.dirty[9]&&o(354,N=i&&da.length?nr||da.map((([e])=>e)):[]),134217728&e.$$.dirty[0]|16384&e.$$.dirty[9]|8192&e.$$.dirty[11]|536870912&e.$$.dirty[12]&&o(355,H=((e,t,o,i)=>{const r=t.filter((([t])=>e.includes(t))).filter((([e,{isSupported:t}])=>t({...i,...o[e]}))).map((([e,t])=>[e,t.Component]));return vs(r,jc,((e,t)=>e[0]===t[0]&&e[1]===t[1]))?jc:(jc=r,r)})(N,da,Ln,{src:So})),16384&e.$$.dirty[11]&&o(308,j=H.length),8&e.$$.dirty[0]|536870912&e.$$.dirty[9]|8192&e.$$.dirty[11]&&o(353,U=j&&N.map((e=>{const t=Uc(e);if(t)return{id:e,view:t[1],tabIcon:or[e+"Icon"],tabLabel:or[e+"Label"]}})).filter(Boolean)||[]),4096&e.$$.dirty[11]&&o(372,r=!!U.find((e=>"trim"===e.id))),5&e.$$.dirty[12]|4194304&e.$$.dirty[13]&&o(307,a=!!(yi&&Rt&&r)),4194304&e.$$.dirty[7]|536870912&e.$$.dirty[9]&&o(43,G=j&&rr&&"string"==typeof rr&&Uc(rr)?rr:j>0?H[0][0]:void 0),4096&e.$$.dirty[1]|268435456&e.$$.dirty[9]&&a&&G&&Yn(),268435456&e.$$.dirty[9]|4&e.$$.dirty[12]&&(a?(Rt.addEventListener("play",Nn),Rt.addEventListener("pause",Nn)):Rt&&"video"===Rt.nodeName&&(Rt.removeEventListener("play",Nn),Rt.removeEventListener("pause",Nn))),268435456&e.$$.dirty[9]&&a&&_n.set(ia()/oa()),18874368&e.$$.dirty[13]&&(e=>{if(!qn())return;const t=Date.now();if(jn&&t-jn<16)return;jn=t;const o=yi*e;if(o.toFixed(1)===Hn)return;Hn=o.toFixed(1);const i=Rt,r=()=>{i.removeEventListener("seeked",r),On()};i.addEventListener("seeked",r),Gh(i,o)})(vi||fi),2097152&e.$$.dirty[13]&&o(370,s=fi&&de(fi,6)),38273024&e.$$.dirty[13]&&o(368,l=pi||[[0,Math.min(yi,wi)/yi]]),134217728&e.$$.dirty[11]&&(c=l[0][0]),134217728&e.$$.dirty[11]&&(u=l[l.length-1][1]),134217728&e.$$.dirty[11]&&o(371,p=l.map((([e,t])=>[de(e,6),de(t,6)]))),1610612736&e.$$.dirty[11]&&o(369,g=p.findIndex((([e,t])=>s>=e&&s<=t))),1879048192&e.$$.dirty[11]&&($=-1===g&&p.findIndex(((e,t,o)=>{const i=o[t-1];return i?s<=e[0]&&s>=i[1]:s<=e[0]}))),8388608&e.$$.dirty[8]&&ta.set(on),4&e.$$.dirty[12]|8388608&e.$$.dirty[13]&&(Rt&&bi?Jn():Qn()),268435456&e.$$.dirty[9]|2097152&e.$$.dirty[13]&&a&&wa.set(oa()*fi),4&e.$$.dirty[12]|1048576&e.$$.dirty[13]&&Rt&&(e=>{if(!a)return;Rt.volume=Math.min(1,e)})($i),256&e.$$.dirty[0]&&vn(ca,gi=gr,gi),1048576&e.$$.dirty[7]&&o(364,f="overlay"===er),128&e.$$.dirty[8]|8388608&e.$$.dirty[11]&&o(45,b=Rr&&!f),134217730&e.$$.dirty[0]&&Ln&&Object.entries(Ln).forEach((([e,t])=>{Object.entries(t).forEach((([t,i])=>{zn[e]&&o(1,zn[e][t]=i,zn)}))})),16384&e.$$.dirty[13]&&o(365,T=!ii),16777216&e.$$.dirty[7]|50331648&e.$$.dirty[11]&&vn(Ys,oo="always"===ar?k:"never"!==ar&&(k&&T),oo),4194304&e.$$.dirty[1]|33554432&e.$$.dirty[7]&&ua.set(sr?1:0,{hard:!oo}),268435456&e.$$.dirty[7]&&(x=ur?(t=ur,d=ma,Ne(Math.min(t.width,d.width),Math.min(t.height,d.height))):ma),262144&e.$$.dirty[13]&&ya.update(ui[0]),131072&e.$$.dirty[13]&&(v=di?(e,t)=>di(e,{flipX:void 0,flipY:void 0,rotation:void 0,...t,isPreview:!0}):Y),268435456&e.$$.dirty[1]&&Array.isArray(ci)&&Ji("selectionchange",[...ci]),33554432&e.$$.dirty[8]|65536&e.$$.dirty[13]&&ks.set(li&&sn),71303168&e.$$.dirty[8]&&Cs.set("pan"===tn||cn),1048576&e.$$.dirty[1]&&Kt&&Fs.set(lt(Kt.x,Kt.y,Kt.width,Kt.height)),8388608&e.$$.dirty[11]|2097154&e.$$.dirty[12]&&Ct&&f&&uo&&uo.complete&&(()=>{const e=ni,t=$t(Ct);e&&e===t||(Ra.set($t(Ct)),kc())})(),8192&e.$$.dirty[11]&&o(46,J=N.length>1),32768&e.$$.dirty[1]&&(J||zs.set(tt())),1024&e.$$.dirty[0]|32768&e.$$.dirty[13]&&(Pr||Bs.set(lt(0,ri,0,0))),33554432&e.$$.dirty[11]|128&e.$$.dirty[12]&&o(367,C=!Wt&&k),1048576&e.$$.dirty[1]&&o(309,st=Kt&&Kt.width>0&&Kt.height>0),8&e.$$.dirty[0]|1610612736&e.$$.dirty[9]&&o(40,ct=st&&or&&!!j),512&e.$$.dirty[1]&&setTimeout((()=>o(294,qs=ct)),1),16777216&e.$$.dirty[7]|32768&e.$$.dirty[9]|83886080&e.$$.dirty[11]&&vn(Xs,$o="always"===ar?C:"never"!==ar&&(C&&qs&&T),$o),67108864&e.$$.dirty[7]|8388608&e.$$.dirty[11]&&Ks.set(lr||f),134217728&e.$$.dirty[7]&&dl.set(cr),134217728&e.$$.dirty[8]&&$n&&wl.set($n),4&e.$$.dirty[0]|9216&e.$$.dirty[13]&&Dn&&(Dn.dispatchEvent(Yh("markupzoom",oi)),Dn.dispatchEvent(Yh("zoom",Oo(oi)?oi:Yo))),4&e.$$.dirty[0]|4096&e.$$.dirty[13]&&Dn&&(Dn.dispatchEvent(Yh("markuppan",Jo)),Dn.dispatchEvent(Yh("pan",Jo))),512&e.$$.dirty[13]&&No&&kl(),2048&e.$$.dirty[13]&&qo&&Pl(),4198400&e.$$.dirty[1]&&G&&Xl.set(.075,{hard:!oo}),536870912&e.$$.dirty[7]&&o(362,M=mr),384&e.$$.dirty[13]&&o(363,P=Wo?-Math.max(...Object.values(Bo)):0),138936320&e.$$.dirty[1]|6291456&e.$$.dirty[11]&&Do){let e=Do.x-Ot.x,t=Ot.x+Ot.width-(Do.x+Do.width),o=Do.y-Ot.y,i=Ot.y+Ot.height-(Do.y+Do.height),r=Math.min(e,o,t,i);Jl.set(r>P?0:Math.min(M,Math.abs(r/64)),{hard:!oo})}if(67108864&e.$$.dirty[1]&&o(361,I=.55/zo),4718592&e.$$.dirty[1]|1048576&e.$$.dirty[11]&&Ot&&Ql.set({x:0,y:Ot.y,width:Ot.x<64?0:Ot.x,height:Ot.height+I},{hard:!oo}),4718592&e.$$.dirty[1]|1048576&e.$$.dirty[11]|2&e.$$.dirty[12]&&Ot&&ec.set({x:0,y:0,width:Ct.width,height:Ot.y+I},{hard:!oo}),4718592&e.$$.dirty[1]|1048576&e.$$.dirty[11]|2&e.$$.dirty[12]&&Ot){let e=Ot.x+Ot.width,t=Ct.width-(Ot.x+Ot.width);t<64&&(e+=t,t=0),ic.set({x:e,y:Ot.y,width:t,height:Ot.height+I},{hard:!oo})}if(4718592&e.$$.dirty[1]|2&e.$$.dirty[12]&&Ot&&rc.set({x:0,y:Ot.y+Ot.height,width:Ct.width,height:Ct.height-(Ot.y+Ot.height)},{hard:!oo}),33554432&e.$$.dirty[1]|72&e.$$.dirty[13]&&o(357,E=Fo&&{id:Nm,backgroundColor:Eo,opacity:Io,...Fo}),33554432&e.$$.dirty[1]|40&e.$$.dirty[13]&&o(360,A=Lo&&{id:Nm,backgroundColor:Eo,opacity:Io,...Lo}),33554432&e.$$.dirty[1]|24&e.$$.dirty[13]&&o(359,F=Ao&&{id:Nm,backgroundColor:Eo,opacity:Io,...Ao}),33554432&e.$$.dirty[1]|12&e.$$.dirty[13]&&o(358,z=Ro&&{id:Nm,backgroundColor:Eo,opacity:Io,...Ro}),983040&e.$$.dirty[11]&&o(356,D=[A,F,z,E].filter(Boolean)),32768&e.$$.dirty[11]|2&e.$$.dirty[13]&&D&&Po&&ql.update((e=>[...e.filter((e=>e.id!==Nm)),...D])),1&e.$$.dirty[9]|536870912&e.$$.dirty[12]&&ac.set(In||(So||void 0)),4&e.$$.dirty[0]|262144&e.$$.dirty[7]|4&e.$$.dirty[12]&&(o(235,cc=Rt),Rt&&Dn.dispatchEvent(Yh("loadpreview",cc))),4194304&e.$$.dirty[12]&&po&&(wl.set(he()),yl.set(void 0),kl(),uc.set([])),1&e.$$.dirty[13]&&o(313,W=Co.index>0),1&e.$$.dirty[13]&&o(312,_=Co.index<Co.length-1),393216&e.$$.dirty[1]|768&e.$$.dirty[12]&&(V=[Dt,Et,Ht,Nt]),8&e.$$.dirty[1]&&Bc.set(Dc),1073741824&e.$$.dirty[12]&&Wc.set(ko),4096&e.$$.dirty[1]&&fs.set(G),33554432&e.$$.dirty[9]|4096&e.$$.dirty[11]&&o(304,Z=U.reduce(((e,t)=>(e[t.id]=Z&&Z[t.id]||0,e)),{})),4096&e.$$.dirty[1]&&o(79,X={name:Hc,selected:G}),4096&e.$$.dirty[11]&&o(335,q=U.map((e=>({id:e.id,icon:e.tabIcon,label:e.tabLabel})))),4096&e.$$.dirty[11]&&o(78,K=U.map((e=>e.id))),524288&e.$$.dirty[7]&&o(77,Q=Xc(["PinturaRoot","PinturaRootComponent",Qi])),2&e.$$.dirty[12]&&o(349,ee=Ct&&(Ct.width>1e3?"wide":Ct.width<600?"narrow":void 0)),2&e.$$.dirty[12]&&o(336,te=Ct&&(Ct.width<=320||Ct.height<=460)),2&e.$$.dirty[12]&&o(348,oe=Ct&&(Ct.height>1e3?"tall":Ct.height<600?"short":void 0)),4&e.$$.dirty[0]&&o(315,ie=Dn&&Dn.parentNode&&Dn.parentNode.classList.contains("PinturaModal")),1&e.$$.dirty[1]|32&e.$$.dirty[10]|2&e.$$.dirty[12]&&o(341,re=ie&&Ct&&mc>Ct.width),2&e.$$.dirty[1]|32&e.$$.dirty[10]|2&e.$$.dirty[12]&&o(340,ne=ie&&Ct&&gc>Ct.height),1073741824&e.$$.dirty[10]|1&e.$$.dirty[11]&&o(342,ae=re&&ne),1048576&e.$$.dirty[0]&&o(339,se=dn),256&e.$$.dirty[11]&&o(310,le="narrow"===ee),4096&e.$$.dirty[8]|2&e.$$.dirty[12]&&o(350,(h=Ct,w=Dr,ce=Ct?"auto"===w?h.width>h.height?"landscape":"portrait":"horizontal"===w?h.width<500?"portrait":"landscape":"vertical"===w?h.height<400?"landscape":"portrait":void 0:"landscape")),512&e.$$.dirty[11]&&o(76,ue="landscape"===ce),1&e.$$.dirty[10]|128&e.$$.dirty[11]&&o(338,pe=le||"short"===oe),1&e.$$.dirty[1]|2&e.$$.dirty[12]&&o(337,ge=Kc&&Ct&&mc===Ct.width&&!$c),4&e.$$.dirty[1]|268435456&e.$$.dirty[12]&&o(311,$e=[...wo||[],...Oc].filter(Boolean)),8192&e.$$.dirty[8]&&o(347,fe="has-navigation-preference-"+Or),16384&e.$$.dirty[8]&&o(346,ye="has-navigation-preference-"+Br),32768&e.$$.dirty[8]&&o(343,be="has-toolbar-preference-"+Wr),65536&e.$$.dirty[8]&&o(345,xe="has-controlgroups-preference-"+_r),131072&e.$$.dirty[8]&&o(344,ve="has-controltabs-preference-"+Vr),2&e.$$.dirty[12]&&o(352,we=void 0!==Ct&&Ct.width>0&&Ct.height>0),4&e.$$.dirty[0]|2048&e.$$.dirty[11]&&o(351,ke=we&&Dn&&getComputedStyle(Dn)),1024&e.$$.dirty[11]&&ke&&rd(),1024&e.$$.dirty[0]|4243456&e.$$.dirty[1]|34603008&e.$$.dirty[7]|2080374816&e.$$.dirty[10]|1023&e.$$.dirty[11]|201334784&e.$$.dirty[12]&&fc.set({...Jt,layoutMode:er,orientation:ce,horizontalSpace:ee,verticalSpace:oe,navigationHorizontalPreference:fe,navigationVerticalPreference:ye,controlGroupsVerticalPreference:xe,controlTabsVerticalpreference:ve,toolbarVerticalPreference:be,isModal:ie,isDisabled:sr,isCentered:ae,isCenteredHorizontally:re,isCenteredVertically:ne,isAnimated:oo,isTransparent:se,pointerAccuracy:xo,pointerHoverable:bo,isCompact:pe,hasSwipeNavigation:ge,hasLimitedSpace:te,hasToolbar:Pr,hasNavigation:J&&b,isIOS:Kc,browserVersion:oc()?"chrome-"+(navigator.userAgent.match(/Chrome\/([0-9]+)/)||[])[1]:void 0}),8192&e.$$.dirty[12]&&o(75,Ce=Object.entries(Jt).map((([e,t])=>/^is|has/.test(e)?t?qh(e):void 0:t)).filter(Boolean).join(" ")),4096&e.$$.dirty[1]&&G&&zc.set([]),4096&e.$$.dirty[1]|4&e.$$.dirty[8]|33554432&e.$$.dirty[10]|8192&e.$$.dirty[12]&&o(44,Te=xr(q.map((e=>({...e,selected:G===e.id}))),{...Jt},(()=>na.set({})))),8192&e.$$.dirty[1]&&o(74,Me=!!Te.find((e=>Array.isArray(e)))),50331648&e.$$.dirty[12]&&o(73,Pe=yo&&Object.entries(fo).filter((([,e])=>null!=e)).reduce(((e,[,t])=>e={...e,...t}),{})),2097152&e.$$.dirty[12]&&o(332,Ae=uo&&"any-to-file"===uo.task),4194304&e.$$.dirty[10]&&Ae&&Lc&&Lc.clear(),8388608&e.$$.dirty[12]&&o(334,Re=!!mo&&!!mo.translation),131072&e.$$.dirty[9]|16777216&e.$$.dirty[10]|4&e.$$.dirty[12]&&Re&&Rt&&Rt!==ld&&(o(296,ld=Rt),ad()),16777216&e.$$.dirty[10]|8388608&e.$$.dirty[12]&&Re&&sd(mo),16777216&e.$$.dirty[1]&&ho&&ho.length>1){let e=[];Lc.forEach(((t,o)=>{0!==o&&t.get().opacity<=0&&e.push(t)})),e.forEach((e=>Lc.remove(e)))}if(8&e.$$.dirty[0]|8388608&e.$$.dirty[10]&&o(39,Ee=or&&Ie.length&&function(e,t){if(R(t.labelSupportError))return t.labelSupportError(e);const o=Ur({features:e},t);return Il(t.labelSupportError,o,"{","}")}(Ie,or)),2097152&e.$$.dirty[12]&&o(324,Le=uo&&!!uo.error),2097152&e.$$.dirty[12]&&o(42,Fe=!uo||!uo.complete&&void 0===uo.task),2097152&e.$$.dirty[12]&&o(325,ze=uo&&(uo.taskLengthComputable?uo.taskProgress:1/0)),4194304&e.$$.dirty[10]&&Ae&&vn(nc,lo=!1,lo),4194304&e.$$.dirty[1]|262144&e.$$.dirty[9]|2097152&e.$$.dirty[12]&&uo&&uo.complete){const e=oo?250:0;clearTimeout(dd),o(297,dd=setTimeout((()=>{vn(nc,lo=!0,lo)}),e))}if(2048&e.$$.dirty[1]|16384&e.$$.dirty[10]|2621440&e.$$.dirty[12]&&o(329,De=uo&&!Le&&!Fe&&!lo),65536&e.$$.dirty[9]|4194308&e.$$.dirty[12]&&o(328,Oe=!(!po||Rt&&!sc)),4194304&e.$$.dirty[1]|524288&e.$$.dirty[12])if(lo){setTimeout((()=>id.set(1,{hard:!oo})),oo?500:0)}else id.set(0,{hard:!oo});if(1064960&e.$$.dirty[12]&&o(323,Be=!!(to||co&&void 0!==co.progress&&!co.complete)),8192&e.$$.dirty[10]&&Be&&Yn(),2048&e.$$.dirty[1]|2097152&e.$$.dirty[12]&&o(326,We=uo&&!(uo.error||Fe)),8&e.$$.dirty[0]|2097152&e.$$.dirty[12]&&o(327,_e=or&&function(e,t){const o=e?!e.complete||e.error?e:{task:"blob-to-bitmap",progress:1/0}:void 0;let i=R(t.statusLabelLoadImage)?t.statusLabelLoadImage(o):Hr({state:o},t);return e&&e.error&&e.error.metadata&&(i=Il(i,e.error.metadata,"{","}")),i}(uo,or)),8&e.$$.dirty[0]|1048576&e.$$.dirty[12]&&o(322,Ve=co&&or&&function(e,t){return R(t.statusLabelProcessImage)?t.statusLabelProcessImage(e):jr({state:e},t)}(co,or)),1048576&e.$$.dirty[12]&&o(320,He=co&&(co.taskLengthComputable?co.taskProgress:1/0)),1048576&e.$$.dirty[12]&&o(321,je=co&&!co.error),1048576&e.$$.dirty[12]&&o(319,Ue=!(!co||!co.error)),8&e.$$.dirty[0]|2048&e.$$.dirty[1]|131072&e.$$.dirty[7]|1048064&e.$$.dirty[10])if(Nr){let e,t,i,r,n;m(Nr)&&(e=Nr),Oo(Nr)?t=Nr:Array.isArray(Nr)&&([e,t,n]=Nr,!1===t&&(r=!0),Oo(t)&&(i=!0)),o(35,pd=(e||t)&&{text:e,aside:r||i,progressIndicator:{visible:i,progress:t},closeButton:r&&{label:or.statusLabelButtonClose,icon:or.statusIconButtonClose,onclick:n||(()=>o(234,Nr=void 0))}})}else o(35,pd=or&&Fe||Le||De||Oe?{text:_e,aside:Le||We,progressIndicator:{visible:We,progress:ze},closeButton:Le&&{label:or.statusLabelButtonClose,icon:or.statusIconButtonClose,onclick:bd}}:or&&Be&&Ve?{text:Ve,aside:Ue||je,progressIndicator:{visible:je,progress:He},closeButton:Ue&&{label:or.statusLabelButtonClose,icon:or.statusIconButtonClose,onclick:xd}}:void 0);if(131072&e.$$.dirty[7]&&o(331,Ge=void 0!==Nr),4194304&e.$$.dirty[1]|32&e.$$.dirty[10]|1048576&e.$$.dirty[12]&&ie&&co&&co.complete&&(ud.set(!0),setTimeout((()=>ud.set(!1)),oo?100:0)),4&e.$$.dirty[0]|4096&e.$$.dirty[1]|524288&e.$$.dirty[12]&&lo&&Dn&&Dn.dispatchEvent(Yh("selectutil",G)),2304&e.$$.dirty[1]|2908160&e.$$.dirty[10]|262144&e.$$.dirty[12]&&o(330,Ze=so||Ee||Fe||Le||De||Oe||Be||Ge),1048576&e.$$.dirty[10]&&vn(cd,ao=Ze?1:0,ao),4194304&e.$$.dirty[1]|1048576&e.$$.dirty[10]&&cd.set(Ze?1:0,{duration:oo?500:1}),8388608&e.$$.dirty[1]&&o(41,Xe=ao>0),16&e.$$.dirty[1]&&o(318,Ye=!(!pd||!pd.aside)),4195344&e.$$.dirty[1]|524288&e.$$.dirty[9]|256&e.$$.dirty[10]|131072&e.$$.dirty[12]&&Xe&&pd){clearTimeout(yd);const e={hard:!1===oo};if(Ye){const t=!!pd.error||!oo;md.set(1,e),hd.set(no,{hard:t}),o(298,yd=setTimeout((()=>{gd.set(16,e)}),1))}else md.set(0,e),o(298,yd=setTimeout((()=>{gd.set(0,e)}),1))}if(1024&e.$$.dirty[1]&&(Xe||(fd.set(void 0,{hard:!0}),hd.set(void 0,{hard:!0}),gd.set(0,{hard:!0}))),65536&e.$$.dirty[12]&&o(317,qe=.5*ro),128&e.$$.dirty[10]|32768&e.$$.dirty[12]&&o(72,Ke=`translateX(${io-qe}px)`),256&e.$$.dirty[1]|12&e.$$.dirty[12]&&o(38,vt=Rt&&At&&!Ee),128&e.$$.dirty[1]|96&e.$$.dirty[10]&&o(314,Qe=Je&&(vt||ie)?vd:n),16&e.$$.dirty[10]&&o(71,it=Qe),16&e.$$.dirty[10]&&o(70,rt=Qe),8&e.$$.dirty[0]|2097152&e.$$.dirty[1]|370&e.$$.dirty[8]|15&e.$$.dirty[10]|8192&e.$$.dirty[12]&&o(69,at=or&&eo&&lm((()=>br([["div","alpha",{class:"PinturaNavGroup"},[["div","alpha-set",{class:"PinturaNavSet"},[Ir&&["Button","close",{label:or.labelClose,icon:or.iconButtonClose,onclick:()=>Ji("close"),hideLabel:!0}],kr&&["Button","revert",{label:or.labelButtonRevert,icon:or.iconButtonRevert,disabled:!W,onclick:Tc,hideLabel:!0}]]]]],["div","beta",{class:"PinturaNavGroup PinturaNavGroupFloat"},[Cr&&["div","history",{class:"PinturaNavSet"},[["Button","undo",{label:or.labelButtonUndo,icon:or.iconButtonUndo,disabled:!W,onclick:Sc.undo,hideLabel:!0}],["Button","redo",{label:or.labelButtonRedo,icon:or.iconButtonRedo,disabled:!_,onclick:Sc.redo,hideLabel:!0}]]],$e.length&&["div","plugin-tools",{class:"PinturaNavSet"},$e.filter(Boolean).map((([e,t,o])=>[e,t,{...o}]))]]],["div","gamma",{class:"PinturaNavGroup"},[Sr&&["Button","export",{label:or.labelButtonExport,icon:le&&or.iconButtonExport,class:"PinturaButtonExport",onclick:Ec,hideLabel:le}]]]],{...Jt},(()=>na.set({})))))),512&e.$$.dirty[12]&&o(306,pt=Ht&&!!Ht.length),134217728&e.$$.dirty[9]|520&e.$$.dirty[12]&&o(305,ht=pt&&Qr(At,Ht)),201326592&e.$$.dirty[9]|6148&e.$$.dirty[12]&&pt&&((e,t,i,r)=>{if(!t||!e||Md===t)return;Md=t;const n={dataSizeScalar:i};r&&r[3]>0&&(n.backgroundColor=[...r]),t(e,n).then((e=>{Td&&y(Td),e.setAttribute("data-retain",!0),o(299,Td=e)}))})(Rt,Xt,ht,Zt),1048576&e.$$.dirty[9]|1544&e.$$.dirty[12]&&Ht&&Td&&At){const{width:e,height:t}=At,i=Qt()?"pixelated":"auto"===Gt?"auto":"pixelated";o(300,Rd=Ht.map((o=>{const r=lt(o.x,o.y,o.width,o.height),n=bt(et(r),o.rotation).map((o=>me(o.x/e,o.y/t)));return{...o,id:"redaction",flipX:!1,flipY:!1,cornerRadius:0,strokeWidth:0,strokeColor:void 0,backgroundColor:[0,0,0,0],backgroundImage:Td,backgroundImageRendering:i,backgroundCorners:n}})))}2097152&e.$$.dirty[9]|256&e.$$.dirty[12]&&o(37,ft=[...Rd,...Nt||[]]),32&e.$$.dirty[1]&&Pd&&Id.set(Pd),4&e.$$.dirty[0]|128&e.$$.dirty[1]&&vt&&Dn&&Dn.dispatchEvent(Yh("ready")),262144&e.$$.dirty[1]&&o(63,Gd=!0),120&e.$$.dirty[12]&&o(64,Zd=!0),131072&e.$$.dirty[1]&&o(65,Xd=!0),65536&e.$$.dirty[1]&&o(66,Yd=!0),64&e.$$.dirty[1]&&o(67,qd=!0),2&e.$$.dirty[12]&&o(303,wt=!!Ct&&Ct.height>0),29360128&e.$$.dirty[9]&&!i&&wt&&(clearTimeout(Kd),o(301,Kd=setTimeout((()=>{i||Ps("locale")}),32)))},o(366,k=!Nc()),B=1===zd()?e=>{e&&(Se(e.origin,Math.round),Se(e.translation,Math.round))}:Y,o(333,Ie=[!tm()&&"WebGL"].filter(Boolean)),o(316,Je=vo()||w()&&O()),o(68,yt=((e,t=!0)=>o=>{"ping"===o.type&&(t&&o.stopPropagation(),e(o.detail.type,o.detail.data))})(Ki.pub)),[wn,zn,Dn,or,ir,dr,pr,hr,gr,yr,Pr,zr,Gr,Xr,Yr,qr,Kr,nn,an,ln,dn,mn,gn,fn,yn,bn,xn,Ln,fa,lc,Sc,mc,gc,Oc,Dc,pd,Pd,ft,vt,Ee,ct,Xe,Fe,G,Te,b,J,It,Et,Dt,Ot,Kt,eo,oo,ao,ho,Eo,zo,Do,ci,Pn,Rn,Gc,Gd,Zd,Xd,Yd,qd,yt,at,rt,it,Ke,Pe,Me,Ce,ue,Q,K,X,Mo,mi,Si,ki,Ci,Ti,Ri,Ii,Ei,Li,Fi,Di,Oi,Wi,_i,Vi,Ni,Hi,ji,Ui,Gi,Zi,Xi,Bn,Wn,_n,ta,na,ca,ua,ba,xa,va,wa,Sa,ka,Ta,Ma,Pa,Ra,Ia,Ea,Oa,_a,Va,Na,Ja,Qa,es,ts,os,is,rs,as,ss,ls,cs,ds,us,ps,ys,bs,xs,ws,Ss,ks,Cs,Ts,Ms,Rs,Is,Es,Ls,Fs,zs,Ds,Bs,Ws,_s,Vs,Hs,Gs,Xs,Ys,Ks,Js,Qs,el,ol,il,rl,nl,ul,pl,ml,$l,fl,yl,xl,vl,wl,Cl,Ml,Rl,jl,ql,Kl,Jl,Ql,ec,ic,rc,nc,ac,dc,uc,pc,fc,wc,Ic,Lc,zc,Vc,Zc,Yc,qc,(e,t)=>t[e],e=>U.find((t=>t.id===e)).view,ed,td,od,id,({target:e,propertyName:t})=>{e===Dn&&/background|outline/.test(t)&&ke&&rd()},nd,cd,ud,hd,md,gd,$d,fd,e=>{const t=!(!pd||!pd.closeButton)||!oo;$d.set(e.detail.width,{hard:t}),fd.set(Math.round(.5*-e.detail.width),{hard:t})},wd,Sd,e=>{const{keyCode:t,metaKey:o,ctrlKey:i,shiftKey:r}=e;if(9===t&&sr)return void e.preventDefault();if(e.target&&32===t&&Dn.contains(e.target)&&!_d(e.target)&&(qt&&a&&Kn(),e.preventDefault()),90===t&&(o||i))return void(r&&o?Sc.redo():Sc.undo());if(89===t&&i)return void Sc.redo();if(229===t)return;const n=new Set([...Yt,t]);Sd.set(Array.from(n))},({key:e,keyCode:t})=>{if("Meta"===e)return Sd.set([]);Sd.set(Yt.filter((e=>e!==t)))},()=>{Sd.set([])},e=>{_d(e.target)||e.preventDefault()},e=>{Ar&&kd(e.detail.resources[0])},()=>{Fr&&sm().then(Cd)},e=>{if(!Lr)return;const t=$s((window.innerWidth-Math.abs(Ct.x))/Ct.width,0,1),o=$s((window.innerHeight-Math.abs(Ct.y))/Ct.height,0,1);t<.75&&o<.75||kd((e.clipboardData||window.clipboardData).files[0])},Ed,Ud,e=>{Mt&>(e.detail,Mt)||vn(Ws,Mt=e.detail,Mt)},Nr,cc,Qi,er,tr,rr,nr,ar,sr,lr,cr,ur,mr,$r,fr,br,xr,wr,Sr,kr,Cr,Rr,Ir,Ar,Lr,Fr,Dr,Or,Br,Wr,_r,Vr,Hr,jr,Ur,Zr,tn,on,rn,sn,cn,$n,Sn,()=>o(60,Pn=void 0),(e,t,i)=>{const{text:r="",placeholder:n="",autoClose:a=!0,align:s="top",justify:l="center",buttonConfirm:c,buttonCancel:d}=i;o(60,Pn={align:s,justify:l,text:r,placeholder:n,buttonConfirm:c,buttonCancel:d,onconfirm:()=>{e(Rn.value),a&&o(60,Pn=void 0)},oncancel:()=>{t(void 0),o(60,Pn=void 0)}})},In,En,An,Fn,Xn,Yn,qn,Kn,Jn,Qn,ea,oa,ia,ra,da,qs,sc,ld,dd,yd,Td,Rd,Kd,i,wt,Z,ht,pt,a,j,st,le,$e,_,W,Qe,ie,Je,qe,Ye,Ue,He,je,Ve,Be,Le,ze,We,_e,Oe,De,Ze,Ge,Ae,Ie,Re,q,te,ge,pe,se,ne,re,ae,be,ve,xe,ye,fe,oe,ee,ce,ke,we,U,N,H,D,E,z,F,A,I,M,P,f,T,k,C,l,g,s,p,r,Ct,Rt,At,Lt,Ft,zt,Wt,Nt,Ht,Gt,Zt,Xt,Jt,to,io,ro,no,so,lo,co,uo,po,mo,fo,yo,bo,xo,wo,So,ko,Co,Po,Ro,Io,Ao,Lo,Fo,Bo,Wo,No,Yo,qo,Jo,oi,ii,ri,li,di,ui,pi,$i,fi,yi,bi,vi,wi,function(){o(31,mc=gm.innerWidth),o(32,gc=gm.innerHeight)},e=>vn(Bs,Ci=e.detail,Ci),({detail:e})=>o(43,G=e),function(t,i){e.$$.not_equal(zn[i],t)&&(zn[i]=t,o(1,zn),o(281,An),o(27,Ln))},e=>Zc(e),e=>Yc(e),(e,{detail:t})=>qc(e,t),e=>vn(zs,Mo=e.detail,Mo),function(t){e.$$.not_equal(zn[G],t)&&(zn[G]=t,o(1,zn),o(281,An),o(27,Ln))},()=>Zc(G),()=>Yc(G),({detail:e})=>qc(G,e),e=>{const t={...e,...Ed()},{annotationShapes:o,decorationShapes:i,interfaceShapes:r,frameShapes:n,selectionShapes:a}=yr({annotationShapes:Dt,decorationShapes:Et,interfaceShapes:_i,frameShapes:It,selectionShapes:ci},t);return Ud(t,ft,o,i,r,n,a)},()=>{o(63,Gd=!1),o(64,Zd=!1),o(65,Xd=!1),o(66,Yd=!1),o(67,qd=!1)},function(e){pa[e?"unshift":"push"]((()=>{Pd=e,o(36,Pd)}))},function(e){wn=e,o(0,wn),o(269,Zr)},function(e){Oc=e,o(33,Oc)},function(e){Dc=e,o(34,Dc)},function(e){pa[e?"unshift":"push"]((()=>{Rn=e,o(61,Rn)}))},function(e){pa[e?"unshift":"push"]((()=>{Dn=e,o(2,Dn)}))},e=>vn(Ls,Kt=e.detail,Kt)]}class Um extends Ga{constructor(e){super(),Ua(this,e,jm,_m,ln,{class:236,layout:237,stores:238,locale:3,id:4,util:239,utils:240,animations:241,disabled:242,previewUpscale:243,previewPad:244,previewMaskOpacity:5,previewImageDataMaxSize:245,previewImageTextPixelRatio:6,markupMaskOpacity:7,zoomMaskOpacity:246,elasticityMultiplier:8,willRevert:247,willProcessImage:248,willRenderCanvas:9,willRenderToolbar:249,willRenderUtilTabs:250,willSetHistoryInitialState:251,enableButtonExport:252,enableButtonRevert:253,enableNavigateHistory:254,enableToolbar:10,enableUtils:255,enableButtonClose:256,enableDropImage:257,enablePasteImage:258,enableBrowseImage:259,enableTransparencyGrid:11,layoutDirectionPreference:260,layoutHorizontalUtilsPreference:261,layoutVerticalUtilsPreference:262,layoutVerticalToolbarPreference:263,layoutVerticalControlGroupsPreference:264,layoutVerticalControlTabsPreference:265,status:234,formatStatusImageLoading:266,formatStatusImageProcessing:267,formatStatusSupportError:268,textDirection:12,markupEditorZoomLevel:269,markupEditorZoomLevels:13,markupEditorZoomAdjustStep:14,markupEditorZoomAdjustFactor:15,markupEditorZoomAdjustWheelFactor:16,markupEditorInteractionMode:270,muteAudio:271,willSetMediaInitialTimeOffset:272,enablePan:17,enableZoom:18,enableZoomControls:273,enableZoomInput:19,enablePanInput:274,enableCanvasAlpha:20,enablePanLimit:21,panLimitGutterScalar:22,pan:275,zoomPresetOptions:23,zoomAdjustStep:24,zoomAdjustFactor:25,zoomAdjustWheelFactor:26,zoomLevel:0,fixScrollDirection:276,hideTextInput:277,showTextInput:278,imagePreviewSrc:279,imageOrienter:280,pluginComponents:281,pluginOptions:27,sub:282,pluginInterface:1,root:2,play:283,pause:284,isPaused:285,togglePlayPause:286,mute:287,unmute:288,toggleMute:289,getDuration:290,getCurrentTime:291,setCurrentTime:292,imageSourceToImageData:28,imagePreview:29,imagePreviewCurrent:235,history:30},null,[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1])}get class(){return this.$$.ctx[236]}set class(e){this.$$set({class:e}),ka()}get layout(){return this.$$.ctx[237]}set layout(e){this.$$set({layout:e}),ka()}get stores(){return this.$$.ctx[238]}set stores(e){this.$$set({stores:e}),ka()}get locale(){return this.$$.ctx[3]}set locale(e){this.$$set({locale:e}),ka()}get id(){return this.$$.ctx[4]}set id(e){this.$$set({id:e}),ka()}get util(){return this.$$.ctx[239]}set util(e){this.$$set({util:e}),ka()}get utils(){return this.$$.ctx[240]}set utils(e){this.$$set({utils:e}),ka()}get animations(){return this.$$.ctx[241]}set animations(e){this.$$set({animations:e}),ka()}get disabled(){return this.$$.ctx[242]}set disabled(e){this.$$set({disabled:e}),ka()}get previewUpscale(){return this.$$.ctx[243]}set previewUpscale(e){this.$$set({previewUpscale:e}),ka()}get previewPad(){return this.$$.ctx[244]}set previewPad(e){this.$$set({previewPad:e}),ka()}get previewMaskOpacity(){return this.$$.ctx[5]}set previewMaskOpacity(e){this.$$set({previewMaskOpacity:e}),ka()}get previewImageDataMaxSize(){return this.$$.ctx[245]}set previewImageDataMaxSize(e){this.$$set({previewImageDataMaxSize:e}),ka()}get previewImageTextPixelRatio(){return this.$$.ctx[6]}set previewImageTextPixelRatio(e){this.$$set({previewImageTextPixelRatio:e}),ka()}get markupMaskOpacity(){return this.$$.ctx[7]}set markupMaskOpacity(e){this.$$set({markupMaskOpacity:e}),ka()}get zoomMaskOpacity(){return this.$$.ctx[246]}set zoomMaskOpacity(e){this.$$set({zoomMaskOpacity:e}),ka()}get elasticityMultiplier(){return this.$$.ctx[8]}set elasticityMultiplier(e){this.$$set({elasticityMultiplier:e}),ka()}get willRevert(){return this.$$.ctx[247]}set willRevert(e){this.$$set({willRevert:e}),ka()}get willProcessImage(){return this.$$.ctx[248]}set willProcessImage(e){this.$$set({willProcessImage:e}),ka()}get willRenderCanvas(){return this.$$.ctx[9]}set willRenderCanvas(e){this.$$set({willRenderCanvas:e}),ka()}get willRenderToolbar(){return this.$$.ctx[249]}set willRenderToolbar(e){this.$$set({willRenderToolbar:e}),ka()}get willRenderUtilTabs(){return this.$$.ctx[250]}set willRenderUtilTabs(e){this.$$set({willRenderUtilTabs:e}),ka()}get willSetHistoryInitialState(){return this.$$.ctx[251]}set willSetHistoryInitialState(e){this.$$set({willSetHistoryInitialState:e}),ka()}get enableButtonExport(){return this.$$.ctx[252]}set enableButtonExport(e){this.$$set({enableButtonExport:e}),ka()}get enableButtonRevert(){return this.$$.ctx[253]}set enableButtonRevert(e){this.$$set({enableButtonRevert:e}),ka()}get enableNavigateHistory(){return this.$$.ctx[254]}set enableNavigateHistory(e){this.$$set({enableNavigateHistory:e}),ka()}get enableToolbar(){return this.$$.ctx[10]}set enableToolbar(e){this.$$set({enableToolbar:e}),ka()}get enableUtils(){return this.$$.ctx[255]}set enableUtils(e){this.$$set({enableUtils:e}),ka()}get enableButtonClose(){return this.$$.ctx[256]}set enableButtonClose(e){this.$$set({enableButtonClose:e}),ka()}get enableDropImage(){return this.$$.ctx[257]}set enableDropImage(e){this.$$set({enableDropImage:e}),ka()}get enablePasteImage(){return this.$$.ctx[258]}set enablePasteImage(e){this.$$set({enablePasteImage:e}),ka()}get enableBrowseImage(){return this.$$.ctx[259]}set enableBrowseImage(e){this.$$set({enableBrowseImage:e}),ka()}get enableTransparencyGrid(){return this.$$.ctx[11]}set enableTransparencyGrid(e){this.$$set({enableTransparencyGrid:e}),ka()}get layoutDirectionPreference(){return this.$$.ctx[260]}set layoutDirectionPreference(e){this.$$set({layoutDirectionPreference:e}),ka()}get layoutHorizontalUtilsPreference(){return this.$$.ctx[261]}set layoutHorizontalUtilsPreference(e){this.$$set({layoutHorizontalUtilsPreference:e}),ka()}get layoutVerticalUtilsPreference(){return this.$$.ctx[262]}set layoutVerticalUtilsPreference(e){this.$$set({layoutVerticalUtilsPreference:e}),ka()}get layoutVerticalToolbarPreference(){return this.$$.ctx[263]}set layoutVerticalToolbarPreference(e){this.$$set({layoutVerticalToolbarPreference:e}),ka()}get layoutVerticalControlGroupsPreference(){return this.$$.ctx[264]}set layoutVerticalControlGroupsPreference(e){this.$$set({layoutVerticalControlGroupsPreference:e}),ka()}get layoutVerticalControlTabsPreference(){return this.$$.ctx[265]}set layoutVerticalControlTabsPreference(e){this.$$set({layoutVerticalControlTabsPreference:e}),ka()}get status(){return this.$$.ctx[234]}set status(e){this.$$set({status:e}),ka()}get formatStatusImageLoading(){return this.$$.ctx[266]}set formatStatusImageLoading(e){this.$$set({formatStatusImageLoading:e}),ka()}get formatStatusImageProcessing(){return this.$$.ctx[267]}set formatStatusImageProcessing(e){this.$$set({formatStatusImageProcessing:e}),ka()}get formatStatusSupportError(){return this.$$.ctx[268]}set formatStatusSupportError(e){this.$$set({formatStatusSupportError:e}),ka()}get textDirection(){return this.$$.ctx[12]}set textDirection(e){this.$$set({textDirection:e}),ka()}get markupEditorZoomLevel(){return this.$$.ctx[269]}set markupEditorZoomLevel(e){this.$$set({markupEditorZoomLevel:e}),ka()}get markupEditorZoomLevels(){return this.$$.ctx[13]}set markupEditorZoomLevels(e){this.$$set({markupEditorZoomLevels:e}),ka()}get markupEditorZoomAdjustStep(){return this.$$.ctx[14]}set markupEditorZoomAdjustStep(e){this.$$set({markupEditorZoomAdjustStep:e}),ka()}get markupEditorZoomAdjustFactor(){return this.$$.ctx[15]}set markupEditorZoomAdjustFactor(e){this.$$set({markupEditorZoomAdjustFactor:e}),ka()}get markupEditorZoomAdjustWheelFactor(){return this.$$.ctx[16]}set markupEditorZoomAdjustWheelFactor(e){this.$$set({markupEditorZoomAdjustWheelFactor:e}),ka()}get markupEditorInteractionMode(){return this.$$.ctx[270]}set markupEditorInteractionMode(e){this.$$set({markupEditorInteractionMode:e}),ka()}get muteAudio(){return this.$$.ctx[271]}set muteAudio(e){this.$$set({muteAudio:e}),ka()}get willSetMediaInitialTimeOffset(){return this.$$.ctx[272]}set willSetMediaInitialTimeOffset(e){this.$$set({willSetMediaInitialTimeOffset:e}),ka()}get enablePan(){return this.$$.ctx[17]}set enablePan(e){this.$$set({enablePan:e}),ka()}get enableZoom(){return this.$$.ctx[18]}set enableZoom(e){this.$$set({enableZoom:e}),ka()}get enableZoomControls(){return this.$$.ctx[273]}set enableZoomControls(e){this.$$set({enableZoomControls:e}),ka()}get enableZoomInput(){return this.$$.ctx[19]}set enableZoomInput(e){this.$$set({enableZoomInput:e}),ka()}get enablePanInput(){return this.$$.ctx[274]}set enablePanInput(e){this.$$set({enablePanInput:e}),ka()}get enableCanvasAlpha(){return this.$$.ctx[20]}set enableCanvasAlpha(e){this.$$set({enableCanvasAlpha:e}),ka()}get enablePanLimit(){return this.$$.ctx[21]}set enablePanLimit(e){this.$$set({enablePanLimit:e}),ka()}get panLimitGutterScalar(){return this.$$.ctx[22]}set panLimitGutterScalar(e){this.$$set({panLimitGutterScalar:e}),ka()}get pan(){return this.$$.ctx[275]}set pan(e){this.$$set({pan:e}),ka()}get zoomPresetOptions(){return this.$$.ctx[23]}set zoomPresetOptions(e){this.$$set({zoomPresetOptions:e}),ka()}get zoomAdjustStep(){return this.$$.ctx[24]}set zoomAdjustStep(e){this.$$set({zoomAdjustStep:e}),ka()}get zoomAdjustFactor(){return this.$$.ctx[25]}set zoomAdjustFactor(e){this.$$set({zoomAdjustFactor:e}),ka()}get zoomAdjustWheelFactor(){return this.$$.ctx[26]}set zoomAdjustWheelFactor(e){this.$$set({zoomAdjustWheelFactor:e}),ka()}get zoomLevel(){return this.$$.ctx[0]}set zoomLevel(e){this.$$set({zoomLevel:e}),ka()}get fixScrollDirection(){return this.$$.ctx[276]}set fixScrollDirection(e){this.$$set({fixScrollDirection:e}),ka()}get hideTextInput(){return this.$$.ctx[277]}get showTextInput(){return this.$$.ctx[278]}get imagePreviewSrc(){return this.$$.ctx[279]}set imagePreviewSrc(e){this.$$set({imagePreviewSrc:e}),ka()}get imageOrienter(){return this.$$.ctx[280]}set imageOrienter(e){this.$$set({imageOrienter:e}),ka()}get pluginComponents(){return this.$$.ctx[281]}set pluginComponents(e){this.$$set({pluginComponents:e}),ka()}get pluginOptions(){return this.$$.ctx[27]}set pluginOptions(e){this.$$set({pluginOptions:e}),ka()}get sub(){return this.$$.ctx[282]}get pluginInterface(){return this.$$.ctx[1]}get root(){return this.$$.ctx[2]}set root(e){this.$$set({root:e}),ka()}get play(){return this.$$.ctx[283]}get pause(){return this.$$.ctx[284]}get isPaused(){return this.$$.ctx[285]}get togglePlayPause(){return this.$$.ctx[286]}get mute(){return this.$$.ctx[287]}get unmute(){return this.$$.ctx[288]}get toggleMute(){return this.$$.ctx[289]}get getDuration(){return this.$$.ctx[290]}get getCurrentTime(){return this.$$.ctx[291]}get setCurrentTime(){return this.$$.ctx[292]}get imageSourceToImageData(){return this.$$.ctx[28]}set imageSourceToImageData(e){this.$$set({imageSourceToImageData:e}),ka()}get imagePreview(){return this.$$.ctx[29]}get imagePreviewCurrent(){return this.$$.ctx[235]}set imagePreviewCurrent(e){this.$$set({imagePreviewCurrent:e}),ka()}get history(){return this.$$.ctx[30]}}"undefined"!=typeof window&&(e=>{if(e&&e._dwkgrvd)return;const[t,o,i]=[[99,111,110,115,111,108,101],[108,111,103],[84,104,105,115,32,118,101,114,115,105,111,110,32,111,102,32,80,105,110,116,117,114,97,32,105,115,32,102,111,114,32,116,101,115,116,105,110,103,32,112,117,114,112,111,115,101,115,32,111,110,108,121,46,32,86,105,115,105,116,32,104,116,116,112,115,58,47,47,112,113,105,110,97,46,110,108,47,112,105,110,116,117,114,97,32,116,111,32,112,117,114,99,104,97,115,101,32,97,32,108,105,99,101,110,115,101,46,32,86,105,115,105,116,32,104,116,116,112,115,58,47,47,112,113,105,110,97,46,110,108,47,112,105,110,116,117,114,97,47,99,104,97,116,32,105,102,32,121,111,117,32,104,97,118,101,32,97,110,121,32,113,117,101,115,116,105,111,110,115,46]].map((e=>e.map((e=>String.fromCharCode(e))).join("")));e&&e[t]&&e[t][o](i)})(window);const Gm=["klass","stores","isVisible","isActive","isActiveFraction","locale"],Zm=["history","klass","stores","navButtons","pluginComponents","pluginInterface","pluginOptions","sub","imagePreviewSrc","imagePreview","imagePreviewCurrent"],Xm=["locale"];let Ym;const qm=new Set([]),Km={},Jm=new Map,Qm=(...e)=>{e.filter((e=>!!e.util)).forEach((e=>{const[t,o,i=(()=>!0)]=e.util;Jm.has(t)||(Jm.set(t,{Component:o,isSupported:i}),$d(o).filter((e=>!Gm.includes(e))).forEach((e=>{qm.add(e),Km[e]?Km[e].push(t):Km[e]=[t]})))}))};var eg=[...Rs,"init","update","undo","redo","revert","writehistory","destroy","show","hide","close","ready","zoom","pan","loadpreview","selectshape","blurshape","updateshape","addshape","removeshape","selectstyle","markuptap","markupzoom","markuppan","selectutil","selectcontrol","selectiondown","selectionup","selectionchange"];var tg=(e,t,o={})=>{const{prefix:i="pintura:"}=o;return eg.map((o=>e.on(o,(e=>jt(t)?((e,t,o)=>e.dispatchEvent(new CustomEvent(t,{detail:o,bubbles:!0,cancelable:!0})))(t,`${i}${o}`,e):t(o,e)))))};const og=e=>m(e[0]),ig=e=>!og(e),rg=e=>e[1],ng=e=>e[3]||[];const ag=(e,t,o,i=(e=>e))=>{const r=cg(t,o),n=r.findIndex((e=>rg(e)===t));var a,s,l;a=r,s=i(n),l=e,a.splice(s,0,l)},sg=(e,t)=>{const o=cg(e,t);return wh(o,(t=>rg(t)===e)),o},lg=(e,t)=>{if(t&&t.length){if(og(t)){if(rg(t)===e)return t;const o=lg(e,ng(t));if(o)return o}if(ig(t))for(const o of t){const t=lg(e,o);if(t)return t}}},cg=(e,t)=>{if(ig(t)){if(t.find((t=>rg(t)===e)))return t;const o=t.find((t=>cg(e,ng(t))));return o&&o[3]}return cg(e,ng(t))},dg=()=>[.75,.25,.25,0,0,.25,.75,.25,0,0,.25,.25,.75,0,0,0,0,0,1,0],ug=()=>[1.398,-.316,.065,-.273,.201,-.051,1.278,-.08,-.273,.201,-.051,.119,1.151,-.29,.215,0,0,0,1,0],pg=()=>[1.073,-.015,.092,-.115,-.017,.107,.859,.184,-.115,-.017,.015,.077,1.104,-.115,-.017,0,0,0,1,0],hg=()=>[1.06,0,0,0,0,0,1.01,0,0,0,0,0,.93,0,0,0,0,0,1,0],mg=()=>[1.1,0,0,0,-.1,0,1.1,0,0,-.1,0,0,1.2,0,-.1,0,0,0,1,0],gg=()=>[.212,.715,.114,0,0,.212,.715,.114,0,0,.212,.715,.114,0,0,0,0,0,1,0],$g=()=>[.15,1.3,-.25,.1,-.2,.15,1.3,-.25,.1,-.2,.15,1.3,-.25,.1,-.2,0,0,0,1,0],fg=()=>[.163,.518,.084,-.01,.208,.163,.529,.082,-.02,.21,.171,.529,.084,0,.214,0,0,0,1,0],yg=()=>[.338,.991,.117,.093,-.196,.302,1.049,.096,.078,-.196,.286,1.016,.146,.101,-.196,0,0,0,1,0],bg=()=>[.393,.768,.188,0,0,.349,.685,.167,0,0,.272,.533,.13,0,0,0,0,0,1,0],xg=()=>[.289,.62,.185,0,.077,.257,.566,.163,0,.115,.2,.43,.128,0,.188,0,0,0,1,0],vg=()=>[.269,.764,.172,.05,.1,.239,.527,.152,0,.176,.186,.4,.119,0,.159,0,0,0,1,0],wg=()=>[.547,.764,.134,0,-.147,.281,.925,.12,0,-.135,.225,.558,.33,0,-.113,0,0,0,1,0],Sg={chrome:ug,fade:pg,pastel:dg,cold:mg,warm:hg,monoDefault:gg,monoWash:fg,monoNoir:$g,monoStark:yg,sepiaDefault:bg,sepiaRust:vg,sepiaBlues:xg,sepiaColor:wg};var kg={filterFunctions:Sg,filterOptions:[["Default",[[void 0,e=>e.labelDefault]]],["Classic",[["chrome",e=>e.filterLabelChrome],["fade",e=>e.filterLabelFade],["cold",e=>e.filterLabelCold],["warm",e=>e.filterLabelWarm],["pastel",e=>e.filterLabelPastel]]],["Monochrome",[["monoDefault",e=>e.filterLabelMonoDefault],["monoNoir",e=>e.filterLabelMonoNoir],["monoStark",e=>e.filterLabelMonoStark],["monoWash",e=>e.filterLabelMonoWash]]],["Sepia",[["sepiaDefault",e=>e.filterLabelSepiaDefault],["sepiaRust",e=>e.filterLabelSepiaRust],["sepiaBlues",e=>e.filterLabelSepiaBlues],["sepiaColor",e=>e.filterLabelSepiaColor]]]]};const Cg={borderColor:"strokeColor",borderWidth:"strokeWidth",lineWidth:"strokeWidth",fontColor:"color",lineColor:"strokeColor",src:"backgroundImage",fit:"backgroundSize"},Tg=e=>0===e||"0%"===e||"0px"===e?0:/px$/.test(e)?parseInt(e,10):/\%$/.test(e)?e:e<=1?100*e+"%":void 0,Mg=(e,t)=>{let o,i;return/%$/.test(e)?(o=parseFloat(e),i=parseFloat(t),o+i+"%"):/px$/.test(e)?(o=parseInt(e,10),i=parseInt(t,10),o+i+"px"):void 0},Pg=(e,t)=>{const o=e,i=t,r=1.5707963267948966-t,n=Math.sin(1.5707963267948966),a=Math.sin(i),s=Math.sin(r),l=Math.cos(r),c=o/n;return me(l*(c*a),l*(c*s))},Rg=(e,{flip:t,aspectRatio:o,rotation:i,center:r,zoom:n,scaleToFit:a})=>{const s={flipX:!1,flipY:!1},l=!r||r&&.5===r.x&&.5===r.y;t&&t.horizontal&&(s.flipX=t.horizontal),t&&t.vertical&&(s.flipY=t.vertical);const c=((e,t)=>null!=t?1/t:e.width/e.height)(e,o),d=!(!1===a),u=((e,t,o=1)=>{const i=e.height/e.width,r=t;let n=1,a=i;a>r&&(a=r,n=a/i);const s=Math.max(1/n,r/a),l=e.width/(o*s*n);return{width:l,height:l*t}})(e,o,n),p=l?e:((e,t)=>{const o=t.x>.5?1-t.x:t.x,i=t.y>.5?1-t.y:t.y;return Ne(2*o*e.width,2*i*e.height)})(e,d?r:{x:.5,y:.5}),h=((e,t)=>{let o=e.width,i=o*t;i>e.height&&(i=e.height,o=i/t);const r=.5*(e.width-o),n=.5*(e.height-i);return lt(r,n,o,i)})(e,o);if((o||!l||n)&&(s.crop=St(ot(p),c)),"number"==typeof i&&null!==i&&0!==i){null!=i&&(s.rotation=i);const t=((e,t)=>{const o=e.width,i=e.height,r=Pg(o,t),n=Pg(i,t),a=me(e.x+Math.abs(r.x),e.y-Math.abs(r.y)),s=me(e.x+e.width+Math.abs(n.y),e.y+Math.abs(n.x)),l=me(e.x-Math.abs(n.y),e.y+e.height-Math.abs(n.x));return{width:Ee(a,s),height:Ee(a,l)}})(h,i),o=Math.max(t.width/p.width,t.height/p.height),n=me(r.x*e.width,r.y*e.height),a=Ht(e,i),l=Ue(a),c=me(.5*(a.width-e.width),.5*(a.height-e.height)),d=bt({x:c.x+n.x-u.width/o*.5,y:c.y+n.y-u.height/o*.5,width:u.width/o,height:u.height/o},i),m=ze(d.map($e),i,l.x,l.y),g=ct(nt(m)),$=ze(m.map($e),-2*i,g.x,g.y);s.crop=nt($)}else null!=n&&ut(s.crop,1/n);return d||(s.cropLimitToImage=!1),s};let Ig=null;const Eg={base:0,min:-.25,max:.25,getLabel:e=>dm(e/.25),getStore:({imageColorMatrix:e})=>e,getValue:e=>{if(e.brightness)return e.brightness[4]},setValue:(e,t)=>e.update((e=>({...e,brightness:[1,0,0,0,t,0,1,0,0,t,0,0,1,0,t,0,0,0,1,0]})))},Ag={base:1,min:.5,max:1.5,getLabel:e=>dm(2*(e-.5)-1),getStore:({imageColorMatrix:e})=>e,getValue:e=>{if(e.contrast)return e.contrast[0]},setValue:(e,t)=>e.update((e=>({...e,contrast:[t,0,0,0,.5*(1-t),0,t,0,0,.5*(1-t),0,0,t,0,.5*(1-t),0,0,0,1,0]})))},Lg={base:1,min:0,max:2,getLabel:e=>dm(e-1),getStore:({imageColorMatrix:e})=>e,getValue:e=>{if(e.saturation)return(e.saturation[0]-.213)/.787},setValue:(e,t)=>e.update((e=>({...e,saturation:[.213+.787*t,.715-.715*t,.072-.072*t,0,0,.213-.213*t,.715+.285*t,.072-.072*t,0,0,.213-.213*t,.715-.715*t,.072+.928*t,0,0,0,0,0,1,0]})))},Fg={base:1,min:.5,max:1.5,getLabel:e=>dm(2*(e-.5)-1),getStore:({imageColorMatrix:e})=>e,getValue:e=>{if(e.exposure)return e.exposure[0]},setValue:(e,t)=>e.update((e=>({...e,exposure:[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0]})))},zg={base:1,min:.15,max:4,getLabel:e=>dm(e<1?(e-.15)/.85-1:(e-1)/3),getStore:({imageGamma:e})=>e},Dg={base:0,min:-1,max:1,getStore:({imageVignette:e})=>e},Og={base:0,min:-1,max:1,getStore:({imageConvolutionMatrix:e})=>e,getValue:e=>{if(e.clarity)return 0===e.clarity[0]?e.clarity[1]/-1:e.clarity[1]/-2},setValue:(e,t)=>{e.update((e=>({...e,clarity:t>=0?[0,-1*t,0,-1*t,1+4*t,-1*t,0,-1*t,0]:[-1*t,-2*t,-1*t,-2*t,1+-3*t,-2*t,-1*t,-2*t,-1*t]})))}},Bg={base:0,min:-1,max:1,getStore:({imageColorMatrix:e})=>e,getValue:e=>{if(!e.temperature)return;const t=e.temperature[0];return t>=1?(t-1)/.1:(1-t)/-.15},setValue:(e,t)=>e.update((e=>({...e,temperature:t>0?[1+.1*t,0,0,0,0,0,1,0,0,0,0,0,1+.1*-t,0,0,0,0,0,1,0]:[1+.15*t,0,0,0,0,0,1+.05*t,0,0,0,0,0,1+.15*-t,0,0,0,0,0,1,0]})))};var Wg={finetuneControlConfiguration:{gamma:zg,brightness:Eg,contrast:Ag,saturation:Lg,exposure:Fg,temperature:Bg,clarity:Og,vignette:Dg},finetuneOptions:[["brightness",e=>e.finetuneLabelBrightness],["contrast",e=>e.finetuneLabelContrast],["saturation",e=>e.finetuneLabelSaturation],["exposure",e=>e.finetuneLabelExposure],["temperature",e=>e.finetuneLabelTemperature],["gamma",e=>e.finetuneLabelGamma],!Nc()&&["clarity",e=>e.finetuneLabelClarity],["vignette",e=>e.finetuneLabelVignette]].filter(Boolean)};const _g=(e,t="thumb")=>["div",t,{style:e,textContent:" "}],Vg={shape:{frameColor:[1,1,1],frameStyle:"solid",frameSize:"2.5%"},thumb:'<rect stroke-width="5" x="0" y="0" width="100%" height="100%"/>'},Ng={shape:{frameColor:[1,1,1],frameStyle:"solid",frameSize:"2.5%",frameRound:!0},thumb:'<rect stroke-width="5" x="0" y="0" width="100%" height="100%" rx="12%"/>'},Hg={shape:{frameColor:[1,1,1],frameStyle:"line",frameInset:"2.5%",frameSize:".3125%",frameRadius:0},thumb:[_g("top:.5em;left:.5em;right:.5em;bottom:.5em;box-shadow:inset 0 0 0 1px currentColor")]},jg={shape:{frameColor:[1,1,1],frameStyle:"line",frameAmount:2,frameInset:"2.5%",frameSize:".3125%",frameOffset:"1.25%",frameRadius:0},thumb:[_g("top:.75em;left:.75em;right:.75em;bottom:.75em; outline: 3px double")]},Ug={shape:{frameColor:[1,1,1],frameStyle:"edge",frameInset:"2.5%",frameOffset:"5%",frameSize:".3125%"},thumb:[_g("top:.75em;left:.5em;bottom:.75em;border-left:1px solid","a"),_g("top:.75em;right:.5em;bottom:.75em;border-right:1px solid","b"),_g("top:.5em;left:.75em;right:.75em;border-top:1px solid","c"),_g("bottom:.5em;left:.75em;right:.75em;border-bottom:1px solid","d")]},Gg={shape:{frameColor:[1,1,1],frameStyle:"edge",frameInset:"2.5%",frameSize:".3125%"},thumb:[_g("top:-.5em;left:.5em;right:.5em;bottom:-.5em; box-shadow: inset 0 0 0 1px currentColor","a"),_g("top:.5em;left:-.5em;right:-.5em;bottom:.5em;box-shadow:inset 0 0 0 1px currentColor","b")]},Zg={shape:{frameColor:[1,1,1],frameStyle:"edge",frameOffset:"1.5%",frameSize:".3125%"},thumb:[_g("top:.3125em;left:.5em;bottom:.3125em;border-left:1px solid","a"),_g("top:.3125em;right:.5em;bottom:.3125em;border-right:1px solid","b"),_g("top:.5em;left:.3125em;right:.3125em;border-top:1px solid","c"),_g("bottom:.5em;left:.3125em;right:.3125em;border-bottom:1px solid","d")]},Xg={shape:{frameColor:[1,1,1],frameStyle:"hook",frameInset:"2.5%",frameSize:".3125%",frameLength:"5%"},thumb:[_g("top:.5em;left:.5em;width:.75em;height:.75em; border-left: 1px solid;border-top: 1px solid","a"),_g("top:.5em;right:.5em;width:.75em;height:.75em; border-right: 1px solid;border-top: 1px solid","b"),_g("bottom:.5em;left:.5em;width:.75em;height:.75em; border-left: 1px solid;border-bottom: 1px solid","c"),_g("bottom:.5em;right:.5em;width:.75em;height:.75em; border-right: 1px solid;border-bottom: 1px solid","d")]},Yg={shape:{frameColor:[1,1,1],frameStyle:"polaroid"},thumb:'<rect stroke-width="20%" x="-5%" y="-5%" width="110%" height="96%"/>'};var qg={frameStyles:{solidSharp:Vg,solidRound:Ng,lineSingle:Hg,lineMultiple:jg,edgeSeparate:Ug,edgeCross:Gg,edgeOverlap:Zg,hook:Xg,polaroid:Yg},frameOptions:[[void 0,e=>e.labelNone],["solidSharp",e=>e.frameLabelMatSharp],["solidRound",e=>e.frameLabelMatRound],["lineSingle",e=>e.frameLabelLineSingle],["lineMultiple",e=>e.frameLabelLineMultiple],["edgeCross",e=>e.frameLabelEdgeCross],["edgeSeparate",e=>e.frameLabelEdgeSeparate],["edgeOverlap",e=>e.frameLabelEdgeOverlap],["hook",e=>e.frameLabelCornerHooks],["polaroid",e=>e.frameLabelPolaroid]]},Kg=e=>e.charAt(0).toUpperCase()+e.slice(1);let Jg=null;var Qg=()=>{if(null===Jg)if(d())try{Jg=!1===document.fonts.check("16px TestNonExistingFont")}catch(e){Jg=!1}else Jg=!1;return Jg};const e$=(e,t)=>o=>o[t?`${t}${Kg(e)}`:e],t$=e=>[e,""+e],o$=(e,t)=>o=>[e[o],e$(o,t)],i$=e=>Array.isArray(e)&&e.every(Oo)?e.map(t$):e,r$=[1,.2549,.2118],n$="0.5%",a$=[1,1,1,0],s$={brush:["path",{bitmap:!0,drawMode:"add",strokeWidth:"5%",cursorStyle:"ellipse",cursorSize:"strokeWidth",disableStyle:["strokeColor"],settings:{strokeWidth:{control:"brushSize"}}}],lassoo:["path",{drawMode:"add",disableStyle:["strokeWidth","strokeColor"],pathClose:!0}],rectangle:["rectangle",{disableStyle:["backgroundColor","strokeWidth","strokeColor","cornerRadius"],drawMode:"add"}],ellipse:["ellipse",{disableStyle:["backgroundColor","strokeWidth","strokeColor"],drawMode:"add"}]},l$=["brush","lassoo","rectangle","ellipse"],c$=e=>{const{hideLabel:t=!0}=e||{};return U$(["new","add","subtract"].map((e=>[e,e$(e,"shapeLabelSelectionMode"),{icon:e$(e,"shapeIconSelectionMode"),hideLabel:t}])),{title:e=>e.shapeTitleSelectionMode,layout:"radio"})},d$=e=>j$(e,{title:e=>e.shapeTitleBrushSize,layout:"radio",optionHideLabel:!0,optionIcon:(e,t)=>`<circle fill="currentColor" stroke-width=".05em" stroke="currentColor" fill-opacity=".25" cx="12" cy="12" r="${2+8*t}"/>`}),u$={eraser:()=>({eraseRadius:8,cursorStyle:"ellipse",cursorSize:"eraseRadius"}),path:()=>({points:[],disableAddPoints:!1}),line:()=>({x1:0,y1:0,x2:0,y2:0,disableErase:!1}),rectangle:()=>({x:0,y:0,width:0,height:0}),ellipse:()=>({x:0,y:0,rx:0,ry:0}),text:()=>({x:0,y:0,text:"Text",disableTextScale:!0})},p$=(e,t={},o)=>{if(!u$[e])return;const{position:i="relative",inputMode:r="drag",isSelection:n=!1,interpolateInput:a=!1}=o||{};return[{...u$[e](),...t},{position:i,inputMode:r,isSelection:n,interpolateInput:a}]},h$=e=>{const t={sharpie:p$("path",{bitmap:!0,strokeJoin:"round",strokeCap:"round",strokeWidth:n$,strokeColor:[...r$],cursorStyle:"ellipse",cursorSize:"strokeWidth",disableErase:!1,disableResize:!0,disableMove:!0},{interpolateInput:!0}),eraser:p$("eraser"),path:p$("path",{pathClose:void 0,strokeWidth:n$,strokeColor:[...r$],backgroundColor:[0,0,0,0]},{inputMode:"step"}),line:p$("line",{strokeColor:[...r$],strokeWidth:n$}),arrow:p$("line",{lineStart:"none",lineEnd:"arrow-solid",strokeColor:[...r$],strokeWidth:n$}),rectangle:p$("rectangle",{strokeColor:[...a$],backgroundColor:[...r$]}),ellipse:p$("ellipse",{strokeColor:[...a$],backgroundColor:[...r$]}),text:p$("text",{color:[...r$],fontSize:"2%"})};return e&&Object.entries(e).forEach((([e,o])=>{Array.isArray(o)?t[e]=o:T(o)&&t[e]&&(t[e]=[{...t[e][0],...o},t[e][1]])})),t},m$=(e,t,o)=>[e,t||e$(e,"shapeLabelTool"),{icon:e$(e,"shapeIconTool"),...o}],g$=(e=["move","view","sharpie","eraser","path","line","arrow","rectangle","ellipse","text","preset"])=>e.map((e=>m(e)?m$(e):Array.isArray(e)?T(e[1])?m$(e[0],void 0,e[1]):m$(e[0],e[1],e[2]):void 0)).filter(Boolean),$$=()=>({transparent:[1,1,1,0],white:[1,1,1],silver:[.8667,.8667,.8667],gray:[.6667,.6667,.6667],black:[0,0,0],navy:[0,.1216,.2471],blue:[0,.4549,.851],aqua:[.498,.8588,1],teal:[.2235,.8,.8],olive:[.2392,.6,.4392],green:[.1804,.8,.251],yellow:[1,.8627,0],orange:[1,.5216,.1059],red:[1,.2549,.2118],maroon:[.5216,.0784,.2941],fuchsia:[.9412,.0706,.7451],purple:[.6941,.051,.7882]}),f$=()=>[16,18,20,24,30,36,48,64,72,96,128,144],y$=f$,b$=()=>({extraSmall:"2%",small:"4%",mediumSmall:"8%",medium:"10%",mediumLarge:"15%",large:"20%",extraLarge:"25%"}),x$=()=>({extraSmall:"40%",small:"60%",mediumSmall:"100%",medium:"120%",mediumLarge:"140%",large:"180%",extraLarge:"220%"}),v$=()=>({extraSmall:"0.25%",small:"0.5%",mediumSmall:"1%",medium:"1.75%",mediumLarge:"2.5%",large:"3.5%",extraLarge:"5%"}),w$=()=>["bar","arrow","arrowSolid","circle","circleSolid","square","squareSolid"],S$=()=>[["Helvetica, Arial, Verdana, 'Droid Sans', sans-serif","Sans Serif"],["'Arial Black', 'Avenir-Black', 'Arial Bold'","Black"],["'Arial Narrow', 'Futura-CondensedMedium'","Narrow"],["'Trebuchet MS'","Humanist"],["Georgia, 'Avenir-Black', 'Times New Roman', 'Droid Serif', serif","Serif"],["Palatino","Old-Style"],["'Times New Roman', 'TimesNewRomanPSMT'","Transitional"],["Menlo, Monaco, 'Lucida Console', monospace","Monospaced"],["'Courier New', monospace","Slab Serif"]],k$=()=>["left","center","right"],C$=()=>[["normal","bold"],["italic","normal"],["italic","bold"]],T$=e=>Object.keys(e).map(o$(e,"shapeTitleColor")),M$=e=>Object.keys(e).map(o$(e,"labelSize")),P$=e=>Object.keys(e).map(o$(e,"labelSize")),R$=e=>Object.keys(e).map(o$(e,"labelSize")),I$=e=>[...e],E$=e=>e.map((e=>[e,t=>t["shapeLabelFontStyle"+e.filter((e=>"normal"!==e)).map(Kg).join("")]])),A$=e=>e.map((e=>[qh(e),t=>t["shapeTitleLineDecoration"+Kg(e)],{icon:t=>t["shapeIconLineDecoration"+Kg(e)]}])),L$=(e,t)=>{const{defaultKey:o,defaultValue:i,defaultOptions:r}=t||{},n=[];return o&&(n[0]=[i,e=>e[o],{...r}]),[...n,...e]},F$=e=>e.split(",").map((e=>e.trim())).some((e=>document.fonts.check("16px "+e))),z$=(e={})=>["ToggleSlider",{...e}],D$="PinturaFontTest",O$=(e,t={defaultKey:"labelDefault"})=>["Dropdown",{title:e=>e.shapeTitleFontFamily,onload:({options:e=[]})=>{Qg()&&e.map((([e])=>e)).filter(Boolean).filter((e=>!F$(e))).forEach((e=>{const t="PinturaFontTest-"+e.replace(/[^a-zA-Z0-9]+/g,"").toLowerCase();document.getElementById(t)||document.body.append($("span",{textContent:" ",id:t,class:D$,style:`font-family:${e};font-size:0;color:transparent;`}))}))},ondestroy:()=>{if(!Qg())return;document.querySelectorAll(".PinturaFontTest").forEach((e=>e.remove()))},optionLabelStyle:e=>"font-family: "+e,options:L$(e,t),optionFilter:e=>{if(!Qg())return!0;const[t]=e;if(!t)return!0;return F$(t)}}],B$=(e,t={})=>["ColorPicker",{options:L$(e),...t}],W$=(e,t={})=>B$(e,{title:e=>e.labelColor,...t}),_$=e=>(t,o={})=>B$(t,{title:t=>t[e],...o}),V$=_$("shapeTitleBackgroundColor"),N$=_$("shapeTitleTextColor"),H$=(e,t={})=>B$(e,{title:e=>e.shapeTitleStrokeColor,options:L$(e),buttonClass:"PinturaColorPickerButtonStroke",onchange:(e,o)=>{const i=o.strokeWidth;(Oo(i)||m(i)?parseFloat(i):0)>0||(o.strokeWidth=t&&t.defaultStrokeWidth||"0.5%")},...t}),j$=(e,t)=>{const{title:o,optionHideLabel:i=!1,layout:r,optionIcon:n=!1}=t||{},a=i$(e),s=e.map((([e])=>m(e)?parseFloat(e):e)),l=Math.max(...s),c=Math.min(...s),d=l-c;return["radio"===r?"RadioGroup":"Dropdown",{title:!1===o?void 0:o||(e=>e.shapeTitleStrokeWidth),options:e=>{const o=t?a.map((e=>{const[t,o,r={}]=e,a=m(t)?parseFloat(t):t,s=(a-c)/d;let l=void 0;return"line"===n?l=`<path stroke="currentColor" stroke-linecap="square" stroke-width="${.1+.875*s}em" d="M3,12 H20"/>`:"dot"===n?l=`<circle fill="currentColor" cx="12" cy="12" r="${2+8*s}"/>`:m(n)?l=n:R(n)&&(l=n(a,s)),[t,o,{icon:l,hideLabel:i,...r}]})):a;return Wo(e,"backgroundColor")?L$(o,{defaultKey:"shapeLabelStrokeNone"}):L$(o)},onchange:(e,t)=>{if(!e)return;const o=t.strokeColor||[];if(o[3])return;const i=[...o];i[3]=1,t.strokeColor=i}}]},U$=(e,t)=>{const{title:o,layout:i}=t||{};return["radio"===i?"RadioGroup":"Dropdown",{title:o,options:L$(e)}]},G$=(e,t,o)=>["Dropdown",{title:e=>e[t],options:L$(e,{defaultKey:"labelNone",defaultOptions:{icon:'<g stroke="currentColor" stroke-linecap="round" stroke-width=".125em"><path d="M5,12 H14"/></g>'}}),optionIconStyle:o}],Z$=e=>G$(e,"shapeTitleLineStart","transform: scaleX(-1)"),X$=e=>G$(e,"shapeTitleLineEnd"),Y$=e=>["Dropdown",{title:e=>e.shapeTitleFontStyle,optionLabelStyle:e=>e&&`font-style:${e[0]};font-weight:${e[1]}`,options:L$(e,{defaultKey:"shapeLabelFontStyleNormal"})}],q$=e=>["ShorthandControl",e],K$=(e,t,o,i)=>{i||e.find((([e])=>e===o))||(i={defaultKey:"labelAuto",defaultValue:o});const r=i$(e);return["Dropdown",{title:t,options:L$(r,i),formatValue:e=>Oo(e)?Math.floor(e):Math.floor(parseFloat(e))+"%",...i}]},J$=(e,t)=>K$(e,(e=>e.shapeTitleFontSize),"4%",t),Q$=(e,t)=>K$(e,(e=>e.shapeTitleLineHeight),"120%",t),ef=e=>["RadioGroup",{title:e=>e.shapeTitleTextAlign,options:L$(e)}],tf={colorOptions:()=>T$({transparent:[1,1,1,0],white:[1,1,1],silver:[.8667,.8667,.8667],gray:[.6667,.6667,.6667],black:[0,0,0],navy:[0,.1216,.2471],blue:[0,.4549,.851],aqua:[.498,.8588,1],teal:[.2235,.8,.8],olive:[.2392,.6,.4392],green:[.1804,.8,.251],yellow:[1,.8627,0],orange:[1,.5216,.1059],red:[1,.2549,.2118],maroon:[.5216,.0784,.2941],fuchsia:[.9412,.0706,.7451],purple:[.6941,.051,.7882]}),lineEndStyleOptions:()=>A$(["bar","arrow","arrowSolid","circle","circleSolid","square","squareSolid"]),fontFamilyOptions:()=>I$([["Helvetica, Arial, Verdana, 'Droid Sans', sans-serif","Sans Serif"],["'Arial Black', 'Avenir-Black', 'Arial Bold'","Black"],["'Arial Narrow', 'Futura-CondensedMedium'","Narrow"],["'Trebuchet MS'","Humanist"],["Georgia, 'Avenir-Black', 'Times New Roman', 'Droid Serif', serif","Serif"],["Palatino","Old-Style"],["'Times New Roman', 'TimesNewRomanPSMT'","Transitional"],["Menlo, Monaco, 'Lucida Console', monospace","Monospaced"],["'Courier New', monospace","Slab Serif"]]),fontStyleOptions:()=>E$([["normal","bold"],["italic","normal"],["italic","bold"]]),textAlignOptions:()=>["left","center","right"].map((e=>[e,t=>t["shapeTitleTextAlign"+Kg(e)],{hideLabel:!0,icon:t=>t["shapeIconTextAlign"+Kg(e)]}])),strokeWidthOptions:()=>R$({extraSmall:"0.25%",small:"0.5%",mediumSmall:"1%",medium:"1.75%",mediumLarge:"2.5%",large:"3.5%",extraLarge:"5%"}),brushSizeOptions:()=>R$(Object.entries({extraSmall:"0.25%",small:"0.5%",mediumSmall:"1%",medium:"1.75%",mediumLarge:"2.5%",large:"3.5%",extraLarge:"5%"}).reduce(((e,[t,o])=>(e[t]=2*parseFloat(o)+"%",e)),{})),fontSizeOptions:()=>M$({extraSmall:"2%",small:"4%",mediumSmall:"8%",medium:"10%",mediumLarge:"15%",large:"20%",extraLarge:"25%"}),lineHeightOptions:()=>P$({extraSmall:"40%",small:"60%",mediumSmall:"100%",medium:"120%",mediumLarge:"140%",large:"180%",extraLarge:"220%"})},of=new Intl.NumberFormat("default",{minimumFractionDigits:1,maximumFractionDigits:1}),rf=(e,t)=>m(t)?e+"%":e,nf=(e,t,o,i)=>m(i)?Math.round(e/o*100)+"%":""+of.format(e),af={getValue:e=>parseFloat(e),setValue:rf,label:nf,step:.05,labelClass:"PinturaPercentageLabel"},sf={factory:q$,options:{title:"Text shadow",controls:[["ToggleSlider","x",{...af,min:-100,max:100,labelPrefix:"X"}],["ToggleSlider","y",{...af,min:-100,max:100,labelPrefix:"Y"}],["ToggleSlider","blur",{...af,min:0,max:25,labelPrefix:e=>e.shapeTitleTextShadowBlur}],["ColorPicker","color",{enablePresets:!1}]]}},lf={defaultColor:{factory:W$,items:"colorOptions"},defaultNumber:{factory:z$},defaultPercentage:{factory:z$,options:{getValue:e=>parseFloat(e),setValue:e=>e+"%",step:.05,label:(e,t,o)=>Math.round(e/o*100)+"%",labelClass:"PinturaPercentageLabel"}},backgroundColor:{items:"colorOptions",factory:V$},strokeColor:{items:"colorOptions",factory:H$},strokeWidth:{items:"strokeWidthOptions",factory:j$},brushSize:{items:"brushSizeOptions",factory:d$},drawMode:{factory:c$},lineStart:{items:"lineEndStyleOptions",factory:Z$},lineEnd:{items:"lineEndStyleOptions",factory:X$},color:{items:"colorOptions",factory:N$},fontFamily:{items:"fontFamilyOptions",factory:O$},fontStyle_fontWeight:{items:"fontStyleOptions",factory:Y$},fontSize:{items:"fontSizeOptions",factory:J$},lineHeight:{items:"lineHeightOptions",factory:Q$},textAlign:{items:"textAlignOptions",factory:ef},textShadowX_textShadowY_textShadowBlur_textShadowColor:sf,textOutlineWidth_textOutlineColor:{factory:q$,options:{title:"Text outline",controls:[["ToggleSlider","width",{getValue:e=>parseFloat(e),setValue:rf,label:nf,min:0,max:15,step:.05,labelClass:"PinturaPercentageLabel",labelPrefix:e=>e.shapeTitleTextOutlineWidth}],["ColorPicker","color",{enablePresets:!1}]]}},cornerRadius:{factory:"defaultPercentage",options:{min:0,max:50,title:e=>e.shapeTitleCornerRadius}},frameColor:{factory:"defaultColor"},frameSize:{factory:"defaultPercentage",options:{min:.2,max:10,title:e=>e.labelSize}},frameInset:{factory:"defaultPercentage",options:{min:.5,max:10,title:e=>e.labelOffset}},frameOffset:{factory:"defaultPercentage",options:{min:.5,max:10,title:e=>e.labelOffset}},frameRadius:{factory:"defaultPercentage",options:{min:.5,max:10,title:e=>e.labelRadius}},frameAmount:{factory:"defaultNumber",options:{min:1,max:5,step:1,title:e=>e.labelAmount}}},cf=(e={})=>{const t={...lf,...e},o={};return Object.entries(t).forEach((([e,i])=>{if(!/Options$/.test(e))if(lf[e]&&T(i)&&!_o(i)){const{component:i,factory:r,items:n,options:a={}}=t[e];if(m(r))o[e]=[r,a];else{const s=lf[e].items;let l=m(s)?t[s]||tf[s]():void 0;m(n)&&tf[n]?l=t[n]?t[n].every((e=>!Array.isArray(e)))?t[n].map((e=>[e,e])):t[n]:tf[n]():(n||a.items)&&(l=n||a.items);let c=r||lf[e].factory;R(c)?o[e]=l?c(l,a):c(a):i&&(o[e]=[i,{...a,items:n}])}}else o[e]=i})),o};function df(e){let t,o,i,r,n;const a=e[7].default,s=mn(a,e,e[6],null);return{c(){t=Fn("div"),o=Fn("div"),s&&s.c(),Nn(o,"class","PinturaToolbarInner"),Nn(t,"class","PinturaToolbar"),Nn(t,"data-layout",e[1]),Nn(t,"data-overflow",e[0])},m(a,l){An(a,t,l),Rn(t,o),s&&s.m(o,null),i=!0,r||(n=[Wn(o,"measure",e[3]),wn(Dc.call(null,o)),Wn(t,"measure",e[2]),wn(Dc.call(null,t))],r=!0)},p(e,[o]){s&&s.p&&(!i||64&o)&&fn(s,a,e,e[6],i?$n(a,e[6],o,null):yn(e[6]),null),(!i||2&o)&&Nn(t,"data-layout",e[1]),(!i||1&o)&&Nn(t,"data-overflow",e[0])},i(e){i||(Ea(s,e),i=!0)},o(e){Aa(s,e),i=!1},d(e){e&&Ln(t),s&&s.d(e),r=!1,an(n)}}}function uf(e,t,o){let i,r,{$$slots:n={},$$scope:a}=t,s=0,l=0,c=0;const d=()=>{o(0,r="compact"===i&&s>c?"overflow":void 0)};return e.$$set=e=>{"$$scope"in e&&o(6,a=e.$$scope)},e.$$.update=()=>{48&e.$$.dirty&&o(1,i=l>c?"compact":"default")},[r,i,({detail:e})=>{const{width:t}=e;o(5,c=t),d()},({detail:e})=>{const{width:t}=e;t>l&&o(4,l=t),s=t,r||d()},l,c,a,n]}class pf extends Ga{constructor(e){super(),Ua(this,e,uf,df,ln,{})}}function hf(e){let t,o,i,r;const n=e[5].default,a=mn(n,e,e[4],null);return{c(){t=Fn("div"),a&&a.c(),Nn(t,"class",e[0])},m(n,s){An(n,t,s),a&&a.m(t,null),o=!0,i||(r=[Wn(t,"measure",(function(){sn(e[1]&&e[3])&&(e[1]&&e[3]).apply(this,arguments)})),wn(e[2].call(null,t))],i=!0)},p(i,[r]){e=i,a&&a.p&&(!o||16&r)&&fn(a,n,e,e[4],o?$n(n,e[4],r,null):yn(e[4]),null),(!o||1&r)&&Nn(t,"class",e[0])},i(e){o||(Ea(a,e),o=!0)},o(e){Aa(a,e),o=!1},d(e){e&&Ln(t),a&&a.d(e),i=!1,an(r)}}}function mf(e,t,o){let{$$slots:i={},$$scope:r}=t;const n=sa();let{class:a=null}=t;const s=ca("measurable");let l=!1;return ra((()=>o(1,l=!0))),e.$$set=e=>{"class"in e&&o(0,a=e.class),"$$scope"in e&&o(4,r=e.$$scope)},[a,l,s,({detail:e})=>n("measure",e),r,i]}class gf extends Ga{constructor(e){super(),Ua(this,e,mf,hf,ln,{class:0})}}const $f=e=>({}),ff=e=>({}),yf=e=>({}),bf=e=>({}),xf=e=>({}),vf=e=>({});function wf(e){let t,o;const i=e[4].header,r=mn(i,e,e[3],vf);return{c(){t=Fn("div"),r&&r.c(),Nn(t,"class","PinturaUtilHeader")},m(e,i){An(e,t,i),r&&r.m(t,null),o=!0},p(e,t){r&&r.p&&(!o||8&t)&&fn(r,i,e,e[3],o?$n(i,e[3],t,xf):yn(e[3]),vf)},i(e){o||(Ea(r,e),o=!0)},o(e){Aa(r,e),o=!1},d(e){e&&Ln(t),r&&r.d(e)}}}function Sf(e){let t,o;const i=e[4].footer,r=mn(i,e,e[3],ff);return{c(){t=Fn("div"),r&&r.c(),Nn(t,"class","PinturaUtilFooter")},m(e,i){An(e,t,i),r&&r.m(t,null),o=!0},p(e,t){r&&r.p&&(!o||8&t)&&fn(r,i,e,e[3],o?$n(i,e[3],t,$f):yn(e[3]),ff)},i(e){o||(Ea(r,e),o=!0)},o(e){Aa(r,e),o=!1},d(e){e&&Ln(t),r&&r.d(e)}}}function kf(e){let t,o,i,r,n,a,s=e[1]&&wf(e);const l=e[4].main,c=mn(l,e,e[3],bf),d=c||function(e){let t,o;return t=new gf({props:{class:"PinturaStage"}}),t.$on("measure",e[5]),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p:en,i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}(e);let u=e[2]&&Sf(e);return{c(){s&&s.c(),t=On(),o=Fn("div"),d&&d.c(),i=On(),u&&u.c(),r=On(),n=Bn(),Nn(o,"class","PinturaUtilMain")},m(l,c){s&&s.m(l,c),An(l,t,c),An(l,o,c),d&&d.m(o,null),e[6](o),An(l,i,c),u&&u.m(l,c),An(l,r,c),An(l,n,c),a=!0},p(e,[o]){e[1]?s?(s.p(e,o),2&o&&Ea(s,1)):(s=wf(e),s.c(),Ea(s,1),s.m(t.parentNode,t)):s&&(Ra(),Aa(s,1,1,(()=>{s=null})),Ia()),c&&c.p&&(!a||8&o)&&fn(c,l,e,e[3],a?$n(l,e[3],o,yf):yn(e[3]),bf),e[2]?u?(u.p(e,o),4&o&&Ea(u,1)):(u=Sf(e),u.c(),Ea(u,1),u.m(r.parentNode,r)):u&&(Ra(),Aa(u,1,1,(()=>{u=null})),Ia())},i(e){a||(Ea(s),Ea(d,e),Ea(u),Ea(false),a=!0)},o(e){Aa(s),Aa(d,e),Aa(u),Aa(false),a=!1},d(a){s&&s.d(a),a&&Ln(t),a&&Ln(o),d&&d.d(a),e[6](null),a&&Ln(i),u&&u.d(a),a&&Ln(r),a&&Ln(n)}}}function Cf(e,t,o){let{$$slots:i={},$$scope:r}=t,{hasHeader:n=!!t.$$slots.header}=t,{hasFooter:a=!!t.$$slots.footer}=t,{root:s}=t;return e.$$set=e=>{o(7,t=on(on({},t),bn(e))),"hasHeader"in e&&o(1,n=e.hasHeader),"hasFooter"in e&&o(2,a=e.hasFooter),"root"in e&&o(0,s=e.root),"$$scope"in e&&o(3,r=e.$$scope)},t=bn(t),[s,n,a,r,i,function(t){da.call(this,e,t)},function(e){pa[e?"unshift":"push"]((()=>{s=e,o(0,s)}))}]}class Tf extends Ga{constructor(e){super(),Ua(this,e,Cf,kf,ln,{hasHeader:1,hasFooter:2,root:0})}}function Mf(e){let t;return{c(){t=Fn("div"),Nn(t,"class","PinturaRangeInputMeter"),Zn(t,"transform",`translateX(${e[10].x-e[13].x}px) translateY(${e[10].y-e[13].y}px)`)},m(o,i){An(o,t,i),t.innerHTML=e[7]},p(e,o){128&o[0]&&(t.innerHTML=e[7]),1024&o[0]&&Zn(t,"transform",`translateX(${e[10].x-e[13].x}px) translateY(${e[10].y-e[13].y}px)`)},d(e){e&&Ln(t)}}}function Pf(e){let t,o,i,r,n,a,s,l,c,d,u,p=e[10]&&Mf(e);return{c(){t=Fn("div"),o=Fn("span"),i=On(),r=Fn("button"),n=Dn(e[1]),s=On(),l=Fn("div"),p&&p.c(),Nn(o,"class","PinturaRangeInputValue"),Nn(r,"class","PinturaRangeInputReset"),Nn(r,"type","button"),r.disabled=a=e[0]===e[2],Nn(l,"class","PinturaRangeInputInner"),Nn(l,"data-value-limited",e[5]),Zn(l,"--range-mask-from",e[9]),Zn(l,"--range-mask-to",e[8]),Nn(t,"class","PinturaRangeInput"),Nn(t,"tabindex","0")},m(a,h){An(a,t,h),Rn(t,o),o.innerHTML=e[3],Rn(t,i),Rn(t,r),Rn(r,n),Rn(t,s),Rn(t,l),p&&p.m(l,null),d||(u=[Wn(r,"click",e[18]),Wn(l,"interactionstart",e[14]),Wn(l,"interactionupdate",e[16]),Wn(l,"interactionend",e[17]),Wn(l,"interactionrelease",e[15]),wn(c=kh.call(null,l,{inertia:e[6]})),Wn(l,"measure",e[39]),wn(Dc.call(null,l)),Wn(t,"wheel",e[20],{passive:!1}),Wn(t,"nudge",e[21]),wn(sp.call(null,t,{direction:"horizontal",preventDefault:!0}))],d=!0)},p(e,t){8&t[0]&&(o.innerHTML=e[3]),2&t[0]&&Un(n,e[1]),5&t[0]&&a!==(a=e[0]===e[2])&&(r.disabled=a),e[10]?p?p.p(e,t):(p=Mf(e),p.c(),p.m(l,null)):p&&(p.d(1),p=null),32&t[0]&&Nn(l,"data-value-limited",e[5]),c&&sn(c.update)&&64&t[0]&&c.update.call(null,{inertia:e[6]}),512&t[0]&&Zn(l,"--range-mask-from",e[9]),256&t[0]&&Zn(l,"--range-mask-to",e[8])},i:en,o:en,d(e){e&&Ln(t),p&&p.d(),d=!1,an(u)}}}function Rf(e,t,o){let i,r,a,s,l,c,d,u,p,h,m,g,{labelReset:$="Reset"}=t,{direction:f="x"}=t,{min:y=0}=t,{max:b=1}=t,{base:x=y}=t,{value:v=0}=t,{valueLabel:w=0}=t,{valueMin:S}=t,{valueMax:k}=t,{oninputstart:C=n}=t,{oninputmove:T=n}=t,{oninputend:M=n}=t,{elasticity:P=0}=t,{nudgeMultiplier:R}=t,{step:I=8}=t;const E=ca("isAnimated");hn(e,E,(e=>o(6,h=e)));const A=ca("fixScrollDirection");hn(e,A,(e=>o(45,m=e)));const L=(e,t,o)=>Math.ceil((e-o)/t)*t+o;let F,z,D;const O={x:2,y:0},B=(e,t,o)=>`M ${e-o} ${t} a ${o} ${o} 0 1 0 0 -1`;let W,_=void 0,V=!1,N={snap:!1,elastic:!1};const H=(e,t,o)=>{const i=e[f]+t[f],r=$s(i,W[1][f],W[0][f]),n=P?r+Ch(i-r,P):r,a=o.elastic?n:r,s=me(0,0);return s[f]=a,j.set(s,{hard:o.snap}),$s(G(s,f),y,b)},j=xc();hn(e,j,(e=>o(10,g=e)));const U=(e,t)=>{const o=.5*(F[t]-s[t])-(lp(e,y,b)*s[t]-.5*s[t]);return{x:"x"===t?o:0,y:"y"===t?o:0}},G=(e,t)=>{const o=-(e[t]-.5*F[t])/s[t];return y+o*i},Z=j.subscribe((e=>{e&&_&&T($s(G(e,f),y,b))})),X=e=>{const t=[U(null!=S?S:y,f),U(null!=k?k:b,f)],o={x:"x"===f?g.x+e:0,y:"y"===f?g.y+e:0},i=$s(o[f],t[1][f],t[0][f]),r={...g,[f]:i};vn(j,g=r,g);const n=$s(G(r,f),y,b);C(),T(n),M(n)};aa((()=>{Z()}));return e.$$set=e=>{"labelReset"in e&&o(1,$=e.labelReset),"direction"in e&&o(22,f=e.direction),"min"in e&&o(23,y=e.min),"max"in e&&o(24,b=e.max),"base"in e&&o(2,x=e.base),"value"in e&&o(0,v=e.value),"valueLabel"in e&&o(3,w=e.valueLabel),"valueMin"in e&&o(25,S=e.valueMin),"valueMax"in e&&o(26,k=e.valueMax),"oninputstart"in e&&o(27,C=e.oninputstart),"oninputmove"in e&&o(28,T=e.oninputmove),"oninputend"in e&&o(29,M=e.oninputend),"elasticity"in e&&o(30,P=e.elasticity),"nudgeMultiplier"in e&&o(31,R=e.nudgeMultiplier),"step"in e&&o(32,I=e.step)},e.$$.update=()=>{if(25165824&e.$$.dirty[0]&&o(34,i=b-y),41943040&e.$$.dirty[0]&&o(36,r=null!=S?Math.max(S,y):y),83886080&e.$$.dirty[0]&&o(35,a=null!=k?Math.min(k,b):b),25165828&e.$$.dirty[0]&&o(38,l=lp(x,y,b)),16&e.$$.dirty[0]|128&e.$$.dirty[1]&&F){const e=.5*F.y;let t,i=40*l,r="",n=F.y,a="";for(let o=0;o<=40;o++){const n=O.x+10*o,s=e;r+=B(n,s,o%5==0?2:.75)+" ",t=n+O.x,o===i&&(a=`<path d="M${n} ${s-4} l2 3 l-2 -1 l-2 1 z"/>`)}o(7,z=`<svg width="${t}" height="${n}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${t} ${n}" aria-hidden="true" focusable="false">\n ${a}\n <rect rx="4" ry="4" y="${e-4}"" height="8"/>\n <path fill-rule="evenodd" d="${r.trim()}"/></svg>`),o(33,D={x:t-2*O.x,y:n})}16&e.$$.dirty[0]|4&e.$$.dirty[1]&&(s=F&&D),25165824&e.$$.dirty[0]|48&e.$$.dirty[1]&&o(5,c=r!==y||a!==b),32&e.$$.dirty[0]|48&e.$$.dirty[1]&&o(37,d=c?function(e,t){const o=1/40,i=lp(e,y,b),r=lp(t,y,b);return[100*de(L(i,o,0)-.0125)+"%",100*de(L(r,o,0)-.0125)+"%"]}(r,a):void 0),64&e.$$.dirty[1]&&o(9,u=d?d[0]:""),64&e.$$.dirty[1]&&o(8,p=d?d[1]:""),4194385&e.$$.dirty[0]|8&e.$$.dirty[1]&&i&&F&&F.x&&F.y&&j.set(U(v,f),{hard:!1===h})},[v,$,x,w,F,c,h,z,p,u,g,E,A,O,()=>{V=!1,_=pn(j),W=[U(null!=S?S:y,f),U(null!=k?k:b,f)],C()},()=>{V=!0},({detail:e})=>{N.snap=!V,N.elastic=!V,H(_,e.translation,N)},({detail:e})=>{N.snap=!1,N.elastic=!1;const t=H(_,e.translation,N);if(_=void 0,W=void 0,Math.abs(t-x)<.01)return M(x);M(t)},()=>{o(0,v=$s(x,r,a)),C(),M(v)},j,e=>{e.preventDefault(),e.stopPropagation();const t=Rh(e,{fixScrollDirection:m})*I;X(t)},({detail:e})=>{X(e[f]*Math.abs(R||8))},f,y,b,S,k,C,T,M,P,R,I,D,i,a,r,d,l,e=>o(4,F=(e=>me(e.width,e.height))(e.detail))]}class If extends Ga{constructor(e){super(),Ua(this,e,Rf,Pf,ln,{labelReset:1,direction:22,min:23,max:24,base:2,value:0,valueLabel:3,valueMin:25,valueMax:26,oninputstart:27,oninputmove:28,oninputend:29,elasticity:30,nudgeMultiplier:31,step:32},null,[-1,-1])}}var Ef={[te]:e=>({x:e.x,y:e.y}),[ae]:e=>({x:e.x+e.width,y:e.y}),[oe]:e=>({x:e.x+e.width,y:e.y}),[se]:e=>({x:e.x+e.width,y:e.y+e.height}),[ie]:e=>({x:e.x,y:e.y+e.height}),[le]:e=>({x:e.x,y:e.y+e.height}),[re]:e=>({x:e.x,y:e.y}),[ne]:e=>({x:e.x,y:e.y})};function Af(e,t,o){const i=e.slice();return i[14]=t[o].key,i[15]=t[o].translate,i[16]=t[o].scale,i[17]=t[o].type,i[18]=t[o].opacity,i}function Lf(e,t){let o,i,r,n,a,s,l;return{key:e,first:null,c(){o=Fn("div"),Nn(o,"role","button"),Nn(o,"aria-label",i=`Drag ${t[17]} ${t[14]}`),Nn(o,"tabindex",r="edge"===t[17]?-1:0),Nn(o,"class","PinturaRectManipulator"),Nn(o,"data-direction",n=t[14]),Nn(o,"data-shape",a=""+("edge"===t[17]?"edge":""+t[0])),Zn(o,"--tx",t[15].x),Zn(o,"--ty",t[15].y),Zn(o,"--sx",t[16].x),Zn(o,"--sy",t[16].y),Zn(o,"opacity",t[18]),this.first=o},m(e,i){An(e,o,i),s||(l=[Wn(o,"nudge",(function(){sn(t[6](t[14]))&&t[6](t[14]).apply(this,arguments)})),wn(sp.call(null,o,{preventDefault:!0})),Wn(o,"interactionstart",(function(){sn(t[5]("resizestart",t[14]))&&t[5]("resizestart",t[14]).apply(this,arguments)})),Wn(o,"interactionupdate",(function(){sn(t[5]("resizemove",t[14]))&&t[5]("resizemove",t[14]).apply(this,arguments)})),Wn(o,"interactionend",(function(){sn(t[5]("resizeend",t[14]))&&t[5]("resizeend",t[14]).apply(this,arguments)})),wn(kh.call(null,o))],s=!0)},p(e,s){t=e,2&s&&i!==(i=`Drag ${t[17]} ${t[14]}`)&&Nn(o,"aria-label",i),2&s&&r!==(r="edge"===t[17]?-1:0)&&Nn(o,"tabindex",r),2&s&&n!==(n=t[14])&&Nn(o,"data-direction",n),3&s&&a!==(a=""+("edge"===t[17]?"edge":""+t[0]))&&Nn(o,"data-shape",a),2&s&&Zn(o,"--tx",t[15].x),2&s&&Zn(o,"--ty",t[15].y),2&s&&Zn(o,"--sx",t[16].x),2&s&&Zn(o,"--sy",t[16].y),2&s&&Zn(o,"opacity",t[18])},d(e){e&&Ln(o),s=!1,an(l)}}}function Ff(e){let t,o=[],i=new Map,r=e[1];const n=e=>e[14];for(let t=0;t<r.length;t+=1){let a=Af(e,r,t),s=n(a);i.set(s,o[t]=Lf(s,a))}return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=Bn()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);An(e,t,i)},p(e,[a]){99&a&&(r=e[1],o=Ba(o,a,n,1,e,r,i,t.parentNode,Da,Lf,t,Af))},i:en,o:en,d(e){for(let t=0;t<o.length;t+=1)o[t].d(e);e&&Ln(t)}}}function zf(e,t,o){let i,r,n,a,{rect:s=null}=t,{visible:l=!1}=t,{cornerStyle:c}=t;const d=ca("isAnimated");hn(e,d,(e=>o(11,a=e)));const u=xc(void 0,{precision:1e-4,stiffness:.2,damping:.4});hn(e,u,(e=>o(10,n=e)));const p=xc(0,{precision:.001});let h;hn(e,p,(e=>o(9,r=e)));const m=sa();return e.$$set=e=>{"rect"in e&&o(7,s=e.rect),"visible"in e&&o(8,l=e.visible),"cornerStyle"in e&&o(0,c=e.cornerStyle)},e.$$.update=()=>{2304&e.$$.dirty&&u.set(l?1:.5,{hard:!1===a}),2304&e.$$.dirty&&p.set(l?1:0,{hard:!1===a}),1664&e.$$.dirty&&o(1,i=Object.keys(ee).map(((e,t)=>{const o=ee[e],i=Ef[o](s),a=1===o.length?"edge":"corner",l="corner"===a;return{key:o,type:a,scale:{x:/^(t|b)$/.test(o)?s.width:l?$s(n,.5,1.25):1,y:/^(r|l)$/.test(o)?s.height:l?$s(n,.5,1.25):1},translate:{x:i.x,y:i.y},opacity:r}})))},[c,i,d,u,p,(e,t)=>({detail:o})=>{h&&t!==h||"resizestart"!==e&&void 0===h||("resizestart"===e&&(h=t),"resizeend"===e&&(h=void 0),m(e,{direction:t,translation:o&&o.translation}))},e=>({detail:t})=>{m("resizestart",{direction:e,translation:{x:0,y:0}}),m("resizemove",{direction:e,translation:t}),m("resizeend",{direction:e,translation:{x:0,y:0}})},s,l,r,n,a]}class Df extends Ga{constructor(e){super(),Ua(this,e,zf,Ff,ln,{rect:7,visible:8,cornerStyle:0})}}var Of=e=>{function t(t,o){e.dispatchEvent(new CustomEvent(t,{detail:o}))}const o=o=>{o.preventDefault(),e.addEventListener("gesturechange",i),e.addEventListener("gestureend",r),t("gesturedown")},i=e=>{e.preventDefault(),t("gestureupdate",e.scale)},r=e=>{t("gestureup",e.scale),e.preventDefault(),n()},n=()=>{e.removeEventListener("gesturechange",i),e.removeEventListener("gestureend",r)};return e.addEventListener("gesturestart",o),{destroy:()=>{n(),e.removeEventListener("gesturestart",o)}}},Bf={[te]:ie,[oe]:re,[ie]:te,[re]:oe,[ne]:se,[ae]:le,[se]:ne,[le]:ae},Wf=e=>{const t=e===re||e===oe,o=e===te||e===ie;return[e===oe||e===ae||e===se,e===re||e===le||e===ne,e===te||e===ae||e===ne,e===ie||e===se||e===le,t,o,t||o]},_f=(e,t,o,i={})=>{const{target:r,translate:n}=t,{aspectRatio:a,minSize:s,maxSize:l}=i,c=ce[Bf[r]],d=ke(me(e.x,e.y),me(c[0]*e.width,c[1]*e.height)),u=ce[r],p=ke(et(e),me(u[0]*e.width,u[1]*e.height)),[h,m,g,$,f,y,b]=Wf(r);let x=n.x,v=n.y;f?v=0:y&&(x=0);const{inner:w,outer:S}=Vf(d,r,o,{aspectRatio:a,minSize:s,maxSize:l});let[k,C,T,M]=kt(e);if(h?M=d.x:m&&(C=d.x),$?k=d.y:g&&(T=d.y),h){const e=w.x+w.width,t=S.x+S.width;C=$s(p.x+x,e,t)}else if(m){const e=S.x,t=w.x;M=$s(p.x+x,e,t)}if($){const e=w.y+w.height,t=S.y+S.height;T=$s(p.y+v,e,t)}else if(g){const e=S.y,t=w.y;k=$s(p.y+v,e,t)}if(M>w.x&&(M=w.x),C<w.x+w.width&&(C=w.x+w.width),k>w.y&&(k=w.y),T<w.y+w.height&&(T=w.y+w.height),M<S.x){const e=S.x-M;M=S.x,C+=e}if(C>S.x+S.width){const e=C-(S.x+S.width);C=S.x+S.width,M-=e}if(k<S.y){const e=S.y-k;k=S.y,T+=e}if(T>S.y+S.height){const e=T-(S.y+S.height);T=S.y+S.height,k-=e}if(a)if(b){let e=C-M,t=T-k;f?(t=e/a,k=d.y-.5*t,T=d.y+.5*t):y&&(e=t*a,M=d.x-.5*e,C=d.x+.5*e)}else{const e=me(p.x+x-d.x,p.y+v-d.y);r===ae?(e.x=Math.max(0,e.x),e.y=Math.min(0,e.y)):r===se?(e.x=Math.max(0,e.x),e.y=Math.max(0,e.y)):r===le?(e.x=Math.min(0,e.x),e.y=Math.max(0,e.y)):r===ne&&(e.x=Math.min(0,e.x),e.y=Math.min(0,e.y));const t=be(e),o=be(me(w.width,w.height)),i=be(me(S.width,S.height)),n=$s(t,o,i),s=me(a,1),l=Me(xe(s),n);r===ae?(C=d.x+l.x,k=d.y-l.y):r===se?(C=d.x+l.x,T=d.y+l.y):r===le?(M=d.x-l.x,T=d.y+l.y):r===ne&&(M=d.x-l.x,k=d.y-l.y)}return lt(M,k,C-M,T-k)};const Vf=(e,t,o,i)=>{const{aspectRatio:r,minSize:n,maxSize:a}=i,s=t===oe||t===ae||t===se,l=t===re||t===le||t===ne,c=t===te||t===ae||t===ne,d=t===ie||t===se||t===le,u=t===re||t===oe,p=t===te||t===ie,h=et(o);s?(h.x=e.x,h.width-=e.x):l&&(h.width=e.x),d?(h.y=e.y,h.height-=e.y):c&&(h.height=e.y);const m=((e,t)=>Qe(0,0,e,t))(Math.min(h.width,a.width),Math.min(h.height,a.height));if(r)if(u){const t=Math.min(e.y,o.height-e.y);m.height=Math.min(2*t,m.height)}else if(p){const t=Math.min(e.x,o.width-e.x);m.width=Math.min(2*t,m.width)}const g=r?We(wt(ot(n),r)):n,$=r?We(St(m,r)):m;let f,y,b,x;s?f=e.x:l&&(y=e.x),d?b=e.y:c&&(x=e.y),s?y=f+g.width:l&&(f=y-g.width),d?x=b+g.height:c&&(b=x-g.height),u?(b=e.y-.5*g.height,x=e.y+.5*g.height):p&&(f=e.x-.5*g.width,y=e.x+.5*g.width);const v=nt([me(f,b),me(y,x)]);s?y=f+$.width:l&&(f=y-$.width),d?x=b+$.height:c&&(b=x-$.height),u?(b=e.y-.5*$.height,x=e.y+.5*$.height):p&&(f=e.x-.5*$.width,y=e.x+.5*$.width),f=Math.max(o.x,f),y=Math.min(o.x+o.width,y),b=Math.max(o.y,b),x=Math.min(o.y+o.height,x);return{inner:v,outer:nt([me(f,b),me(y,x)])}};var Nf=e=>180*e/Math.PI;function Hf(e){let t,o,i;return o=new If({props:{elasticity:e[5],min:e[9],max:e[10],value:e[11],valueMin:Math.max(e[9],e[0]),valueMax:Math.min(e[10],e[1]),labelReset:e[6],base:e[12],valueLabel:Math.round(Nf(e[11]))+"°",oninputstart:e[2],oninputmove:e[17],oninputend:e[18]}}),{c(){t=Fn("div"),Na(o.$$.fragment),Nn(t,"class","PinturaImageRotator")},m(e,r){An(e,t,r),Ha(o,t,null),i=!0},p(e,[t]){const i={};32&t&&(i.elasticity=e[5]),512&t&&(i.min=e[9]),1024&t&&(i.max=e[10]),2048&t&&(i.value=e[11]),513&t&&(i.valueMin=Math.max(e[9],e[0])),1026&t&&(i.valueMax=Math.min(e[10],e[1])),64&t&&(i.labelReset=e[6]),4096&t&&(i.base=e[12]),2048&t&&(i.valueLabel=Math.round(Nf(e[11]))+"°"),4&t&&(i.oninputstart=e[2]),392&t&&(i.oninputmove=e[17]),400&t&&(i.oninputend=e[18]),o.$set(i)},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Ln(t),ja(o)}}}function jf(e,t,o){let i,r,a,s,l,c,d,{rotation:u}=t,{valueMin:p}=t,{valueMax:h}=t,{oninputstart:m=n}=t,{oninputmove:g=n}=t,{oninputend:$=n}=t,{elasticity:f=0}=t,{labelReset:y}=t,{rotationMin:b}=t,{rotationMax:x}=t;return e.$$set=e=>{"rotation"in e&&o(13,u=e.rotation),"valueMin"in e&&o(0,p=e.valueMin),"valueMax"in e&&o(1,h=e.valueMax),"oninputstart"in e&&o(2,m=e.oninputstart),"oninputmove"in e&&o(3,g=e.oninputmove),"oninputend"in e&&o(4,$=e.oninputend),"elasticity"in e&&o(5,f=e.elasticity),"labelReset"in e&&o(6,y=e.labelReset),"rotationMin"in e&&o(14,b=e.rotationMin),"rotationMax"in e&&o(15,x=e.rotationMax)},e.$$.update=()=>{16384&e.$$.dirty&&o(9,i=b+1e-9),32768&e.$$.dirty&&o(10,r=x-1e-9),1536&e.$$.dirty&&o(12,a=i+.5*(r-i)),32768&e.$$.dirty&&o(16,s=2*x),8192&e.$$.dirty&&o(8,l=Math.sign(u)),73728&e.$$.dirty&&o(7,c=Math.round(Math.abs(u)/s)*s),8576&e.$$.dirty&&o(11,d=u-l*c)},[p,h,m,g,$,f,y,c,l,i,r,d,a,u,b,x,s,e=>g(l*c+e),e=>$(l*c+e)]}class Uf extends Ga{constructor(e){super(),Ua(this,e,jf,Hf,ln,{rotation:13,valueMin:0,valueMax:1,oninputstart:2,oninputmove:3,oninputend:4,elasticity:5,labelReset:6,rotationMin:14,rotationMax:15})}}function Gf(e){let t,o,i,r,n;return{c(){t=Fn("div"),o=Fn("p"),i=Dn(e[0]),r=Dn(" × "),n=Dn(e[1]),Nn(t,"class","PinturaImageInfo")},m(e,a){An(e,t,a),Rn(t,o),Rn(o,i),Rn(o,r),Rn(o,n)},p(e,[t]){1&t&&Un(i,e[0]),2&t&&Un(n,e[1])},i:en,o:en,d(e){e&&Ln(t)}}}function Zf(e,t,o){let{width:i}=t,{height:r}=t;return e.$$set=e=>{"width"in e&&o(0,i=e.width),"height"in e&&o(1,r=e.height)},[i,r]}class Xf extends Ga{constructor(e){super(),Ua(this,e,Zf,Gf,ln,{width:0,height:1})}}function Yf(e){let t,o;return t=new Lu({props:{class:"PinturaPresetListFilter",layout:"row",options:e[8],selectedIndex:e[7],onchange:e[10]}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};256&o&&(i.options=e[8]),128&o&&(i.selectedIndex=e[7]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function qf(e){let t,o;return t=new op({props:{icon:e[0],label:e[1],labelClass:e[2],hideLabel:e[3],options:e[9],selectedIndex:e[4],onchange:e[5],optionMapper:e[6],$$slots:{controls:[Yf]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,[o]){const i={};1&o&&(i.icon=e[0]),2&o&&(i.label=e[1]),4&o&&(i.labelClass=e[2]),8&o&&(i.hideLabel=e[3]),512&o&&(i.options=e[9]),16&o&&(i.selectedIndex=e[4]),32&o&&(i.onchange=e[5]),64&o&&(i.optionMapper=e[6]),262528&o&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}const Kf='fill="none" stroke="currentColor"';function Jf(e,t,o){let i,r,a,{icon:s}=t,{label:l}=t,{labelClass:c}=t,{hideLabel:d}=t,{options:u}=t,{selectedIndex:p}=t,{onchange:h}=t,{optionMapper:g}=t,{filter:$="landscape"}=t,{onfilterchange:f=n}=t;const y=(e,t,o,i,r)=>`\n <rect ${Kf} x="${e}" y="${t}" width="${o}" height="${i}" rx="${r}"/>`,b=(e,t)=>`<path ${Kf} d="M${e} ${t} l2 2 l3 -4"/>`;return e.$$set=e=>{"icon"in e&&o(0,s=e.icon),"label"in e&&o(1,l=e.label),"labelClass"in e&&o(2,c=e.labelClass),"hideLabel"in e&&o(3,d=e.hideLabel),"options"in e&&o(12,u=e.options),"selectedIndex"in e&&o(4,p=e.selectedIndex),"onchange"in e&&o(5,h=e.onchange),"optionMapper"in e&&o(6,g=e.optionMapper),"filter"in e&&o(11,$=e.filter),"onfilterchange"in e&&o(13,f=e.onfilterchange)},e.$$.update=()=>{6144&e.$$.dirty&&o(9,i=((e,t)=>(e||[]).map((e=>m(e[0])?(e[1]=e[1].map(t),e):t(e))))(u,(e=>t=>{const[o,i,r={}]=t;return Oo(o)&&(r.hidden="landscape"===e?o<1:o>1),[o,i,r]})($))),2048&e.$$.dirty&&o(7,r="landscape"===$?0:1),128&e.$$.dirty&&o(8,a=[["landscape","Landscape",{hideLabel:!0,icon:y(2,6,19,12,2)+(0===r?b(9,12):"")}],["portrait","Portrait",{hideLabel:!0,icon:y(5,3,13,18,2)+(1===r?b(9,12):"")}]])},[s,l,c,d,p,h,g,r,a,i,e=>{o(11,$=e.value),f(e.value)},$,u,f]}class Qf extends Ga{constructor(e){super(),Ua(this,e,Jf,qf,ln,{icon:0,label:1,labelClass:2,hideLabel:3,options:12,selectedIndex:4,onchange:5,optionMapper:6,filter:11,onfilterchange:13})}}const ey=e=>Se(e,(e=>de(e,6))),ty=e=>Tt(e,(e=>de(e,6))),oy=(e,t,o=1e-4)=>Math.abs(e-t)<o;var iy=(e,t,o,i,r={})=>{const{aspectRatio:n}=r;e=ty(e),i=i.map(ey);const a=ht(e,Bf[o.target]),s=Se(a,(e=>de(e,6))),l=n?wt(r.minSize,n):r.minSize,c=n?St(r.maxSize,n):r.maxSize,d=ht(t,o.target);if(Ee(d,a)<1){t=et(e);const o=Math.min(l.width/e.width,l.height/e.height);ut(t,o,a)}t=pt(et(t),l,c,a);let u=et(t);t=ty(t);const p=Ot(i,1),h=Ct(e),m=Ct(t),g=h.findIndex((e=>we(Se(e,(e=>de(e,6))),s))),$=e=>p.map((t=>It(t,e))).filter(Boolean).pop();if(n){const t=m.map(((e,t)=>{if(t===g)return;const o=me(a.x-e.x,a.y-e.y);xe(o),Me(o,.5);const i=me(a.x-o.x,a.y-o.y),r=Ye(i,ey(e)),n=$(r);if(!n)return;const s=h[t];return{intersection:n,cornerDist:Ee(a,s),intersectionDist:Ee(a,n)}})).filter(Boolean);if(t.length){const o=t.reduce(((e,t)=>{const o=t.intersectionDist/t.cornerDist;return o<e?o:e}),Number.MAX_SAFE_INTEGER);u=et(e),ut(u,o,a)}}else{const e=1===o.target.length,r=!(i[0].y===i[1].y||i[0].x===i[1].x),n=h.map(((t,o)=>{if(o===g)return;const i=m[o],n=!oy(i.x,s.x)&&!oy(i.y,s.y);if(!e&&!r&&n)return;if(e&&(oy(i.x,s.x)||oy(i.y,s.y)))return;const l=$e(e?t:a),c=Ce($e(l),i);xe(c),Me(c,.5),e?ke(l,c):Ce(l,c);const d=Ye(l,i),u=$(d);return u||void 0})).filter(Boolean);if(n.length){const[e,i,r,l]=Wf(o.target);let[c,d,p,h]=kt(t);n.forEach((({x:t,y:o})=>{const n=de(t,6),a=de(o,6);r&&!oy(a,s.y)&&(c=Math.max(c,o)),e&&!oy(n,s.x)&&(d=Math.min(d,t)),l&&!oy(a,s.y)&&(p=Math.min(p,o)),i&&!oy(n,s.x)&&(h=Math.max(h,t))})),u=it([c,d,p,h]),ut(u,.9999,a)}}return pt(u,l,c,a),u};function ry(e){let t,o;return t=new mh({props:{items:e[11]}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};2048&o[0]&&(i.items=e[11]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function ny(e){let t,o,i;return o=new pf({props:{$$slots:{default:[ry]},$$scope:{ctx:e}}}),{c(){t=Fn("div"),Na(o.$$.fragment),Nn(t,"slot","header")},m(e,r){An(e,t,r),Ha(o,t,null),i=!0},p(e,t){const i={};2048&t[0]|256&t[7]&&(i.$$scope={dirty:t,ctx:e}),o.$set(i)},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Ln(t),ja(o)}}}function ay(e){let t,o;return t=new vh({props:{onclick:e[88],label:e[4].cropLabelButtonRecenter,icon:e[4].cropIconButtonRecenter,disabled:!e[9],hideLabel:!0,class:"PinturaButtonCenter",style:`opacity:${e[29]};transform:translate3d(${e[30].x}px, ${e[30].y}px,0)`}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};16&o[0]&&(i.label=e[4].cropLabelButtonRecenter),16&o[0]&&(i.icon=e[4].cropIconButtonRecenter),512&o[0]&&(i.disabled=!e[9]),1610612736&o[0]&&(i.style=`opacity:${e[29]};transform:translate3d(${e[30].x}px, ${e[30].y}px,0)`),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function sy(e){let t,o;return t=new Df({props:{rect:e[8],visible:e[12],cornerStyle:e[1]}}),t.$on("resizestart",e[68]),t.$on("resizemove",e[69]),t.$on("resizeend",e[70]),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};256&o[0]&&(i.rect=e[8]),4096&o[0]&&(i.visible=e[12]),2&o[0]&&(i.cornerStyle=e[1]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function ly(e){let t,o;return t=new Xf({props:{width:Math.round(e[21].width),height:Math.round(e[21].height)}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};2097152&o[0]&&(i.width=Math.round(e[21].width)),2097152&o[0]&&(i.height=Math.round(e[21].height)),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function cy(e){let t,o,i,r,n,a,s,l,c=e[20]&&e[10]&&ay(e),d=e[20]&&sy(e),u=e[22]&&ly(e);return{c(){t=Fn("div"),o=Fn("div"),c&&c.c(),i=On(),d&&d.c(),n=On(),u&&u.c(),Nn(o,"class","PinturaStage"),Nn(t,"slot","main")},m(p,h){An(p,t,h),Rn(t,o),c&&c.m(o,null),Rn(o,i),d&&d.m(o,null),e[166](o),Rn(t,n),u&&u.m(t,null),a=!0,s||(l=[wn(Dc.call(null,o)),Wn(o,"measure",e[164]),Wn(o,"wheel",(function(){sn(e[2]&&e[87])&&(e[2]&&e[87]).apply(this,arguments)}),{passive:!1}),Wn(o,"interactionstart",e[74]),Wn(o,"interactionupdate",e[75]),Wn(o,"interactionrelease",e[77]),Wn(o,"interactionend",e[76]),wn(r=kh.call(null,o,{drag:!0,inertia:!0,pinch:e[2],shouldStartInteraction:by,getEventPosition:e[167]})),Wn(o,"gesturedown",e[84]),Wn(o,"gestureupdate",e[85]),Wn(o,"gestureup",e[86]),wn(Of.call(null,o))],s=!0)},p(n,a){(e=n)[20]&&e[10]?c?(c.p(e,a),1049600&a[0]&&Ea(c,1)):(c=ay(e),c.c(),Ea(c,1),c.m(o,i)):c&&(Ra(),Aa(c,1,1,(()=>{c=null})),Ia()),e[20]?d?(d.p(e,a),1048576&a[0]&&Ea(d,1)):(d=sy(e),d.c(),Ea(d,1),d.m(o,null)):d&&(Ra(),Aa(d,1,1,(()=>{d=null})),Ia()),r&&sn(r.update)&&16777220&a[0]&&r.update.call(null,{drag:!0,inertia:!0,pinch:e[2],shouldStartInteraction:by,getEventPosition:e[167]}),e[22]?u?(u.p(e,a),4194304&a[0]&&Ea(u,1)):(u=ly(e),u.c(),Ea(u,1),u.m(t,null)):u&&(Ra(),Aa(u,1,1,(()=>{u=null})),Ia())},i(e){a||(Ea(c),Ea(d),Ea(u),a=!0)},o(e){Aa(c),Aa(d),Aa(u),a=!1},d(o){o&&Ln(t),c&&c.d(),d&&d.d(),e[166](null),u&&u.d(),s=!1,an(l)}}}function dy(e){let t,o,i,r;const n=[{class:"PinturaControlList"},{tabs:e[7]},e[17]];let a={$$slots:{default:[uy,({tab:e})=>({224:e}),({tab:e})=>[0,0,0,0,0,0,0,e?128:0]]},$$scope:{ctx:e}};for(let e=0;e<n.length;e+=1)a=on(a,n[e]);t=new od({props:a}),t.$on("select",e[165]);const s=[{class:"PinturaControlPanels"},{panelClass:"PinturaControlPanel"},{panels:e[16]},e[17]];let l={$$slots:{default:[my,({panel:e})=>({223:e}),({panel:e})=>[0,0,0,0,0,0,0,e?64:0]]},$$scope:{ctx:e}};for(let e=0;e<s.length;e+=1)l=on(l,s[e]);return i=new gd({props:l}),{c(){Na(t.$$.fragment),o=On(),Na(i.$$.fragment)},m(e,n){Ha(t,e,n),An(e,o,n),Ha(i,e,n),r=!0},p(e,o){const r=131200&o[0]?Wa(n,[n[0],128&o[0]&&{tabs:e[7]},131072&o[0]&&_a(e[17])]):{};384&o[7]&&(r.$$scope={dirty:o,ctx:e}),t.$set(r);const a=196608&o[0]?Wa(s,[s[0],s[1],65536&o[0]&&{panels:e[16]},131072&o[0]&&_a(e[17])]):{};511713304&o[0]|320&o[7]&&(a.$$scope={dirty:o,ctx:e}),i.$set(a)},i(e){r||(Ea(t.$$.fragment,e),Ea(i.$$.fragment,e),r=!0)},o(e){Aa(t.$$.fragment,e),Aa(i.$$.fragment,e),r=!1},d(e){ja(t,e),e&&Ln(o),ja(i,e)}}}function uy(e){let t,o,i=e[224].label+"";return{c(){t=Fn("span"),o=Dn(i)},m(e,i){An(e,t,i),Rn(t,o)},p(e,t){128&t[7]&&i!==(i=e[224].label+"")&&Un(o,i)},d(e){e&&Ln(t)}}}function py(e){let t,o;return t=new If({props:{elasticity:e[25]*e[44],base:yy,min:e[23],max:fy,valueMin:e[27][0],valueMax:e[27][1],value:e[28],labelReset:e[4].labelReset,valueLabel:Math.round(100*e[28])+"%",oninputstart:e[81],oninputmove:e[82],oninputend:e[83]}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};33554432&o[0]&&(i.elasticity=e[25]*e[44]),8388608&o[0]&&(i.min=e[23]),134217728&o[0]&&(i.valueMin=e[27][0]),134217728&o[0]&&(i.valueMax=e[27][1]),268435456&o[0]&&(i.value=e[28]),16&o[0]&&(i.labelReset=e[4].labelReset),268435456&o[0]&&(i.valueLabel=Math.round(100*e[28])+"%"),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function hy(e){let t,o;return t=new Uf({props:{elasticity:e[25]*e[44],rotation:e[13],labelReset:e[4].labelReset,valueMin:e[26][0],valueMax:e[26][1],rotationMin:-e[3],rotationMax:e[3],oninputstart:e[71],oninputmove:e[72],oninputend:e[73]}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};33554432&o[0]&&(i.elasticity=e[25]*e[44]),8192&o[0]&&(i.rotation=e[13]),16&o[0]&&(i.labelReset=e[4].labelReset),67108864&o[0]&&(i.valueMin=e[26][0]),67108864&o[0]&&(i.valueMax=e[26][1]),8&o[0]&&(i.rotationMin=-e[3]),8&o[0]&&(i.rotationMax=e[3]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function my(e){let t,o,i,r;const n=[hy,py],a=[];function s(e,t){return e[223]===e[93]+"-rotation"?0:e[223]===e[93]+"-zoom"?1:-1}return~(t=s(e))&&(o=a[t]=n[t](e)),{c(){o&&o.c(),i=Bn()},m(e,o){~t&&a[t].m(e,o),An(e,i,o),r=!0},p(e,r){let l=t;t=s(e),t===l?~t&&a[t].p(e,r):(o&&(Ra(),Aa(a[l],1,1,(()=>{a[l]=null})),Ia()),~t?(o=a[t],o?o.p(e,r):(o=a[t]=n[t](e),o.c()),Ea(o,1),o.m(i.parentNode,i)):o=null)},i(e){r||(Ea(o),r=!0)},o(e){Aa(o),r=!1},d(e){~t&&a[t].d(e),e&&Ln(i)}}}function gy(e){let t,o,i=e[18]&&dy(e);return{c(){t=Fn("div"),i&&i.c(),Nn(t,"slot","footer"),Zn(t,"transform",e[15])},m(e,r){An(e,t,r),i&&i.m(t,null),o=!0},p(e,o){e[18]?i?(i.p(e,o),262144&o[0]&&Ea(i,1)):(i=dy(e),i.c(),Ea(i,1),i.m(t,null)):i&&(Ra(),Aa(i,1,1,(()=>{i=null})),Ia()),32768&o[0]&&Zn(t,"transform",e[15])},i(e){o||(Ea(i),o=!0)},o(e){Aa(i),o=!1},d(e){e&&Ln(t),i&&i.d()}}}function $y(e){let t,o,i;function r(t){e[168](t)}let n={hasHeader:e[19],$$slots:{footer:[gy],main:[cy],header:[ny]},$$scope:{ctx:e}};return void 0!==e[14]&&(n.root=e[14]),t=new Tf({props:n}),pa.push((()=>Va(t,"root",r))),t.$on("measure",e[169]),{c(){Na(t.$$.fragment)},m(e,o){Ha(t,e,o),i=!0},p(e,i){const r={};524288&i[0]&&(r.hasHeader=e[19]),2146942974&i[0]|256&i[7]&&(r.$$scope={dirty:i,ctx:e}),!o&&16384&i[0]&&(o=!0,r.root=e[14],xa((()=>o=!1))),t.$set(r)},i(e){i||(Ea(t.$$.fragment,e),i=!0)},o(e){Aa(t.$$.fragment,e),i=!1},d(e){ja(t,e)}}}const fy=1,yy=0,by=(e,t)=>e.target===t;function xy(e,t,o){let i,r,n,a,s,l,c,d,u,p,h,m,g,$,f,y,b,x,v,w,S,k,C,T,M,P,I,E,A,F,z,D,O,B,W,_,V,N,H,j,U,G,Z,q,K,ee,te,oe,ie,re,ue,pe,he,ge,ye,ve,Se,Te,Pe,Re,Ie,Ee,Ae,Le,Fe,ze,De,Be,Ve,He,Ye,qe,Ke,Je=en,Qe=()=>(Je(),Je=un(tt,(e=>o(12,F=e))),tt);e.$$.on_destroy.push((()=>Je()));let{isActive:tt}=t;Qe();let{stores:it}=t,{cropImageSelectionCornerStyle:rt="circle"}=t,{cropWillRenderImageSelectionGuides:nt=((e,t)=>{const o="rotate"==e;return{rows:o?5:3,cols:o?5:3,opacity:.25*t}})}=t,{cropAutoCenterImageSelectionTimeout:at}=t,{cropEnableZoomMatchImageAspectRatio:pt=!0}=t,{cropEnableRotateMatchImageAspectRatio:ht="never"}=t,{cropEnableRotationInput:ft=!0}=t,{cropEnableZoom:yt=!0}=t,{cropEnableZoomInput:bt=!0}=t,{cropEnableZoomAutoHide:Ct=!0}=t,{cropEnableImageSelection:Mt=!0}=t,{cropEnableInfoIndicator:Pt=!1}=t,{cropEnableZoomTowardsWheelPosition:Rt=!0}=t,{cropEnableLimitWheelInputToCropSelection:It=!0}=t,{cropEnableCenterImageSelection:Et=!0}=t,{cropEnableButtonRotateLeft:At=!0}=t,{cropEnableButtonRotateRight:Lt=!1}=t,{cropEnableButtonFlipHorizontal:Ft=!0}=t,{cropEnableButtonFlipVertical:zt=!1}=t,{cropSelectPresetOptions:Dt}=t,{cropEnableSelectPreset:Ot=!0}=t,{cropEnableFilterMatchAspectRatio:Bt=!0}=t,{cropSelectPresetFilter:Wt=!1}=t,{cropEnableButtonToggleCropLimit:_t=!1}=t,{cropWillRenderTools:Vt=Y}=t,{cropActiveTransformTool:Nt="rotation"}=t,{cropMinimizeToolbar:Ht="auto"}=t,{cropInteractionFocus:jt="image"}=t,{cropRotationRange:Ut=J}=t,{cropMaskOpacity:Gt=.85}=t,{locale:Zt={}}=t,{cropFormatIconSelectPreset:Xt=function(e){const{aspectRatio:t}=e,[o,i,r]=t?[t<1?1:.3,1===t?.85:.5,t>1?1:.3]:[.2,.3,.4];return{a:o,b:i,c:r}}}=t,{cropFormatIconCropBoundary:Yt=function(e){const{isBoundToImage:t}=e,[o,i,r,n]=t?[.3,1,0,0]:[0,0,.3,1];return{a:o,b:i,c:r,d:n}}}=t;const qt=ca("isAnimated");hn(e,qt,(e=>o(141,z=e)));const Kt=ca("elasticityMultiplier");hn(e,Kt,(e=>o(25,Be=e)));const Jt=ca("redrawTrigger");hn(e,Jt,(e=>o(163,De=e)));const Qt=ca("imageIsStatic");hn(e,Qt,(e=>o(147,N=e)));const eo=ca("imageStaticVisualCorners");hn(e,eo,(e=>o(185,Re=e)));const to=ca("fixScrollDirection");hn(e,to,(e=>o(179,he=e)));let oo="idle";const io=Ya();hn(e,io,(e=>o(160,Le=e)));const ro=()=>void 0===Te,no=e=>1/e,ao=e=>{Bt&&Wt!==e&&(o(95,Wt=e),Te&&1!==Te&&so()&&vn(Go,Te=no(Te),Te))},so=()=>{if(1===Te||!i)return!1;const e=no(Te);return!!iu(Le).find((([t])=>t===e))},lo=(e,t,o)=>Q(o)?t.width===Math.round(e.height)||t.height===Math.round(e.width):t.width===Math.round(e.width)||t.height===Math.round(e.height),co=()=>(ro()||"always"===ht&&so())&&((e,t,o)=>{const i=Xe(Ge(Oe(t),o),(e=>Math.abs(Math.round(e)))),r=Ue(i),n=ct(e);return we(r,n)})(j,ie,re)&&lo(j,ie,re),uo=e=>{if("never"!==ht&&co()){vn(Ao,re+=e,re);const t=Q(re),o=t?ie.height:ie.width,i=t?ie.width:ie.height;vn(No,j=lt(0,0,o,i),j),ro()||vn(Go,Te=X(o,i),Te)}else vn(Ao,re+=e,re)},{history:po,env:ho,isInteracting:mo,isInteractingFraction:go,isTransformingImage:$o,rootRect:fo,stageRect:yo,utilRect:bo,utilRectPadded:xo,rootLineColor:vo,allowPan:wo,allowZoom:So,allowPlayPause:ko,rangeInputElasticity:Co,presentationScalar:To,utilTools:Mo,imagePreviewModifiers:Po,imageOutlineOpacity:Ro,imageFlipX:Io,imageFlipY:Eo,imageRotation:Ao,imageRotationRange:Lo,imageOutputSize:Fo,imageSelectionRect:zo,imageSelectionRectSnapshot:Do,imageSelectionRectIntent:Oo,imageSelectionRectPresentation:Bo,imageCropRectIntent:Wo,imageCropRectOrigin:Vo,imageCropRect:No,imageCropMinSize:Ho,imageCropMaxSize:jo,imageCropRange:Uo,imageCropAspectRatio:Go,imageCropLimitToImage:Zo,imageSize:Xo,imageScalar:Yo,imageOverlayMarkup:qo,stagePadded:Ko,stageRecenter:Jo}=it;function Qo(e,t){return R(e.cropIconSelectPreset)?nu(e.cropIconSelectPreset,e,t):Il(e.cropIconSelectPreset,Xt({aspectRatio:t}),"{","}")}function ei(e,t){return R(e.cropIconCropBoundary)?nu(e.cropIconCropBoundary,e,t):Il(e.cropIconCropBoundary,Yt({isBoundToImage:t}),"{","}")}let ti;hn(e,ho,(e=>o(142,D=e))),hn(e,mo,(e=>o(146,V=e))),hn(e,$o,(e=>o(177,te=e))),hn(e,fo,(e=>o(24,ge=e))),hn(e,yo,(e=>o(155,ee=e))),hn(e,xo,(e=>o(152,Z=e))),hn(e,To,(e=>o(151,G=e))),hn(e,Mo,(e=>o(187,Ee=e))),hn(e,Po,(e=>o(176,W=e))),hn(e,Io,(e=>o(162,ze=e))),hn(e,Eo,(e=>o(161,Fe=e))),hn(e,Ao,(e=>o(13,re=e))),hn(e,Lo,(e=>o(26,Ve=e))),hn(e,Fo,(e=>o(148,H=e))),hn(e,zo,(e=>o(154,K=e))),hn(e,Do,(e=>o(153,q=e))),hn(e,Oo,(e=>o(186,Ie=e))),hn(e,Bo,(e=>o(145,_=e))),hn(e,Wo,(e=>o(180,ye=e))),hn(e,Vo,(e=>o(182,Se=e))),hn(e,No,(e=>o(149,j=e))),hn(e,Ho,(e=>o(158,pe=e))),hn(e,jo,(e=>o(184,Pe=e))),hn(e,Uo,(e=>o(181,ve=e))),hn(e,Go,(e=>o(183,Te=e))),hn(e,Zo,(e=>o(157,ue=e))),hn(e,Xo,(e=>o(156,ie=e))),hn(e,Yo,(e=>o(150,U=e))),hn(e,Ko,(e=>o(144,B=e)));const oi=(e,t)=>{const o={target:e,translate:t},i=je(Oe(pe),G),r=je(Oe(Pe),G);let n=_f(q,o,{...Z,x:0,y:0},{aspectRatio:Te,minSize:i,maxSize:r});if(n=((e,t,o)=>{const[i,r,n,a]=kt(e),s={...e};if(i<t.y&&(e.height=e.height-(t.y-i),e.y=t.y),r>t.x+t.width&&(e.width=t.x+t.width-e.x),n>t.y+t.height&&(e.height=t.y+t.height-e.y),a<t.x&&(e.width=e.width-(t.x-a),e.x=t.x),o){const t=Math.min(1,s.width/e.width,s.height/e.height);return mt(s,t)}return e})(n,{...Z,x:0,y:0},Te),!ue)return{boundsLimited:n,boundsIntent:n};let a=iy(q,n,o,Re,{aspectRatio:Te,minSize:i,maxSize:r});return{boundsLimited:a,boundsIntent:a}},ii=(e,t)=>{const o={target:e,translate:t},i=je(Oe(pe),G),r=je(Oe(Pe),G),n=((e,t,o={})=>{const{target:i,translate:r}=t,{aspectRatio:n,minSize:a}=o,s=ce[Bf[i]],l=ke(et(e),me(s[0]*e.width,s[1]*e.height)),c=ce[i],d=ke(et(e),me(c[0]*e.width,c[1]*e.height)),[u,p,h,m,g,$,f]=Wf(i);let y=r.x,b=r.y;g?b=0:$&&(y=0);let[x,v,w,S]=kt(e);if(u?S=l.x:p&&(v=l.x),m?x=l.y:h&&(w=l.y),u?v=d.x+y:p&&(S=d.x+y),m?w=d.y+b:h&&(x=d.y+b),a&&g&&w-x<a.height){const e=a.height-(w-x);x-=.5*e,w+=.5*e}if(a&&$&&v-S<a.width){const e=a.width-(v-S);S-=.5*e,v+=.5*e}if(n)if(f){let e=v-S,t=w-x;g?(t=e/n,x=l.y-.5*t,w=l.y+.5*t):$&&(e=t*n,S=l.x-.5*e,v=l.x+.5*e)}else{const e=me(d.x+y-l.x,d.y+b-l.y);i===ae?(e.x=Math.max(0,e.x),e.y=Math.min(0,e.y)):i===se?(e.x=Math.max(0,e.x),e.y=Math.max(0,e.y)):i===le?(e.x=Math.min(0,e.x),e.y=Math.max(0,e.y)):i===ne&&(e.x=Math.min(0,e.x),e.y=Math.min(0,e.y));const t=be(e),o=me(n,1),r=Me(xe(o),t);i===ae?(v=l.x+r.x,x=l.y-r.y):i===se?(v=l.x+r.x,w=l.y+r.y):i===le?(S=l.x-r.x,w=l.y+r.y):i===ne&&(S=l.x-r.x,x=l.y-r.y)}return lt(S,x,v-S,w-x)})(q,o,{aspectRatio:Te,minSize:i});return{boundsLimited:_f(q,o,{...Z,x:0,y:0},{aspectRatio:Te,minSize:i,maxSize:r}),boundsIntent:n}};let ri=void 0,ni=void 0;const ai=({translation:e,scalar:t})=>{N&&(t=1,e=fe($e(e)));const o=Math.min(K.width/j.width,K.height/j.height),i=Me($e(e),1/o);let r;if(ni){const t=Ce($e(ni),e);ni=e,r=dt(et(j),t)}else r=dt(et(ri),fe($e(i))),void 0!==t&&ut(r,1/t);vn(Wo,ye=r,ye),vn(No,j=r,j)},si=qa([Uo,No],(([e,t],o)=>{if(!t)return;const[i,r]=e,n=$t(t);o([We(Tt(wt(i,n),de)),We(Tt(St(r,n),de))])}));hn(e,si,(e=>o(178,oe=e)));const li=qa([Xo,Zo,Ho,jo,Uo,Ao],(([e,t,o,i,r,n],a)=>{if(!e)return;const s=r[0],l=r[1];let c,d;t?(c=((e,t,o)=>Q(o)?1-1/Math.min(e.height/t.width,e.width/t.height):1-1/Math.min(e.width/t.width,e.height/t.height))(e,l,n),d=Math.min(s.width/o.width,s.height/o.height)):(c=-1,d=1);a([c,d].map((e=>de(e))))}));hn(e,li,(e=>o(27,He=e)));const ci=qa([Xo,No,Uo,Ao],(([e,t,o,i],r)=>{if(!e||!t)return r(0);let n;const a=o[0],s=o[1],l=t.width,c=t.height,d=$t(t),u=Q(i)?Ne(e.height,e.width):e,p=St(u,d);if(l<=p.width||c<=p.height){const e=p.width-a.width,t=p.height-a.height;n=0===e||0===t?1:1-Math.min((l-a.width)/e,(c-a.height)/t)}else{const e=s.width-p.width,t=s.height-p.height,o=St({width:e,height:t},d);n=-Math.min((l-p.width)/o.width,(c-p.height)/o.height)}r(n)}));hn(e,ci,(e=>o(28,Ye=e)));const di=e=>{const t=$t(ri);let o,i,r;const n=Q(re)?Ne(ie.height,ie.width):ie,a=St(n,t);if(e>=0){const n=a.width-ve[0].width,s=a.height-ve[0].height;o=a.width-n*e,i=a.height-s*e,r=wt({width:o,height:i},t)}else{const n=ve[1].width-a.width,s=ve[1].height-a.height;o=a.width+n*-e,i=a.height+s*-e,r=St({width:o,height:i},t)}o=r.width,i=r.height;const s=ri.x+.5*ri.width-.5*o,l=ri.y+.5*ri.height-.5*i;vn(No,j={x:s,y:l,width:o,height:i},j)};let ui;const pi=e=>{const t=ut(et(ui),1/e);vn(Wo,ye=t,ye),vn(No,j=t,j)};let hi;const mi=()=>{Jo.set({})};let gi;const $i=xc(0,{precision:1e-4});hn(e,$i,(e=>o(29,qe=e)));const fi=xc();hn(e,fi,(e=>o(30,Ke=e)));const yi=qa([Go,Fo,io],(([e,t,o],r)=>{if(!i)return;const n=iu(o),a=[...n].map((e=>e[0])).sort(((e,t)=>_o(e[0])&&!_o(t[0])?1:-1)).find((o=>{if(_o(o)&&t){const[i,r]=o,n=t.width===i&&t.height===r,a=e===X(i,r);return n&&a}return o===e}));if(!a)return r(void 0);r(n.map((e=>e[0])).findIndex((e=>_o(e)?vs(e,a):e===a)))}));hn(e,yi,(e=>o(159,Ae=e)));const bi=(e,t)=>{if(!i||-1===e||void 0===e)return;const o=iu(t)[e][0];return o?_o(o)?X(o[0],o[1]):o:void 0},xi=qa([vo,Bo,go],(([e,t,o],i)=>{const{rows:r,cols:n,opacity:a}=nt(oo,o);if(!t||a<=0)return i([]);const{x:s,y:l,width:c,height:d}=t,u=c/n,p=d/r,h=[];for(let t=1;t<=r-1;t++){const o=l+p*t;h.push({id:"image-selection-guide-row-"+t,points:[me(s,o),me(s+c,o)],opacity:a,strokeWidth:1,strokeColor:e})}for(let t=1;t<=n-1;t++){const o=s+u*t;h.push({id:"image-selection-guide-col-"+t,points:[me(o,l),me(o,l+d)],opacity:a,strokeWidth:1,strokeColor:e})}i(h)}));hn(e,xi,(e=>o(143,O=e)));const vi="crop-"+L();let wi,Si=vi+"-"+(ft?Nt:"zoom"),ki=Si,Ci=void 0;const Ti=xc(z?20:0);hn(e,Ti,(e=>o(140,A=e)));return e.$$set=e=>{"isActive"in e&&Qe(o(0,tt=e.isActive)),"stores"in e&&o(97,it=e.stores),"cropImageSelectionCornerStyle"in e&&o(1,rt=e.cropImageSelectionCornerStyle),"cropWillRenderImageSelectionGuides"in e&&o(98,nt=e.cropWillRenderImageSelectionGuides),"cropAutoCenterImageSelectionTimeout"in e&&o(99,at=e.cropAutoCenterImageSelectionTimeout),"cropEnableZoomMatchImageAspectRatio"in e&&o(100,pt=e.cropEnableZoomMatchImageAspectRatio),"cropEnableRotateMatchImageAspectRatio"in e&&o(101,ht=e.cropEnableRotateMatchImageAspectRatio),"cropEnableRotationInput"in e&&o(102,ft=e.cropEnableRotationInput),"cropEnableZoom"in e&&o(2,yt=e.cropEnableZoom),"cropEnableZoomInput"in e&&o(103,bt=e.cropEnableZoomInput),"cropEnableZoomAutoHide"in e&&o(104,Ct=e.cropEnableZoomAutoHide),"cropEnableImageSelection"in e&&o(105,Mt=e.cropEnableImageSelection),"cropEnableInfoIndicator"in e&&o(106,Pt=e.cropEnableInfoIndicator),"cropEnableZoomTowardsWheelPosition"in e&&o(107,Rt=e.cropEnableZoomTowardsWheelPosition),"cropEnableLimitWheelInputToCropSelection"in e&&o(108,It=e.cropEnableLimitWheelInputToCropSelection),"cropEnableCenterImageSelection"in e&&o(109,Et=e.cropEnableCenterImageSelection),"cropEnableButtonRotateLeft"in e&&o(110,At=e.cropEnableButtonRotateLeft),"cropEnableButtonRotateRight"in e&&o(111,Lt=e.cropEnableButtonRotateRight),"cropEnableButtonFlipHorizontal"in e&&o(112,Ft=e.cropEnableButtonFlipHorizontal),"cropEnableButtonFlipVertical"in e&&o(113,zt=e.cropEnableButtonFlipVertical),"cropSelectPresetOptions"in e&&o(114,Dt=e.cropSelectPresetOptions),"cropEnableSelectPreset"in e&&o(115,Ot=e.cropEnableSelectPreset),"cropEnableFilterMatchAspectRatio"in e&&o(116,Bt=e.cropEnableFilterMatchAspectRatio),"cropSelectPresetFilter"in e&&o(95,Wt=e.cropSelectPresetFilter),"cropEnableButtonToggleCropLimit"in e&&o(117,_t=e.cropEnableButtonToggleCropLimit),"cropWillRenderTools"in e&&o(118,Vt=e.cropWillRenderTools),"cropActiveTransformTool"in e&&o(119,Nt=e.cropActiveTransformTool),"cropMinimizeToolbar"in e&&o(120,Ht=e.cropMinimizeToolbar),"cropInteractionFocus"in e&&o(121,jt=e.cropInteractionFocus),"cropRotationRange"in e&&o(3,Ut=e.cropRotationRange),"cropMaskOpacity"in e&&o(122,Gt=e.cropMaskOpacity),"locale"in e&&o(4,Zt=e.locale),"cropFormatIconSelectPreset"in e&&o(123,Xt=e.cropFormatIconSelectPreset),"cropFormatIconCropBoundary"in e&&o(124,Yt=e.cropFormatIconCropBoundary)},e.$$.update=()=>{4096&e.$$.dirty[0]|268435456&e.$$.dirty[3]&&Qt.set("selection"===jt&&F),2097152&e.$$.dirty[3]&&o(131,i=Dt&&Array.isArray(Dt)&&Dt.length),2097152&e.$$.dirty[3]|128&e.$$.dirty[4]&&io.set(i?Dt:[]),4096&e.$$.dirty[0]|131072&e.$$.dirty[4]&&F&&Ro.set(1,{hard:!z}),4096&e.$$.dirty[0]&&wo.set(!F),4096&e.$$.dirty[0]&&So.set(!F),4096&e.$$.dirty[0]&&F&&ko.set(!0),262144&e.$$.dirty[4]&&o(126,h="overlay"===D.layoutMode),4194304&e.$$.dirty[3]|4&e.$$.dirty[4]&&o(130,w=Ot&&!h),1342177280&e.$$.dirty[4]&&o(139,l=Z&&K&&xt(Z,K)),1073774592&e.$$.dirty[4]&&o(137,c=!(!K||!l)),1073782784&e.$$.dirty[4]&&o(135,d=c&>(K,l,(e=>de(e,5)))),8208&e.$$.dirty[0]|52297732&e.$$.dirty[3]|264384&e.$$.dirty[4]|510&e.$$.dirty[5]&&o(11,r=De&&Vt([At&&["Button","rotate-left",{label:Zt.cropLabelButtonRotateLeft,labelClass:"PinturaToolbarContentWide",icon:Zt.cropIconButtonRotateLeft,onclick:()=>{uo(-Math.PI/2),po.write()}}],Lt&&["Button","rotate-right",{label:Zt.cropLabelButtonRotateRight,labelClass:"PinturaToolbarContentWide",icon:Zt.cropIconButtonRotateRight,onclick:()=>{uo(Math.PI/2),po.write()}}],Ft&&["Button","flip-horizontal",{label:Zt.cropLabelButtonFlipHorizontal,labelClass:"PinturaToolbarContentWide",icon:Zt.cropIconButtonFlipHorizontal,onclick:()=>{Q(re)?vn(Eo,Fe=!Fe,Fe):vn(Io,ze=!ze,ze),po.write()}}],zt&&["Button","flip-vertical",{label:Zt.cropLabelButtonFlipVertical,labelClass:"PinturaToolbarContentWide",icon:Zt.cropIconButtonFlipVertical,onclick:()=>{Q(re)?vn(Io,ze=!ze,ze):vn(Eo,Fe=!Fe,Fe),po.write()}}],w&&i&&[!1===Wt?"Dropdown":Qf,"select-preset",{icon:Qo(Zt,bi(Ae,Le)),label:nu(Zt.cropLabelSelectPreset,Zt,bi(Ae,Le)),labelClass:"PinturaToolbarContentWide",options:Le,filter:Wt,onfilterchange:ao,selectedIndex:Ae,onchange:({value:e})=>{_o(e)?(vn(Go,Te=X(e[0],e[1]),Te),vn(Fo,H=_e(e),H)):vn(Go,Te=e,Te),d&&mi(),po.write()},optionMapper:e=>{let t=!1;const o=_o(e.value)?e.value[0]/e.value[1]:e.value;if(o){const e=hs(ie,re,o);t=e.width<pe.width||e.height<pe.height}return e.icon=((e,t={})=>{const{width:o=24,height:i=24,bounds:r=16,radius:n=3}=t;let a,s,l,c,d=_o(e)?X(e[0],e[1]):e,u=!!d;return d=u?d:1,l=d>1?r:d*r,c=l/d,a=Math.round(.5*(o-l)),s=Math.round(.5*(i-c)),`<rect fill="${u?"currentColor":"none"}" stroke="${u?"none":"currentColor"}" stroke-width="${o/16}" stroke-dasharray="${[o/12,o/6].join(" ")}" x="${a}" y="${s}" width="${l}" height="${c}" rx="${n}"/>`})(e.value,{bounds:14}),{...e,disabled:t}}}],_t&&["Dropdown","select-crop-limit",{icon:ei(Zt,ue),label:Zt.cropLabelCropBoundary,labelClass:"PinturaToolbarContentWide",onchange:({value:e})=>{vn(Zo,ue=e,ue),po.write()},options:[[!0,Zt.cropLabelCropBoundaryEdge,{icon:ei(Zt,!0)}],[!1,Zt.cropLabelCropBoundaryNone,{icon:ei(Zt,!1)}]]}]].filter(Boolean),D,(()=>Jt.set({}))).filter(Boolean)),6144&e.$$.dirty[0]|134217728&e.$$.dirty[3]|262148&e.$$.dirty[4]&&vn(Mo,Ee=F&&"never"!==Ht&&("always"===Ht||"short"===D.verticalSpace||h)?r.map((([e,t,o])=>Array.isArray(o)?[e,t,o]:[e,t,{...o,hideLabel:!0}])):[],Ee),4&e.$$.dirty[5]&&o(23,n=ue?0:-1),268435456&e.$$.dirty[4]|1&e.$$.dirty[5]&&o(132,a=Z&&me(-(ee.x-Z.x),-(ee.y-Z.y))),2097408&e.$$.dirty[4]&&o(133,s=_&&a&&me(Od(_.x+.5*_.width+a.x),Od(_.y+.5*_.height+a.y))),536870912&e.$$.dirty[4]&&o(136,u=null!=q),268468224&e.$$.dirty[4]&&o(138,p=Z&&l&&(l.height===Z.height||l.width===Z.width)),201342976&e.$$.dirty[4]&&o(134,m=!p&&G<1&&U<1),15360&e.$$.dirty[4]&&o(9,g=c&&!u&&(!d||m)),8192&e.$$.dirty[3]|33554436&e.$$.dirty[4]&&o(22,$=Pt&&!!j&&!h),50331648&e.$$.dirty[4]&&o(21,f=function(e,t){if(t){const o=e.width/e.height;return t.width&&!t.height?Ne(t.width,t.width/o):t.height&&!t.width?Ne(t.height*o,t.height):Oe(t)}return Ne(e.width,e.height)}(j,H)),2097408&e.$$.dirty[4]&&o(8,x=_&&a&&{x:_.x+a.x,y:_.y+a.y,width:_.width,height:_.height}),256&e.$$.dirty[0]|4096&e.$$.dirty[3]|4&e.$$.dirty[4]&&o(20,y=Mt&&!!x&&!h),65600&e.$$.dirty[3]|8389120&e.$$.dirty[4]&&o(10,b=Et&&!!s&&!at&&!N),512&e.$$.dirty[0]|64&e.$$.dirty[3]|4194306&e.$$.dirty[4]&&g&&at&&!V&&(clearTimeout(gi),o(125,gi=setTimeout(mi,at))),4194306&e.$$.dirty[4]&&V&&clearTimeout(gi),1536&e.$$.dirty[0]|131072&e.$$.dirty[4]&&$i.set(b&&g?1:0,{hard:!1===z}),131584&e.$$.dirty[4]&&fi.set(s,{hard:!1===z}),4096&e.$$.dirty[0]|1048576&e.$$.dirty[4]&&(F&&!B?(vn(Po,W.crop={maskOpacity:Gt,maskMarkupOpacity:Gt},W),Po.set(W)):(delete W.crop,Po.set(W))),524288&e.$$.dirty[4]&&O&&qo.update((e=>{const t=e.filter((e=>!/^image\-selection\-guide/.test(e.id)));return F?[...t,...O]:t})),262144&e.$$.dirty[4]&&o(129,v="short"!==D.verticalSpace),134217728&e.$$.dirty[3]|36&e.$$.dirty[4]&&o(19,S="never"===Ht&&!h||v&&"always"!==Ht),4&e.$$.dirty[0]|1024&e.$$.dirty[3]&&o(128,k=yt&&bt),2048&e.$$.dirty[3]|48&e.$$.dirty[4]&&o(127,C=Ct?v&&k:k),512&e.$$.dirty[3]|8&e.$$.dirty[4]&&o(18,T=ft||C),8&e.$$.dirty[4]&&(C||o(5,ki=Si)),32&e.$$.dirty[0]&&o(17,M={name:vi,selected:ki}),16&e.$$.dirty[0]|512&e.$$.dirty[3]|8&e.$$.dirty[4]&&o(7,P=[ft&&{id:vi+"-rotation",label:Zt.cropLabelTabRotation},C&&{id:vi+"-zoom",label:Zt.cropLabelTabZoom}].filter(Boolean)),128&e.$$.dirty[0]&&o(16,I=P.map((e=>e.id))),64&e.$$.dirty[0]|4&e.$$.dirty[4]&&wi&&!wi.children.length&&h&&wi.dispatchEvent(new CustomEvent("measure",{detail:wi.rect})),4096&e.$$.dirty[0]|131072&e.$$.dirty[4]&&z&&Ti.set(F?0:20),65536&e.$$.dirty[4]&&o(15,E=A?`translateY(${A}px)`:"none")},[tt,rt,yt,Ut,Zt,ki,wi,P,x,g,b,r,F,re,Ci,E,I,M,T,S,y,f,$,n,ge,Be,Ve,He,Ye,qe,Ke,qt,Kt,Jt,Qt,eo,to,io,ho,mo,$o,fo,yo,xo,Co,To,Mo,Po,Io,Eo,Ao,Lo,Fo,zo,Do,Oo,Bo,Wo,Vo,No,Ho,jo,Uo,Go,Zo,Xo,Yo,Ko,()=>{oo="select",vn(mo,V=!0,V),vn(Do,q=et(K),q),ti=N?oi:ii},({detail:e})=>{const{boundsLimited:t,boundsIntent:o}=ti(e.direction,e.translation);vn($o,te=!0,te),vn(Oo,Ie=o,Ie),vn(zo,K=t,K)},({detail:e})=>{const{boundsLimited:t}=ti(e.direction,e.translation);vn($o,te=!1,te),vn(mo,V=!1,V),vn(Oo,Ie=void 0,Ie),be(e.translation)&&(vn(zo,K=t,K),po.write()),vn(Do,q=void 0,q),oo=void 0},()=>{oo="rotate",vn(mo,V=!0,V),vn(Vo,Se=et(j),Se)},e=>{vn($o,te=!0,te),vn(Ao,re=e,re)},e=>{vn($o,te=!1,te),vn(mo,V=!1,V),vn(Ao,re=e,re),po.write(),vn(Vo,Se=void 0,Se)},()=>{oo="pan",ni=void 0,vn(mo,V=!0,V),ri=et(j)},({detail:e})=>{vn($o,te=!0,te),ai(e)},({detail:e})=>{vn($o,te=!1,te),vn(mo,V=!1,V),(be(e.translation)>0||0!==e.scalar)&&(ai(e),po.write()),vn(Wo,ye=void 0,ye),ri=void 0},({detail:{translation:e}})=>{N&&(e=fe($e(e))),ni=e,vn(mo,V=!1,V)},si,li,ci,()=>{oo="zoom",vn(mo,V=!0,V),ri=et(j)},e=>{vn($o,te=!1,te),di(e)},e=>{di(e),po.write(),vn($o,te=!1,te),vn(mo,V=!1,V),ri=void 0},()=>{oo="zoom",ri||(ui=et(j),vn(mo,V=!0,V))},({detail:e})=>{ui&&(vn($o,te=!0,te),pi(e))},({detail:e})=>{ui&&(vn($o,te=!1,te),vn(mo,V=!1,V),pi(e),vn(Wo,ye=void 0,ye),ui=void 0,po.write())},e=>{const t=pm(e,ge,ee);if(It&&!vt(K,t))return;oo="zoom",vn(mo,V=!0,V),vn($o,te=!0,te),e.preventDefault(),e.stopPropagation();const o=Rh(e,{fixScrollDirection:he}),i=1+o/100,r=et(j),n=1===Math.min(j.width/pe.width,j.height/pe.height);if(pt&&ue){const e=lo(j,ie,re);if(ro()&&e&&o>0&&d){vn(mo,V=!1,V),vn($o,te=!1,te);const e=Q(re)?ot({height:ie.width,width:ie.height}):ot(ie);if(gt(r,e))return;if(clearTimeout(hi),gt(po.state.crop,e))return;return vn(No,j=e,j),void po.write()}}let a=ct(j);if(Rt&&"selection"!==jt&&o<0&&!n){const e=Ce($e(t),K),o=Math.min(K.width/j.width,K.height/j.height),i=ut(et(K),1.1);a=vt(i,t)?ke(et(j),Me(e,1/o)):a}let s=ut(et(j),i,a);if(Ze(oe[1],s)||(s=st(ct(s),oe[1])),Ze(s,oe[0])||(s=st(ct(s),oe[0])),gt(r,s,de))return vn(mo,V=!1,V),void vn($o,te=!1,te);vn(No,j=Tt(s,(e=>de(e,5))),j),vn(mo,V=!1,V),vn($o,te=!1,te),clearTimeout(hi),hi=setTimeout((()=>{po.write()}),500)},mi,$i,fi,yi,xi,vi,Ti,Wt,"crop",it,nt,at,pt,ht,ft,bt,Ct,Mt,Pt,Rt,It,Et,At,Lt,Ft,zt,Dt,Ot,Bt,_t,Vt,Nt,Ht,jt,Gt,Xt,Yt,gi,h,C,k,v,w,i,a,s,m,d,u,c,p,l,A,z,D,O,B,_,V,N,H,j,U,G,Z,q,K,ee,ie,ue,pe,Ae,Le,Fe,ze,De,function(t){da.call(this,e,t)},({detail:e})=>o(5,ki=e),function(e){pa[e?"unshift":"push"]((()=>{wi=e,o(6,wi)}))},e=>um(e),function(e){Ci=e,o(14,Ci)},function(t){da.call(this,e,t)}]}var vy={util:["crop",class extends Ga{constructor(e){super(),Ua(this,e,xy,$y,ln,{name:96,isActive:0,stores:97,cropImageSelectionCornerStyle:1,cropWillRenderImageSelectionGuides:98,cropAutoCenterImageSelectionTimeout:99,cropEnableZoomMatchImageAspectRatio:100,cropEnableRotateMatchImageAspectRatio:101,cropEnableRotationInput:102,cropEnableZoom:2,cropEnableZoomInput:103,cropEnableZoomAutoHide:104,cropEnableImageSelection:105,cropEnableInfoIndicator:106,cropEnableZoomTowardsWheelPosition:107,cropEnableLimitWheelInputToCropSelection:108,cropEnableCenterImageSelection:109,cropEnableButtonRotateLeft:110,cropEnableButtonRotateRight:111,cropEnableButtonFlipHorizontal:112,cropEnableButtonFlipVertical:113,cropSelectPresetOptions:114,cropEnableSelectPreset:115,cropEnableFilterMatchAspectRatio:116,cropSelectPresetFilter:95,cropEnableButtonToggleCropLimit:117,cropWillRenderTools:118,cropActiveTransformTool:119,cropMinimizeToolbar:120,cropInteractionFocus:121,cropRotationRange:3,cropMaskOpacity:122,locale:4,cropFormatIconSelectPreset:123,cropFormatIconCropBoundary:124},null,[-1,-1,-1,-1,-1,-1,-1,-1])}get name(){return this.$$.ctx[96]}get isActive(){return this.$$.ctx[0]}set isActive(e){this.$$set({isActive:e}),ka()}get stores(){return this.$$.ctx[97]}set stores(e){this.$$set({stores:e}),ka()}get cropImageSelectionCornerStyle(){return this.$$.ctx[1]}set cropImageSelectionCornerStyle(e){this.$$set({cropImageSelectionCornerStyle:e}),ka()}get cropWillRenderImageSelectionGuides(){return this.$$.ctx[98]}set cropWillRenderImageSelectionGuides(e){this.$$set({cropWillRenderImageSelectionGuides:e}),ka()}get cropAutoCenterImageSelectionTimeout(){return this.$$.ctx[99]}set cropAutoCenterImageSelectionTimeout(e){this.$$set({cropAutoCenterImageSelectionTimeout:e}),ka()}get cropEnableZoomMatchImageAspectRatio(){return this.$$.ctx[100]}set cropEnableZoomMatchImageAspectRatio(e){this.$$set({cropEnableZoomMatchImageAspectRatio:e}),ka()}get cropEnableRotateMatchImageAspectRatio(){return this.$$.ctx[101]}set cropEnableRotateMatchImageAspectRatio(e){this.$$set({cropEnableRotateMatchImageAspectRatio:e}),ka()}get cropEnableRotationInput(){return this.$$.ctx[102]}set cropEnableRotationInput(e){this.$$set({cropEnableRotationInput:e}),ka()}get cropEnableZoom(){return this.$$.ctx[2]}set cropEnableZoom(e){this.$$set({cropEnableZoom:e}),ka()}get cropEnableZoomInput(){return this.$$.ctx[103]}set cropEnableZoomInput(e){this.$$set({cropEnableZoomInput:e}),ka()}get cropEnableZoomAutoHide(){return this.$$.ctx[104]}set cropEnableZoomAutoHide(e){this.$$set({cropEnableZoomAutoHide:e}),ka()}get cropEnableImageSelection(){return this.$$.ctx[105]}set cropEnableImageSelection(e){this.$$set({cropEnableImageSelection:e}),ka()}get cropEnableInfoIndicator(){return this.$$.ctx[106]}set cropEnableInfoIndicator(e){this.$$set({cropEnableInfoIndicator:e}),ka()}get cropEnableZoomTowardsWheelPosition(){return this.$$.ctx[107]}set cropEnableZoomTowardsWheelPosition(e){this.$$set({cropEnableZoomTowardsWheelPosition:e}),ka()}get cropEnableLimitWheelInputToCropSelection(){return this.$$.ctx[108]}set cropEnableLimitWheelInputToCropSelection(e){this.$$set({cropEnableLimitWheelInputToCropSelection:e}),ka()}get cropEnableCenterImageSelection(){return this.$$.ctx[109]}set cropEnableCenterImageSelection(e){this.$$set({cropEnableCenterImageSelection:e}),ka()}get cropEnableButtonRotateLeft(){return this.$$.ctx[110]}set cropEnableButtonRotateLeft(e){this.$$set({cropEnableButtonRotateLeft:e}),ka()}get cropEnableButtonRotateRight(){return this.$$.ctx[111]}set cropEnableButtonRotateRight(e){this.$$set({cropEnableButtonRotateRight:e}),ka()}get cropEnableButtonFlipHorizontal(){return this.$$.ctx[112]}set cropEnableButtonFlipHorizontal(e){this.$$set({cropEnableButtonFlipHorizontal:e}),ka()}get cropEnableButtonFlipVertical(){return this.$$.ctx[113]}set cropEnableButtonFlipVertical(e){this.$$set({cropEnableButtonFlipVertical:e}),ka()}get cropSelectPresetOptions(){return this.$$.ctx[114]}set cropSelectPresetOptions(e){this.$$set({cropSelectPresetOptions:e}),ka()}get cropEnableSelectPreset(){return this.$$.ctx[115]}set cropEnableSelectPreset(e){this.$$set({cropEnableSelectPreset:e}),ka()}get cropEnableFilterMatchAspectRatio(){return this.$$.ctx[116]}set cropEnableFilterMatchAspectRatio(e){this.$$set({cropEnableFilterMatchAspectRatio:e}),ka()}get cropSelectPresetFilter(){return this.$$.ctx[95]}set cropSelectPresetFilter(e){this.$$set({cropSelectPresetFilter:e}),ka()}get cropEnableButtonToggleCropLimit(){return this.$$.ctx[117]}set cropEnableButtonToggleCropLimit(e){this.$$set({cropEnableButtonToggleCropLimit:e}),ka()}get cropWillRenderTools(){return this.$$.ctx[118]}set cropWillRenderTools(e){this.$$set({cropWillRenderTools:e}),ka()}get cropActiveTransformTool(){return this.$$.ctx[119]}set cropActiveTransformTool(e){this.$$set({cropActiveTransformTool:e}),ka()}get cropMinimizeToolbar(){return this.$$.ctx[120]}set cropMinimizeToolbar(e){this.$$set({cropMinimizeToolbar:e}),ka()}get cropInteractionFocus(){return this.$$.ctx[121]}set cropInteractionFocus(e){this.$$set({cropInteractionFocus:e}),ka()}get cropRotationRange(){return this.$$.ctx[3]}set cropRotationRange(e){this.$$set({cropRotationRange:e}),ka()}get cropMaskOpacity(){return this.$$.ctx[122]}set cropMaskOpacity(e){this.$$set({cropMaskOpacity:e}),ka()}get locale(){return this.$$.ctx[4]}set locale(e){this.$$set({locale:e}),ka()}get cropFormatIconSelectPreset(){return this.$$.ctx[123]}set cropFormatIconSelectPreset(e){this.$$set({cropFormatIconSelectPreset:e}),ka()}get cropFormatIconCropBoundary(){return this.$$.ctx[124]}set cropFormatIconCropBoundary(e){this.$$set({cropFormatIconCropBoundary:e}),ka()}}]};function wy(e){let t,o,i,r,n,a,s,l=e[77],c=(R(e[77].label)?e[77].label(e[2]):e[77].label)+"";function d(...t){return e[51](e[77],...t)}const u=()=>e[52](o,l),p=()=>e[52](null,l);return{c(){t=Fn("div"),o=Fn("div"),i=On(),r=Fn("span"),n=Dn(c),Nn(o,"class",Ty),Nn(t,"slot","option"),Nn(t,"class","PinturaFilterOption")},m(e,l){An(e,t,l),Rn(t,o),u(),Rn(t,i),Rn(t,r),Rn(r,n),a||(s=[Wn(o,"measure",d),wn(Dc.call(null,o))],a=!0)},p(t,o){l!==(e=t)[77]&&(p(),l=e[77],u()),4&o[0]|32768&o[2]&&c!==(c=(R(e[77].label)?e[77].label(e[2]):e[77].label)+"")&&Un(n,c)},d(e){e&&Ln(t),p(),a=!1,an(s)}}}function Sy(e){let t,o;return t=new Lu({props:{locale:e[2],layout:"row",options:e[3],selectedIndex:e[12],onchange:e[32],$$slots:{option:[wy,({option:e})=>({77:e}),({option:e})=>[0,0,e?32768:0]]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};4&o[0]&&(i.locale=e[2]),8&o[0]&&(i.options=e[3]),4096&o[0]&&(i.selectedIndex=e[12]),1028&o[0]|98304&o[2]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function ky(e){let t,o,i,r,n,a,s,l;function c(t){e[54](t)}function d(t){e[55](t)}function u(t){e[56](t)}let p={elasticity:e[13]*e[19],onscroll:e[53],$$slots:{default:[Sy]},$$scope:{ctx:e}};return void 0!==e[4]&&(p.maskFeatherStartOpacity=e[4]),void 0!==e[5]&&(p.maskFeatherEndOpacity=e[5]),void 0!==e[6]&&(p.maskFeatherSize=e[6]),o=new Ah({props:p}),pa.push((()=>Va(o,"maskFeatherStartOpacity",c))),pa.push((()=>Va(o,"maskFeatherEndOpacity",d))),pa.push((()=>Va(o,"maskFeatherSize",u))),o.$on("measure",e[57]),{c(){t=Fn("div"),Na(o.$$.fragment),Nn(t,"slot","footer"),Zn(t,"transform",e[11])},m(i,r){An(i,t,r),Ha(o,t,null),a=!0,s||(l=[Wn(t,"transitionend",e[30]),Wn(t,"measure",e[58]),wn(Dc.call(null,t,{observePosition:!0}))],s=!0)},p(e,a){const s={};8192&a[0]&&(s.elasticity=e[13]*e[19]),128&a[0]&&(s.onscroll=e[53]),5132&a[0]|65536&a[2]&&(s.$$scope={dirty:a,ctx:e}),!i&&16&a[0]&&(i=!0,s.maskFeatherStartOpacity=e[4],xa((()=>i=!1))),!r&&32&a[0]&&(r=!0,s.maskFeatherEndOpacity=e[5],xa((()=>r=!1))),!n&&64&a[0]&&(n=!0,s.maskFeatherSize=e[6],xa((()=>n=!1))),o.$set(s),2048&a[0]&&Zn(t,"transform",e[11])},i(e){a||(Ea(o.$$.fragment,e),a=!0)},o(e){Aa(o.$$.fragment,e),a=!1},d(e){e&&Ln(t),ja(o),s=!1,an(l)}}}function Cy(e){let t,o;return t=new Tf({props:{$$slots:{footer:[ky]},$$scope:{ctx:e}}}),t.$on("measure",e[59]),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};16380&o[0]|65536&o[2]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}let Ty="PinturaFilterPreview";function My(e,t,o){let i,r,n,a,s,l,c,d,u,p,h,m,g,$,f,y,b,x,v,w,S=en,k=()=>(S(),S=un(P,(e=>o(43,d=e))),P),C=en,T=()=>(C(),C=un(M,(e=>o(49,b=e))),M);e.$$.on_destroy.push((()=>S())),e.$$.on_destroy.push((()=>C()));let{isActive:M}=t;T();let{isActiveFraction:P}=t;k();let{stores:I}=t,{locale:E}=t,{filterFunctions:A}=t,{filterOptions:L}=t;const F=ca("elasticityMultiplier");hn(e,F,(e=>o(13,w=e)));const{history:z,interfaceImages:D,stageRectBase:O,utilRect:B,animation:W,scrollElasticity:_,imageSize:V,imagePreview:N,imageCropRect:H,imageRotation:j,imageFlipX:U,imageFlipY:G,imageBackgroundColor:Z,imageGamma:X,imageColorMatrix:Y,allowPan:q,allowZoom:K,allowZoomControls:J,allowPlayPause:Q}=I;hn(e,D,(e=>o(60,u=e))),hn(e,O,(e=>o(48,y=e))),hn(e,B,(e=>o(47,f=e))),hn(e,W,(e=>o(50,x=e))),hn(e,V,(e=>o(62,h=e))),hn(e,N,(e=>o(42,c=e))),hn(e,Z,(e=>o(61,p=e))),hn(e,X,(e=>o(44,m=e))),hn(e,Y,(e=>o(40,s=e)));const ee=Ya({});hn(e,ee,(e=>o(46,$=e)));const te=(e,t)=>vn(ee,$[e.value]=t,$),oe=qa(ee,(e=>{if(!e[void 0])return;const t=e[void 0];return v&&He(v,t)?v:Oe(t)}));hn(e,oe,(e=>o(63,v=e)));const ie=qa([M,oe,H,V,j,U,G],(([e,t,o,i,r,n,a],s)=>{if(!e||!t||!i)return g;const l=ot(i),c=ct(l),d=gs(i,o,r),u=ct(d),p=Ce($e(c),u),h=fe($e(p)),m=Math.max(t.width/o.width,t.height/o.height);s({origin:h,translation:p,rotation:{x:a?Math.PI:0,y:n?Math.PI:0,z:r},scale:m})}));hn(e,ie,(e=>o(45,g=e)));const re=xc(x?20:0);let ne;hn(e,re,(e=>o(39,a=e)));const ae={};let se,le,ce,de,ue,pe,he={x:0,y:0};const ge=Ya([]);hn(e,ge,(e=>o(41,l=e)));const ye=e=>{const t={...e,data:c,size:h,offset:{...e.offset},mask:{...e.mask},backgroundColor:p};return t.opacity=d,t.offset.y+=a,t.mask.y+=a,t.id="filter",t},be=()=>u.filter((e=>"filter"!==e.id));aa((()=>{D.set([])}));return e.$$set=e=>{"isActive"in e&&T(o(0,M=e.isActive)),"isActiveFraction"in e&&k(o(1,P=e.isActiveFraction)),"stores"in e&&o(34,I=e.stores),"locale"in e&&o(2,E=e.locale),"filterFunctions"in e&&o(35,A=e.filterFunctions),"filterOptions"in e&&o(3,L=e.filterOptions)},e.$$.update=()=>{if(262144&e.$$.dirty[1]&&q.set(b),262144&e.$$.dirty[1]&&K.set(b),262144&e.$$.dirty[1]&&J.set(b),262144&e.$$.dirty[1]&&b&&Q.set(!1),8&e.$$.dirty[0]&&o(38,i=iu(L)),640&e.$$.dirty[1]&&o(12,r=((e,t)=>{if(!e||!e.filter||!t)return 0;const o=e.filter;return t.findIndex((([e])=>{if(!A[e])return!1;const t=A[e]();return vs(t,o)}))})(s,i)),786432&e.$$.dirty[1]&&x&&re.set(b?0:20),512&e.$$.dirty[0]|458752&e.$$.dirty[1]&&b&&f&&y&&pe&&o(37,ue={x:y.x-f.x,y:y.y-f.y+pe.y}),496&e.$$.dirty[0]|58096&e.$$.dirty[1]&&g&&ue&&he&&de&&ne){const e=ue.x+de.x+he.x,t=ue.y,o=de.x+ue.x,r=o+de.width;ge.set(i.map((([i],n)=>{const a=$[i],l=he.x+a.x,c=l+a.width;if(c<0||l>de.width)return!1;const d=e+a.x,u=t+a.y,p=(e=>({origin:$e(e.origin),translation:$e(e.translation),rotation:{...e.rotation},scale:e.scale}))(g);p.offset=me(.5*a.width+d,.5*a.height+u);p.maskOpacity=1,p.mask=lt(d+0,u,a.width+0,a.height),p.maskFeather=[1,0,1,0,1,r,1,r],l<ce&&se<1&&(p.maskFeather[0]=se,p.maskFeather[1]=o,p.maskFeather[2]=1,p.maskFeather[3]=o+ce),c>de.width-ce&&le<1&&(p.maskFeather[4]=le,p.maskFeather[5]=r-ce,p.maskFeather[6]=1,p.maskFeather[7]=r),p.maskCornerRadius=ne[i];let h=s&&Object.keys(s).filter((e=>"filter"!=e)).map((e=>s[e]))||[];return R(A[i])&&h.push(A[i]()),p.colorMatrix=h.length?Jr(h):void 0,p.gamma=m,p})).filter(Boolean))}if(7424&e.$$.dirty[1])if(d>0&&l){const e=[...be(),...l.map(ye)];D.set(e)}else D.set(be());256&e.$$.dirty[1]&&o(11,n=a?`translateY(${a}px)`:"none")},[M,P,E,L,se,le,ce,he,de,pe,ae,n,r,w,F,D,O,B,W,_,V,N,Z,X,Y,ee,te,oe,ie,re,e=>{e.target.className===Ty&&o(36,ne=Object.keys(ae).reduce(((e,t)=>{const o=ae[t],i=getComputedStyle(o),r=["top-left","top-right","bottom-left","bottom-right"].map((e=>i.getPropertyValue(`border-${e}-radius`))).map(Ph).map((e=>1.25*e));return e[t]=r,e}),{}))},ge,({value:e})=>{vn(Y,s={...s,filter:R(A[e])?A[e]():void 0},s),z.write()},"filter",I,A,ne,ue,i,a,s,l,c,d,m,g,$,f,y,b,x,(e,t)=>te(e,t.detail),function(e,t){pa[e?"unshift":"push"]((()=>{ae[t.value]=e,o(10,ae)}))},e=>o(7,he=e),function(e){se=e,o(4,se)},function(e){le=e,o(5,le)},function(e){ce=e,o(6,ce)},e=>o(8,de=e.detail),e=>o(9,pe=e.detail),function(t){da.call(this,e,t)}]}var Py={util:["filter",class extends Ga{constructor(e){super(),Ua(this,e,My,Cy,ln,{name:33,isActive:0,isActiveFraction:1,stores:34,locale:2,filterFunctions:35,filterOptions:3},null,[-1,-1,-1])}get name(){return this.$$.ctx[33]}get isActive(){return this.$$.ctx[0]}set isActive(e){this.$$set({isActive:e}),ka()}get isActiveFraction(){return this.$$.ctx[1]}set isActiveFraction(e){this.$$set({isActiveFraction:e}),ka()}get stores(){return this.$$.ctx[34]}set stores(e){this.$$set({stores:e}),ka()}get locale(){return this.$$.ctx[2]}set locale(e){this.$$set({locale:e}),ka()}get filterFunctions(){return this.$$.ctx[35]}set filterFunctions(e){this.$$set({filterFunctions:e}),ka()}get filterOptions(){return this.$$.ctx[3]}set filterOptions(e){this.$$set({filterOptions:e}),ka()}}]};function Ry(e){let t,o,i,r;t=new Ah({props:{elasticity:e[6]*e[9],class:"PinturaControlListScroller",$$slots:{default:[Ey]},$$scope:{ctx:e}}});const n=[{class:"PinturaControlPanels"},{panelClass:"PinturaControlPanel"},{panels:e[4]},e[5]];let a={$$slots:{default:[Ay,({panel:e})=>({42:e}),({panel:e})=>[0,e?2048:0]]},$$scope:{ctx:e}};for(let e=0;e<n.length;e+=1)a=on(a,n[e]);return i=new gd({props:a}),{c(){Na(t.$$.fragment),o=On(),Na(i.$$.fragment)},m(e,n){Ha(t,e,n),An(e,o,n),Ha(i,e,n),r=!0},p(e,o){const r={};64&o[0]&&(r.elasticity=e[6]*e[9]),38&o[0]|8192&o[1]&&(r.$$scope={dirty:o,ctx:e}),t.$set(r);const a=48&o[0]?Wa(n,[n[0],n[1],16&o[0]&&{panels:e[4]},32&o[0]&&_a(e[5])]):{};128&o[0]|10240&o[1]&&(a.$$scope={dirty:o,ctx:e}),i.$set(a)},i(e){r||(Ea(t.$$.fragment,e),Ea(i.$$.fragment,e),r=!0)},o(e){Aa(t.$$.fragment,e),Aa(i.$$.fragment,e),r=!1},d(e){ja(t,e),e&&Ln(o),ja(i,e)}}}function Iy(e){let t,o,i=e[43].label+"";return{c(){t=Fn("span"),o=Dn(i)},m(e,i){An(e,t,i),Rn(t,o)},p(e,t){4096&t[1]&&i!==(i=e[43].label+"")&&Un(o,i)},d(e){e&&Ln(t)}}}function Ey(e){let t,o;const i=[{class:"PinturaControlList"},{tabs:e[1]},e[5]];let r={$$slots:{default:[Iy,({tab:e})=>({43:e}),({tab:e})=>[0,e?4096:0]]},$$scope:{ctx:e}};for(let e=0;e<i.length;e+=1)r=on(r,i[e]);return t=new od({props:r}),t.$on("select",e[24]),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const r=34&o[0]?Wa(i,[i[0],2&o[0]&&{tabs:e[1]},32&o[0]&&_a(e[5])]):{};12288&o[1]&&(r.$$scope={dirty:o,ctx:e}),t.$set(r)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Ay(e){let t,o;const i=[e[7][e[42]]];let r={};for(let e=0;e<i.length;e+=1)r=on(r,i[e]);return t=new If({props:r}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const r=128&o[0]|2048&o[1]?Wa(i,[_a(e[7][e[42]])]):{};t.$set(r)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Ly(e){let t,o,i=e[5]&&Ry(e);return{c(){t=Fn("div"),i&&i.c(),Nn(t,"slot","footer"),Zn(t,"transform",e[3])},m(e,r){An(e,t,r),i&&i.m(t,null),o=!0},p(e,o){e[5]?i?(i.p(e,o),32&o[0]&&Ea(i,1)):(i=Ry(e),i.c(),Ea(i,1),i.m(t,null)):i&&(Ra(),Aa(i,1,1,(()=>{i=null})),Ia()),8&o[0]&&Zn(t,"transform",e[3])},i(e){o||(Ea(i),o=!0)},o(e){Aa(i),o=!1},d(e){e&&Ln(t),i&&i.d()}}}function Fy(e){let t,o;return t=new Tf({props:{$$slots:{footer:[Ly]},$$scope:{ctx:e}}}),t.$on("measure",e[25]),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};254&o[0]|8192&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function zy(e,t,o){let i,r,n,a,s,l,c,d,u,p,h,m=en,g=()=>(m(),m=un(f,(e=>o(21,c=e))),f);e.$$.on_destroy.push((()=>m()));let{stores:$}=t,{isActive:f}=t;g();let{locale:y={}}=t,{finetuneControlConfiguration:b}=t,{finetuneOptions:x}=t,{finetuneNudgePrecision:v}=t;const{history:w,animation:S,scrollElasticity:k,rangeInputElasticity:C,imageColorMatrix:T,imageConvolutionMatrix:M,imageGamma:P,imageVignette:I,imageNoise:E,allowPan:A,allowZoom:F,allowZoomControls:z,allowPlayPause:D}=$;hn(e,S,(e=>o(22,d=e)));const O={imageColorMatrix:T,imageConvolutionMatrix:M,imageGamma:P,imageVignette:I,imageNoise:E},B=ca("elasticityMultiplier");hn(e,B,(e=>o(6,p=e)));const W="finetune-"+L(),_=Ya({});hn(e,_,(e=>o(23,u=e)));const V=Ya({});hn(e,V,(e=>o(7,h=e)));let N=[];const H=xc(d?20:0);hn(e,H,(e=>o(20,l=e)));return e.$$set=e=>{"stores"in e&&o(15,$=e.stores),"isActive"in e&&g(o(0,f=e.isActive)),"locale"in e&&o(16,y=e.locale),"finetuneControlConfiguration"in e&&o(17,b=e.finetuneControlConfiguration),"finetuneOptions"in e&&o(18,x=e.finetuneOptions),"finetuneNudgePrecision"in e&&o(19,v=e.finetuneNudgePrecision)},e.$$.update=()=>{var t;2097152&e.$$.dirty[0]&&A.set(c),2097152&e.$$.dirty[0]&&F.set(c),2097152&e.$$.dirty[0]&&z.set(c),2097152&e.$$.dirty[0]&&c&&D.set(!0),327680&e.$$.dirty[0]&&o(1,i=x?x.map((([e,t])=>({id:e,label:R(t)?t(y):t}))):[]),2&e.$$.dirty[0]&&o(2,r=i.length?i[0].id:void 0),4&e.$$.dirty[0]&&o(5,n=r&&{name:W,selected:r}),2&e.$$.dirty[0]&&o(4,a=i.map((e=>e.id))),131072&e.$$.dirty[0]&&b&&(t=b,N&&N.forEach((e=>e())),N=a.map((e=>{const{getStore:o,getValue:i=Y}=t[e];return o(O).subscribe((t=>{const o=null!=t?i(t):t;vn(_,u={...u,[e]:o},u)}))}))),8519680&e.$$.dirty[0]&&b&&u&&vn(V,h=Object.keys(u).reduce(((e,t)=>{const{base:o,min:i,max:r,getLabel:n,getStore:a,setValue:s=((e,t)=>e.set(t))}=b[t],l=a(O),c=null!=u[t]?u[t]:o;return e[t]={base:o,min:i,max:r,value:c,valueLabel:n?n(c,i,r,r-i):Math.round(100*c),oninputmove:e=>{s(l,e)},oninputend:e=>{s(l,e),w.write()},elasticity:p*C,labelReset:y.labelReset,nudgeMultiplier:v},e}),{}),h),6291456&e.$$.dirty[0]&&d&&H.set(c?0:20),1048576&e.$$.dirty[0]&&o(3,s=l?`translateY(${l}px)`:"none")},[f,i,r,s,a,n,p,h,S,k,B,_,V,H,"finetune",$,y,b,x,v,l,c,d,u,({detail:e})=>o(2,r=e),function(t){da.call(this,e,t)}]}var Dy={util:["finetune",class extends Ga{constructor(e){super(),Ua(this,e,zy,Fy,ln,{name:14,stores:15,isActive:0,locale:16,finetuneControlConfiguration:17,finetuneOptions:18,finetuneNudgePrecision:19},null,[-1,-1])}get name(){return this.$$.ctx[14]}get stores(){return this.$$.ctx[15]}set stores(e){this.$$set({stores:e}),ka()}get isActive(){return this.$$.ctx[0]}set isActive(e){this.$$set({isActive:e}),ka()}get locale(){return this.$$.ctx[16]}set locale(e){this.$$set({locale:e}),ka()}get finetuneControlConfiguration(){return this.$$.ctx[17]}set finetuneControlConfiguration(e){this.$$set({finetuneControlConfiguration:e}),ka()}get finetuneOptions(){return this.$$.ctx[18]}set finetuneOptions(e){this.$$set({finetuneOptions:e}),ka()}get finetuneNudgePrecision(){return this.$$.ctx[19]}set finetuneNudgePrecision(e){this.$$set({finetuneNudgePrecision:e}),ka()}}]},Oy=(e,t)=>{const o=t.length;return e<0?e%o+o:e>=o?e%o:e};function By(e,t,o){const i=e.slice();return i[50]=t[o].key,i[51]=t[o].index,i[52]=t[o].translate,i[16]=t[o].scale,i[53]=t[o].selected,i[15]=t[o].rotate,i[54]=t[o].dir,i[55]=t[o].center,i[56]=t[o].type,i[4]=t[o].visible,i}function Wy(e){let t;return{c(){t=Fn("div"),Nn(t,"class","PinturaShapeManipulator"),Nn(t,"data-control","point"),Zn(t,"pointer-events","none"),Zn(t,"opacity",e[6]),Zn(t,"transform",`translate3d(${e[55].x}px, ${e[55].y}px, 0) scale(${e[7]}, ${e[7]})`)},m(e,o){An(e,t,o)},p(e,o){64&o[0]&&Zn(t,"opacity",e[6]),160&o[0]&&Zn(t,"transform",`translate3d(${e[55].x}px, ${e[55].y}px, 0) scale(${e[7]}, ${e[7]})`)},d(e){e&&Ln(t)}}}function _y(e,t){let o,i,r,n,a,s,l,c,d;function u(...e){return t[22](t[51],...e)}let p="edge"===t[56]&&t[4]&&Wy(t);return{key:e,first:null,c(){o=Fn("div"),s=On(),p&&p.c(),l=Bn(),Nn(o,"role","button"),Nn(o,"aria-label",i=`Drag ${t[56]} ${t[50]}`),Nn(o,"tabindex",r="edge"===t[56]?-1:0),Nn(o,"class","PinturaShapeManipulator"),Nn(o,"data-control",n=t[56]),Nn(o,"data-selected",a=t[53]),Zn(o,"cursor",t[54]?t[54]+"-resize":"move"),Zn(o,"opacity",t[6]),Zn(o,"--tx",t[52].x),Zn(o,"--ty",t[52].y),Zn(o,"--r",("edge"===t[56]?t[15]:0)+"rad"),Zn(o,"--sx","point"===t[56]?t[7]:t[16].x),Zn(o,"--sy","point"===t[56]?t[7]:t[16].y),this.first=o},m(e,i){An(e,o,i),An(e,s,i),p&&p.m(e,i),An(e,l,i),c||(d=[Wn(o,"nudge",u),wn(sp.call(null,o,{preventDefault:!0})),Wn(o,"interactionstart",(function(){sn(t[11]("start",t[51]))&&t[11]("start",t[51]).apply(this,arguments)})),Wn(o,"interactionupdate",(function(){sn(t[11]("move",t[51]))&&t[11]("move",t[51]).apply(this,arguments)})),Wn(o,"interactionend",(function(){sn(t[11]("end",t[51]))&&t[11]("end",t[51]).apply(this,arguments)})),wn(kh.call(null,o,{observeKeys:!0}))],c=!0)},p(e,s){t=e,32&s[0]&&i!==(i=`Drag ${t[56]} ${t[50]}`)&&Nn(o,"aria-label",i),32&s[0]&&r!==(r="edge"===t[56]?-1:0)&&Nn(o,"tabindex",r),32&s[0]&&n!==(n=t[56])&&Nn(o,"data-control",n),32&s[0]&&a!==(a=t[53])&&Nn(o,"data-selected",a),32&s[0]&&Zn(o,"cursor",t[54]?t[54]+"-resize":"move"),64&s[0]&&Zn(o,"opacity",t[6]),32&s[0]&&Zn(o,"--tx",t[52].x),32&s[0]&&Zn(o,"--ty",t[52].y),32&s[0]&&Zn(o,"--r",("edge"===t[56]?t[15]:0)+"rad"),160&s[0]&&Zn(o,"--sx","point"===t[56]?t[7]:t[16].x),160&s[0]&&Zn(o,"--sy","point"===t[56]?t[7]:t[16].y),"edge"===t[56]&&t[4]?p?p.p(t,s):(p=Wy(t),p.c(),p.m(l.parentNode,l)):p&&(p.d(1),p=null)},d(e){e&&Ln(o),e&&Ln(s),p&&p.d(e),e&&Ln(l),c=!1,an(d)}}}function Vy(e){let t,o,i;return{c(){t=Fn("div"),Nn(t,"role","button"),Nn(t,"aria-label","Drag rotator"),Nn(t,"tabindex","0"),Nn(t,"class","PinturaShapeManipulator"),Nn(t,"data-control","rotate"),Zn(t,"transform",`translate3d(${e[0].x}px, ${e[0].y}px, 0) scale(${e[7]}, ${e[7]})`),Zn(t,"opacity",e[6])},m(r,n){An(r,t,n),o||(i=[Wn(t,"nudge",e[13]),wn(sp.call(null,t,{preventDefault:!0})),Wn(t,"interactionstart",e[15]("start")),Wn(t,"interactionupdate",e[15]("move")),Wn(t,"interactionend",e[15]("end")),wn(kh.call(null,t,{observeKeys:!0}))],o=!0)},p(e,o){129&o[0]&&Zn(t,"transform",`translate3d(${e[0].x}px, ${e[0].y}px, 0) scale(${e[7]}, ${e[7]})`),64&o[0]&&Zn(t,"opacity",e[6])},d(e){e&&Ln(t),o=!1,an(i)}}}function Ny(e){let t,o,i;return{c(){t=Fn("div"),Nn(t,"role","button"),Nn(t,"aria-label","Drag scalar"),Nn(t,"tabindex","0"),Nn(t,"class","PinturaShapeManipulator"),Nn(t,"data-control","scale"),Zn(t,"transform",`translate3d(${e[1].x}px, ${e[1].y}px, 0) scale(${e[7]}, ${e[7]})`),Zn(t,"opacity",e[6])},m(r,n){An(r,t,n),o||(i=[Wn(t,"nudge",e[14]),wn(sp.call(null,t,{preventDefault:!0})),Wn(t,"interactionstart",e[16]("start")),Wn(t,"interactionupdate",e[16]("move")),Wn(t,"interactionend",e[16]("end")),wn(kh.call(null,t,{observeKeys:!0}))],o=!0)},p(e,o){130&o[0]&&Zn(t,"transform",`translate3d(${e[1].x}px, ${e[1].y}px, 0) scale(${e[7]}, ${e[7]})`),64&o[0]&&Zn(t,"opacity",e[6])},d(e){e&&Ln(t),o=!1,an(i)}}}function Hy(e){let t,o,i,r=[],n=new Map,a=e[5];const s=e=>e[50];for(let t=0;t<a.length;t+=1){let o=By(e,a,t),i=s(o);n.set(i,r[t]=_y(i,o))}let l=e[2]&&e[0]&&Vy(e),c=e[3]&&e[1]&&Ny(e);return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=On(),l&&l.c(),o=On(),c&&c.c(),i=Bn()},m(e,n){for(let t=0;t<r.length;t+=1)r[t].m(e,n);An(e,t,n),l&&l.m(e,n),An(e,o,n),c&&c.m(e,n),An(e,i,n)},p(e,d){6368&d[0]&&(a=e[5],r=Ba(r,d,s,1,e,a,n,t.parentNode,Da,_y,t,By)),e[2]&&e[0]?l?l.p(e,d):(l=Vy(e),l.c(),l.m(o.parentNode,o)):l&&(l.d(1),l=null),e[3]&&e[1]?c?c.p(e,d):(c=Ny(e),c.c(),c.m(i.parentNode,i)):c&&(c.d(1),c=null)},i:en,o:en,d(e){for(let t=0;t<r.length;t+=1)r[t].d(e);e&&Ln(t),l&&l.d(e),e&&Ln(o),c&&c.d(e),e&&Ln(i)}}}function jy(e,t,o){let i,r,n,a;const s=sa(),l=.5*J,c=K-l,d=K+l,u=-K,p=u-l,h=u+l,m=q-l,g=-q+l,$=l,f=-l,y=K-J,b=y-l,x=y+l,v=q-J,w=v-l,S=v+l,k=u-J,C=k+l,T=k-l,M=u+J,P=M+l,R=M-l;let{visible:I=!1}=t,{points:E=[]}=t,{rotatorPoint:A}=t,{scalarPoint:L}=t,{selectedPoint:F}=t,{enableDragEdges:z=!0}=t,{enableDragPoints:D=!0}=t,{enableRotatePoints:O=!0}=t,{enableScalePoints:B=!0}=t;const W=ca("isAnimated");hn(e,W,(e=>o(21,r=e)));const _=xc(.5,{precision:1e-4,stiffness:.3,damping:.7});hn(e,_,(e=>o(7,a=e)));const V=xc(0,{precision:.001,stiffness:.3,damping:.7});hn(e,V,(e=>o(6,n=e)));const N=e=>{let t="";return(e<=d&&e>=c||e>=p&&e<=h)&&(t="ns"),(e<=g||e>=m||e>=f&&e<=$)&&(t="ew"),(e>=w&&e<=S||e<=P&&e>=R)&&(t="nesw"),(e>=b&&e<=x||e<=C&&e>=T)&&(t="nwse"),t},H=(e,t)=>{s("resizestart",{indexes:e,translation:he(),isNudge:!0}),s("resizemove",{indexes:e,translation:t,isNudge:!0}),s("resizeend",{indexes:e,translation:he(),isNudge:!0})};return e.$$set=e=>{"visible"in e&&o(4,I=e.visible),"points"in e&&o(17,E=e.points),"rotatorPoint"in e&&o(0,A=e.rotatorPoint),"scalarPoint"in e&&o(1,L=e.scalarPoint),"selectedPoint"in e&&o(18,F=e.selectedPoint),"enableDragEdges"in e&&o(19,z=e.enableDragEdges),"enableDragPoints"in e&&o(20,D=e.enableDragPoints),"enableRotatePoints"in e&&o(2,O=e.enableRotatePoints),"enableScalePoints"in e&&o(3,B=e.enableScalePoints)},e.$$.update=()=>{2097168&e.$$.dirty[0]&&_.set(I?1:.5,{hard:!1===r}),2097168&e.$$.dirty[0]&&V.set(I?1:0,{hard:!1===r}),131072&e.$$.dirty[0]&&o(5,i=((e,t)=>{let o=0;const i=Le(e),r=[],n=e.length;for(;o<n;o++){const t=Oy(o-1,e),n=Oy(o+1,e),a=e[t],s=e[o],l=e[n],c=Math.atan2(l.y-s.y,l.x-s.x);if(D){const e=xe(me(a.x-s.x,a.y-s.y)),t=xe(me(l.x-s.x,l.y-s.y)),i=me(e.x+t.x,e.y+t.y),n=z?D&&N(Math.atan2(i.y,i.x)):void 0;r.push({index:[o],key:"point-"+o,type:"point",selected:F===o,scale:{x:1,y:1},translate:{x:s.x,y:s.y},angle:void 0,rotate:O,center:s,dir:n})}if(!z)continue;if(Array.isArray(z)&&!z.some((([e,t])=>o===e&&n===t)))continue;const d=me(s.x+.5*(l.x-s.x),s.y+.5*(l.y-s.y));r.push({index:[o,n],key:"edge-"+o,type:"edge",scale:{x:Ee(s,l),y:1},translate:{x:s.x,y:s.y},angle:c,rotate:c,center:d,visible:Array.isArray(z),dir:N(Math.atan2(i.y-d.y,i.x-d.x))})}return r})(E))},[A,L,O,B,I,i,n,a,W,_,V,(e,t)=>({detail:o})=>{const i=o&&o.translation?o.translation:me(0,0);s("resize"+e,{...o,indexes:t,translation:i})},H,({detail:e})=>{s("rotatestart",{translation:he(),isNudge:!0}),s("rotatemove",{translation:e,isNudge:!0}),s("rotateend",{translation:he(),isNudge:!0})},({detail:e})=>{s("scalestart",{translation:he(),isNudge:!0}),s("scalemove",{translation:e,isNudge:!0}),s("scaleend",{translation:he(),isNudge:!0})},e=>({detail:t})=>{const o=t&&t.translation?t.translation:me(0,0);s("rotate"+e,{...t,translation:o})},e=>({detail:t})=>{const o=t&&t.translation?t.translation:me(0,0);s("scale"+e,{...t,translation:o})},E,F,z,D,r,(e,{detail:t})=>H(e,t)]}class Uy extends Ga{constructor(e){super(),Ua(this,e,jy,Hy,ln,{visible:4,points:17,rotatorPoint:0,scalarPoint:1,selectedPoint:18,enableDragEdges:19,enableDragPoints:20,enableRotatePoints:2,enableScalePoints:3},null,[-1,-1])}}var Gy=(e,t)=>{const o=um(e);return Ce(o,t)},Zy=e=>document.createTextNode(e),Xy=e=>(Qt()&&e.endsWith("<div><br></div>")?e.replace(/<div><br><\/div>$/,"<br><br>"):e).replace(/<div><br><\/div>/g,"<br>").replace(/<\/div>/g,"").replace(/<div>/g,"<br>");function Yy(e){let t,o,i,r;return{c(){t=Fn("pre"),Nn(t,"class","PinturaContentEditable")},m(n,a){An(n,t,a),t.innerHTML=e[0],i||(r=wn(o=id.call(null,t,e[7]+";position:absolute;z-index:-1;pointer-events:none;")),i=!0)},p(e,i){1&i[0]&&(t.innerHTML=e[0]),o&&sn(o.update)&&128&i[0]&&o.update.call(null,e[7]+";position:absolute;z-index:-1;pointer-events:none;")},d(e){e&&Ln(t),i=!1,r()}}}function qy(e){let t,o,i,r,n,a,s=e[8]&&Yy(e);return{c(){s&&s.c(),t=On(),o=Fn("pre"),Nn(o,"class","PinturaContentEditable"),Nn(o,"data-wrap-content",i=e[4]||e[5]?"wrap":"nowrap"),Nn(o,"contenteditable",""),Nn(o,"spellcheck",e[1]),Nn(o,"autocorrect",e[2]),Nn(o,"autocapitalize",e[3])},m(i,l){s&&s.m(i,l),An(i,t,l),An(i,o,l),e[26](o),n||(a=[wn(r=id.call(null,o,e[8]?e[15](e[7]):e[7])),Wn(o,"input",e[13]),Wn(o,"compositionend",e[12]),Wn(o,"paste",e[14]),Wn(o,"keydown",e[10]),Wn(o,"keyup",e[11]),Wn(o,"blur",e[9])],n=!0)},p(e,n){e[8]?s?s.p(e,n):(s=Yy(e),s.c(),s.m(t.parentNode,t)):s&&(s.d(1),s=null),48&n[0]&&i!==(i=e[4]||e[5]?"wrap":"nowrap")&&Nn(o,"data-wrap-content",i),2&n[0]&&Nn(o,"spellcheck",e[1]),4&n[0]&&Nn(o,"autocorrect",e[2]),8&n[0]&&Nn(o,"autocapitalize",e[3]),r&&sn(r.update)&&384&n[0]&&r.update.call(null,e[8]?e[15](e[7]):e[7])},i:en,o:en,d(i){s&&s.d(i),i&&Ln(t),i&&Ln(o),e[26](null),n=!1,an(a)}}}function Ky(e,t,o){let i,r,{spellcheck:a="false"}=t,{autocorrect:s="off"}=t,{autocapitalize:l="off"}=t,{wrapLines:c=!0}=t,{allowNewline:d=!0}=t,{textFormat:u="text"}=t,{formatInput:p=Y}=t,{formatPaste:h=Y}=t,{styles:m}=t,{innerHTML:g}=t,{oninput:f=n}=t,{enableTextStyleShortcuts:y=!1}=t;const b=()=>{if(!v)return;const e=document.createRange();e.selectNodeContents(v);const t=P();t.removeAllRanges(),t.addRange(e)},x=sa();let v;document.execCommand("defaultParagraphSeparator",!1,"br");const w=e=>e.replace(/<\/?(?:i|b|em|u|s|strike|strong|font)>/,"").replace(/style=".*?"/g,"").replace(/\n/gim,"<br>"),S=()=>{o(0,g=v.innerHTML);const e=Xy(g);x("input",e),f(e),requestAnimationFrame((()=>v&&v.scrollTo(0,0)))},k=()=>{R(v);const e="html"===u?v.innerHTML:w(v.innerHTML);o(6,v.innerHTML=p(e),v),I(v),S()},C={b:"bold",i:"italic",u:"underline",s:"strikethrough"},T=e=>{const t=$("span");return t.dataset.bookmark=e,t},M=(e,t,o)=>{const i=T(o);if(e.nodeType===Node.TEXT_NODE){const r=e.textContent;if("start"===o){const o=Zy(r.substring(0,t)),n=Zy(r.substring(t));e.replaceWith(o,i,n)}else{const o=Zy(r.substring(0,t)),n=Zy(r.substring(t));e.replaceWith(o,i,n)}}else e.nodeType===Node.ELEMENT_NODE&&e.insertBefore(i,e.childNodes[t])},P=()=>{const e=v.getRootNode();return"getSelection"in e?e.getSelection():document.getSelection()},R=e=>{const t=P();if(!t.getRangeAt||!t.rangeCount)return;const o=t.getRangeAt(0),{startOffset:i,endOffset:r,startContainer:n,endContainer:a}=o;if(e.contains(o.startContainer)&&e.contains(o.endContainer))if(n.nodeType===Node.TEXT_NODE&&n===a){const e=n.textContent,t=e.substring(0,i),o=T("start"),a=r-i>0?e.substring(i,r):"",s=T("end"),l=e.substring(r);n.replaceWith(t,o,a,s,l)}else M(n,i,"start"),M(a,r+(n===a?1:0),"end")},I=e=>{const t=E(e,"start"),o=E(e,"end");if(!t||!o)return;const i=document.createRange();i.setStart(t,0),i.setEnd(o,0);const r=P();r.removeAllRanges(),r.addRange(i),t.remove(),o.remove()},E=(e,t)=>{const o=e.children;for(let e=0;e<o.length;e++){const i=o[e];if(i.dataset.bookmark===t)return i;if(i.children.length){const e=E(i,t);if(e)return e}}};let A;return e.$$set=e=>{"spellcheck"in e&&o(1,a=e.spellcheck),"autocorrect"in e&&o(2,s=e.autocorrect),"autocapitalize"in e&&o(3,l=e.autocapitalize),"wrapLines"in e&&o(4,c=e.wrapLines),"allowNewline"in e&&o(5,d=e.allowNewline),"textFormat"in e&&o(16,u=e.textFormat),"formatInput"in e&&o(17,p=e.formatInput),"formatPaste"in e&&o(18,h=e.formatPaste),"styles"in e&&o(19,m=e.styles),"innerHTML"in e&&o(0,g=e.innerHTML),"oninput"in e&&o(20,f=e.oninput),"enableTextStyleShortcuts"in e&&o(21,y=e.enableTextStyleShortcuts)},e.$$.update=()=>{var t;if(64&e.$$.dirty[0]&&o(25,i=!!v),33554433&e.$$.dirty[0]&&i&&g&&(t=g)!==v.innerHTML&&(o(6,v.innerHTML=t,v),v===document.activeElement&&b()),524336&e.$$.dirty[0])if(!c&&d){const e=m.includes(":right")?"text-indent:-100px!important":m.includes(":center")?"":"min-width:calc(100% + 100px)!important";o(7,A=m+";overflow:visible;"+e)}else o(7,A=m);524288&e.$$.dirty[0]&&o(8,r=m.includes("text-stroke"))},[g,a,s,l,c,d,v,A,r,()=>{x("blur")},e=>{if(/escape/i.test(e.code))return e.stopPropagation(),void x("cancel");const t=e.ctrlKey||e.metaKey;if("html"===u&&t&&/b|i|u|s/.test(e.key))return y&&(e=>{const t=C[e];t&&document.execCommand(t)})(e.key),void e.preventDefault();/enter/i.test(e.code)&&(e.stopPropagation(),e.isComposing||(t?x("confirm"):(d||e.preventDefault(),document.execCommand("insertLineBreak"),e.preventDefault())))},()=>{},e=>{""!==e.data&&k()},e=>{const{inputType:t}=e;"insertCompositionText"!==t&&"deleteCompositionText"!==t&&k()},e=>{e.preventDefault();const t=e.clipboardData.getData("text/plain"),o="html"===u?t:w(t),i=h(o);if(!i.length)return;const r=P().getRangeAt(0);r.deleteContents(),r.insertNode(document.createTextNode(i)),S()},e=>e.replace("-webkit-text-stroke","--text-stroke").replace("text-shadow","--text-shadow"),u,p,h,m,f,y,()=>k(),()=>v&&v.focus(),b,i,function(e){pa[e?"unshift":"push"]((()=>{v=e,o(6,v)}))}]}class Jy extends Ga{constructor(e){super(),Ua(this,e,Ky,qy,ln,{spellcheck:1,autocorrect:2,autocapitalize:3,wrapLines:4,allowNewline:5,textFormat:16,formatInput:17,formatPaste:18,styles:19,innerHTML:0,oninput:20,enableTextStyleShortcuts:21,confirm:22,focus:23,select:24},null,[-1,-1])}get spellcheck(){return this.$$.ctx[1]}set spellcheck(e){this.$$set({spellcheck:e}),ka()}get autocorrect(){return this.$$.ctx[2]}set autocorrect(e){this.$$set({autocorrect:e}),ka()}get autocapitalize(){return this.$$.ctx[3]}set autocapitalize(e){this.$$set({autocapitalize:e}),ka()}get wrapLines(){return this.$$.ctx[4]}set wrapLines(e){this.$$set({wrapLines:e}),ka()}get allowNewline(){return this.$$.ctx[5]}set allowNewline(e){this.$$set({allowNewline:e}),ka()}get textFormat(){return this.$$.ctx[16]}set textFormat(e){this.$$set({textFormat:e}),ka()}get formatInput(){return this.$$.ctx[17]}set formatInput(e){this.$$set({formatInput:e}),ka()}get formatPaste(){return this.$$.ctx[18]}set formatPaste(e){this.$$set({formatPaste:e}),ka()}get styles(){return this.$$.ctx[19]}set styles(e){this.$$set({styles:e}),ka()}get innerHTML(){return this.$$.ctx[0]}set innerHTML(e){this.$$set({innerHTML:e}),ka()}get oninput(){return this.$$.ctx[20]}set oninput(e){this.$$set({oninput:e}),ka()}get enableTextStyleShortcuts(){return this.$$.ctx[21]}set enableTextStyleShortcuts(e){this.$$set({enableTextStyleShortcuts:e}),ka()}get confirm(){return this.$$.ctx[22]}get focus(){return this.$$.ctx[23]}get select(){return this.$$.ctx[24]}}const Qy=["i","b","u","strike"].map((e=>({tag:e,tagOpen:new RegExp(`<${e}>`,"g"),tagClose:new RegExp(`</${e}>`,"g"),placeholderOpen:new RegExp(`___${e}O___`,"g"),placeholderClose:new RegExp(`___${e}C___`,"g")})));var eb=e=>e=((e,t=Qy)=>(t.forEach((({tag:t,placeholderOpen:o,placeholderClose:i})=>{e=e.replace(o,`<${t}>`).replace(i,`</${t}>`)})),e))(e=(e=((e,t=Qy)=>(t.forEach((({tag:t,tagOpen:o,tagClose:i})=>{e=e.replace(o,`___${t}O___`).replace(i,`___${t}C___`)})),e))(e)).replace(/ {2,}/g," ").replace(/\u00a0/g," ").split("\n").join("<br>")),tb=(e,t)=>m(e)?parseFloat(e)/100*t:e,ob=(e,t)=>({x:Zo(e.x,t.width),y:Zo(e.y,t.height)});function ib(e,t,o){const i=e.slice();return i[316]=t[o],i[318]=o,i}function rb(e,t){let o,i,r,n,a,s,l,c,d,u,p,h=t[316].name+"";function m(){return t[197](t[318])}return r=new zp({props:{color:t[316].color}}),{key:e,first:null,c(){o=Fn("li"),i=Fn("button"),Na(r.$$.fragment),n=On(),a=Fn("span"),s=Dn(h),c=On(),Nn(i,"class","PinturaShapeListItem"),Nn(i,"type","button"),Nn(i,"aria-label",l="Select shape "+t[316].name),this.first=o},m(e,t){An(e,o,t),Rn(o,i),Ha(r,i,null),Rn(i,n),Rn(i,a),Rn(a,s),Rn(o,c),d=!0,u||(p=Wn(i,"click",m),u=!0)},p(e,o){t=e;const n={};8388608&o[0]&&(n.color=t[316].color),r.$set(n),(!d||8388608&o[0])&&h!==(h=t[316].name+"")&&Un(s,h),(!d||8388608&o[0]&&l!==(l="Select shape "+t[316].name))&&Nn(i,"aria-label",l)},i(e){d||(Ea(r.$$.fragment,e),d=!0)},o(e){Aa(r.$$.fragment,e),d=!1},d(e){e&&Ln(o),ja(r),u=!1,p()}}}function nb(e){let t,o;return t=new Uy({props:{visible:!0,points:e[13],rotatorPoint:e[31],scalarPoint:e[30],selectedPoint:e[18],enableDragEdges:e[19],enableDragPoints:e[33],enableRotatePoints:e[17],enableScalePoints:e[15]}}),t.$on("resizestart",e[42]),t.$on("resizemove",e[43]),t.$on("resizeend",e[44]),t.$on("rotatestart",e[45]),t.$on("rotatemove",e[46]),t.$on("rotateend",e[47]),t.$on("scalestart",e[48]),t.$on("scalemove",e[49]),t.$on("scaleend",e[50]),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};8192&o[0]&&(i.points=e[13]),1&o[1]&&(i.rotatorPoint=e[31]),1073741824&o[0]&&(i.scalarPoint=e[30]),262144&o[0]&&(i.selectedPoint=e[18]),524288&o[0]&&(i.enableDragEdges=e[19]),4&o[1]&&(i.enableDragPoints=e[33]),131072&o[0]&&(i.enableRotatePoints=e[17]),32768&o[0]&&(i.enableScalePoints=e[15]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function ab(e){let t,o,i,r;const n=[lb,sb],a=[];function s(e,t){return"modal"===e[4]?0:"inline"===e[4]?1:-1}return~(t=s(e))&&(o=a[t]=n[t](e)),{c(){o&&o.c(),i=Bn()},m(e,o){~t&&a[t].m(e,o),An(e,i,o),r=!0},p(e,r){let l=t;t=s(e),t===l?~t&&a[t].p(e,r):(o&&(Ra(),Aa(a[l],1,1,(()=>{a[l]=null})),Ia()),~t?(o=a[t],o?o.p(e,r):(o=a[t]=n[t](e),o.c()),Ea(o,1),o.m(i.parentNode,i)):o=null)},i(e){r||(Ea(o),r=!0)},o(e){Aa(o),r=!1},d(e){~t&&a[t].d(e),e&&Ln(i)}}}function sb(e){let t,o,i,r,n,a,s={formatInput:e[52],wrapLines:!!e[14].width,textFormat:e[14].format,enableTextStyleShortcuts:e[5],allowNewline:e[32],styles:e[29]};return o=new Jy({props:s}),e[201](o),o.$on("input",e[53]),o.$on("keyup",e[57]),o.$on("cancel",e[59]),o.$on("confirm",e[58]),{c(){t=Fn("div"),Na(o.$$.fragment),Nn(t,"class","PinturaInlineInput")},m(s,l){An(s,t,l),Ha(o,t,null),r=!0,n||(a=[wn(i=id.call(null,t,e[28])),Wn(t,"focusout",e[202])],n=!0)},p(e,t){const r={};16384&t[0]&&(r.wrapLines=!!e[14].width),16384&t[0]&&(r.textFormat=e[14].format),32&t[0]&&(r.enableTextStyleShortcuts=e[5]),2&t[1]&&(r.allowNewline=e[32]),536870912&t[0]&&(r.styles=e[29]),o.$set(r),i&&sn(i.update)&&268435456&t[0]&&i.update.call(null,e[28])},i(e){r||(Ea(o.$$.fragment,e),r=!0)},o(e){Aa(o.$$.fragment,e),r=!1},d(i){i&&Ln(t),e[201](null),ja(o),n=!1,an(a)}}}function lb(e){let t,o;return t=new Uh({props:{panelOffset:e[2],onconfirm:e[58],oncancel:e[59],buttonCancel:{icon:e[6].shapeIconInputCancel,label:e[6].shapeLabelInputCancel},buttonConfirm:{icon:e[6].shapeIconInputConfirm,label:e[6].shapeLabelInputConfirm,hideLabel:!0},willHandleKeydown:e[200],$$slots:{default:[cb]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};4&o[0]&&(i.panelOffset=e[2]),64&o[0]&&(i.buttonCancel={icon:e[6].shapeIconInputCancel,label:e[6].shapeLabelInputCancel}),64&o[0]&&(i.buttonConfirm={icon:e[6].shapeIconInputConfirm,label:e[6].shapeLabelInputConfirm,hideLabel:!0}),2048&o[0]&&(i.willHandleKeydown=e[200]),671088896&o[0]|512&o[10]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function cb(e){let t,o,i,r;return{c(){t=Fn("textarea"),Nn(t,"spellcheck","false"),Nn(t,"autocorrect","off"),Nn(t,"autocapitalize","off")},m(n,a){An(n,t,a),e[198](t),Gn(t,e[27]),i||(r=[Wn(t,"keydown",e[55]),Wn(t,"keypress",e[54]),Wn(t,"keyup",e[57]),Wn(t,"input",e[53]),Wn(t,"input",e[199]),wn(o=id.call(null,t,e[29]))],i=!0)},p(e,i){134217728&i[0]&&Gn(t,e[27]),o&&sn(o.update)&&536870912&i[0]&&o.update.call(null,e[29])},d(o){o&&Ln(t),e[198](null),i=!1,an(r)}}}function db(e){let t,o,i,r,n;return o=new mh({props:{items:e[24],key:e[10]}}),{c(){t=Fn("div"),Na(o.$$.fragment),Nn(t,"class","PinturaShapeControls"),Zn(t,"transform",e[26]),Zn(t,"opacity",e[25])},m(a,s){An(a,t,s),Ha(o,t,null),i=!0,r||(n=[Wn(t,"measure",e[203]),wn(Dc.call(null,t))],r=!0)},p(e,i){const r={};16777216&i[0]&&(r.items=e[24]),1024&i[0]&&(r.key=e[10]),o.$set(r),67108864&i[0]&&Zn(t,"transform",e[26]),33554432&i[0]&&Zn(t,"opacity",e[25])},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Ln(t),ja(o),r=!1,an(n)}}}function ub(e){let t,o,i,r,a,s,l,c,d,u,p=[],h=new Map,m=e[23];const g=e=>e[316].id;for(let t=0;t<m.length;t+=1){let o=ib(e,m,t),i=g(o);h.set(i,p[t]=rb(i,o))}let $=e[16]&&nb(e),f=e[12]&&ab(e),y=e[20]>0&&db(e);return{c(){t=Fn("div"),o=Fn("nav"),i=Fn("ul");for(let e=0;e<p.length;e+=1)p[e].c();r=On(),$&&$.c(),a=On(),f&&f.c(),s=On(),y&&y.c(),Nn(o,"class","PinturaShapeList"),Nn(o,"data-visible",e[21]),Nn(t,"class","PinturaShapeEditor"),Nn(t,"tabindex","0")},m(h,m){An(h,t,m),Rn(t,o),Rn(o,i);for(let e=0;e<p.length;e+=1)p[e].m(i,null);Rn(t,r),$&&$.m(t,null),Rn(t,a),f&&f.m(t,null),Rn(t,s),y&&y.m(t,null),e[204](t),c=!0,d||(u=[Wn(o,"focusin",e[62]),Wn(o,"focusout",e[63]),Wn(t,"keydown",(function(){sn(e[0]?n:e[51])&&(e[0]?n:e[51]).apply(this,arguments)})),Wn(t,"nudge",(function(){sn(e[0]?n:e[61])&&(e[0]?n:e[61]).apply(this,arguments)})),Wn(t,"measure",e[196]),Wn(t,"pointermove",(function(){sn(e[0]?n:e[64])&&(e[0]?n:e[64]).apply(this,arguments)})),Wn(t,"pointerleave",(function(){sn(e[0]?n:e[65])&&(e[0]?n:e[65]).apply(this,arguments)})),Wn(t,"interactionstart",(function(){sn(e[0]?n:e[36])&&(e[0]?n:e[36]).apply(this,arguments)})),Wn(t,"interactionupdate",(function(){sn(e[0]?n:e[38])&&(e[0]?n:e[38]).apply(this,arguments)})),Wn(t,"interactioncancel",(function(){sn(e[0]?n:e[37])&&(e[0]?n:e[37]).apply(this,arguments)})),Wn(t,"interactionrelease",(function(){sn(e[0]?n:e[39])&&(e[0]?n:e[39]).apply(this,arguments)})),Wn(t,"interactionend",(function(){sn(e[0]?n:e[40])&&(e[0]?n:e[40]).apply(this,arguments)})),wn(Dc.call(null,t)),wn(sp.call(null,t)),wn(l=kh.call(null,t,{drag:!0,inertia:!0,multiTouch:!1,observeKeys:!0,shouldStartInteraction:mb,getEventPosition:e[205]}))],d=!0)},p(r,n){e=r,8388738&n[0]&&(m=e[23],Ra(),p=Ba(p,n,g,1,e,m,h,i,Oa,rb,null,ib),Ia()),(!c||2097152&n[0])&&Nn(o,"data-visible",e[21]),e[16]?$?($.p(e,n),65536&n[0]&&Ea($,1)):($=nb(e),$.c(),Ea($,1),$.m(t,a)):$&&(Ra(),Aa($,1,1,(()=>{$=null})),Ia()),e[12]?f?(f.p(e,n),4096&n[0]&&Ea(f,1)):(f=ab(e),f.c(),Ea(f,1),f.m(t,s)):f&&(Ra(),Aa(f,1,1,(()=>{f=null})),Ia()),e[20]>0?y?(y.p(e,n),1048576&n[0]&&Ea(y,1)):(y=db(e),y.c(),Ea(y,1),y.m(t,null)):y&&(Ra(),Aa(y,1,1,(()=>{y=null})),Ia()),l&&sn(l.update)&&8&n[0]&&l.update.call(null,{drag:!0,inertia:!0,multiTouch:!1,observeKeys:!0,shouldStartInteraction:mb,getEventPosition:e[205]})},i(e){if(!c){for(let e=0;e<m.length;e+=1)Ea(p[e]);Ea($),Ea(f),Ea(y),c=!0}},o(e){for(let e=0;e<p.length;e+=1)Aa(p[e]);Aa($),Aa(f),Aa(y),c=!1},d(o){o&&Ln(t);for(let e=0;e<p.length;e+=1)p[e].d();$&&$.d(),f&&f.d(),y&&y.d(),e[204](null),d=!1,an(u)}}}const pb=256,hb="markup-hover",mb=(e,t)=>e.target===t||"PinturaContentEditable"===e.target.className;function gb(e,t,o){let i,r,a,s,l,c,d,u,p,h,g,$,f,y,b,x,v,w,S,k,C,T,M,P,R,I,E,A,F,z,D,B,W,_,V,N,H,j,U,G,Z,X,q,K,J,Q,ee,te,oe,ie,re,ne,ae,se,le,ce,ue,ge,fe,be,Te,Pe,Re,Ae,De,Oe,We=en,_e=()=>(We(),We=un(Ue,(e=>o(192,Pe=e))),Ue);e.$$.on_destroy.push((()=>We()));let{uid:Ve=L()}=t,{ui:He}=t,{disabled:je=!1}=t,{shapes:Ue}=t;_e();let{selection:Ge}=t,{offset:Ze}=t,{contextRotation:qe=0}=t,{contextFlipX:Je=!1}=t,{contextFlipY:Qe=!1}=t,{contextZoom:et=1}=t,{active:tt=!1}=t,{opacity:ot=1}=t,{parentRect:it}=t,{rootRect:st}=t,{utilRect:dt}=t,{hoverColor:ut}=t,{caretColor:pt}=t,{gridColor:ht}=t,{snapColor:mt}=t,{textInputMode:gt="inline"}=t,{oninteractionstart:$t=n}=t,{oninteractionupdate:ft=n}=t,{oninteractionrelease:yt=n}=t,{oninteractionend:xt=n}=t,{oninteractioncancel:vt=n}=t,{onaddshape:wt=n}=t,{onupdateshape:Tt=n}=t,{onselectshape:Mt=n}=t,{onblurshape:Pt=n}=t,{onremoveshape:Rt=n}=t,{ontapshape:It=n}=t,{onhovershape:Et=n}=t,{ontriggerhistorywrite:Ft=n}=t,{onhovercanvas:Dt=n}=t,{ontapcanvas:Ot=n}=t,{onleavecanvas:Ht=n}=t,{beforeSelectShape:jt=(()=>!0)}=t,{beforeDeselectShape:Ut=(()=>!0)}=t,{beforeRemoveShape:Gt=(()=>!0)}=t,{beforeUpdateShape:Zt=((e,t,o)=>t)}=t,{willRenderShapeControls:Xt=Y}=t,{willRenderShapeTextControls:Yt=Y}=t,{willStartInteraction:qt=((e,t)=>!0)}=t,{mapEditorPointToImagePoint:Kt}=t,{mapImagePointToEditorPoint:Jt}=t,{eraseRadius:Qt}=t,{selectRadius:eo}=t,{enableButtonFlipVertical:to=!1}=t,{enableTapToAddText:oo=!0}=t,{enableMultiSelect:io=!1}=t,{enableTextStyleControls:ro=!0}=t,{locale:no}=t,{snapThreshold:ao=0}=t,{snapPointer:so=!0}=t,{enableSnapToContext:lo=!0}=t,{gridSize:co=0}=t;const uo=e=>{if(0===ao)return[];let t;return lo&&(t={...it,x:0,y:0}),[...Pe.filter((t=>t!==e)).filter((e=>!Bi(e))).filter((e=>(e=>!0!==e.disableAcceptSnap)(e))).map((e=>vr({...e},it))),t].filter(Boolean)},po=(e,t,o,i)=>0===e?{snapTargets:[]}:{snapThreshold:e,gridSize:t,gridRect:o,snapTargets:uo(i)},ho=ca("isAnimated");hn(e,ho,(e=>o(193,Ae=e)));const mo=ca("softKeyboardState"),go=e=>e.set(pn(e)),$o=e=>pn(e).find(Bi),fo=(e,t)=>{if(!$o(t))return Hi(e),vo(e,t)},yo=e=>{$o(e)&&e.update((e=>e.filter((e=>!Bi(e)))))},bo=e=>{const t=$o(e);if(t)return ji(t),go(e),t},xo=(e,t,o=((e,t)=>({...e,...t})))=>{$o(t)&&t.update((t=>t.map((t=>Bi(t)?o(t,e):t))))},vo=(e,t=Ue)=>(t.update((t=>[...t,e])),e),wo=(e,t,o)=>{const i=Zt({...e},t,{...o});return Cr(e,i,o),e},So=(e,t)=>{const o=Ee(e,t),i=ve(e,t),r=Math.PI/8,n=r*Math.round(i/r)-qe%r;t.x=e.x+o*Math.cos(n),t.y=e.y+o*Math.sin(n)},ko=ca("keysPressed");hn(e,ko,(e=>o(194,De=e)));const Co=(e,t,o)=>0===e||t&&o?e:t||o?-e:e,To=e=>{if(null===e.x&&null===e.y)return Mo();e.x&&o(148,Po=Kt({x:e.x,y:0}).x),e.y&&o(149,Ro=Kt({x:0,y:e.y}).y)},Mo=()=>{o(148,Po=null),o(149,Ro=null)};let Po=null,Ro=null;const Io=(e,t)=>{const o=Jt(e);return Kt(ke(o,t))},Eo=(e,t,o)=>{const i=(o-t)/e+1;return Array.from({length:i},((o,i)=>t+i*e))},Ao=e=>{let t=[],o=[],i=e.points;if(void 0!==e.x1&&(i=[{x:e.x1,y:e.y1},{x:e.x2,y:e.y2}]),i){const e=i.map(Jt),r=nt(e),n=e[0],a=e[e.length-1];t=[r.x,r.x+.5*r.width,r.x+r.width,n.x,a.x],o=[r.y,r.y+.5*r.height,r.y+r.height,n.y,a.y]}else if(e.text||void 0!==e.width||void 0!==e.rx){let i;if(e.text&&void 0===e.height){const t=li(e.text,e);i=lt(e.x,e.y,t.width,t.height)}else i=void 0!==e.width?rt(e):rt({x:e.x-e.rx,y:e.y-e.ry,width:2*e.rx,height:2*e.ry});const r=Ct(i).map(Jt),n=Math.abs(e.rotation)>0?bt(i,e.rotation).map(Jt):r,a=nt(n),s=ct(a),l=.5*a.width,c=.5*a.height;t=[s.x-l,s.x,s.x+l],o=[s.y-c,s.y,s.y+c]}else if(void 0!==e.x){const i=Jt(e);t=[i.x],o=[i.y]}return{x:t,y:o}},Lo=(e,t,o)=>{let i,r,n,a=Number.Infinity,s=null,l=null;for(let c=0;c<e.length;c++){r=e[c];for(let e=0;e<t.length;e++)n=t[e],i=Math.abs(r-n),i<o&&(null===l||i<a)&&(a=i,s=r,l=n)}return{origin:s,target:l}},Fo=(e,t,o,i,r)=>{const n={x:null,y:null},a={x:null,y:null},s=t.map(Ao);if(i>0){const e=Jt({x:0,y:0}),t=Jt({x:i,y:i}),o=Jt({x:r.width,y:r.height}),n=t.x-e.x,a=Eo(n,e.x,o.x),l=Eo(n,e.y,o.y);s.push({x:a,y:l})}return s.forEach((t=>{const{snapTranslation:i,snapLine:r}=((e,t,o)=>{const i={x:null,y:null},r={x:null,y:null},n=Lo(e.x,t.x,o);null!==n.target&&(i.x=n.target,r.x=n.target-n.origin);const a=Lo(e.y,t.y,o);return null!==a.target&&(i.y=a.target,r.y=a.target-a.origin),{snapTranslation:r,snapLine:i}})(e,t,o);null!==i.x&&(null===a.x||Math.abs(i.x)<Math.abs(a.x))&&(a.x=i.x||0,n.x=r.x),null!==i.y&&(null===a.y||Math.abs(i.y)<Math.abs(a.y))&&(a.y=i.y||0,n.y=r.y)})),{snapTranslation:a,snapLines:n}},zo=(e,t)=>(null!==t.x&&(e.x+=t.x),null!==t.y&&(e.y+=t.y),e),Do=(e,t,o,i)=>{const{snapThreshold:r=0,gridSize:n=0,gridRect:a,snapTargets:s=[]}=i||{};let l=null;if(Ai(e)){if(r){const i=vr({...e},it),l=Io(Ci(t),o),c=Io(Ti(t),o),d=Ao({...i,x1:l.x,y1:l.y,x2:c.x,y2:c.y}),{snapTranslation:u,snapLines:p}=Fo(d,s,r,n,a);zo(o,u),To(p)}const i=Io(Ci(t),o),c=Io(Ti(t),o);l={x1:i.x,y1:i.y,x2:c.x,y2:c.y}}else if(e.points){if(Ji(Si)&&Jo(Si,{selectedPoint:void 0}),r){const i=vr({...e},it),l=Ao({...i,points:t.points.map((e=>Io(e,o)))}),{snapTranslation:c,snapLines:d}=Fo(l,s,r,n,a);zo(o,c),To(d)}l={points:t.points.map((e=>Io(e,o)))}}else if(Ii(e)||Mi(e)||Ei(e)){if(r){const i=vr({...e},it),l=Io(t,o),c=Ao({...i,...l}),{snapTranslation:d,snapLines:u}=Fo(c,s,r,n,a);zo(o,d),To(u)}l=Io(t,o)}l&&(wo(e,l,it),qo())},Bo={0:1,1:0,2:3,3:2},_o={0:3,1:2,2:1,3:0},Vo=(e,t,o,i,r)=>{const{shiftKey:a,snapThreshold:s=0,gridSize:l=0,gridRect:c,snapTargets:d=[],aspectRatio:u,beforeResizeShape:p=n}=r||{},h=s?(e,t,o)=>{const{snapTranslation:i,snapLines:r}=Fo(Ao(e),d,s,l,c);zo(t,i),To(r);const n=Io(o(),t);e.x=n.x,e.y=n.y}:n;if(Ai(e)||Li(e)&&Wo(e,"pathClose")){const[r]=o,n=a?So:(e,t)=>t;let s,l,c;if(Ai(e))0===r?(s=()=>Ci(t),l=e=>n(Ti(t),e),c=(e,t)=>{e.x1=t.x,e.y1=t.y}):1===r&&(s=()=>Ti(t),l=e=>n(Ci(t),e),c=(e,t)=>{e.x2=t.x,e.y2=t.y});else{const e=t.points;s=()=>({...e[r]}),l=t=>{const o=e[Oy(r-1,e)],i=e[Oy(r+1,e)];n(o,t),n(i,t)},c=(e,t)=>e.points=e.points.map(((e,o)=>r===o?t:e))}const d=Io(s(),i);h(d,i,s),l(d),c(e,d)}else if(Wi(e)||Ei(e)||Mi(e)){let n,a=!1,s=!1;if(Ei(t))n=at(t);else if(Wi(t))n=rt(t);else if(Wo(t,"width")){a=!0,n=rt(t);const e=li(t.text,t);n.height=e.height}else{s=!0,n=rt(t);const e=li(t.text,t);n.width=e.width,n.height=e.height}let l=u;e.aspectRatio?l=e.aspectRatio:!r.shiftKey||a||s||(l=n.width/n.height);const c=rt(n),d=ct(c),m=e.rotation,g=Ct(c),$=bt(c,m);if(1===o.length){let t=o[0];e.flipX&&(t=Bo[t]),e.flipY&&(t=_o[t]);const[r,n,a,s]=g,c=Jt($[t]),u=ke({...c},i),f=Kt(u);h(f,i,(()=>Kt(c)));const y=me(f.x-$[t].x,f.y-$[t].y),b=ye($e(y),-m),x=me(g[t].x+b.x,g[t].y+b.y);let v;0===t&&(v=a),1===t&&(v=s),2===t&&(v=r),3===t&&(v=n);const w=nt([v,x]);if(l){const{width:e,height:t}=St(w,l),[o,i,r,n]=kt(w);w.width=e,w.height=t,x.y<v.y&&(w.y=r-t),x.x<v.x&&(w.x=i-e)}const S=bt(w,m,d),k=Le(S),C=ye(S[0],-m,k),T=ye(S[2],-m,k),M=nt([C,T]);p(M),wo(e,Ei(e)?pe(M):M,it)}else{o=o.map((t=>(e.flipX&&(t=Bo[t]),e.flipY&&(t=_o[t]),t)));const[t,r]=o.map((e=>$[e])),n={x:t.x+.5*(r.x-t.x),y:t.y+.5*(r.y-t.y)},[s,c]=o.map((e=>g[e])),[u,p]=o.map((e=>{const t=e+2;return t<4?g[t]:g[t-4]})),f={x:u.x+.5*(p.x-u.x),y:u.y+.5*(p.y-u.y)},y=Jt(n),b=ke({...y},i),x=Kt(b);h(x,i,(()=>Kt(y)));const v=me(x.x-n.x,x.y-n.y),w=ye($e(v),-m),S=Ce($e(s),c),k=Se(S,(e=>1-Math.abs(Math.sign(e)))),C=me(w.x*k.x,w.y*k.y);ke(s,C),ke(c,C);const T=nt(g);if(l){let e=T.width,t=T.height;0===k.y?t=e/l:e=t*l,T.width=e,T.height=t,0===k.y?T.y=f.y-.5*t:T.x=f.x-.5*e}const M=bt(T,m,d),P=Le(M),R=ye(M[0],-m,P),I=ye(M[2],-m,P),E=nt([R,I]);let A;Ei(e)?A=pe(E):Wi(e)?A=E:a&&(A={x:E.x,y:E.y,width:E.width}),wo(e,A,it)}}qo()};let No;const Ho=(e,t)=>{const o=e.points.filter(((e,o)=>o!==t));Jo(e,{points:o,selectedPoint:void 0})},jo=()=>{if(Pe.length)return Pe.find(Bi)},Uo=()=>{if(Pe.length)return Pe.findIndex(Bi)},Go=()=>{const e=jo();if(e)return ji(e),qo(),e},Yo=()=>{if(!jo())return;const e=[...Pe];e.splice(Uo(),1),Ue.set(e)},qo=()=>{Ue.set(Pe)},Ko=(e,t=[],o=!0)=>{t.filter(Boolean).forEach((t=>delete e[t])),o&&qo()},Jo=(e,t,o=!0)=>{e=Object.assign(e,t),o&&qo()},Qo=(e,t,o,i=!0)=>{e[t]=o,i&&qo()},ei=(e,t=!0)=>{Pe.forEach((t=>Jo(t,e,!1))),t&&qo()},ti=()=>[...Pe].reverse().filter(Di),oi=()=>[...Pe].reverse().find(Di),ii=()=>!!oi(),ri=(e,t=!0,o=!1)=>{const i=Pe.filter((e=>Zi(e)&&Gi(e))),r=i.findIndex((t=>t===e));if(!1===((e,t=!1)=>{if(!Gt(e))return!1;Ue.set(Pe.filter((t=>t!==e))),t||Rt(e)})(e,o))return;if(ai=e,i.length-1<=0)return si();if(!t)return!0;const n=r-1<0?i.length-1:r-1;return di(i[n]),!0},ni=()=>{if(s){const e=[];return a.forEach(((t,o)=>{if(!Zi(t))return;ri(t,o===a.length-1,!0)&&e.push(t)})),void(e.length&&Ft())}const e=oi();e&&ri(e)};let ai=void 0;const si=(e={})=>{const{storePrevious:t=!0}=e;Object.keys(jr).forEach((e=>jr[e]={}));const o=ci();t&&(ai=o),ei({isSelected:!1,isEditing:!1,_prerender:!1}),o&&Pt(o)},ci=()=>Pe.find(Di),di=(e,t=!0,o=!1)=>{if(Bi(e))return;const i=ci()||ai,r=Di(e);ai=void 0,jt(i,e)&&(o||si(),(e=>{e.isSelected=!0})(e),!r&&Mt(e),t&&qo())},ui=e=>{zr&&zr.confirm&&e.isEditing&&zr.confirm();const t={isSelected:!1,isEditing:!1,_prerender:!1};e.selectedPoint>-1&&(t.selectedPoint=void 0),Jo(e,t),Pt(e)},pi=e=>{Jo(e,{isSelected:!0,isEditing:!0,_prerender:"inline"===gt})},hi=e=>{Jo(e,{isSelected:!0,isEditing:!1,_prerender:!1})},mi=e=>{if(!e.length)return[];const t=e.filter(Gt);return Ue.set(Pe.filter((e=>!t.includes(e)))),t},gi=e=>{const t=li(e.text,e);return lt(e.x,e.y,e.width?Math.min(e.width,t.width):t.width,e.height?Math.min(e.height,t.height):t.height)},$i=e=>{if(Wi(e))return rt(e);if(Ei(e))return at(e);const t=gi(e);return t.width=Math.max(10,e.width||t.width),t},fi=(e,t,o=0,i=(()=>!0))=>[...e].reverse().filter(i).map((e=>({shape:e,priority:1}))).filter((e=>{const{shape:i}=e,r=vr(xi(i),it),n=o+.5*(r.strokeWidth||0);if(Ii(r))return Nt(t,n,r,i.rotation);if(Mi(r)){const o=$i(r),a=Nt(t,n,o,i.rotation);let s=!1;if(a&&!Di(i)){const a=gi(r);"right"!==i.textAlign||i.flipX||(a.x=o.x+o.width-a.width),"center"===i.textAlign&&(a.x=o.x+.5*o.width-.5*a.width),s=Nt(t,n,a,i.rotation,ct(o)),s||(e.priority=-1)}return a}return Ei(r)?((e,t,o,i,r,n)=>{const a=Bt(me(o.x,o.y),o.rx,o.ry,i,r,n,12);return Vt(e,t,a)})(t,n,r,i.rotation,i.flipX,i.flipY):Ai(r)?Wt(t,Math.max(16,n),Ci(r),Ti(r)):Li(r)&&r.pathClose?Vt(t,n,r.points):!!Li(r)&&(1===r.points.length?Ie(t,r.points[0])<n*n:_t(t,Math.max(16,n),r.points))})).sort(((e,t)=>e.priority<t.priority?1:e.priority>t.priority?-1:0)).map((e=>e.shape)),yi=(e,t,o,i=0)=>{const r=Math.abs(i),n=Ye(t,o),a=Ke(n,r),s=(({start:e,end:t},o)=>{if(0===o)return[me(e.x,e.y),me(e.x,e.y),me(t.x,t.y),me(t.x,t.y)];const i=Math.atan2(t.y-e.y,t.x-e.x),r=Math.sin(i)*o,n=Math.cos(i)*o;return[me(r+e.x,-n+e.y),me(-r+e.x,n+e.y),me(-r+t.x,n+t.y),me(r+t.x,-n+t.y)]})(a,r);return e.filter((e=>{const t=vr(xi(e),it);if(Ai(t)||Li(t)){const e=t.points?[...t.points]:[Ci(t),Ti(t)];return!!At(a,e)}return((e,t)=>!!e.find((e=>Lt(e,t)))||!!t.find((t=>Lt(t,e))))(s,((e,t=12)=>{if(Ii(e))return bt(e,e.rotation,ct(e));if(Mi(e)){const t=$i(e);return bt(t,e.rotation,ct(t))}return Ei(e)?Bt(me(e.x,e.y),e.rx,e.ry,e.rotation,e.flipX,e.flipY,t):[]})(t))}))};let bi=void 0,vi=void 0,wi=void 0,Si=void 0,ki=void 0,zi=void 0,Oi=!1,_i=!1,Vi=!1,Ni=!1,or=void 0;const ir=e=>{or=e.map((e=>({shape:e,shapeOrigin:xi(e),shapeOriginComputed:vr(xi(e),it)})))},rr=()=>{clearTimeout(vi),vi=void 0,o(151,Ni=!1),Mo()};let nr=null;const ar=e=>{const t=Oo(e.rotation)&&0!==e.rotation;if(Ii(e)){if(e.width<1&&e.height<1)return;const o=ct(e),i=Ct(e);return(e.flipX||e.flipY)&&Fe(i,e.flipX,e.flipY,o.x,o.y),t?ze(i,e.rotation,o.x,o.y):i}if(Ei(e)){if(e.rx<1&&e.ry<1)return;const o=e,i=Ct(at(e));return(e.flipX||e.flipY)&&Fe(i,e.flipX,e.flipY,o.x,o.y),t?ze(i,e.rotation,o.x,o.y):i}if(Ai(e))return[Ci(e),Ti(e)];if(Li(e)){if(e.bitmap&&!e.pathClose){const t=nt(e.points);t.x-=.5*e.strokeWidth,t.y-=.5*e.strokeWidth,t.width+=e.strokeWidth,t.height+=e.strokeWidth;return ar({...e,...t})}return[...e.points]}if(Mi(e)){if(e.width<5&&e.height<5)return;const o=$i(e);o.width=Math.max(10,o.width);const i=ct(o),r=Ct(o);return(e.flipX||e.flipY)&&Fe(r,e.flipX,e.flipY,i.x,i.y),t?ze(r,e.rotation,i.x,i.y):r}return[]},sr=e=>{const t=ar(e);let o,i;return e.flipY?(o=Le([t[0],t[1]]),i=xe(me(t[1].x-t[2].x,t[1].y-t[2].y))):(o=Le([t[2],t[3]]),i=xe(me(t[2].x-t[1].x,t[2].y-t[1].y))),Me(i,20/et),{origin:o,dir:i}};const lr=e=>t=>t.id===e,cr=e=>{const t=lr(e);return e=>e.filter((e=>t=>!e(t))(t))},dr=e=>{const t=lr(e),o=cr(e);return()=>He.update((e=>e.some(t)?o(e):e))},ur=e=>{const t=cr(e);return(...e)=>{He.update((o=>[...t(o),...e.filter(Boolean)]))}},pr=dr(hb),mr=ur(hb);let gr;const $r="markup-manipulator-segment-"+Ve,fr=dr($r),yr=ur($r),br=(e,t)=>{const o=e[t],i=t-1<0?e[e.length-1]:e[t-1],r=t+1<e.length?e[t+1]:e[0],n=Ce($e(i),o);xe(n);const a=ke(Me(n,10),o),s=Ce($e(r),o);xe(s);return[a,o,ke(Me(s,10),o)]},xr=()=>{o(152,gr=void 0),pr()},wr="markup-multi-selection-segment-"+Ve,Sr=dr(wr),Tr=ur(wr),Mr=(e,t)=>{if(ao<=0)return e;if(t)return Mo(),e;const o=Kt(e),r=uo(),{snapTranslation:n,snapLines:a}=Fo(Ao(o),r,ao,co,i);return To(a),zo(e,n),e},Pr=xc(0);hn(e,Pr,(e=>o(195,Oe=e)));const Rr="markup-grid-line-"+Ve,Ir=dr(Rr),Er=ur(Rr),Ar="markup-snap-line",Lr=dr(Ar),Fr=ur(Ar);let zr;mo.subscribe((e=>{"inline"===gt&&r&&r.isEditing&&"hidden"===e&&_r()}));const Dr=e=>{o(8,zr.innerHTML=eb(e),zr)},Or=e=>{const t=void 0===e.value?e.innerHTML:e.value,o="text"===r.format?Xy(t).split(/<br>|<br\/>/g).join("\n").replace(/ /g,String.fromCharCode(160)).replace(/&/g,"&"):t;return Pi(r)&&!1!==r.disableNewline?(e=>{const t=e.split(/[\n\r]/g);return t.length>1?t.map((e=>e.trim())).filter((e=>e.length)).join(" "):t[0]})(o):o},Br=()=>{const e=Or(zr),t=qi(r,e),o=!0===t?e:t;let i=H.x,n=H.y;if(!r.height){const e=bt({...U},r.rotation),t=li(o,p),a=bt({x:i,y:n,...t},r.rotation),[s,,l]=e,[c,,d]=a;let u=s,h=c;r.flipX&&(u=l,h=d);const m=Ce($e(u),h);i+=m.x,n+=m.y}Jo(r,{x:m(N.x)?Zo(i,it.width):i,y:m(N.y)?Zo(n,it.height):n,text:o})},Wr=e=>{const{key:t,ctrlKey:o,metaKey:i,altKey:r}=e;return"Enter"===t&&(o||r||i)},_r=()=>{d&&Go(),zr&&zr.confirm&&zr.confirm(),zr&&Br(),hi(r),Tt(r)},Vr=()=>{d?Yo():(Jo(r,{text:N.text,x:N.x,y:N.y}),hi(r))},Nr=(e,t,{flipX:o,flipY:i,rotation:r},n="top left")=>{let a,s;const[l,c,d,u]=bt(e,r),[p,h,m,g]=bt(t,r);if("top center"===n){a=Le(i?[u,d]:[l,c]),s=Le(i?[g,m]:[p,h])}else"top right"===n&&!o||"top left"===n&&o?(a=i?d:c,s=i?m:h):(a=i?u:l,s=i?g:p);return Ce($e(a),s)},Hr=(e,t,o)=>me(m(e.x)?Zo(t.x+o.x,it.width):t.x+o.x,m(e.y)?Zo(t.y+o.y,it.height):t.y+o.y),jr={},Ur=()=>Ho(r,r.selectedPoint),Gr=()=>pi(r),Zr=(e,t,o)=>{const{width:i,height:r,...n}=o,a=li(t.text,n),s=Nr(lt(o.x,o.y,e.width,e.height),lt(o.x,o.y,a.width,a.height),o,"top "+t.textAlign),l=!1!==o.disableNewline;Ko(t,["width","height",l&&"textAlign"]),Jo(t,{...Hr(t,o,s)})},Xr=(e,t,o,i,r={})=>{const{height:n,...a}=o,s=Xe(li(t.text,a),(e=>Math.ceil(e))),l=Ne(r.width||o.width||i.width,s.height),c=r.textAlign||"left",d=Nr(lt(o.x,o.y,e.width,e.height),lt(o.x,o.y,l.width,l.height),o,"top "+c);Ko(t,["height"]),Jo(t,{...Hr(t,o,d),width:m(t.width)?Zo(l.width,it.width):l.width,textAlign:c})},Yr=(e,t,o,i,r={})=>{const n=Ne(r.width||i.width,r.height||i.height),a=r.textAlign||"left",s=Nr(lt(o.x,o.y,e.width,e.height),lt(o.x,o.y,n.width,n.height),o,"top "+a);Jo(t,{...Hr(t,o,s),width:m(t.width)?Zo(n.width,it.width):n.width,height:m(t.width)?Zo(n.height,it.height):n.height,textAlign:a})},qr=()=>{const e=Xe(li(r.text,p),(e=>Math.ceil(e))),t=Wo(r,"height"),o=!t&&Wo(r,"width"),i=r.id;let n=jr[i];if(n||(jr[i]={},n=jr[i]),t){n.textAlign=r.textAlign,n.width=p.width,n.height=p.height;const t=Ne(p.width,p.height);Ki(r,"auto-height")?Xr(t,r,p,e,n):Ki(r,"auto-width")&&Zr(t,r,p)}else if(o){n.textAlign=r.textAlign,n.width=p.width;const t=Ne(p.width,e.height);Ki(r,"auto-width")?Zr(t,r,p):Ki(r,"fixed-size")&&Yr(t,r,p,e,n)}else{n.textAlign=r.textAlign||n.textAlign;const t=Ne(Math.ceil(e.width),Math.ceil(e.height));Ki(r,"fixed-size")?Yr(t,r,p,e,n):Ki(r,"auto-height")&&Xr(t,r,p,e,n)}},Kr=e=>{e.stopPropagation();const t=r.flipX||!1;Qo(r,"flipX",!t),Tt(r)},Jr=e=>{e.stopPropagation();const t=r.flipY||!1;Qo(r,"flipY",!t),Tt(r)},Qr=e=>{Qo(r,"opacity",e)},tn=e=>{Qr(e),Tt(r)},on=e=>{e.stopPropagation(),e.target.blur(),ni()},rn=e=>{e.stopPropagation();Pe.findIndex((e=>e===r))!==Pe.length-1&&(Ue.set(Pe.filter((e=>e!==r)).concat([r])),Tt(r))},nn=e=>{e.stopPropagation(),an()},an=()=>{const e=(s?a:[r]).filter(Xi).map((e=>{const t=xi(e);t.id=L();const o=me(50,-50);if(Wo(t,"points")){const e=kr(t,["points"],it);e.points.forEach((e=>{e.x+=o.x,e.y+=o.y})),Cr(t,e,it)}else if(Ai(t)){const e=kr(t,["x1","y1","x2","y2"],it);e.x1+=o.x,e.y1+=o.y,e.x2+=o.x,e.y2+=o.y,Cr(t,e,it)}else{const e=kr(t,["x","y"],it);e.x+=50,e.y-=50,Cr(t,e,it)}return Ue.set([...Pe,t]),wt(t),t}));if(e.length>1)return si(),void e.forEach((e=>{di(e,!0,!0)}));di(e[0])},sn=xc(0,{stiffness:.2,damping:.7});hn(e,sn,(e=>o(20,Re=e)));let ln;const cn=(e,t)=>{const{disableTextLayout:o=[]}=t;return"height"in t?o.includes("auto-height")?e.shapeIconButtonTextLayoutAutoWidth:e.shapeIconButtonTextLayoutAutoHeight:"width"in t?o.includes("auto-width")?e.shapeIconButtonTextLayoutFixedSize:e.shapeIconButtonTextLayoutAutoWidth:o.includes("fixed-size")?e.shapeIconButtonTextLayoutAutoHeight:e.shapeIconButtonTextLayoutFixedSize},dn=(e,t)=>{const{disableTextLayout:o=[]}=t;return"height"in t?o.includes("auto-height")?e.shapeTitleButtonTextLayoutAutoWidth:e.shapeTitleButtonTextLayoutAutoHeight:"width"in t?o.includes("auto-width")?e.shapeTitleButtonTextLayoutFixedSize:e.shapeTitleButtonTextLayoutAutoWidth:o.includes("fixed-size")?e.shapeTitleButtonTextLayoutAutoHeight:e.shapeTitleButtonTextLayoutFixedSize};let mn=!1;let gn=he(),$n=void 0;const fn=e=>{Et(e),o(152,gr=e)};let yn;aa((()=>{Lr(),Ir(),fr(),pr()}));return e.$$set=e=>{"uid"in e&&o(66,Ve=e.uid),"ui"in e&&o(67,He=e.ui),"disabled"in e&&o(0,je=e.disabled),"shapes"in e&&_e(o(1,Ue=e.shapes)),"selection"in e&&o(68,Ge=e.selection),"offset"in e&&o(2,Ze=e.offset),"contextRotation"in e&&o(69,qe=e.contextRotation),"contextFlipX"in e&&o(70,Je=e.contextFlipX),"contextFlipY"in e&&o(71,Qe=e.contextFlipY),"contextZoom"in e&&o(72,et=e.contextZoom),"active"in e&&o(73,tt=e.active),"opacity"in e&&o(74,ot=e.opacity),"parentRect"in e&&o(75,it=e.parentRect),"rootRect"in e&&o(3,st=e.rootRect),"utilRect"in e&&o(76,dt=e.utilRect),"hoverColor"in e&&o(77,ut=e.hoverColor),"caretColor"in e&&o(78,pt=e.caretColor),"gridColor"in e&&o(79,ht=e.gridColor),"snapColor"in e&&o(80,mt=e.snapColor),"textInputMode"in e&&o(4,gt=e.textInputMode),"oninteractionstart"in e&&o(81,$t=e.oninteractionstart),"oninteractionupdate"in e&&o(82,ft=e.oninteractionupdate),"oninteractionrelease"in e&&o(83,yt=e.oninteractionrelease),"oninteractionend"in e&&o(84,xt=e.oninteractionend),"oninteractioncancel"in e&&o(85,vt=e.oninteractioncancel),"onaddshape"in e&&o(86,wt=e.onaddshape),"onupdateshape"in e&&o(87,Tt=e.onupdateshape),"onselectshape"in e&&o(88,Mt=e.onselectshape),"onblurshape"in e&&o(89,Pt=e.onblurshape),"onremoveshape"in e&&o(90,Rt=e.onremoveshape),"ontapshape"in e&&o(91,It=e.ontapshape),"onhovershape"in e&&o(92,Et=e.onhovershape),"ontriggerhistorywrite"in e&&o(93,Ft=e.ontriggerhistorywrite),"onhovercanvas"in e&&o(94,Dt=e.onhovercanvas),"ontapcanvas"in e&&o(95,Ot=e.ontapcanvas),"onleavecanvas"in e&&o(96,Ht=e.onleavecanvas),"beforeSelectShape"in e&&o(97,jt=e.beforeSelectShape),"beforeDeselectShape"in e&&o(98,Ut=e.beforeDeselectShape),"beforeRemoveShape"in e&&o(99,Gt=e.beforeRemoveShape),"beforeUpdateShape"in e&&o(100,Zt=e.beforeUpdateShape),"willRenderShapeControls"in e&&o(101,Xt=e.willRenderShapeControls),"willRenderShapeTextControls"in e&&o(102,Yt=e.willRenderShapeTextControls),"willStartInteraction"in e&&o(103,qt=e.willStartInteraction),"mapEditorPointToImagePoint"in e&&o(104,Kt=e.mapEditorPointToImagePoint),"mapImagePointToEditorPoint"in e&&o(105,Jt=e.mapImagePointToEditorPoint),"eraseRadius"in e&&o(106,Qt=e.eraseRadius),"selectRadius"in e&&o(107,eo=e.selectRadius),"enableButtonFlipVertical"in e&&o(108,to=e.enableButtonFlipVertical),"enableTapToAddText"in e&&o(109,oo=e.enableTapToAddText),"enableMultiSelect"in e&&o(110,io=e.enableMultiSelect),"enableTextStyleControls"in e&&o(5,ro=e.enableTextStyleControls),"locale"in e&&o(6,no=e.locale),"snapThreshold"in e&&o(111,ao=e.snapThreshold),"snapPointer"in e&&o(112,so=e.snapPointer),"enableSnapToContext"in e&&o(113,lo=e.enableSnapToContext),"gridSize"in e&&o(114,co=e.gridSize)},e.$$.update=()=>{var t,n;if(8192&e.$$.dirty[2]|2097152&e.$$.dirty[3]&&o(179,i=co>0?{x:0,y:0,...it}:void 0),1&e.$$.dirty[0]|64&e.$$.dirty[6]&&o(11,r=!je&&Pe&&(jo()||oi())),131072&e.$$.dirty[3]|64&e.$$.dirty[6]&&o(171,a=io?Pe.filter(Di):[]),65536&e.$$.dirty[5]&&o(170,s=a.length>1),8192&e.$$.dirty[2]|98304&e.$$.dirty[5]&&o(191,l=s?a.map((e=>vr(xi(e),it))):[]),2048&e.$$.dirty[0]&&o(188,c=!!r),2048&e.$$.dirty[0]&&o(173,d=r&&Bi(r)),2048&e.$$.dirty[0]|262144&e.$$.dirty[5]&&o(10,u=r&&!d?r.id:void 0),2056&e.$$.dirty[0]|8192&e.$$.dirty[2]&&o(14,p=st&&r&&vr(xi(r),it)),2048&e.$$.dirty[0]|262144&e.$$.dirty[5]&&o(154,h=!(!r||!d)),18432&e.$$.dirty[0]|4096&e.$$.dirty[2]&&o(186,g=r&&ot&&ar(p)||[]),32768&e.$$.dirty[5]|32&e.$$.dirty[6]&&o(183,$=s?l.map(ar):[]),2048&e.$$.dirty[0]|32768&e.$$.dirty[5]&&o(190,f=!s&&r&&(er(t=r)&&tr(t)&&!0!==t.disableResize&&(Wi(t)||Ri(t)||Ei(t)||Ai(t)||Li(t)&&Wo(t,"pathClose")))&&!Fi(r)),2048&e.$$.dirty[0]|32768&e.$$.dirty[5]&&o(17,y=!s&&r&&(e=>er(e)&&!0!==e.disableRotate&&(Wi(e)||Wo(e,"text")||Ei(e)))(r)&&!Fi(r)),2048&e.$$.dirty[0]&&o(15,b=r&&Mi(r)&&!Ri(r)&&!Fi(r)&&!1===r.disableTextScale),2048&e.$$.dirty[0]|16&e.$$.dirty[6]&&o(19,x=!!f&&function(e){return!!e&&(Mi(e)&&!e.height?[[1,2],[3,0]]:!Ai(e)&&!Li(e))}(r)),526336&e.$$.dirty[0]|16&e.$$.dirty[6]&&o(33,v=!!r&&(!Array.isArray(x)&&f)),98304&e.$$.dirty[5]&&o(189,w=s?(e=>{const t=e.map((e=>ar(vr(e,it)))).flat(),o=nt(t);return Ct(o)})(a):[]),2048&e.$$.dirty[0]|32768&e.$$.dirty[5]|1&e.$$.dirty[6]&&o(16,S=r&&g.length>1||s),4096&e.$$.dirty[3]|32768&e.$$.dirty[5]|9&e.$$.dirty[6]&&o(184,k=s?w.map(Jt):g.map(Jt)),4&e.$$.dirty[0]|536870912&e.$$.dirty[5]&&o(13,C=k.map((e=>me(e.x-Ze.x,e.y-Ze.y)))),2048&e.$$.dirty[0]&&o(18,T=r&&r.points&&Oo(r.selectedPoint)?r.selectedPoint:-1),262144&e.$$.dirty[0]&&o(163,M=T>=0),270336&e.$$.dirty[0]|256&e.$$.dirty[5]&&o(168,P=M?C[T]:void 0),2048&e.$$.dirty[0]|4&e.$$.dirty[6]&&o(32,R=c&&(Ri(r)?!Wo(r,"disableNewline")||!r.disableNewline:!1===r.disableNewline)),4096&e.$$.dirty[3]|268435456&e.$$.dirty[4]&&(gr&&Jt&&!Di(gr)&&Gi(gr)?(e=>{const t=ar(vr(xi(e),it));if(!t)return;const o=t.map(Jt),i=!!e.pathClose||!(!e.bitmap&&(Li(e)||Ai(e))),r="hook"===e.selectionStyle,n=r?o.map(((e,t,o)=>({id:hb,points:br(o,t),strokeColor:[0,0,0,.1],strokeWidth:2}))):[{id:hb,points:o.map((e=>me(e.x+1,e.y+1))),strokeColor:[0,0,0,.1],strokeWidth:2,pathClose:i}],a=r?o.map(((e,t,o)=>({id:hb,points:br(o,t),strokeColor:ut,strokeWidth:2}))):[{id:hb,points:o,strokeColor:ut,strokeWidth:2,pathClose:i}];mr(...n,...a)})(gr):pr()),221184&e.$$.dirty[0]|4096&e.$$.dirty[2]&&o(185,I=S&&y&&ot&&C?(e=>{const t=sr(e),o=Jt({x:t.origin.x+t.dir.x,y:t.origin.y+t.dir.y});return{origin:Jt(t.origin),position:o}})(p):void 0),4&e.$$.dirty[0]|1073741824&e.$$.dirty[5]&&o(31,E=I&&me(I.position.x-Ze.x,I.position.y-Ze.y)),122880&e.$$.dirty[0]|4096&e.$$.dirty[2]&&o(187,A=S&&b&&ot&&C?(e=>{const t=ar(e);let o=2;e.flipX&&e.flipY?o=0:e.flipX?o=3:e.flipY&&(o=1);const i={...t[o]};return Jt({x:i.x,y:i.y})})(p):void 0),4&e.$$.dirty[0]|2&e.$$.dirty[6]&&o(30,F=A&&me(A.x-Ze.x,A.y-Ze.y)),256&e.$$.dirty[6]&&o(178,W=!!(De||[]).find((e=>[91,93,17].includes(e)))),524288&e.$$.dirty[3]|8388608&e.$$.dirty[5]&&o(180,z=!(W||!so)),2048&e.$$.dirty[0]|4096&e.$$.dirty[2]|536870912&e.$$.dirty[4]|570687488&e.$$.dirty[5]&&r&&k&&ot>0&&(r===gr&&xr(),((e,t,o)=>{if(!Gi(t))return;const i=Li(t),r=i&&Wo(t,"pathClose"),n=r&&(e=>e.strokeWidth&&((e,t)=>{const o=e.strokeColor;return!!o&&(3===o.length||o[3]>0)})(e))(t),a=Bi(t),s=Fi(t),l="hook"===t.selectionStyle,c=!0!==t.disableShowPoints,{selectionOpacity:d=1}=t;if(a&&i&&!r)return;const u=[],p=[...k],h=p[p.length-1],m=p[0],$=(s?.05:.1)*e*d,f=$>0,y=(s?.5:1)*e*d,b=y>0,x=[0,0,0],v=[1,1,1],w=s?1:1.5;De.includes(16)&&h&&o&&So(h,o);const S=p.length&&r&&a&&o?Ie(m,o):1/0,C=p.length&&r&&a&&o?Ie(h,o):1/0,T=S<=pb,M=C<=pb;!T&&o&&p.push(o);const P=p.length>1,R=!!t.pathClose||!(!t.bitmap&&(Li(t)||Ai(t)))||p.length>2&&T;P&&f&&(l?u.push(...p.map(((e,t,o)=>({id:$r,points:br(o,t),strokeColor:x,opacity:$})))):u.push({id:$r,points:p.map((e=>me(e.x+1,e.y+1))),pathClose:R,strokeColor:x,strokeWidth:2,opacity:$})),r&&f&&c&&u.push(...p.map((e=>({id:$r,...e,rx:2*w,ry:2*w,backgroundColor:x,opacity:$})))),I&&f&&u.push({id:$r,points:[me(I.origin.x+1,I.origin.y+1),me(I.position.x+1,I.position.y+1)],strokeColor:x,strokeWidth:2,opacity:$}),P&&b&&(l?u.push(...p.map(((e,t,o)=>({id:$r,points:br(o,t),strokeColor:v,strokeWidth:w,opacity:y})))):u.push({id:$r,points:p,pathClose:R,strokeColor:v,strokeWidth:w,backgroundColor:a&&r&&t.backgroundColor&&t.backgroundColor[3]>0?t.backgroundColor:[0,0,0,0],opacity:y})),r&&c&&u.push(...p.map((e=>({id:$r,...e,rx:3*w,ry:3*w,backgroundColor:[.5,.5,.5],strokeWidth:w,strokeColor:v})))),r&&a&&c&&k.length>=3&&u.push({...m,id:$r,rx:w*(T?5:4),ry:w*(T?5:4),backgroundColor:T?ut:[.5,.5,.5],strokeWidth:w,strokeColor:v}),r&&a&&n&&c&&!T&&g.length>=2&&u.push({...h,id:$r,rx:w*(M?5:4),ry:w*(M?5:4),backgroundColor:M?ut:[.5,.5,.5],strokeWidth:w,strokeColor:v}),I&&b&&!l&&u.push({id:$r,points:[{x:I.origin.x,y:I.origin.y},{x:I.position.x,y:I.position.y}],strokeColor:v,strokeWidth:w,opacity:y}),yr(...u)})(ot,r,d&&Li(r)?Mr({...$n},!z):void 0)),2048&e.$$.dirty[0]&&(r||(xr(),fr())),4096&e.$$.dirty[3]|268435456&e.$$.dirty[5])if($.length){Sr();const e=$.map((e=>({id:wr,points:e.map(Jt),strokeWidth:1,strokeColor:[1,1,1,.5],pathClose:!0})));Tr(...e)}else Sr();268435456&e.$$.dirty[4]&&o(181,D=!!gr),67108864&e.$$.dirty[4]&&o(182,B=!!Si),536870912&e.$$.dirty[4]|234881024&e.$$.dirty[5]&&(!$n||B||D||Mr({...$n},!z)),131072&e.$$.dirty[2]|2101248&e.$$.dirty[3]|16777216&e.$$.dirty[5]|512&e.$$.dirty[6]&&co>0&&i&&Jt&&((e,t,o,i)=>{const r=Jt({x:0,y:0}),n=Jt({x:e,y:e}),a=Jt({x:t.width,y:t.height}),s=n.x-r.x;if(Pr.set(s>6?1:0),i<=0)return Ir();const l=Eo(s,r.x,a.x).map((e=>({id:Rr,opacity:i,points:[{x:e,y:r.y},{x:e,y:a.y}],strokeWidth:1,strokeColor:o}))),c=Eo(s,r.y,a.y).map((e=>({id:Rr,opacity:i,points:[{x:r.x,y:e},{x:a.x,y:e}],strokeWidth:1,strokeColor:o})));Er(...c,...l)})(co,i,ht,Oe),262144&e.$$.dirty[2]|4096&e.$$.dirty[3]|50331648&e.$$.dirty[4]|8388608&e.$$.dirty[5]&&Jt&&(W?Lr():((e,t,o)=>{if(null===e&&null===t)return Lr();let i,r;null!==e&&(i={id:Ar,strokeColor:o,strokeWidth:1.5,points:[Jt({x:e,y:0}),Jt({x:e,y:it.height})]}),null!==t&&(r={id:Ar,strokeColor:o,strokeWidth:1.5,points:[Jt({x:0,y:t}),Jt({x:it.width,y:t})]}),Fr(i,r)})(Po,Ro,mt)),2048&e.$$.dirty[2]&&(e=>{if(!e)return ei({_prerender:!1});const t=Pe.find((e=>e.isEditing));t&&Jo(t,{_prerender:"inline"===gt})})(tt),256&e.$$.dirty[6]&&De&&De.length&&(()=>{const[e]=De;8!==e&&46!==e||ii()&&(r.isEditing||(Li(r)&&Oo(r.selectedPoint)?setTimeout((()=>Ho(r,r.selectedPoint)),0):setTimeout((()=>ni()),0)))})(),272&e.$$.dirty[0]&&zr&&"inline"===gt&&zr.focus(),2048&e.$$.dirty[0]&&o(177,_=r&&Mi(r)),2048&e.$$.dirty[0]|4194304&e.$$.dirty[5]&&o(12,V=_&&!1!==qi(r)&&Fi(r)),4096&e.$$.dirty[0]&&o(172,N=V?{...r}:void 0),8192&e.$$.dirty[2]|131072&e.$$.dirty[5]&&o(174,H=N&&vr({...N},it)),524288&e.$$.dirty[5]&&o(176,j=H&&li(H.text,H)),2621440&e.$$.dirty[5]&&(U=H&<(H.x,H.y,j.width,j.height)),6144&e.$$.dirty[0]&&o(27,G=V?r.text:""),6152&e.$$.dirty[0]|8192&e.$$.dirty[2]&&o(175,Z=st&&r&&V&&vr({...xi(r),width:Oo(r.width)?Math.floor(r.width):void 0,height:Oo(r.height)?Math.floor(r.height):void 0},it)),4112&e.$$.dirty[0]|1048576&e.$$.dirty[5]&&o(29,X=V&&((e,t)=>{const{textAlign:o="left",fontFamily:i="sans-serif",fontWeight:r="normal",fontStyle:n="normal",letterSpacing:a="normal",textShadowX:s=0,textShadowY:l=0,textShadowBlur:c=0,textShadowColor:d,textOutlineWidth:u=0,textOutlineColor:p}=e,h="!important",m=`caret-color:${K};text-align:${o}${h};font-family:${i}${h};font-weight:${r}${h};font-style:${n}${h};letter-spacing:${Oo(a)?a+"px":"normal"}${h}`;if("modal"===t)return m;const g=u?`;-webkit-text-stroke:${2*u}px ${Xo(p)} ${h}`:"",$=c||s||l?`;text-shadow:${s}px ${l}px ${c}px ${Xo(d)} ${h}`:"";let f=e.fontSize,y=1,b="";f>1e3&&O()&&(y=f/1e3,b=`transform-origin:0 0;transform:scale(${y})`,f=1e3);let x=e.lineHeight/y;const v=Xo(e.color),w=.5*Math.max(0,f-x);return`--font-scalar:${y};--bottom-inset:${w}px;padding:${w}px 0 0${h};color:${v}${h};font-size:${f}px${h};line-height:${x}px${h};${m};${b}${g}${$}`})(Z,gt)),4100&e.$$.dirty[0]|1152&e.$$.dirty[2]|1048576&e.$$.dirty[5]&&o(28,q=V&&((e,t,o,i)=>{let n,a;e.width&&e.height?(n=ct(e),a=Be(e)):(a=li(r.text,p),a.width=p.width||a.width,n=me(e.x+.5*a.width,e.y+.5*a.height));const s=Math.max(0,e.fontSize-e.lineHeight)+e.lineHeight,l=Jt(n);let c=l.x-t.x-.5*a.width,d=l.y-t.y-.5*a.height,u=e.flipX,h=e.flipY,m=e.rotation;Je&&Qe?(u=!u,h=!h):Je?(u=!u,m=-m):Qe&&(h=!h,m=-m),m+=i;const g=o*(u?-1:1),$=o*(h?-1:1);return`--line-height:${s}px;width:${a.width}px;height:${a.height}px;transform:translate(${c}px,${d}px) rotate(${m}rad) scale(${g}, ${$})`})(Z,Ze,et,qe)),65536&e.$$.dirty[2]&&(K=pt?Xo(pt):"auto"),4368&e.$$.dirty[0]&&V&&zr&&"inline"===gt&&Dr(G),2048&e.$$.dirty[0]|1073741824&e.$$.dirty[4]|16&e.$$.dirty[5]&&o(159,J=r&&!h?r:J),16&e.$$.dirty[5]&&o(161,Q=J&&Yi(J)),16&e.$$.dirty[5]&&o(156,ee=J&&Ki(J)),16&e.$$.dirty[5]&&o(158,te=J&&Xi(J)),16&e.$$.dirty[5]&&o(157,oe=J&&Zi(J)),32784&e.$$.dirty[5]&&o(160,ie=!s&&J&&(e=>!0!==e.disableReorder)(J)),16&e.$$.dirty[5]&&o(155,re=J&&!1!==qi(J)),16&e.$$.dirty[5]&&o(162,ne=J&&Wo(J,"backgroundImage")&&Ui(J,"opacity")),2064&e.$$.dirty[0]&&o(165,ae=r&&"html"===r.format&&"inline"===gt),2048&e.$$.dirty[0]|1073741824&e.$$.dirty[4]|1024&e.$$.dirty[5]&&o(169,se=r&&(!h||ae)),134217728&e.$$.dirty[4]|16384&e.$$.dirty[5]|128&e.$$.dirty[6]&&sn.set(se&&!Ni?1:0,{hard:!1===Ae}),8192&e.$$.dirty[0]|20480&e.$$.dirty[5]&&o(167,le=se&&C.length?(n=nt(C),Se(me(n.x+.5*n.width,n.y),Od)):le),512&e.$$.dirty[0]|16384&e.$$.dirty[2]|12288&e.$$.dirty[5]&&o(166,ce=(P||le)&&ln&&dt&&((e,t,o,i)=>{const r=e.x,n=e.y,a=r+e.width;let s=Math.max(t.x-.5*o.width,r),l=Math.max(t.y-o.height+i,n);return s+o.width>a&&(s=a-o.width),me(s,l)})(dt,P||le,ln,-16)),2048&e.$$.dirty[5]&&o(26,ue=ce?`translate(${ce.x}px, ${ce.y}px)`:void 0),1048576&e.$$.dirty[0]|2048&e.$$.dirty[5]&&o(25,ge=ce?Re:void 0),4096&e.$$.dirty[0]&&o(164,fe=V?"text":"shape"),3136&e.$$.dirty[0]|33536&e.$$.dirty[3]|2047&e.$$.dirty[5]|64&e.$$.dirty[6]&&o(24,be="text"===fe&&Yt&&ae?lm((()=>Yt([["div","text-styles",{class:"PinturaShapeControlsGroup"},[...[["bold",{label:"B",style:"font-weight:900;",title:"Bold",shortcut:["CMD","B"]}],["italic",{label:"I",style:"font-family:Times New Roman;font-style:italic;",title:"Italic",shortcut:["CMD","I"]}],["underline",{label:"U",style:"text-decoration:underline;",title:"Underline",shortcut:["CMD","U"]}],["strikeThrough",{label:"S",style:"text-decoration:line-through;",title:"Strikethrough",shortcut:["CMD","S"]}]].map((([e,t])=>["Button","style-"+e,{onclick:()=>document.execCommand(e),...t,style:"font-size:1.25em;text-underline-offset:1px;text-decoration-thickness:1.5px;font-weight:400;"+t.style}]))]],["div","text-reset",{class:"PinturaShapeControlsGroup"},[["Button","style-reset",{onclick:()=>document.execCommand("removeFormat"),style:"font-weight:400",title:"Remove styles",label:[["span","T",{style:"font-size:1.25em;font-style:italic;font-family:Times New Roman;text-decoration:underline",textContent:"T"}],["span","x",{style:"position:relative;top:.175rem;",innerHTML:"×"}]]}]]]],u))):"shape"===fe&&Xt&&u?lm((()=>Xt(M?[["div","epsilon",{class:"PinturaShapeControlsGroup"},[["Button","remove-point",{onclick:Ur,label:no.shapeTitleButtonRemove,icon:no.shapeIconButtonRemove,shortcut:["Backspace"],hideLabel:!0}]]]]:[ne&&["div","alpha",{class:"PinturaShapeControlsGroup"},[["ToggleSlider","adjust-opacity",{onrelease:tn,onchange:Qr,step:.01,value:Wo(r,"opacity")?r.opacity:1,label:(e,t,o)=>Math.round(e/o*100)+"%",min:0,max:1,direction:"x"}]]],["div","beta",{class:"PinturaShapeControlsGroup"},[Q&&["Button","flip-horizontal",{onclick:Kr,label:no.shapeTitleButtonFlipHorizontal,icon:no.shapeIconButtonFlipHorizontal,hideLabel:!0}],Q&&to&&["Button","flip-vertical",{onclick:Jr,label:no.shapeTitleButtonFlipVertical,icon:no.shapeIconButtonFlipVertical,hideLabel:!0}],ie&&["Button","to-front",{onclick:rn,label:no.shapeTitleButtonMoveToFront,icon:no.shapeIconButtonMoveToFront,hideLabel:!0,disabled:Pe[Pe.length-1]===J}],te&&["Button","duplicate",{onclick:nn,label:no.shapeTitleButtonDuplicate,icon:no.shapeIconButtonDuplicate,shortcut:["CMD","D"],hideLabel:!0}],oe&&["Button","remove",{onclick:on,label:no.shapeTitleButtonRemove,icon:no.shapeIconButtonRemove,shortcut:["Backspace"],hideLabel:!0}]].filter(Boolean)],re&&ee&&["div","gamma",{class:"PinturaShapeControlsGroup"},[["Button","text-layout",{onclick:qr,label:nu(dn,no,r),icon:nu(cn,no,r),hideLabel:!0}]]],re&&["div","delta",{class:"PinturaShapeControlsGroup"},[["Button","edit-text",{label:no.shapeLabelInputText,onclick:Gr}]]]].filter(Boolean),u))):[]),64&e.$$.dirty[0]|64&e.$$.dirty[6]&&o(23,Te=Pe.filter(Gi).filter((e=>e.id)).filter((e=>!Bi(e))).map((e=>({id:e.id,color:Mi(e)?e.color:Ai(e)?e.strokeColor:e.backgroundColor,name:e.name||no["shapeLabelTool"+as(hr(e))]}))))},[je,Ue,Ze,st,gt,ro,no,di,zr,ln,u,r,V,C,p,b,S,y,T,x,Re,mn,yn,Te,be,ge,ue,G,q,X,F,E,R,v,ho,ko,e=>{const{origin:t}=e.detail,i=io&&De.includes(16);or=void 0,o(150,Si=void 0),ki=void 0,zi=void 0,Oi=!1,wi=void 0,_i=!1,Vi=!1,Mo(),clearTimeout(vi),vi=setTimeout((()=>o(151,Ni=!0)),250);const n=jo();if(!n||Li(n)&&Wo(n,"pathClose")||Go(),bi=Kt($e(t)),n&&Li(n)&&Wo(n,"pathClose"))return $t(e);const l=fi(Pe,bi,eo,(e=>Gi(e))),c=l.length&&l.shift();if(r&&Fi(r))if(c!==r)_r();else{const e=Wo(r,"height"),t=!e&&Wo(r,"width");if(e||t){const e=xi(r),t=xi(e);vr(t,it);const o=Xe(li(e.text,t),(e=>Math.ceil(e))),i=Ne(t.width,t.height||o.height);Zr(i,e,t);const n=fi([{...e,strokeWidth:"5%"}],bi,0);Vi=0===n.length}}if(r&&oo&&(_i=!0),!c&&r&&Fi(r)&&ui(r),!qt(t))return;if(c&&Di(c))return Oi=!0,o(150,Si=c),s?(i&&ui(c),void ir(a)):(ki=xi(Si),void(zi=vr(xi(Si),it)));wi=c||void 0;if(!$t(e)&&c){if(di(c,!0,i),o(150,Si=c),s)return ir(a);ki=xi(Si),zi=vr(xi(Si),it)}},e=>{rr(),vt(e)},e=>{const{translation:t,ctrlKey:o,metaKey:r,shiftKey:n,position:s}=e.detail;if(Si){if(!tr(Si))return;if(Fi(Si)){if(!Vi)return;_r()}if(n){let e=Math.abs(t.x),o=Math.abs(t.y);"x"===nr&&(o-=64),"y"===nr&&(e-=64),e>o?(t.y=0,nr="x"):o>e&&(t.x=0,nr="y")}else nr=null;const e=o||r;if(or){if(!a.every(tr))return;return void or.forEach((({shape:e,shapeOriginComputed:o})=>{Do(e,o,t,{...po(0,co,i,e)})}))}return Do(Si,zi,t,{...po(e?0:ao,co,i,Si)})}ft(e)},e=>{if(rr(),Si){if(!s)if(e.detail.isTap&&Li(Si)&&Qi(Si)){const{position:t}=e.detail,o=Kt($e(t));((e,t)=>{const o=e.points,i=[];for(let e=0;e<o.length-1;e++)i.push([o[e],o[e+1]]);i.push([o[o.length-1],o[0]]);const r=i.findIndex((([e,o])=>Wt(t,6,e,o)));let n;const a=[];for(let e=0;e<i.length;e++)a.push(i[e][0]),e===r&&(n=e+1,a.push(t));Jo(e,{points:a,selectedPoint:n})})(Si,o)}else e.detail.isTap&&Oi&&Mi(Si)&&!1!==qi(Si)&&pi(Si)}else yt(e)},e=>{const t=wi&&e.detail.isTap,i=io&&De.includes(16);if(e.detail.isTap&&setTimeout((()=>{Ot({target:Si||wi,position:bi},0)})),Si)return It(Si),r=Si,n=ki,JSON.stringify(r)!==JSON.stringify(n)&&Tt(Si),void o(150,Si=void 0);var r,n;let a=!0;if(!i){const e=ci();a=!e||Ut(e,wi||void 0),a&&si({storePrevious:!1})}xt(e),a&&t&&di(wi,!0,i)},Pr,e=>{o(151,Ni=!0),o(150,Si=r),zi=p},e=>{if(!Si)return void o(151,Ni=!1);const{translation:t,indexes:r,shiftKey:n,ctrlKey:a,metaKey:s,isNudge:l}=e.detail;Vo(Si,zi,r,t,{shiftKey:!l&&n,...po(a||s?0:ao,co,i,Si)}),Ji(Si)&&Ie(t)>16&&Jo(Si,{selectedPoint:void 0})},e=>{if(!Si)return void o(151,Ni=!1);di(Si);const{isTap:t,translation:i,indexes:n}=e.detail;t&&(Ji(Si)&&Jo(Si,{selectedPoint:Si.selectedPoint===n[0]?void 0:n[0]}),It(Si)),o(150,Si=void 0),o(151,Ni=!1),Tt(r)},e=>{No=sr(p).origin,o(151,Ni=!0),o(150,Si=r),zi=p},e=>{if(!Si)return void o(151,Ni=!1);const{translation:t,shiftKey:i}=e.detail;((e,t,o,i)=>{const r=$i(vr(xi(e),it)),n=ct(r),a=Io(No,o);let s=ve(a,n)+Math.PI/2;if(i.shiftKey){const e=Math.PI/16;s=e*Math.round(s/e)-qe%e}wo(e,{rotation:s},it),qo()})(Si,0,t,{shiftKey:i})},()=>{Si?(di(Si),o(150,Si=void 0),o(151,Ni=!1),Tt(r)):o(151,Ni=!1)},e=>{o(151,Ni=!0),o(150,Si=r),zi=p},e=>{if(!Si)return void o(151,Ni=!1);const{translation:t,ctrlKey:r,metaKey:n}=e.detail;((e,t,o,i)=>{const r=rt(t),n=li(t.text,t);r.width||(r.width=n.width),r.height||(r.height=n.height);let a=2;e.flipX&&e.flipY?a=0:e.flipX?a=3:e.flipY&&(a=1),Vo(e,t,[a],o,{...i,aspectRatio:r.width/r.height,beforeResizeShape:e=>{const o=e.width/r.width;e.fontSize=t.fontSize*o,t.width||delete e.width,t.height||delete e.height}})})(Si,zi,t,{...po(r||n?0:ao,co,i,Si)})},()=>{Si?(di(Si),o(150,Si=void 0),o(151,Ni=!1),Tt(r)):o(151,Ni=!1)},e=>{const{key:t}=e,o=/escape/i.test(t);if(ii())return o?(e.preventDefault(),e.stopPropagation(),ui(r)):void(te&&"d"===t&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),e.stopPropagation(),an()))},e=>{const t=qi(r,e);return!0===t?e:t},Br,e=>{const{target:t,key:o}=e,i=t.value||t.innerText,n=t.selectionStart||0,a=t.selectionEnd||i.length,s=i.substring(0,n)+o+i.substring(a);if(qi(r,s)!==s)return e.preventDefault()},e=>Pi(r)&&/enter/i.test(e.code)&&!1!==r.disableNewline?e.preventDefault():/arrow/i.test(e.code)?e.stopPropagation():/escape/i.test(e.key)?Vr():void 0,Wr,e=>{if(Wr(e))return _r()},_r,Vr,sn,e=>{const t=ti();t&&(t.find(Fi)||t.find((e=>!tr(e)))||t.forEach((t=>{o(150,Si=t),zi=vr(xi(Si),it),Do(Si,zi,e.detail)})))},e=>{o(21,mn=!0)},({relatedTarget:e})=>{e&&e.classList.contains("shape-selector__button")||o(21,mn=!1)},e=>{if("touch"===e.pointerType||"PinturaShapeEditor"!==e.target.className)return void Ht();(Ni||vi)&&fn(void 0);const t=Gy(e,st);o(153,$n=$e(t));const i=Se(Kt(t),(e=>Math.round(e)));if(we(i,gn))return;if(gn=$e(i),Dt(Ni,t,i),Ni||vi)return;if(h)return;const[r]=fi(Pe,i,0,Gi);r&&Bi(r)||fn(r)},e=>{"touch"!==e.pointerType&&Ht()},Ve,He,Ge,qe,Je,Qe,et,tt,ot,it,dt,ut,pt,ht,mt,$t,ft,yt,xt,vt,wt,Tt,Mt,Pt,Rt,It,Et,Ft,Dt,Ot,Ht,jt,Ut,Gt,Zt,Xt,Yt,qt,Kt,Jt,Qt,eo,to,oo,io,ao,so,lo,co,go,$o,fo,yo,bo,xo,vo,(e,t={})=>{let o,r,n,a=[],s=Ei(e),l=Mi(e),c="relative"===t.position;const d=t.interpolateInput,u=uo(),p=e=>{if(!ao)return e;const t=Kt(e),{snapTranslation:o,snapLines:r}=Fo(Ao(t),u,ao,co,i);return zo(e,o),To(r),e},h=!!ci(),g=t.isSelection?Ge:Ue,$="step"===t.inputMode;if(Li(e)){if($){let t=!1;const i=(e,o)=>{const i=$o(g),r=e&&me(tb(e.x,it.width),tb(e.y,it.height)),n=r&&Jt(r);De.includes(16)&&n&&So(n,o);const a=Kt(o),s=i.points.length?i.points[0]:a,l=me(tb(s.x,it.width),tb(s.y,it.height)),d=Jt(l),u=Ie(d,o);if(!t&&1===i.points.length&&u<36)return yo(g);if(i.points.length>2&&u<=pb){i.pathClose=!0,Gi(i)&&di(i);const e=bo(g);return void wt(e)}const p=i.strokeWidth&&i.strokeColor&&(void 0===i.strokeColor[3]||i.strokeColor[3]>0),h=Ie(n,o);if(p&&i.points.length>1&&h<pb){i.pathClose=!1,i.backgroundColor=[0,0,0,0],Gi(i)&&di(i);const e=bo(g);wt(e)}else if(!(i.points.length>0&&h<100))return c?ob(a,it):a};return{start:e=>{const a=$o(g),{origin:s}=e.detail;if(r=4,o=p($e(s)),n=$e(o),a){const e=a.points[a.points.length-1],t=i(e,o);return t&&(a.points=[...a.points,t]),void xo({points:a.points},g)}t=!0},update:e=>{if(!t)return;const r=$o(g);if(!r)return;const n=r.points[0],a=i(n,me(o.x+e.detail.translation.x,o.y+e.detail.translation.y));a&&(r.points[1]=a,xo({points:r.points},g))},release:e=>e.detail.preventInertia(),cancel:()=>{yo(g)},end:i=>{if(!t)return;const r=Kt(o),n=c?ob(r,it):r,{isTap:a}=i.detail;if(a){if(fi(Pe,r,0,Gi).length)return yo(g)}fo({...e,points:[n]},g)}}}return{start:t=>{const{origin:i}=t.detail;r=4,o=$e(i),n=$e(o),a.push({...n});const s=Kt(o),l=c?ob(s,it):s;fo({...e,points:[l]},g)},update:e=>{const t=$o(g);if(!t)return;const{translation:i}=e.detail,s=me(o.x+i.x,o.y+i.y),l=Ee(n,s);if(de(l,5)<=r)return;const u=[],p=ve(s,n),h=r-l,m={x:n.x+h*Math.cos(p),y:n.y+h*Math.sin(p)};if(a.push({...m}),d&&t.points.length>1){const e=a.length,t=Math.ceil(l/10);let o=l/30;const i=a[e-3],r=a[e-2],n=a[e-1];a[e-4]||(o*=.1),u.push(...zt(i,r,n,t,o).slice(1,-1)),a.splice(e-1,0,...u)}u.push(m),n.x=m.x,n.y=m.y,xo({points:t.points.concat(u.map((e=>{const t=Kt(e);return c?ob(t,it):t})))},g)},release:e=>e.detail.preventInertia(),cancel:()=>{yo(g)},end:e=>{const t=$o(g);if(!t)return;if(e.detail.isTap){let e=!1;if(t.bitmap?(wi&&(e=!0),h&&(e=!0)):e=!0,e)return yo(g)}const o=bo(g);wt(o)}}}return s||l||Ii(e)?{start:t=>{const{origin:i}=t.detail;o=p($e(i));const r=Kt(o),n=c?ob(r,it):r,a=-1*Co(qe,Je,Qe),l={...e,rotation:a,...n};l.flipX=Je,l.flipY=Qe,delete l.position,l.opacity=0;(s?["rx","ry"]:["width","height"]).forEach((e=>{l[e]=c?"0%":0})),fo(l,g)},update:e=>{const t=$o(g);if(!t)return;t.opacity=1;let{aspectRatio:i}=t,{translation:r,shiftKey:n,ctrlKey:a}=e.detail;!i&&n&&(i=1);const l=p(me(o.x+r.x,o.y+r.y)),c=Kt(o),d=Kt(l);if(i){const e=nt([c,d]),t=St(e,i),o=d.x<c.x?-1:1,r=d.y<c.y?-1:1;d.x=c.x+t.width*o,d.y=c.y+t.height*r}const u={x:c.x+.5*(d.x-c.x),y:c.y+.5*(d.y-c.y)},h=Co(qe,Je,Qe);ye(c,h,u),ye(d,h,u);const m=Math.min(c.x,d.x),$=Math.min(c.y,d.y);let f=Math.max(c.x,d.x)-m,y=Math.max(c.y,d.y)-$,b={};s?(a?(b.x=c.x,b.y=c.y):(b.x=m+.5*f,b.y=$+.5*y),b.rx=.5*f,b.ry=.5*y):(a?(b.x=c.x-.5*f,b.y=c.y-.5*y):(b.x=m,b.y=$),b.width=f,b.height=y),xo(b,g,((e,t)=>wo(e,t,it)))},release:e=>{e.detail.preventInertia()},cancel:()=>{yo(g)},end:e=>{const t=$o(g);if(t){if(e.detail.isTap){if(Mi(t)&&oo&&_i)return yo(g);if(!Mi(t)||!oo||wi)return yo(g);delete t.width,delete t.height,!1!==t.disableNewline&&delete t.textAlign;const e=vr({...t},it),i=li(t.text,e),r=Kt({x:o.x,y:o.y-.5*i.height}),n=Kt({x:o.x+i.width,y:o.y+.5*i.height}),a={x:r.x+.5*(n.x-r.x),y:r.y+.5*(n.y-r.y)},s=Co(qe,Je,Qe);ye(r,s,a),ye(n,s,a);let l=Math.min(r.x,n.x),c=Math.min(r.y,n.y);l<0&&(l=0),c<0&&(c=0),l+i.width>it.width&&(l=it.width-i.width),c+i.height>it.height&&(c=it.height-i.height),t.x=m(t.x)?Zo(l,it.width):l,t.y=m(t.y)?Zo(c,it.height):c}if(t.opacity=1,Mi(t))wt(t);else{const e=bo(g);wt(e)}Gi(t)&&di(t),Mi(t)&&pi(t)}}}:Ai(e)?{start:t=>{const{origin:i}=t.detail,r=Kt(p(i)),n=Se(r,Od);o=$e(i),fo({...e,x1:c?Zo(n.x,it.width):n.x,y1:c?Zo(n.y,it.height):n.y,x2:c?Zo(n.x,it.width):n.x,y2:c?Zo(n.y,it.height):n.y,opacity:0},g)},update:e=>{if(!$o(g))return;const{translation:t}=e.detail,i=p(ke($e(o),t));if(De.includes(16)){const e=Ee(o,i),t=ve(o,i),r=Math.PI/4,n=r*Math.round(t/r);i.x=o.x+e*Math.cos(n),i.y=o.y+e*Math.sin(n)}const r=Kt(i);xo({x2:c?Zo(r.x,it.width):r.x,y2:c?Zo(r.y,it.height):r.y,opacity:1},g)},release:e=>e.detail.preventInertia(),cancel:()=>{yo(g)},end:e=>{const t=$o(g);if(!t)return;if(e.detail.isTap)return yo(g);t.opacity=1;const o=bo(g);wt(o),Gi(t)&&di(o)}}:void 0},()=>{let e,t;const o=Qt*Qt,i=(e,t,i=!1)=>{const r=Ie(e,t);if(!i&&r<2)return!1;const n=Pe.filter((e=>!e.disableErase));let a;a=r<o?fi(Pe,Kt(t),Qt):yi(n,Kt(e),Kt(t),Qt);return mi(a).forEach(Rt),!0};return{start:o=>{e=me(Math.round(o.detail.origin.x),Math.round(o.detail.origin.y)),i(e,e,!0),t=e},update:o=>{const{translation:r}=o.detail,n=me(Math.round(e.x+r.x),Math.round(e.y+r.y));i(t,n)&&(t=$e(n))},release:e=>e.detail.preventInertia(),cancel:()=>{yo(collection)},end:()=>{}}},jo,Uo,e=>{if(!jo())return Hi(e),vo(e)},Go,Yo,(e={})=>({id:L(),...e}),qo,Ko,Jo,Qo,(e,t,o=!0)=>{Pe.forEach((o=>Qo(o,e,t,!1))),o&&qo()},ei,ti,oi,ii,si,ui,pi,hi,mi,gi,$i,fi,yi,Po,Ro,Si,Ni,gr,$n,h,re,ee,oe,te,J,ie,Q,ne,M,fe,ae,ce,le,P,se,s,a,N,d,H,Z,j,_,W,i,z,D,B,$,k,I,g,A,c,w,f,l,Pe,Ae,De,Oe,function(t){da.call(this,e,t)},e=>di(Ue[e]),function(e){pa[e?"unshift":"push"]((()=>{zr=e,o(8,zr)}))},function(){G=this.value,o(27,G),o(12,V),o(11,r),o(177,_),o(0,je),o(192,Pe)},e=>{const{key:t}=e;if("Enter"===t){if(Wr(e))return!0;if(!1===r.disableNewline)return!1}return!0},function(e){pa[e?"unshift":"push"]((()=>{zr=e,o(8,zr)}))},()=>{yn&&yn.focus()},e=>o(9,ln=e.detail),function(e){pa[e?"unshift":"push"]((()=>{yn=e,o(22,yn)}))},e=>Gy(e,st)]}class $b extends Ga{constructor(e){super(),Ua(this,e,gb,ub,ln,{uid:66,ui:67,disabled:0,shapes:1,selection:68,offset:2,contextRotation:69,contextFlipX:70,contextFlipY:71,contextZoom:72,active:73,opacity:74,parentRect:75,rootRect:3,utilRect:76,hoverColor:77,caretColor:78,gridColor:79,snapColor:80,textInputMode:4,oninteractionstart:81,oninteractionupdate:82,oninteractionrelease:83,oninteractionend:84,oninteractioncancel:85,onaddshape:86,onupdateshape:87,onselectshape:88,onblurshape:89,onremoveshape:90,ontapshape:91,onhovershape:92,ontriggerhistorywrite:93,onhovercanvas:94,ontapcanvas:95,onleavecanvas:96,beforeSelectShape:97,beforeDeselectShape:98,beforeRemoveShape:99,beforeUpdateShape:100,willRenderShapeControls:101,willRenderShapeTextControls:102,willStartInteraction:103,mapEditorPointToImagePoint:104,mapImagePointToEditorPoint:105,eraseRadius:106,selectRadius:107,enableButtonFlipVertical:108,enableTapToAddText:109,enableMultiSelect:110,enableTextStyleControls:5,locale:6,snapThreshold:111,snapPointer:112,enableSnapToContext:113,gridSize:114,syncShapeCollection:115,getShapeDraft:116,addShapeDraft:117,discardShapeDraft:118,confirmShapeDraft:119,updateShapeDraft:120,addShape:121,createShape:122,eraseShape:123,getMarkupItemDraft:124,getMarkupItemDraftIndex:125,addMarkupItemDraft:126,confirmMarkupItemDraft:127,discardMarkupItemDraft:128,createMarkupItem:129,syncShapes:130,removeMarkupShapeProps:131,updateMarkupShape:132,updateMarkupShapeProperty:133,updateMarkupItemsShapeProperty:134,updateMarkupShapeItems:135,getActiveMarkupItems:136,getActiveMarkupItem:137,hasActiveMarkupItem:138,blurShapes:139,selectShape:7,deselectMarkupItem:140,editMarkupItem:141,finishEditMarkupItem:142,removeMarkupItems:143,getTextShapeRect:144,getMarkupShapeRect:145,getShapesNearPosition:146,getShapesBetweenPoints:147},null,[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1])}get syncShapeCollection(){return this.$$.ctx[115]}get getShapeDraft(){return this.$$.ctx[116]}get addShapeDraft(){return this.$$.ctx[117]}get discardShapeDraft(){return this.$$.ctx[118]}get confirmShapeDraft(){return this.$$.ctx[119]}get updateShapeDraft(){return this.$$.ctx[120]}get addShape(){return this.$$.ctx[121]}get createShape(){return this.$$.ctx[122]}get eraseShape(){return this.$$.ctx[123]}get getMarkupItemDraft(){return this.$$.ctx[124]}get getMarkupItemDraftIndex(){return this.$$.ctx[125]}get addMarkupItemDraft(){return this.$$.ctx[126]}get confirmMarkupItemDraft(){return this.$$.ctx[127]}get discardMarkupItemDraft(){return this.$$.ctx[128]}get createMarkupItem(){return this.$$.ctx[129]}get syncShapes(){return this.$$.ctx[130]}get removeMarkupShapeProps(){return this.$$.ctx[131]}get updateMarkupShape(){return this.$$.ctx[132]}get updateMarkupShapeProperty(){return this.$$.ctx[133]}get updateMarkupItemsShapeProperty(){return this.$$.ctx[134]}get updateMarkupShapeItems(){return this.$$.ctx[135]}get getActiveMarkupItems(){return this.$$.ctx[136]}get getActiveMarkupItem(){return this.$$.ctx[137]}get hasActiveMarkupItem(){return this.$$.ctx[138]}get blurShapes(){return this.$$.ctx[139]}get selectShape(){return this.$$.ctx[7]}get deselectMarkupItem(){return this.$$.ctx[140]}get editMarkupItem(){return this.$$.ctx[141]}get finishEditMarkupItem(){return this.$$.ctx[142]}get removeMarkupItems(){return this.$$.ctx[143]}get getTextShapeRect(){return this.$$.ctx[144]}get getMarkupShapeRect(){return this.$$.ctx[145]}get getShapesNearPosition(){return this.$$.ctx[146]}get getShapesBetweenPoints(){return this.$$.ctx[147]}}function fb(e){let t,o,i;return o=new mh({props:{items:e[2]}}),{c(){t=Fn("ul"),Na(o.$$.fragment),Nn(t,"class","PinturaShapeStyleList")},m(e,r){An(e,t,r),Ha(o,t,null),i=!0},p(e,t){const i={};4&t&&(i.items=e[2]),o.$set(i)},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Ln(t),ja(o)}}}function yb(e){let t,o;return t=new Ah({props:{class:"PinturaShapeStyles",elasticity:e[0],$$slots:{default:[bb]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};1&o&&(i.elasticity=e[0]),524292&o&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function bb(e){let t,o,i;return o=new mh({props:{items:e[2]}}),{c(){t=Fn("ul"),Na(o.$$.fragment),Nn(t,"class","PinturaShapeStyleList")},m(e,r){An(e,t,r),Ha(o,t,null),i=!0},p(e,t){const i={};4&t&&(i.items=e[2]),o.$set(i)},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Ln(t),ja(o)}}}function xb(e){let t,o,i,r;const n=[yb,fb],a=[];function s(e,t){return e[1]?0:1}return o=s(e),i=a[o]=n[o](e),{c(){t=Fn("div"),i.c(),Zn(t,"opacity",e[5]),Zn(t,"pointer-events",e[4]),Zn(t,"visibility",e[3])},m(e,i){An(e,t,i),a[o].m(t,null),r=!0},p(e,[r]){let l=o;o=s(e),o===l?a[o].p(e,r):(Ra(),Aa(a[l],1,1,(()=>{a[l]=null})),Ia(),i=a[o],i?i.p(e,r):(i=a[o]=n[o](e),i.c()),Ea(i,1),i.m(t,null)),32&r&&Zn(t,"opacity",e[5]),16&r&&Zn(t,"pointer-events",e[4]),8&r&&Zn(t,"visibility",e[3])},i(e){r||(Ea(i),r=!0)},o(e){Aa(i),r=!1},d(e){e&&Ln(t),a[o].d()}}}function vb(e,t,o){let i,r,n,a,s,l,c,d,{isActive:u=!1}=t,{controls:p=[]}=t,{locale:h}=t,{scrollElasticity:m}=t,{scrollEnable:g=!0}=t,{hideTitles:$=!1}=t,{willRenderControls:f=Y}=t;const y=ca("redrawTrigger");hn(e,y,(e=>o(16,l=e)));const b=ca("env");hn(e,b,(e=>o(15,s=e)));const x=ca("isAnimated");hn(e,x,(e=>o(18,d=e)));const v=xc(0,{stiffness:.25,damping:.9});return hn(e,v,(e=>o(17,c=e))),e.$$set=e=>{"isActive"in e&&o(10,u=e.isActive),"controls"in e&&o(11,p=e.controls),"locale"in e&&o(12,h=e.locale),"scrollElasticity"in e&&o(0,m=e.scrollElasticity),"scrollEnable"in e&&o(1,g=e.scrollEnable),"hideTitles"in e&&o(13,$=e.hideTitles),"willRenderControls"in e&&o(14,f=e.willRenderControls)},e.$$.update=()=>{263168&e.$$.dirty&&v.set(u?1:0,{hard:!1===d}),131072&e.$$.dirty&&o(5,i=c),1024&e.$$.dirty&&o(4,r=u?"auto":"none"),131072&e.$$.dirty&&o(3,n=c<=0?"hidden":"visible"),129024&e.$$.dirty&&o(2,a=l&&f(p.map((e=>["ShapeStyle",e.id,{title:e.componentProps.title,locale:h,hideTitle:$,items:[[e.component,e.id,e.componentProps]]}])),s,(()=>y.set({}))))},[m,g,a,n,r,i,y,b,x,v,u,p,h,$,f,s,l,c,d]}class wb extends Ga{constructor(e){super(),Ua(this,e,vb,xb,ln,{isActive:10,controls:11,locale:12,scrollElasticity:0,scrollEnable:1,hideTitles:13,willRenderControls:14})}}function Sb(e,t,o){const i=e.slice();return i[15]=t[o].key,i[6]=t[o].controls,i[16]=t[o].isActive,i}function kb(e,t){let o,i,r;return i=new wb({props:{isActive:t[16],controls:t[6],locale:t[1],scrollElasticity:t[2],scrollEnable:t[3],hideTitles:t[4],willRenderControls:t[5]}}),{key:e,first:null,c(){o=Bn(),Na(i.$$.fragment),this.first=o},m(e,t){An(e,o,t),Ha(i,e,t),r=!0},p(e,o){t=e;const r={};128&o&&(r.isActive=t[16]),128&o&&(r.controls=t[6]),2&o&&(r.locale=t[1]),4&o&&(r.scrollElasticity=t[2]),8&o&&(r.scrollEnable=t[3]),16&o&&(r.hideTitles=t[4]),32&o&&(r.willRenderControls=t[5]),i.$set(r)},i(e){r||(Ea(i.$$.fragment,e),r=!0)},o(e){Aa(i.$$.fragment,e),r=!1},d(e){e&&Ln(o),ja(i,e)}}}function Cb(e){let t,o,i,r=[],n=new Map,a=e[7];const s=e=>e[15];for(let t=0;t<a.length;t+=1){let o=Sb(e,a,t),i=s(o);n.set(i,r[t]=kb(i,o))}return{c(){t=Fn("div");for(let e=0;e<r.length;e+=1)r[e].c();Nn(t,"class",o=Xc(["PinturaShapeStyleEditor",!e[3]&&"PinturaShapeStyleEditorOverflow",e[0]]))},m(e,o){An(e,t,o);for(let e=0;e<r.length;e+=1)r[e].m(t,null);i=!0},p(e,[l]){190&l&&(a=e[7],Ra(),r=Ba(r,l,s,1,e,a,n,t,Oa,kb,null,Sb),Ia()),(!i||9&l&&o!==(o=Xc(["PinturaShapeStyleEditor",!e[3]&&"PinturaShapeStyleEditorOverflow",e[0]])))&&Nn(t,"class",o)},i(e){if(!i){for(let e=0;e<a.length;e+=1)Ea(r[e]);i=!0}},o(e){for(let e=0;e<r.length;e+=1)Aa(r[e]);i=!1},d(e){e&&Ln(t);for(let e=0;e<r.length;e+=1)r[e].d()}}}function Tb(e,t,o){let i,r,n,{class:a}=t,{controls:s={}}=t,{shapeProps:l}=t,{onchange:c}=t,{locale:d}=t,{scrollElasticity:u}=t,{scrollEnable:p=!0}=t,{hideTitles:h=!1}=t,{willRenderControls:g}=t;const $=[];return e.$$set=e=>{"class"in e&&o(0,a=e.class),"controls"in e&&o(6,s=e.controls),"shapeProps"in e&&o(8,l=e.shapeProps),"onchange"in e&&o(9,c=e.onchange),"locale"in e&&o(1,d=e.locale),"scrollElasticity"in e&&o(2,u=e.scrollElasticity),"scrollEnable"in e&&o(3,p=e.scrollEnable),"hideTitles"in e&&o(4,h=e.hideTitles),"willRenderControls"in e&&o(5,g=e.willRenderControls)},e.$$.update=()=>{64&e.$$.dirty&&o(11,i=Object.keys(s).filter((e=>s[e]))),2304&e.$$.dirty&&o(10,r=l&&Object.keys(l).length&&i&&Ui(l)?(e=>i.filter((t=>t.split("_").every((t=>Wo(e,t)&&Ui(e,t))))).map((t=>{const o=(e.settings&&e.settings[t]||{}).control||t,i=t.split("_");let r=i.length>1?i.map((t=>e[t])):e[t];if(R(s[o])){const{title:i,component:n}=s[o](r,(e=>{c({[t]:e})}),{selectedShapeId:e.id});return{id:o,component:mh,componentProps:{title:i,items:n}}}let[n,a]=s[o];if(m(n)&&s[n]){const e={...a};[n,a]=s[n],a={...a,...e}}const l=R(a.options)?a.options(e):a.options;return"RadioGroup"===n&&(a.selectedIndex=-1),a.formatValue&&(r=a.formatValue(r)),{id:o,component:n,componentProps:{...a,options:l,locale:d,value:r,optionLabelClass:"PinturaButtonLabel",onchange:o=>{const r=T(o)&&!_o(o)?o.value:o;a.onchange&&a.onchange(r,e);const n=i.length>1?i.reduce(((e,t,o)=>({...e,[t]:Array.isArray(r)?r[o]:r})),{}):{[t]:r};c(n)}}}})).filter(Boolean))(l):[]),1280&e.$$.dirty&&o(7,n=((e,t)=>{let o=$.find((t=>t.key===e));return o||(o={key:e,controls:t},$.push(o)),$.forEach((e=>e.isActive=!1)),o.controls=t,o.isActive=!0,$})(l&&Object.keys(l).length?Object.keys(l).join("_"):"none",r||[]))},[a,d,u,p,h,g,s,n,l,c,r,i]}class Mb extends Ga{constructor(e){super(),Ua(this,e,Tb,Cb,ln,{class:0,controls:6,shapeProps:8,onchange:9,locale:1,scrollElasticity:2,scrollEnable:3,hideTitles:4,willRenderControls:5})}}var Pb=e=>/<svg /.test(e);function Rb(e){let t,o;return t=new mh({props:{items:e[10]}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};1024&o&&(i.items=e[10]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Ib(e){let t,o,i,r;const n=[Ab,Eb],a=[];function s(e,t){return e[8]?0:1}return t=s(e),o=a[t]=n[t](e),{c(){o.c(),i=Bn()},m(e,o){a[t].m(e,o),An(e,i,o),r=!0},p(e,r){let l=t;t=s(e),t===l?a[t].p(e,r):(Ra(),Aa(a[l],1,1,(()=>{a[l]=null})),Ia(),o=a[t],o?o.p(e,r):(o=a[t]=n[t](e),o.c()),Ea(o,1),o.m(i.parentNode,i))},i(e){r||(Ea(o),r=!0)},o(e){Aa(o),r=!1},d(e){a[t].d(e),e&&Ln(i)}}}function Eb(e){let t,o,i,r,n=e[10]&&Lb(e);return i=new Ah({props:{scrollAutoCancel:e[9],elasticity:e[0],$$slots:{default:[Fb]},$$scope:{ctx:e}}}),{c(){t=Fn("div"),n&&n.c(),o=On(),Na(i.$$.fragment),Nn(t,"class","PinturaShapePresetsFlat")},m(e,a){An(e,t,a),n&&n.m(t,null),Rn(t,o),Ha(i,t,null),r=!0},p(e,r){e[10]?n?(n.p(e,r),1024&r&&Ea(n,1)):(n=Lb(e),n.c(),Ea(n,1),n.m(t,o)):n&&(Ra(),Aa(n,1,1,(()=>{n=null})),Ia());const a={};512&r&&(a.scrollAutoCancel=e[9]),1&r&&(a.elasticity=e[0]),536871070&r&&(a.$$scope={dirty:r,ctx:e}),i.$set(a)},i(e){r||(Ea(n),Ea(i.$$.fragment,e),r=!0)},o(e){Aa(n),Aa(i.$$.fragment,e),r=!1},d(e){e&&Ln(t),n&&n.d(),ja(i)}}}function Ab(e){let t,o,i,r,n;o=new Ah({props:{elasticity:e[0],class:"PinturaShapePresetsGroups",$$slots:{default:[_b]},$$scope:{ctx:e}}});const a=[{class:"PinturaControlPanels"},{panelClass:"PinturaControlPanel"},{panels:e[11]},e[12]];let s={$$slots:{default:[Nb,({panel:e,panelIsActive:t})=>({26:e,27:t}),({panel:e,panelIsActive:t})=>(e?67108864:0)|(t?134217728:0)]},$$scope:{ctx:e}};for(let e=0;e<a.length;e+=1)s=on(s,a[e]);return r=new gd({props:s}),{c(){t=Fn("div"),Na(o.$$.fragment),i=On(),Na(r.$$.fragment),Nn(t,"class","PinturaShapePresetsGrouped")},m(e,a){An(e,t,a),Ha(o,t,null),Rn(t,i),Ha(r,t,null),n=!0},p(e,t){const i={};1&t&&(i.elasticity=e[0]),536876128&t&&(i.$$scope={dirty:t,ctx:e}),o.$set(i);const n=6144&t?Wa(a,[a[0],a[1],2048&t&&{panels:e[11]},4096&t&&_a(e[12])]):{};738206239&t&&(n.$$scope={dirty:t,ctx:e}),r.$set(n)},i(e){n||(Ea(o.$$.fragment,e),Ea(r.$$.fragment,e),n=!0)},o(e){Aa(o.$$.fragment,e),Aa(r.$$.fragment,e),n=!1},d(e){e&&Ln(t),ja(o),ja(r)}}}function Lb(e){let t,o;return t=new mh({props:{items:e[10]}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};1024&o&&(i.items=e[10]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Fb(e){let t,o;return t=new Fd({props:{items:e[7],onclickitem:e[1],ongrabitem:e[2],ondragitem:e[3],ondropitem:e[4]}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};128&o&&(i.items=e[7]),2&o&&(i.onclickitem=e[1]),4&o&&(i.ongrabitem=e[2]),8&o&&(i.ondragitem=e[3]),16&o&&(i.ondropitem=e[4]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function zb(e){let t,o;return t=new mh({props:{items:e[10]}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};1024&o&&(i.items=e[10]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Db(e){let t,o;return t=new Sd({props:{$$slots:{default:[Ob]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};805306368&o&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Ob(e){let t,o=e[28].icon+"";return{c(){t=zn("g")},m(e,i){An(e,t,i),t.innerHTML=o},p(e,i){268435456&i&&o!==(o=e[28].icon+"")&&(t.innerHTML=o)},d(e){e&&Ln(t)}}}function Bb(e){let t,o,i=e[28].label+"";return{c(){t=Fn("span"),o=Dn(i)},m(e,i){An(e,t,i),Rn(t,o)},p(e,t){268435456&t&&i!==(i=e[28].label+"")&&Un(o,i)},d(e){e&&Ln(t)}}}function Wb(e){let t,o,i,r=e[28].icon&&Db(e),n=!e[28].hideLabel&&Bb(e);return{c(){r&&r.c(),t=On(),n&&n.c(),o=Bn()},m(e,a){r&&r.m(e,a),An(e,t,a),n&&n.m(e,a),An(e,o,a),i=!0},p(e,i){e[28].icon?r?(r.p(e,i),268435456&i&&Ea(r,1)):(r=Db(e),r.c(),Ea(r,1),r.m(t.parentNode,t)):r&&(Ra(),Aa(r,1,1,(()=>{r=null})),Ia()),e[28].hideLabel?n&&(n.d(1),n=null):n?n.p(e,i):(n=Bb(e),n.c(),n.m(o.parentNode,o))},i(e){i||(Ea(r),i=!0)},o(e){Aa(r),i=!1},d(e){r&&r.d(e),e&&Ln(t),n&&n.d(e),e&&Ln(o)}}}function _b(e){let t,o,i,r=e[10]&&zb(e);const n=[{class:"PinturaControlList"},{tabs:e[5]},e[12],{layout:"compact"}];let a={$$slots:{default:[Wb,({tab:e})=>({28:e}),({tab:e})=>e?268435456:0]},$$scope:{ctx:e}};for(let e=0;e<n.length;e+=1)a=on(a,n[e]);return o=new od({props:a}),o.$on("select",e[18]),{c(){r&&r.c(),t=On(),Na(o.$$.fragment)},m(e,n){r&&r.m(e,n),An(e,t,n),Ha(o,e,n),i=!0},p(e,i){e[10]?r?(r.p(e,i),1024&i&&Ea(r,1)):(r=zb(e),r.c(),Ea(r,1),r.m(t.parentNode,t)):r&&(Ra(),Aa(r,1,1,(()=>{r=null})),Ia());const a=4128&i?Wa(n,[n[0],32&i&&{tabs:e[5]},4096&i&&_a(e[12]),n[3]]):{};805306368&i&&(a.$$scope={dirty:i,ctx:e}),o.$set(a)},i(e){i||(Ea(r),Ea(o.$$.fragment,e),i=!0)},o(e){Aa(r),Aa(o.$$.fragment,e),i=!1},d(e){r&&r.d(e),e&&Ln(t),ja(o,e)}}}function Vb(e){let t,o;return t=new Fd({props:{items:e[13][e[26]].items,disabled:e[13][e[26]].disabled,onclickitem:e[1],ongrabitem:e[2],ondragitem:e[3],ondropitem:e[4]}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};67117056&o&&(i.items=e[13][e[26]].items),67117056&o&&(i.disabled=e[13][e[26]].disabled),2&o&&(i.onclickitem=e[1]),4&o&&(i.ongrabitem=e[2]),8&o&&(i.ondragitem=e[3]),16&o&&(i.ondropitem=e[4]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Nb(e){let t,o;return t=new Ah({props:{scroll:e[27]?{scrollOffset:0,animate:!1}:void 0,scrollAutoCancel:e[9],elasticity:e[0],$$slots:{default:[Vb]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};134217728&o&&(i.scroll=e[27]?{scrollOffset:0,animate:!1}:void 0),512&o&&(i.scrollAutoCancel=e[9]),1&o&&(i.elasticity=e[0]),603987998&o&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Hb(e){let t,o,i,r;const n=[Ib,Rb],a=[];function s(e,t){return e[9]?0:e[10]?1:-1}return~(o=s(e))&&(i=a[o]=n[o](e)),{c(){t=Fn("div"),i&&i.c(),Nn(t,"class","PinturaShapePresetsPalette")},m(e,i){An(e,t,i),~o&&a[o].m(t,null),r=!0},p(e,[r]){let l=o;o=s(e),o===l?~o&&a[o].p(e,r):(i&&(Ra(),Aa(a[l],1,1,(()=>{a[l]=null})),Ia()),~o?(i=a[o],i?i.p(e,r):(i=a[o]=n[o](e),i.c()),Ea(i,1),i.m(t,null)):i=null)},i(e){r||(Ea(i),r=!0)},o(e){Aa(i),r=!1},d(e){e&&Ln(t),~o&&a[o].d()}}}function jb(e,t,o){let i,r,a,s,l,c,d,u,p,{locale:h}=t,{presets:g}=t,{scrollElasticity:$}=t,{enableSelectImage:f=!0}=t,{willRenderPresetToolbar:y=Y}=t,{onaddpreset:b=n}=t,{ongrabpreset:x}=t,{ondragpreset:v}=t,{ondroppreset:w}=t;const S="presets-"+L(),k=(e,t="")=>Pb(e)?e:Bo(e)?Uo(e,t):`<img src="${e}" alt="${t}"/>`,C=e=>j(Zt(e)),T=["src","alt","thumb","shape","id","mount","disabled"],M=e=>e.map((e=>(e=>_o(e)&&m(e[0])&&_o(e[1]))(e)?{...e[2],id:`${S}-${e[0].toLowerCase()}`,label:e[0],items:M(e[1])}:(e=>{let t,o,i,r,n,a,s,l=e;return m(e)?Bo(e)?(t=e,n=e,r=k(t,n)):(t=e,n=C(t),r=k(t,n)):(t=e.src,n=e.alt||(m(t)?C(t):m(e.thumb)?C(e.thumb):void 0),r=k(e.thumb||t,n),o=e.shape,a=e.mount,s=e.disabled,i=Object.keys(e).reduce(((t,o)=>(T.includes(o)||(t[o]=e[o]),t)),{})),{id:l,src:t,thumb:r,shape:o,shapeProps:i,alt:n,title:n,mount:a,disabled:s}})(e)));return e.$$set=e=>{"locale"in e&&o(14,h=e.locale),"presets"in e&&o(15,g=e.presets),"scrollElasticity"in e&&o(0,$=e.scrollElasticity),"enableSelectImage"in e&&o(16,f=e.enableSelectImage),"willRenderPresetToolbar"in e&&o(17,y=e.willRenderPresetToolbar),"onaddpreset"in e&&o(1,b=e.onaddpreset),"ongrabpreset"in e&&o(2,x=e.ongrabpreset),"ondragpreset"in e&&o(3,v=e.ondragpreset),"ondroppreset"in e&&o(4,w=e.ondroppreset)},e.$$.update=()=>{32768&e.$$.dirty&&o(7,i=M(g)),128&e.$$.dirty&&o(9,r=i.length),640&e.$$.dirty&&o(8,a=r&&i.some((e=>!!e.items))),384&e.$$.dirty&&o(5,s=a&&i),384&e.$$.dirty&&o(13,l=a&&i.reduce(((e,t)=>(e[t.id]=t,e)),{})),96&e.$$.dirty&&o(6,c=c||s&&(s.find((e=>!e.disabled))||{}).id),64&e.$$.dirty&&o(12,d={name:S,selected:c}),32&e.$$.dirty&&o(11,u=s&&s.map((e=>e.id))),212994&e.$$.dirty&&o(10,p=h&&y([f&&["Button","browse",{label:h.shapeLabelButtonSelectSticker,icon:h.shapeIconButtonSelectSticker,onclick:()=>{sm().then((e=>{e&&b(e)}))}}]]))},[$,b,x,v,w,s,c,i,a,r,p,u,d,l,h,g,f,y,({detail:e})=>o(6,c=e)]}class Ub extends Ga{constructor(e){super(),Ua(this,e,jb,Hb,ln,{locale:14,presets:15,scrollElasticity:0,enableSelectImage:16,willRenderPresetToolbar:17,onaddpreset:1,ongrabpreset:2,ondragpreset:3,ondroppreset:4})}}function Gb(e){let t,o,i,r;return t=new mh({props:{items:e[30]}}),i=new Mb({props:{locale:e[4],shapeProps:e[49],onchange:e[85],controls:e[9],scrollEnable:!1,hideTitles:!0,willRenderControls:e[165]}}),{c(){Na(t.$$.fragment),o=On(),Na(i.$$.fragment)},m(e,n){Ha(t,e,n),An(e,o,n),Ha(i,e,n),r=!0},p(e,o){const r={};1073741824&o[0]&&(r.items=e[30]),t.$set(r);const n={};16&o[0]&&(n.locale=e[4]),262144&o[1]&&(n.shapeProps=e[49]),512&o[0]&&(n.controls=e[9]),i.$set(n)},i(e){r||(Ea(t.$$.fragment,e),Ea(i.$$.fragment,e),r=!0)},o(e){Aa(t.$$.fragment,e),Aa(i.$$.fragment,e),r=!1},d(e){ja(t,e),e&&Ln(o),ja(i,e)}}}function Zb(e){let t,o,i;return o=new pf({props:{$$slots:{default:[Gb]},$$scope:{ctx:e}}}),{c(){t=Fn("div"),Na(o.$$.fragment),Nn(t,"slot","header")},m(e,r){An(e,t,r),Ha(o,t,null),i=!0},p(e,t){const i={};1073742352&t[0]|262144&t[1]|134217728&t[6]&&(i.$$scope={dirty:t,ctx:e}),o.$set(i)},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Ln(t),ja(o)}}}function Xb(e){let t,o;const i=[{locale:e[4]},{ui:e[69]},{shapes:e[5]},{selection:e[58]},{uid:e[20]},{parentRect:e[37]},{rootRect:e[55]},{utilRect:e[39]},{offset:e[50]},{disabled:e[38]},{contextRotation:e[23]},{contextFlipX:e[24]},{contextFlipY:e[25]},{contextZoom:e[36]?e[36].scale:void 0},{active:e[35]},{opacity:e[56]},{hoverColor:e[57]},{caretColor:e[57]},{snapColor:e[57]},{gridColor:[1,1,1,.125]},{eraseRadius:e[47]},{selectRadius:e[6]},{enableButtonFlipVertical:e[10]},{enableMultiSelect:e[14]},{mapEditorPointToImagePoint:e[21]},{mapImagePointToEditorPoint:e[22]},{enableTapToAddText:e[13]},{textInputMode:e[8]},{snapThreshold:e[16]},{snapPointer:!e[48]},{enableSnapToContext:e[17]},{gridSize:e[15]},{willStartInteraction:e[95]},{oninteractionstart:e[79]},{oninteractionupdate:e[80]},{oninteractionrelease:e[81]},{oninteractionend:e[83]},{oninteractioncancel:e[82]},{onleavecanvas:e[87]},{onhovercanvas:e[86]},{onhovershape:e[89]},{ontapcanvas:e[88]},{onaddshape:e[156]},{onselectshape:e[157]},{onblurshape:e[158]},{ontapshape:e[159]},{onupdateshape:e[160]},{onremoveshape:e[161]},{ontriggerhistorywrite:e[162]},e[42]];let r={};for(let e=0;e<i.length;e+=1)r=on(r,i[e]);return t=new $b({props:r}),e[163](t),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const r=66315632&o[0]|252381681&o[1]|255721600&o[2]|12&o[3]?Wa(i,[16&o[0]&&{locale:e[4]},128&o[2]&&{ui:e[69]},32&o[0]&&{shapes:e[5]},134217728&o[1]&&{selection:e[58]},1048576&o[0]&&{uid:e[20]},64&o[1]&&{parentRect:e[37]},16777216&o[1]&&{rootRect:e[55]},256&o[1]&&{utilRect:e[39]},524288&o[1]&&{offset:e[50]},128&o[1]&&{disabled:e[38]},8388608&o[0]&&{contextRotation:e[23]},16777216&o[0]&&{contextFlipX:e[24]},33554432&o[0]&&{contextFlipY:e[25]},32&o[1]&&{contextZoom:e[36]?e[36].scale:void 0},16&o[1]&&{active:e[35]},33554432&o[1]&&{opacity:e[56]},67108864&o[1]&&{hoverColor:e[57]},67108864&o[1]&&{caretColor:e[57]},67108864&o[1]&&{snapColor:e[57]},i[19],65536&o[1]&&{eraseRadius:e[47]},64&o[0]&&{selectRadius:e[6]},1024&o[0]&&{enableButtonFlipVertical:e[10]},16384&o[0]&&{enableMultiSelect:e[14]},2097152&o[0]&&{mapEditorPointToImagePoint:e[21]},4194304&o[0]&&{mapImagePointToEditorPoint:e[22]},8192&o[0]&&{enableTapToAddText:e[13]},256&o[0]&&{textInputMode:e[8]},65536&o[0]&&{snapThreshold:e[16]},131072&o[1]&&{snapPointer:!e[48]},131072&o[0]&&{enableSnapToContext:e[17]},32768&o[0]&&{gridSize:e[15]},4&o[3]&&{willStartInteraction:e[95]},131072&o[2]&&{oninteractionstart:e[79]},262144&o[2]&&{oninteractionupdate:e[80]},524288&o[2]&&{oninteractionrelease:e[81]},2097152&o[2]&&{oninteractionend:e[83]},1048576&o[2]&&{oninteractioncancel:e[82]},33554432&o[2]&&{onleavecanvas:e[87]},16777216&o[2]&&{onhovercanvas:e[86]},134217728&o[2]&&{onhovershape:e[89]},67108864&o[2]&&{ontapcanvas:e[88]},1&o[1]|8&o[3]&&{onaddshape:e[156]},1&o[1]&&{onselectshape:e[157]},1&o[1]&&{onblurshape:e[158]},1&o[1]&&{ontapshape:e[159]},1&o[1]|8&o[3]&&{onupdateshape:e[160]},1&o[1]|8&o[3]&&{onremoveshape:e[161]},8&o[3]&&{ontriggerhistorywrite:e[162]},2048&o[1]&&_a(e[42])]):{};t.$set(r)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(o){e[163](null),ja(t,o)}}}function Yb(e){let t,o,i,r,a=e[51]&&Xb(e);return{c(){t=Fn("div"),a&&a.c(),Nn(t,"slot","main"),Zn(t,"cursor",e[46])},m(s,l){An(s,t,l),a&&a.m(t,null),e[164](t),o=!0,i||(r=[Wn(t,"keydown",e[84]),wn(_c.call(null,t)),Wn(t,"dropfiles",(function(){sn(e[12]?e[94]:n)&&(e[12]?e[94]:n).apply(this,arguments)})),wn(Dc.call(null,t)),Wn(t,"measure",e[152])],i=!0)},p(o,i){(e=o)[51]?a?(a.p(e,i),1048576&i[1]&&Ea(a,1)):(a=Xb(e),a.c(),Ea(a,1),a.m(t,null)):a&&(Ra(),Aa(a,1,1,(()=>{a=null})),Ia()),32768&i[1]&&Zn(t,"cursor",e[46])},i(e){o||(Ea(a),o=!0)},o(e){Aa(a),o=!1},d(o){o&&Ln(t),a&&a.d(),e[164](null),i=!1,an(r)}}}function qb(e){let t,o;return t=new Ub({props:{locale:e[4],presets:e[19],enableSelectImage:e[11],willRenderPresetToolbar:e[43],onaddpreset:e[93],ongrabpreset:e[90],ondragpreset:e[91],ondroppreset:e[92],scrollElasticity:e[44]}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};16&o[0]&&(i.locale=e[4]),524288&o[0]&&(i.presets=e[19]),2048&o[0]&&(i.enableSelectImage=e[11]),4096&o[1]&&(i.willRenderPresetToolbar=e[43]),8192&o[1]&&(i.scrollElasticity=e[44]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Kb(e){let t,o,i,r="stack"===e[7]&&Jb(e),n=(e[53]&&e[34]||"row"===e[7])&&tx(e);return{c(){r&&r.c(),t=On(),n&&n.c(),o=Bn()},m(e,a){r&&r.m(e,a),An(e,t,a),n&&n.m(e,a),An(e,o,a),i=!0},p(e,i){"stack"===e[7]?r?(r.p(e,i),128&i[0]&&Ea(r,1)):(r=Jb(e),r.c(),Ea(r,1),r.m(t.parentNode,t)):r&&(Ra(),Aa(r,1,1,(()=>{r=null})),Ia()),e[53]&&e[34]||"row"===e[7]?n?(n.p(e,i),128&i[0]|4194312&i[1]&&Ea(n,1)):(n=tx(e),n.c(),Ea(n,1),n.m(o.parentNode,o)):n&&(Ra(),Aa(n,1,1,(()=>{n=null})),Ia())},i(e){i||(Ea(r),Ea(n),i=!0)},o(e){Aa(r),Aa(n),i=!1},d(e){r&&r.d(e),e&&Ln(t),n&&n.d(e),e&&Ln(o)}}}function Jb(e){let t,o,i,r;const n=[ex,Qb],a=[];function s(e,t){return e[45]?0:1}return o=s(e),i=a[o]=n[o](e),{c(){t=Fn("div"),i.c(),Nn(t,"class","PinturaControlPanels")},m(e,i){An(e,t,i),a[o].m(t,null),r=!0},p(e,r){let l=o;o=s(e),o===l?a[o].p(e,r):(Ra(),Aa(a[l],1,1,(()=>{a[l]=null})),Ia(),i=a[o],i?i.p(e,r):(i=a[o]=n[o](e),i.c()),Ea(i,1),i.m(t,null))},i(e){r||(Ea(i),r=!0)},o(e){Aa(i),r=!1},d(e){e&&Ln(t),a[o].d()}}}function Qb(e){let t,o,i;return o=new Mb({props:{locale:e[4],shapeProps:e[49],onchange:e[85],controls:e[9],scrollElasticity:e[44],willRenderControls:e[18]}}),{c(){t=Fn("div"),Na(o.$$.fragment),Nn(t,"class","PinturaControlPanel")},m(e,r){An(e,t,r),Ha(o,t,null),i=!0},p(e,t){const i={};16&t[0]&&(i.locale=e[4]),262144&t[1]&&(i.shapeProps=e[49]),512&t[0]&&(i.controls=e[9]),8192&t[1]&&(i.scrollElasticity=e[44]),262144&t[0]&&(i.willRenderControls=e[18]),o.$set(i)},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Ln(t),ja(o)}}}function ex(e){let t,o,i;return o=new Ub({props:{locale:e[4],presets:e[19],enableSelectImage:e[11],willRenderPresetToolbar:e[43],onaddpreset:e[93],ongrabpreset:e[90],ondragpreset:e[91],ondroppreset:e[92],scrollElasticity:e[44]}}),{c(){t=Fn("div"),Na(o.$$.fragment),Nn(t,"class","PinturaControlPanel")},m(e,r){An(e,t,r),Ha(o,t,null),i=!0},p(e,t){const i={};16&t[0]&&(i.locale=e[4]),524288&t[0]&&(i.presets=e[19]),2048&t[0]&&(i.enableSelectImage=e[11]),4096&t[1]&&(i.willRenderPresetToolbar=e[43]),8192&t[1]&&(i.scrollElasticity=e[44]),o.$set(i)},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Ln(t),ja(o)}}}function tx(e){let t,o;return t=new Ah({props:{class:"PinturaControlListScroller",elasticity:e[44],$$slots:{default:[lx]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};8192&o[1]&&(i.elasticity=e[44]),262801&o[0]|262154&o[1]|134217728&o[6]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function ox(e){let t,o;return t=new Lu({props:{locale:e[4],class:"PinturaControlList",optionClass:"PinturaControlListOption",layout:"row",options:e[32],selectedIndex:e[32].findIndex(e[153]),onchange:e[78],$$slots:{option:[ax,({option:e})=>({212:e}),({option:e})=>[0,0,0,0,0,0,e?67108864:0]]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};16&o[0]&&(i.locale=e[4]),2&o[1]&&(i.options=e[32]),1&o[0]|2&o[1]&&(i.selectedIndex=e[32].findIndex(e[153])),16&o[0]|201326592&o[6]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function ix(e){let t,o;return t=new Sd({props:{$$slots:{default:[rx]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};16&o[0]|201326592&o[6]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function rx(e){let t,o=(R(e[212].icon)?e[212].icon(e[4]):e[212].icon)+"";return{c(){t=zn("g")},m(e,i){An(e,t,i),t.innerHTML=o},p(e,i){16&i[0]|67108864&i[6]&&o!==(o=(R(e[212].icon)?e[212].icon(e[4]):e[212].icon)+"")&&(t.innerHTML=o)},d(e){e&&Ln(t)}}}function nx(e){let t,o,i=(R(e[212].label)?e[212].label(e[4]):e[212].label)+"";return{c(){t=Fn("span"),o=Dn(i)},m(e,i){An(e,t,i),Rn(t,o)},p(e,t){16&t[0]|67108864&t[6]&&i!==(i=(R(e[212].label)?e[212].label(e[4]):e[212].label)+"")&&Un(o,i)},d(e){e&&Ln(t)}}}function ax(e){let t,o,i,r=e[212].icon&&ix(e),n=!e[212].hideLabel&&nx(e);return{c(){t=Fn("div"),r&&r.c(),o=On(),n&&n.c(),Nn(t,"slot","option")},m(e,a){An(e,t,a),r&&r.m(t,null),Rn(t,o),n&&n.m(t,null),i=!0},p(e,i){e[212].icon?r?(r.p(e,i),67108864&i[6]&&Ea(r,1)):(r=ix(e),r.c(),Ea(r,1),r.m(t,o)):r&&(Ra(),Aa(r,1,1,(()=>{r=null})),Ia()),e[212].hideLabel?n&&(n.d(1),n=null):n?n.p(e,i):(n=nx(e),n.c(),n.m(t,null))},i(e){i||(Ea(r),i=!0)},o(e){Aa(r),i=!1},d(e){e&&Ln(t),r&&r.d(),n&&n.d()}}}function sx(e){let t,o;return t=new Mb({props:{locale:e[4],shapeProps:e[49],onchange:e[85],controls:e[9],scrollEnable:!1,hideTitles:!0,willRenderControls:e[154]}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};16&o[0]&&(i.locale=e[4]),262144&o[1]&&(i.shapeProps=e[49]),512&o[0]&&(i.controls=e[9]),262144&o[0]&&(i.willRenderControls=e[154]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function lx(e){let t,o,i,r=e[34]&&ox(e),n="row"===e[7]&&sx(e);return{c(){r&&r.c(),t=On(),n&&n.c(),o=Bn()},m(e,a){r&&r.m(e,a),An(e,t,a),n&&n.m(e,a),An(e,o,a),i=!0},p(e,i){e[34]?r?(r.p(e,i),8&i[1]&&Ea(r,1)):(r=ox(e),r.c(),Ea(r,1),r.m(t.parentNode,t)):r&&(Ra(),Aa(r,1,1,(()=>{r=null})),Ia()),"row"===e[7]?n?(n.p(e,i),128&i[0]&&Ea(n,1)):(n=sx(e),n.c(),Ea(n,1),n.m(o.parentNode,o)):n&&(Ra(),Aa(n,1,1,(()=>{n=null})),Ia())},i(e){i||(Ea(r),Ea(n),i=!0)},o(e){Aa(r),Aa(n),i=!1},d(e){r&&r.d(e),e&&Ln(t),n&&n.d(e),e&&Ln(o)}}}function cx(e){let t,o;return t=new Ah({props:{class:"PinturaControlListScroller",elasticity:e[44],$$slots:{default:[hx]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};8192&o[1]&&(i.elasticity=e[44]),134217744&o[0]|8388608&o[1]|134217728&o[6]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function dx(e){let t,o;return t=new Sd({props:{$$slots:{default:[ux]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};16&o[0]|201326592&o[6]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function ux(e){let t,o=(R(e[212].icon)?e[212].icon(e[4]):e[212].icon)+"";return{c(){t=zn("g")},m(e,i){An(e,t,i),t.innerHTML=o},p(e,i){16&i[0]|67108864&i[6]&&o!==(o=(R(e[212].icon)?e[212].icon(e[4]):e[212].icon)+"")&&(t.innerHTML=o)},d(e){e&&Ln(t)}}}function px(e){let t,o,i,r,n,a=(R(e[212].label)?e[212].label(e[4]):e[212].label)+"",s=e[212].icon&&dx(e);return{c(){t=Fn("div"),s&&s.c(),o=On(),i=Fn("span"),r=Dn(a),Nn(t,"slot","option")},m(e,a){An(e,t,a),s&&s.m(t,null),Rn(t,o),Rn(t,i),Rn(i,r),n=!0},p(e,i){e[212].icon?s?(s.p(e,i),67108864&i[6]&&Ea(s,1)):(s=dx(e),s.c(),Ea(s,1),s.m(t,o)):s&&(Ra(),Aa(s,1,1,(()=>{s=null})),Ia()),(!n||16&i[0]|67108864&i[6])&&a!==(a=(R(e[212].label)?e[212].label(e[4]):e[212].label)+"")&&Un(r,a)},i(e){n||(Ea(s),n=!0)},o(e){Aa(s),n=!1},d(e){e&&Ln(t),s&&s.d()}}}function hx(e){let t,o;return t=new Lu({props:{locale:e[4],class:"PinturaControlList",optionClass:"PinturaControlListOption",layout:"row",options:e[54],selectedIndex:e[54].findIndex(e[155]),onchange:e[77],$$slots:{option:[px,({option:e})=>({212:e}),({option:e})=>[0,0,0,0,0,0,e?67108864:0]]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};16&o[0]&&(i.locale=e[4]),8388608&o[1]&&(i.options=e[54]),134217728&o[0]|8388608&o[1]&&(i.selectedIndex=e[54].findIndex(e[155])),16&o[0]|201326592&o[6]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function mx(e){let t,o,i,r,n;const a=[Kb,qb],s=[];function l(e,t){return e[52]?0:e[45]?1:-1}~(o=l(e))&&(i=s[o]=a[o](e));let c=e[33]&&cx(e);return{c(){t=Fn("div"),i&&i.c(),r=On(),c&&c.c(),Nn(t,"slot","footer"),Zn(t,"transform",e[40])},m(e,i){An(e,t,i),~o&&s[o].m(t,null),Rn(t,r),c&&c.m(t,null),n=!0},p(e,n){let d=o;o=l(e),o===d?~o&&s[o].p(e,n):(i&&(Ra(),Aa(s[d],1,1,(()=>{s[d]=null})),Ia()),~o?(i=s[o],i?i.p(e,n):(i=s[o]=a[o](e),i.c()),Ea(i,1),i.m(t,r)):i=null),e[33]?c?(c.p(e,n),4&n[1]&&Ea(c,1)):(c=cx(e),c.c(),Ea(c,1),c.m(t,null)):c&&(Ra(),Aa(c,1,1,(()=>{c=null})),Ia()),512&n[1]&&Zn(t,"transform",e[40])},i(e){n||(Ea(i),Ea(c),n=!0)},o(e){Aa(i),Aa(c),n=!1},d(e){e&&Ln(t),~o&&s[o].d(),c&&c.d()}}}function gx(e){let t,o;return t=new Tf({props:{hasHeader:e[41],$$slots:{footer:[mx],main:[Yb],header:[Zb]},$$scope:{ctx:e}}}),t.$on("measure",e[166]),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};1024&o[1]&&(i.hasHeader=e[41]),2080374769&o[0]|134216703&o[1]|134217728&o[6]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function $x(e,t,o){let i,r,n,a,s,l,c,d,u,p,h,g,$,f,y,b,x,v,w,S,k,C,T,M,P,R,I,E,A,L,F,z,D,O,B,W,_,V,N,H,j,U,G,Z,X,q,K,J,Q,ee,te,oe,ie,re,ne,ae,se,le,ce,de,ue,pe,he,ge,$e,fe,ye,be,xe=en,ve=()=>(xe(),xe=un(Ie,(e=>o(35,X=e))),Ie),we=en,Se=()=>(we(),we=un(Oe,(e=>o(145,Q=e))),Oe),ke=en,Ce=()=>(ke(),ke=un(ft,(e=>o(37,ae=e))),ft),Te=en,Me=()=>(Te(),Te=un(Fe,(e=>o(151,ge=e))),Fe),Pe=en,Re=()=>(Pe(),Pe=un(Ae,(e=>o(56,ye=e))),Ae);e.$$.on_destroy.push((()=>xe())),e.$$.on_destroy.push((()=>we())),e.$$.on_destroy.push((()=>ke())),e.$$.on_destroy.push((()=>Te())),e.$$.on_destroy.push((()=>Pe()));let{isActive:Ie}=t;ve();let{isActiveFraction:Ae}=t;Re();let{isVisible:Fe}=t;Me();let{stores:ze}=t,{locale:De={}}=t,{shapes:Oe}=t;Se();let{toolbar:Be=[]}=t,{toolShapes:We={}}=t,{toolActive:_e}=t,{toolSelectRadius:Ve}=t,{toolRetainStyles:Ne=!1}=t,{toolbarLayout:He="stack"}=t,{textInputMode:je}=t,{shapeControls:Ue={}}=t,{enableButtonFlipVertical:Ge=!1}=t,{enablePresetSelectImage:Ze=!0}=t,{enablePresetDropImage:Xe=!0}=t,{enableSelectToolToAddShape:Ye=!1}=t,{enableAutoSelectMoveTool:qe=["line","arrow","path","rectangle","ellipse","text"]}=t,{enableTapToAddText:Ke=!1}=t,{enableMoveTool:Je=!1}=t,{enableViewTool:Qe=!1}=t,{enableToolShareStyles:et=!0}=t,{enableMultiSelect:tt=!1}=t,{gridSize:ot=0}=t,{snapThreshold:it=0}=t,{enableSnapToContext:rt=!0}=t,{willRenderHeaderTools:nt=Y}=t,{willRenderPresetToolbar:at}=t,{willRenderShapeStyleControls:st}=t,{willStartInteraction:lt}=t,{shapePresets:dt=[]}=t,{utilKey:ut}=t,{mapScreenPointToImagePoint:pt}=t,{mapImagePointToScreenPoint:ht}=t,{imageRotation:mt=0}=t,{imageFlipX:gt=!1}=t,{imageFlipY:$t=!1}=t,{parentRect:ft}=t;Ce();let{hooks:yt={}}=t;const bt=ca("selection");hn(e,bt,(e=>o(150,ue=e)));const xt=ca("isAnimated");hn(e,xt,(e=>o(142,q=e)));const wt=ca("elasticityMultiplier");hn(e,wt,(e=>o(146,ee=e)));const St=ca("ui");hn(e,St,(e=>o(177,pe=e)));const kt=ca("keysPressed");let Ct;hn(e,kt,(e=>o(149,de=e)));const{env:Tt,history:Mt,rootRect:Pt,rootColorSecondary:Rt,enablePanInput:It,enablePanInputStatus:Et,enableZoomInput:At,stageRect:Lt,utilRectPadded:Ft,scrollElasticity:zt,imageOverlayMarkup:Dt,imagePreviewModifiers:Ot,imageCropRect:Bt,stageScalar:Wt,imageSelectionRect:_t,imageTransformsInterpolated:Vt,imageSelectionPan:Nt,imageSize:Ht,allowPan:jt,allowZoom:Ut,allowZoomControls:Gt,allowPlayPause:Zt}=ze;hn(e,Tt,(e=>o(143,K=e))),hn(e,Pt,(e=>o(55,fe=e))),hn(e,Rt,(e=>o(57,be=e))),hn(e,Et,(e=>o(38,le=e))),hn(e,Lt,(e=>o(147,te=e))),hn(e,Ft,(e=>o(39,he=e))),hn(e,Ot,(e=>o(178,$e=e))),hn(e,Bt,(e=>o(176,se=e))),hn(e,Wt,(e=>o(174,re=e))),hn(e,_t,(e=>o(175,ne=e))),hn(e,Vt,(e=>o(36,oe=e))),hn(e,Nt,(e=>o(173,ie=e))),hn(e,Ht,(e=>o(148,ce=e)));let Xt=0,Yt={};const qt=e=>{const[t,o]=Ct[e];let i,r,n="relative"===o.position;const a=n?"0%":0,s=n?"0%":0;Ii(t)||Mi(t)?(r=n?"20%":.2*ae.width,i=xi(t),sr(i),lr(i),i.x=a,i.y=s,Cr(i,{width:r,height:r},ae)):Ei(t)?(r=n?"10%":.1*ae.width,i=xi(t),i.x=a,i.y=s,Cr(i,{rx:r,ry:r},ae)):Ai(t)&&(r=n?"10%":.1*ae.width,i=xi(t),i.x1=a,i.y1=s,i.x2=a,i.y2=s),i&&Promise.resolve().then((()=>{ho(uo(i,void 0,r))}))},Kt=e=>pt(Gy(e,fe));let Jt,Qt={};let eo;let to;const oo=e=>{if(!(Li(e)&&Wo(e,"pathClose")))return;const t=[...e.strokeColor];t[3]=1,Jt.updateMarkupShape(e,{pathClose:!1,strokeColor:t},!1),Jt.removeMarkupShapeProps(e,["backgroundColor"],!1),Jt.confirmMarkupItemDraft(),Jt.selectShape(e),_("addshape",e),Mt.write()},io=e=>{const t=xi(e);return Object.assign(t,pe[ut]?pe[ut][_e]:{}),pr(t),t};let ro;const no=(e,t)=>{const o={};return Object.entries(e).forEach((([e,i])=>{Wo(t,e)&&(o[e]=i)})),o},ao=(e,t)=>{if(Oo(e))return e;if(e.endsWith("%")){return parseFloat(e)/100*t.width}};let so=void 0,lo=void 0,co=void 0;const uo=(e,t,o)=>{let i=!1;t||(i=!0,t=W?pt(ct(te)):ct(se)),t.x-=ae.x||0,t.y-=ae.y||0,(gt||$t)&&(e.flipX=gt,e.flipY=$t);const r=Jt.getShapesNearPosition(Q,t);if(i&&r.length){const e=.1*Math.min(se.width,se.height);t.x+=Math.round(-e+Math.random()*e*2),t.y+=Math.round(-e+Math.random()*e*2)}if(0!==mt&&(e.rotation=gt&&$t?-mt:gt||$t?mt:-mt),Wo(e,"width")&&Wo(e,"height")){const{width:o,height:i}=kr(e,["width","height"],ae);Cr(e,{x:t.x-.5*o,y:t.y-.5*i},ae)}else if(Ei(e))Cr(e,{x:t.x,y:t.y},ae);else if(Ai(e)){const{x1:i,y1:r,x2:n,y2:a}=kr(e,["x1","y1","x2","y2"],ae),s=Ee(me(i,r),me(n,a)),l=m(o)?mr(o,ae.width):s;Cr(e,{x1:t.x-l,y1:t.y+l,x2:t.x+l,y2:t.y-l},ae)}else if(Li(e)){const{points:o}=kr(e,["points"],ae),i=Le(o);Cr(e,{points:o.map((e=>({x:e.x+t.x-i.x,y:e.y+t.y-i.y})))},ae)}return e},po=(e,t)=>{const o=uo(ki(e,se),t);return e.shape&&(Wo(e.shape,"x")&&(o.x=e.shape.x),Wo(e.shape,"y")&&(o.y=e.shape.y)),ho(o)},ho=e=>{const{beforeAddShape:t=(()=>!0)}=yt;if(t(e))return Jt.addShape(e),Jt.selectShape(e),_("addshape",e),Mt.write(),e};let mo=!1;const go=()=>{Mt.write()};let $o;const fo=ca("redrawTrigger");hn(e,fo,(e=>o(144,J=e)));const yo=[],bo=xc(q?20:0);hn(e,bo,(e=>o(141,Z=e)));return e.$$set=e=>{"isActive"in e&&ve(o(1,Ie=e.isActive)),"isActiveFraction"in e&&Re(o(2,Ae=e.isActiveFraction)),"isVisible"in e&&Me(o(3,Fe=e.isVisible)),"stores"in e&&o(100,ze=e.stores),"locale"in e&&o(4,De=e.locale),"shapes"in e&&Se(o(5,Oe=e.shapes)),"toolbar"in e&&o(101,Be=e.toolbar),"toolShapes"in e&&o(102,We=e.toolShapes),"toolActive"in e&&o(0,_e=e.toolActive),"toolSelectRadius"in e&&o(6,Ve=e.toolSelectRadius),"toolRetainStyles"in e&&o(103,Ne=e.toolRetainStyles),"toolbarLayout"in e&&o(7,He=e.toolbarLayout),"textInputMode"in e&&o(8,je=e.textInputMode),"shapeControls"in e&&o(9,Ue=e.shapeControls),"enableButtonFlipVertical"in e&&o(10,Ge=e.enableButtonFlipVertical),"enablePresetSelectImage"in e&&o(11,Ze=e.enablePresetSelectImage),"enablePresetDropImage"in e&&o(12,Xe=e.enablePresetDropImage),"enableSelectToolToAddShape"in e&&o(104,Ye=e.enableSelectToolToAddShape),"enableAutoSelectMoveTool"in e&&o(105,qe=e.enableAutoSelectMoveTool),"enableTapToAddText"in e&&o(13,Ke=e.enableTapToAddText),"enableMoveTool"in e&&o(106,Je=e.enableMoveTool),"enableViewTool"in e&&o(107,Qe=e.enableViewTool),"enableToolShareStyles"in e&&o(108,et=e.enableToolShareStyles),"enableMultiSelect"in e&&o(14,tt=e.enableMultiSelect),"gridSize"in e&&o(15,ot=e.gridSize),"snapThreshold"in e&&o(16,it=e.snapThreshold),"enableSnapToContext"in e&&o(17,rt=e.enableSnapToContext),"willRenderHeaderTools"in e&&o(109,nt=e.willRenderHeaderTools),"willRenderPresetToolbar"in e&&o(110,at=e.willRenderPresetToolbar),"willRenderShapeStyleControls"in e&&o(18,st=e.willRenderShapeStyleControls),"willStartInteraction"in e&&o(111,lt=e.willStartInteraction),"shapePresets"in e&&o(19,dt=e.shapePresets),"utilKey"in e&&o(20,ut=e.utilKey),"mapScreenPointToImagePoint"in e&&o(21,pt=e.mapScreenPointToImagePoint),"mapImagePointToScreenPoint"in e&&o(22,ht=e.mapImagePointToScreenPoint),"imageRotation"in e&&o(23,mt=e.imageRotation),"imageFlipX"in e&&o(24,gt=e.imageFlipX),"imageFlipY"in e&&o(25,$t=e.imageFlipY),"parentRect"in e&&Ce(o(26,ft=e.parentRect)),"hooks"in e&&o(112,yt=e.hooks)},e.$$.update=()=>{var t,ie,re,ne;if(33554432&e.$$.dirty[4]&&o(124,i=de.includes(18)),1049088&e.$$.dirty[3]&&(Ct&&We===Ct||o(113,Ct=We)),16&e.$$.dirty[1]&&jt.set(X),16&e.$$.dirty[1]&&Ut.set(X),16&e.$$.dirty[1]&&Gt.set(X),256&e.$$.dirty[3]&&o(33,r=Array.isArray(Be)&&Be.length>1&&Array.isArray(Be[0][1])),4&e.$$.dirty[1]|256&e.$$.dirty[3]&&o(54,n=r?Be.map(((e,t)=>[t,e[0]])):[]),134217728&e.$$.dirty[0]|4&e.$$.dirty[1]|256&e.$$.dirty[3]&&o(140,a=r?Be[Xt][1]:Be),524288&e.$$.dirty[0]|155648&e.$$.dirty[3]|65536&e.$$.dirty[4]&&o(32,s=((e,{willRenderPresetToolbar:t,shapePresets:o,enableViewTool:i,enableMoveTool:n})=>{let a=0!==o.length||t?e:e.filter((e=>"preset"!==e[0]));return r&&(a=[["move",e=>e.shapeLabelToolMove,{icon:e=>e.shapeIconToolMove}],["view",e=>e.shapeLabelToolView,{icon:e=>e.shapeIconToolView}],...a]),a=n?a:a.filter((e=>"move"!==e[0])),i?a:a.filter((e=>"view"!==e[0]))})(a,{willRenderPresetToolbar:at,shapePresets:dt,enableMoveTool:Je,enableViewTool:Qe})),2&e.$$.dirty[1]&&o(138,d=!!s.length),1&e.$$.dirty[0]|2&e.$$.dirty[1]|16384&e.$$.dirty[4]&&d&&void 0===_e&&o(0,_e=s[0][0]),134217729&e.$$.dirty[0]|4&e.$$.dirty[1]|2097152&e.$$.dirty[3]|65536&e.$$.dirty[4]&&r&&o(114,Yt={...Yt,[Xt]:a.map((([e])=>e)).includes(_e)?_e:Yt[Xt]||a[0][0]}),512&e.$$.dirty[0]&&o(137,l=!!Object.keys(Ue).length),2&e.$$.dirty[1]&&o(34,c=s.length>1),12&e.$$.dirty[1]&&o(53,u=c||r),1&e.$$.dirty[0]&&o(139,p=void 0!==_e),57344&e.$$.dirty[4]&&o(52,h=(!p||d)&&l),536870912&e.$$.dirty[0]&&o(31,_=$o&&(t=$o,(e,o)=>{t.dispatchEvent(Yh(e,o))})),1&e.$$.dirty[0]|17&e.$$.dirty[1]&&X&&_&&_("selectcontrol",_e),16&e.$$.dirty[1]&&(X?vn(Ot,$e[ut]={maskMarkupOpacity:.85},$e):delete $e[ut]),1&e.$$.dirty[0]|1048576&e.$$.dirty[3]&&o(136,g=_e&&Ct[_e]?Ct[_e][1]:void 0),4096&e.$$.dirty[4]&&o(125,$=g&&g.isSelection?"selection":"shapes"),3&e.$$.dirty[4]&&(e=>{if(!Jt)return;const t=Jt.getShapeDraft(bt);t&&(e&&(eo=t.drawMode),Jt.updateShapeDraft({drawMode:e?"subtract":eo},bt))})("selection"===$&&i),268435457&e.$$.dirty[0]&&_e&&Jt){const e=Jt.getMarkupItemDraft();e&&oo(e)}if(1&e.$$.dirty[0]&&_e&&Jt&&"move"!==_e&&Jt.blurShapes(),16&e.$$.dirty[1]|134217728&e.$$.dirty[4]&&o(51,f=ge&&X),256&e.$$.dirty[1]|8388608&e.$$.dirty[4]&&o(50,y=he&&me(te.x-he.x,te.y-he.y)),512&e.$$.dirty[0]&&o(135,b=Object.keys(Ue)),16384&e.$$.dirty[0]|16&e.$$.dirty[1]|2097152&e.$$.dirty[4]&&o(122,x=tt?X&&Q.filter(Di):[]),536870912&e.$$.dirty[3]&&o(123,v=x.length>1),16&e.$$.dirty[1]|2097152&e.$$.dirty[4]&&o(119,w=X&&Q.filter(Di)[0]),16&e.$$.dirty[1]|2097152&e.$$.dirty[4]&&o(130,S=X&&Q.find((e=>Oi(e)))),16&e.$$.dirty[1]|2097152&e.$$.dirty[4]&&o(133,k=X&&Q.find((e=>Bi(e)))),1&e.$$.dirty[0]|16&e.$$.dirty[1]|1048576&e.$$.dirty[3]&&o(127,C=X&&Ct[_e]?io(Ct[_e][0]):{}),1048576&e.$$.dirty[3]&&Ct&&o(115,Qt={}),1&e.$$.dirty[0]|4227072&e.$$.dirty[3]|2056&e.$$.dirty[4]&&o(126,T=C&&Object.keys(C).reduce(((e,t)=>{const o="disableStyle"===t,i="settings"===t,r=!!b.find((e=>e.split("_").includes(t)));if(!o&&!i&&!r)return e;if(void 0===C[t])return e;if(!0===C.disableStyle)return e;if(C.disableStyle&&C.disableStyle.includes(t))return e;if("strokeWidth"===t&&Object.keys(Qt).includes("strokeWidth")&&void 0===Qt[t]&&Wo(C,"points"))return e[t]=C[t],e;const{share:n=!0}=C.settings&&C.settings[t]||{},a=et&&n?Qt:Qt[_e]||{};return e[t]=Wo(a,t)?a[t]:C[t],e}),{})),1048577&e.$$.dirty[0]|1024&e.$$.dirty[3]|4&e.$$.dirty[4]&&(Ne?((e,t,o)=>{const i=pe[e],r=i?i[t]:{};St.set({...pe,[e]:{...i,[t]:{...r,...o}}})})(ut,_e,T):(ie=ut,St.set({[ie]:{}}))),16&e.$$.dirty[1]|67108864&e.$$.dirty[3]|67108868&e.$$.dirty[4]&&o(134,M=ue&&X?w||T:void 0),1610612736&e.$$.dirty[3]|1536&e.$$.dirty[4]&&o(49,P=v?function(e){const t={};return e.forEach((e=>{Object.entries(e).filter((([e])=>!e.startsWith("_"))).forEach((([e,o])=>{Wo(t,e)?"disableStyle"===e&&_o(o)&&t[e].push(...o):t[e]=o}))})),t}(x):M||k),1&e.$$.dirty[0]|8&e.$$.dirty[4]&&o(48,R=Wo(C,"eraseRadius")||Wo(C,"points")&&!Wo(C,"pathClose")||"move"===_e||"view"===_e),64&e.$$.dirty[1]|8&e.$$.dirty[4]&&o(47,I=C&&void 0!==C.eraseRadius?ao(C.eraseRadius,ae):void 0),16&e.$$.dirty[1]|33554432&e.$$.dirty[4]&&o(131,E=X&&de.includes(32)),1&e.$$.dirty[0]|16&e.$$.dirty[1]&&o(132,A=X&&"view"===_e),384&e.$$.dirty[4]&&o(129,L=A||E),96&e.$$.dirty[4]&&o(128,F=!!L&&(!!S||_d(document.activeElement))),16&e.$$.dirty[1]|48&e.$$.dirty[4]&&It.set(!X||L&&!F),16&e.$$.dirty[1]|16&e.$$.dirty[4]&&At.set(!X||!F),64&e.$$.dirty[1]|12&e.$$.dirty[4]&&o(120,z=C.cursorStyle?(({cursorStyle:e,cursorSize:t},o,i)=>{let r;const n=o[t];if(void 0===n?r=ao(t,i):Oo(n)?r=n:m(n)&&(r=yr(t,o[t],i),"strokeWidth"===t&&(r*=.5)),!(r<=0||void 0===r))return{size:r,style:e}})(C,{...C,...T},ae):void 0),33554432&e.$$.dirty[3]|16777216&e.$$.dirty[4]&&o(121,D=co&&(ne=ce,(re=co).x>=0&&re.y>=0&&re.x<=ne.width&&re.y<=ne.height)),1048576&e.$$.dirty[0]|160&e.$$.dirty[1]|427819008&e.$$.dirty[3]|3&e.$$.dirty[4])if(D&&!so&&z&&!le){const e=z.size*oe.scale,t={id:"cursor-"+ut,x:lo.x,y:lo.y,strokeWidth:.5,strokeColor:[0,0,0]};"ellipse"===z.style&&(t.rx=e,t.ry=e);const o={strokeWidth:2.5,strokeColor:[1,1,1],opacity:.75},r=[{...t,...o},t];if("selection"===$&&i){const t=e,i=lo.x+t,n=lo.y+t+4,a={id:"cursor-"+ut,strokeWidth:.75,strokeColor:[0,0,0],points:[{x:i,y:n},{x:i+4,y:n}]};r.push({...a,...o,strokeWidth:2,points:[{x:i-.5,y:n},{x:i+4.5,y:n}]},a)}(e=>{Dt.update((t=>[...t.filter((e=>e.id!=="cursor-"+ut)),...e]))})(r)}else Dt.update((e=>e.filter((e=>e.id!=="cursor-"+ut))));1&e.$$.dirty[0]|128&e.$$.dirty[1]|478150656&e.$$.dirty[3]&&o(46,O=D?((e,t,o,i,r,n)=>{if(i)return r?"grabbing":"grab";if(e&&!t)return"none";if(!t)return"move"===n?"default":"crosshair";let a=t||o;return Di(a)?Oi(a)?"modal"===je?"default":"text":!tr(a)||v&&!x.every(tr)?"default":"move":"default"})(z,so,w,le,false,_e):"default"),526337&e.$$.dirty[0]|131072&e.$$.dirty[3]&&o(45,B="preset"===_e&&(dt.length>0||Ze||at)),64&e.$$.dirty[1]&&(W=!Wo(ae,"x")&&!Wo(ae,"y")),4194304&e.$$.dirty[4]&&o(44,V=ee*zt),131072&e.$$.dirty[3]|1572864&e.$$.dirty[4]&&o(43,N=J&&at?e=>lm((()=>at(e,po,{...K},(()=>fo.set({}))))):Y),524288&e.$$.dirty[3]&&o(42,H=Object.keys(yt).reduce(((e,t)=>("beforeAddShape"===t||void 0===yt[t]||(e[t]=yt[t]),e)),{})),16&e.$$.dirty[1]&&(e=>{Q&&Oe.update((t=>t.map((t=>(t._prerender=!!e&&Oi(t),t)))))})(X),65536&e.$$.dirty[3]|1572864&e.$$.dirty[4]&&o(30,j=J&&nt([],K,(()=>fo.set({})))),1073742336&e.$$.dirty[0]&&o(41,U=!!j.length||!!Object.keys(Ue).some((e=>yo.includes(e)))),16&e.$$.dirty[1]|262144&e.$$.dirty[4]&&q&&bo.set(X?0:20),e.$$.dirty[4],131072&e.$$.dirty[4]&&o(40,G=Z?`translateY(${Z}px)`:"none")},Zt.set(!1),[_e,Ie,Ae,Fe,De,Oe,Ve,He,je,Ue,Ge,Ze,Xe,Ke,tt,ot,it,rt,st,dt,ut,pt,ht,mt,gt,$t,ft,Xt,Jt,$o,j,_,s,r,c,X,oe,ae,le,he,G,U,H,N,V,B,O,I,R,P,y,f,h,u,n,fe,ye,be,bt,xt,wt,St,kt,Tt,Pt,Rt,Et,Lt,Ft,Dt,Ot,Bt,Wt,_t,Vt,Nt,Ht,({index:e},t)=>{o(27,Xt=e),o(0,_e=Yt[e])},({value:e},t)=>{o(0,_e=e),(Ye||/enter/i.test(t.key))&&qt(e)},e=>{if("eraser"===_e)to=Jt.eraseShape();else if(_e&&Ct[_e]){const[e,t={}]=Ct[_e],o=xi(e);sr(o),lr(o);const{drawMode:r}=M;"selection"===$&&"new"===r&&bt.set([]);let n={};"selection"===$&&(_("selectiondown",[...ue]),i&&(eo=o.drawMode,n.drawMode="subtract")),to=Jt.createShape({...o,...T,...n},t)}else to=void 0;return!!to&&(to.start(e),!0)},e=>!!to&&(to.update(e),!0),e=>!!to&&(to.release(e),!0),e=>!!to&&(to.cancel(e),to=void 0,!0),e=>{if(!to)return!1;if(to.end(e),to=void 0,"selection"===$){if(e.detail.isTap){const[e]=Ct[_e];e.bitmap||bt.set([])}_("selectionup",[...ue])}const t=Jt.getMarkupItemDraft(),i=Je&&(!0===qe||Array.isArray(qe)&&qe.includes(_e));return t&&!t.isEditing||!i||o(0,_e="move"),!0},e=>{const{key:t}=e,o=Jt.getMarkupItemDraft();/escape/i.test(t)&&o&&(e.preventDefault(),e.stopPropagation(),Jt.discardMarkupItemDraft(),to=void 0),/enter/i.test(t)&&o&&(e.preventDefault(),e.stopPropagation(),oo(o),to=void 0)},function(e){Object.keys(e).forEach((t=>{const{retain:i=!0,share:r=!0}=C.settings&&C.settings[t]||{};i&&(et&&r?o(115,Qt[t]=e[t],Qt):(Qt[_e]||o(115,Qt[_e]={},Qt),o(115,Qt[_e][t]=e[t],Qt)))})),_("selectstyle",e),w&&(v?x.forEach((t=>{Jt.updateMarkupShape(t,no(e,t))})):Jt.updateMarkupShape(w,e),clearTimeout(ro),ro=setTimeout((()=>{go()}),200))},(e,t,i)=>{o(117,lo=t),o(118,co=i)},()=>{o(118,co=void 0),o(117,lo=void 0)},e=>{_("markuptap",e)},e=>o(116,so=e),()=>{mo=!1},(e,t)=>{if(mo)return;const{beforeAddShape:o=(()=>!0)}=yt,i=Kt(t),r=Jt.getMarkupItemDraft(),n=vt(se,{x:i.x+(ae.x||0),y:i.y+(ae.y||0)});if(r&&!n&&Jt.discardMarkupItemDraft(),n){if(!r){const r=ki(e,se),n=uo(r,i);return o(n)?(Hi(n),void Jt.addShape(n)):(mo=!0,void t.preventDefault())}Ii(r)&&(i.x-=.5*r.width,i.y-=.5*r.height),e.shape&&(Wo(e.shape,"x")&&(i.x=e.shape.x),Wo(e.shape,"y")&&(i.y=e.shape.y)),Jt.updateMarkupShape(r,i)}},(e,t)=>{if(mo)return;const o=Kt(t);if(!vt(se,{x:o.x+(ae.x||0),y:o.y+(ae.y||0)}))return void Jt.discardMarkupItemDraft();const i=Jt.confirmMarkupItemDraft();Jt.selectShape(i),_("addshape",i),Mt.write()},e=>po(e),e=>{return t=e.detail.resources,o=Kt(e.detail.event),t.forEach((e=>po(e,o)));var t,o},e=>{if(!lt)return!0;const t=rectClone(ne);return rectScale(t,1/re),rectTranslate(t,ie),rectScale(t,oe.scale),lt(e,{...t,x:t.x+te.x,y:t.y+te.y})},go,fo,yo,bo,ze,Be,We,Ne,Ye,qe,Je,Qe,et,nt,at,lt,yt,Ct,Yt,Qt,so,lo,co,w,z,D,x,v,i,$,T,C,F,L,S,E,A,k,M,b,g,l,d,p,a,Z,q,K,J,Q,ee,te,ce,de,ue,ge,function(t){da.call(this,e,t)},e=>e[0]===_e,(e,t,o)=>{const i=e.filter((([,e])=>!yo.includes(e)));return st?st(i,t,o):i},e=>e[0]===Xt,e=>{Promise.resolve().then((()=>{_("addshape",e),go()}))},e=>{_("selectshape",e)},e=>{Promise.resolve().then((()=>{_("blurshape",e)}))},e=>{_("tapshape",e)},e=>{_("updateshape",e),go()},e=>{_("removeshape",e),go()},()=>{go()},function(e){pa[e?"unshift":"push"]((()=>{Jt=e,o(28,Jt)}))},function(e){pa[e?"unshift":"push"]((()=>{$o=e,o(29,$o)}))},e=>e.filter((([,e])=>yo.includes(e))),function(t){da.call(this,e,t)}]}class fx extends Ga{constructor(e){super(),Ua(this,e,$x,gx,ln,{isActive:1,isActiveFraction:2,isVisible:3,stores:100,locale:4,shapes:5,toolbar:101,toolShapes:102,toolActive:0,toolSelectRadius:6,toolRetainStyles:103,toolbarLayout:7,textInputMode:8,shapeControls:9,enableButtonFlipVertical:10,enablePresetSelectImage:11,enablePresetDropImage:12,enableSelectToolToAddShape:104,enableAutoSelectMoveTool:105,enableTapToAddText:13,enableMoveTool:106,enableViewTool:107,enableToolShareStyles:108,enableMultiSelect:14,gridSize:15,snapThreshold:16,enableSnapToContext:17,willRenderHeaderTools:109,willRenderPresetToolbar:110,willRenderShapeStyleControls:18,willStartInteraction:111,shapePresets:19,utilKey:20,mapScreenPointToImagePoint:21,mapImagePointToScreenPoint:22,imageRotation:23,imageFlipX:24,imageFlipY:25,parentRect:26,hooks:112},null,[-1,-1,-1,-1,-1,-1,-1])}get isActive(){return this.$$.ctx[1]}set isActive(e){this.$$set({isActive:e}),ka()}get isActiveFraction(){return this.$$.ctx[2]}set isActiveFraction(e){this.$$set({isActiveFraction:e}),ka()}get isVisible(){return this.$$.ctx[3]}set isVisible(e){this.$$set({isVisible:e}),ka()}get stores(){return this.$$.ctx[100]}set stores(e){this.$$set({stores:e}),ka()}get locale(){return this.$$.ctx[4]}set locale(e){this.$$set({locale:e}),ka()}get shapes(){return this.$$.ctx[5]}set shapes(e){this.$$set({shapes:e}),ka()}get toolbar(){return this.$$.ctx[101]}set toolbar(e){this.$$set({toolbar:e}),ka()}get toolShapes(){return this.$$.ctx[102]}set toolShapes(e){this.$$set({toolShapes:e}),ka()}get toolActive(){return this.$$.ctx[0]}set toolActive(e){this.$$set({toolActive:e}),ka()}get toolSelectRadius(){return this.$$.ctx[6]}set toolSelectRadius(e){this.$$set({toolSelectRadius:e}),ka()}get toolRetainStyles(){return this.$$.ctx[103]}set toolRetainStyles(e){this.$$set({toolRetainStyles:e}),ka()}get toolbarLayout(){return this.$$.ctx[7]}set toolbarLayout(e){this.$$set({toolbarLayout:e}),ka()}get textInputMode(){return this.$$.ctx[8]}set textInputMode(e){this.$$set({textInputMode:e}),ka()}get shapeControls(){return this.$$.ctx[9]}set shapeControls(e){this.$$set({shapeControls:e}),ka()}get enableButtonFlipVertical(){return this.$$.ctx[10]}set enableButtonFlipVertical(e){this.$$set({enableButtonFlipVertical:e}),ka()}get enablePresetSelectImage(){return this.$$.ctx[11]}set enablePresetSelectImage(e){this.$$set({enablePresetSelectImage:e}),ka()}get enablePresetDropImage(){return this.$$.ctx[12]}set enablePresetDropImage(e){this.$$set({enablePresetDropImage:e}),ka()}get enableSelectToolToAddShape(){return this.$$.ctx[104]}set enableSelectToolToAddShape(e){this.$$set({enableSelectToolToAddShape:e}),ka()}get enableAutoSelectMoveTool(){return this.$$.ctx[105]}set enableAutoSelectMoveTool(e){this.$$set({enableAutoSelectMoveTool:e}),ka()}get enableTapToAddText(){return this.$$.ctx[13]}set enableTapToAddText(e){this.$$set({enableTapToAddText:e}),ka()}get enableMoveTool(){return this.$$.ctx[106]}set enableMoveTool(e){this.$$set({enableMoveTool:e}),ka()}get enableViewTool(){return this.$$.ctx[107]}set enableViewTool(e){this.$$set({enableViewTool:e}),ka()}get enableToolShareStyles(){return this.$$.ctx[108]}set enableToolShareStyles(e){this.$$set({enableToolShareStyles:e}),ka()}get enableMultiSelect(){return this.$$.ctx[14]}set enableMultiSelect(e){this.$$set({enableMultiSelect:e}),ka()}get gridSize(){return this.$$.ctx[15]}set gridSize(e){this.$$set({gridSize:e}),ka()}get snapThreshold(){return this.$$.ctx[16]}set snapThreshold(e){this.$$set({snapThreshold:e}),ka()}get enableSnapToContext(){return this.$$.ctx[17]}set enableSnapToContext(e){this.$$set({enableSnapToContext:e}),ka()}get willRenderHeaderTools(){return this.$$.ctx[109]}set willRenderHeaderTools(e){this.$$set({willRenderHeaderTools:e}),ka()}get willRenderPresetToolbar(){return this.$$.ctx[110]}set willRenderPresetToolbar(e){this.$$set({willRenderPresetToolbar:e}),ka()}get willRenderShapeStyleControls(){return this.$$.ctx[18]}set willRenderShapeStyleControls(e){this.$$set({willRenderShapeStyleControls:e}),ka()}get willStartInteraction(){return this.$$.ctx[111]}set willStartInteraction(e){this.$$set({willStartInteraction:e}),ka()}get shapePresets(){return this.$$.ctx[19]}set shapePresets(e){this.$$set({shapePresets:e}),ka()}get utilKey(){return this.$$.ctx[20]}set utilKey(e){this.$$set({utilKey:e}),ka()}get mapScreenPointToImagePoint(){return this.$$.ctx[21]}set mapScreenPointToImagePoint(e){this.$$set({mapScreenPointToImagePoint:e}),ka()}get mapImagePointToScreenPoint(){return this.$$.ctx[22]}set mapImagePointToScreenPoint(e){this.$$set({mapImagePointToScreenPoint:e}),ka()}get imageRotation(){return this.$$.ctx[23]}set imageRotation(e){this.$$set({imageRotation:e}),ka()}get imageFlipX(){return this.$$.ctx[24]}set imageFlipX(e){this.$$set({imageFlipX:e}),ka()}get imageFlipY(){return this.$$.ctx[25]}set imageFlipY(e){this.$$set({imageFlipY:e}),ka()}get parentRect(){return this.$$.ctx[26]}set parentRect(e){this.$$set({parentRect:e}),ka()}get hooks(){return this.$$.ctx[112]}set hooks(e){this.$$set({hooks:e}),ka()}}var yx=(e,t,o,i,r,n,a,s,l)=>{const c=$e(e),d=.5*o.width,u=.5*o.height,p=.5*t.width,h=.5*t.height,m=r.x+i.x,g=r.y+i.y;s&&(c.x=o.width-c.x),l&&(c.y=o.height-c.y);const $=Math.cos(n),f=Math.sin(n);c.x-=d,c.y-=u;const y=c.x*$-c.y*f,b=c.x*f+c.y*$;c.x=d+y,c.y=u+b,c.x*=a,c.y*=a,c.x+=p,c.y+=h,c.x+=m,c.y+=g,c.x-=d*a,c.y-=u*a;const x=(r.x-m)*a,v=(r.y-g)*a,w=x*$-v*f,S=x*f+v*$;return c.x+=w,c.y+=S,c},bx=(e,t,o,i,r,n,a,s,l)=>{const c=$e(e),d=Ue(o),u=Ue(t),p=me(r.x+i.x,r.y+i.y),h=Math.cos(n),m=Math.sin(n);c.x-=u.x,c.y-=u.y;const g=(r.x-p.x)*a,$=(r.y-p.y)*a,f=g*h-$*m,y=g*m+$*h;c.x-=f,c.y-=y,c.x-=p.x,c.y-=p.y,c.x/=a,c.y/=a;const b=c.x*h+c.y*m,x=c.x*m-c.y*h;return c.x=b,c.y=-x,c.x+=d.x,c.y+=d.y,s&&(c.x=o.width-c.x),l&&(c.y=o.height-c.y),c},xx=e=>"boolean"==typeof e;function vx(e){let t,o,i;function r(t){e[60](t)}let n={utilKey:e[1],stores:e[5],locale:e[6],isActive:e[2],isActiveFraction:e[3],isVisible:e[4],mapScreenPointToImagePoint:e[46],mapImagePointToScreenPoint:e[45],imageRotation:e[47],imageFlipX:e[44],imageFlipY:e[43],shapes:e[49],toolbar:e[21]||e[7],toolShapes:e[22]||e[8],toolRetainStyles:e[9],enableSelectToolToAddShape:e[31],enableTapToAddText:e[32],enableViewTool:e[30],enableMoveTool:e[34],enableAutoSelectMoveTool:e[33],enableMultiSelect:e[35],snapThreshold:e[16],gridSize:Oo(e[18])?e[18]:e[15],enableSnapToContext:xx(e[19])?e[19]:e[17],enableToolShareStyles:e[13],shapeControls:e[23]||e[10],shapePresets:e[27],enableButtonFlipVertical:e[24],parentRect:e[50],enablePresetDropImage:e[26],enablePresetSelectImage:e[25],toolSelectRadius:e[11],textInputMode:e[12],willStartInteraction:e[14],willRenderPresetToolbar:e[28]||e[20],willRenderShapeStyleControls:e[29],hooks:{willRenderShapeControls:e[36],willRenderShapeTextControls:e[37],beforeAddShape:e[38],beforeRemoveShape:e[39],beforeDeselectShape:e[40],beforeSelectShape:e[41],beforeUpdateShape:e[42]}};return void 0!==e[0]&&(n.toolActive=e[0]),t=new fx({props:n}),pa.push((()=>Va(t,"toolActive",r))),t.$on("measure",e[61]),{c(){Na(t.$$.fragment)},m(e,o){Ha(t,e,o),i=!0},p(e,i){const r={};32&i[0]&&(r.stores=e[5]),64&i[0]&&(r.locale=e[6]),4&i[0]&&(r.isActive=e[2]),8&i[0]&&(r.isActiveFraction=e[3]),16&i[0]&&(r.isVisible=e[4]),32768&i[1]&&(r.mapScreenPointToImagePoint=e[46]),16384&i[1]&&(r.mapImagePointToScreenPoint=e[45]),65536&i[1]&&(r.imageRotation=e[47]),8192&i[1]&&(r.imageFlipX=e[44]),4096&i[1]&&(r.imageFlipY=e[43]),2097280&i[0]&&(r.toolbar=e[21]||e[7]),4194560&i[0]&&(r.toolShapes=e[22]||e[8]),512&i[0]&&(r.toolRetainStyles=e[9]),1&i[1]&&(r.enableSelectToolToAddShape=e[31]),2&i[1]&&(r.enableTapToAddText=e[32]),1073741824&i[0]&&(r.enableViewTool=e[30]),8&i[1]&&(r.enableMoveTool=e[34]),4&i[1]&&(r.enableAutoSelectMoveTool=e[33]),16&i[1]&&(r.enableMultiSelect=e[35]),65536&i[0]&&(r.snapThreshold=e[16]),294912&i[0]&&(r.gridSize=Oo(e[18])?e[18]:e[15]),655360&i[0]&&(r.enableSnapToContext=xx(e[19])?e[19]:e[17]),8192&i[0]&&(r.enableToolShareStyles=e[13]),8389632&i[0]&&(r.shapeControls=e[23]||e[10]),134217728&i[0]&&(r.shapePresets=e[27]),16777216&i[0]&&(r.enableButtonFlipVertical=e[24]),67108864&i[0]&&(r.enablePresetDropImage=e[26]),33554432&i[0]&&(r.enablePresetSelectImage=e[25]),2048&i[0]&&(r.toolSelectRadius=e[11]),4096&i[0]&&(r.textInputMode=e[12]),16384&i[0]&&(r.willStartInteraction=e[14]),269484032&i[0]&&(r.willRenderPresetToolbar=e[28]||e[20]),536870912&i[0]&&(r.willRenderShapeStyleControls=e[29]),4064&i[1]&&(r.hooks={willRenderShapeControls:e[36],willRenderShapeTextControls:e[37],beforeAddShape:e[38],beforeRemoveShape:e[39],beforeDeselectShape:e[40],beforeSelectShape:e[41],beforeUpdateShape:e[42]}),!o&&1&i[0]&&(o=!0,r.toolActive=e[0],xa((()=>o=!1))),t.$set(r)},i(e){i||(Ea(t.$$.fragment,e),i=!0)},o(e){Aa(t.$$.fragment,e),i=!1},d(e){ja(t,e)}}}function wx(e,t,o){let i,r,n,a,s,l,c,d,u;let{isActive:p}=t,{isActiveFraction:h}=t,{isVisible:m}=t,{stores:g}=t,{locale:$={}}=t,{markupEditorToolbar:f}=t,{markupEditorToolStyles:y}=t,{markupEditorToolRetainStyles:b}=t,{markupEditorShapeStyleControls:x}=t,{markupEditorToolSelectRadius:v}=t,{markupEditorTextInputMode:w}=t,{markupEditorToolShareStyles:S}=t,{markupEditorWillStartInteraction:k}=t,{markupEditorGridSize:C=0}=t,{markupEditorSnapThreshold:T=0}=t,{markupEditorSnapToContext:M=!1}=t,{annotateGridSize:P}=t,{annotateSnapToContext:R}=t,{willRenderShapePresetToolbar:I}=t,{annotateTools:E}=t,{annotateToolShapes:A}=t,{annotateShapeControls:L}=t,{annotateActiveTool:F}=t,{annotateEnableButtonFlipVertical:z=!1}=t,{annotateEnableSelectImagePreset:D=!1}=t,{annotateEnableDropImagePreset:O=!0}=t,{annotatePresets:B=[]}=t,{annotateWillRenderShapePresetToolbar:W}=t,{annotateWillRenderShapeStyleControls:_}=t,{enableViewTool:V}=t,{enableSelectToolToAddShape:N}=t,{enableTapToAddText:H}=t,{enableAutoSelectMoveTool:j}=t,{enableMoveTool:U}=t,{enableMultiSelect:G}=t,{willRenderShapeControls:Z}=t,{willRenderShapeTextControls:X}=t,{beforeAddShape:Y}=t,{beforeRemoveShape:q}=t,{beforeDeselectShape:K}=t,{beforeSelectShape:J}=t,{beforeUpdateShape:Q}=t;const{rootRect:ee,imageAnnotation:te,imageSize:oe,imageRotation:ie,imageFlipX:re,imageFlipY:ne,imageTransforms:ae,imageTransformsInterpolated:se}=g;return hn(e,ee,(e=>o(59,d=e))),hn(e,oe,(e=>o(58,c=e))),hn(e,ie,(e=>o(47,u=e))),hn(e,re,(e=>o(44,a=e))),hn(e,ne,(e=>o(43,n=e))),hn(e,ae,(e=>o(57,l=e))),hn(e,se,(e=>o(56,s=e))),e.$$set=e=>{"isActive"in e&&o(2,p=e.isActive),"isActiveFraction"in e&&o(3,h=e.isActiveFraction),"isVisible"in e&&o(4,m=e.isVisible),"stores"in e&&o(5,g=e.stores),"locale"in e&&o(6,$=e.locale),"markupEditorToolbar"in e&&o(7,f=e.markupEditorToolbar),"markupEditorToolStyles"in e&&o(8,y=e.markupEditorToolStyles),"markupEditorToolRetainStyles"in e&&o(9,b=e.markupEditorToolRetainStyles),"markupEditorShapeStyleControls"in e&&o(10,x=e.markupEditorShapeStyleControls),"markupEditorToolSelectRadius"in e&&o(11,v=e.markupEditorToolSelectRadius),"markupEditorTextInputMode"in e&&o(12,w=e.markupEditorTextInputMode),"markupEditorToolShareStyles"in e&&o(13,S=e.markupEditorToolShareStyles),"markupEditorWillStartInteraction"in e&&o(14,k=e.markupEditorWillStartInteraction),"markupEditorGridSize"in e&&o(15,C=e.markupEditorGridSize),"markupEditorSnapThreshold"in e&&o(16,T=e.markupEditorSnapThreshold),"markupEditorSnapToContext"in e&&o(17,M=e.markupEditorSnapToContext),"annotateGridSize"in e&&o(18,P=e.annotateGridSize),"annotateSnapToContext"in e&&o(19,R=e.annotateSnapToContext),"willRenderShapePresetToolbar"in e&&o(20,I=e.willRenderShapePresetToolbar),"annotateTools"in e&&o(21,E=e.annotateTools),"annotateToolShapes"in e&&o(22,A=e.annotateToolShapes),"annotateShapeControls"in e&&o(23,L=e.annotateShapeControls),"annotateActiveTool"in e&&o(0,F=e.annotateActiveTool),"annotateEnableButtonFlipVertical"in e&&o(24,z=e.annotateEnableButtonFlipVertical),"annotateEnableSelectImagePreset"in e&&o(25,D=e.annotateEnableSelectImagePreset),"annotateEnableDropImagePreset"in e&&o(26,O=e.annotateEnableDropImagePreset),"annotatePresets"in e&&o(27,B=e.annotatePresets),"annotateWillRenderShapePresetToolbar"in e&&o(28,W=e.annotateWillRenderShapePresetToolbar),"annotateWillRenderShapeStyleControls"in e&&o(29,_=e.annotateWillRenderShapeStyleControls),"enableViewTool"in e&&o(30,V=e.enableViewTool),"enableSelectToolToAddShape"in e&&o(31,N=e.enableSelectToolToAddShape),"enableTapToAddText"in e&&o(32,H=e.enableTapToAddText),"enableAutoSelectMoveTool"in e&&o(33,j=e.enableAutoSelectMoveTool),"enableMoveTool"in e&&o(34,U=e.enableMoveTool),"enableMultiSelect"in e&&o(35,G=e.enableMultiSelect),"willRenderShapeControls"in e&&o(36,Z=e.willRenderShapeControls),"willRenderShapeTextControls"in e&&o(37,X=e.willRenderShapeTextControls),"beforeAddShape"in e&&o(38,Y=e.beforeAddShape),"beforeRemoveShape"in e&&o(39,q=e.beforeRemoveShape),"beforeDeselectShape"in e&&o(40,K=e.beforeDeselectShape),"beforeSelectShape"in e&&o(41,J=e.beforeSelectShape),"beforeUpdateShape"in e&&o(42,Q=e.beforeUpdateShape)},e.$$.update=()=>{503328768&e.$$.dirty[1]&&o(46,i=e=>bx(e,d,c,s.origin,s.translation,l.rotation.z,s.scale,a,n)),503328768&e.$$.dirty[1]&&o(45,r=e=>yx(e,d,c,s.origin,s.translation,l.rotation.z,s.scale,a,n))},[F,"annotate",p,h,m,g,$,f,y,b,x,v,w,S,k,C,T,M,P,R,I,E,A,L,z,D,O,B,W,_,V,N,H,j,U,G,Z,X,Y,q,K,J,Q,n,a,r,i,u,ee,te,oe,ie,re,ne,ae,se,s,l,c,d,function(e){F=e,o(0,F)},function(t){da.call(this,e,t)}]}var Sx={util:["annotate",class extends Ga{constructor(e){super(),Ua(this,e,wx,vx,ln,{name:1,isActive:2,isActiveFraction:3,isVisible:4,stores:5,locale:6,markupEditorToolbar:7,markupEditorToolStyles:8,markupEditorToolRetainStyles:9,markupEditorShapeStyleControls:10,markupEditorToolSelectRadius:11,markupEditorTextInputMode:12,markupEditorToolShareStyles:13,markupEditorWillStartInteraction:14,markupEditorGridSize:15,markupEditorSnapThreshold:16,markupEditorSnapToContext:17,annotateGridSize:18,annotateSnapToContext:19,willRenderShapePresetToolbar:20,annotateTools:21,annotateToolShapes:22,annotateShapeControls:23,annotateActiveTool:0,annotateEnableButtonFlipVertical:24,annotateEnableSelectImagePreset:25,annotateEnableDropImagePreset:26,annotatePresets:27,annotateWillRenderShapePresetToolbar:28,annotateWillRenderShapeStyleControls:29,enableViewTool:30,enableSelectToolToAddShape:31,enableTapToAddText:32,enableAutoSelectMoveTool:33,enableMoveTool:34,enableMultiSelect:35,willRenderShapeControls:36,willRenderShapeTextControls:37,beforeAddShape:38,beforeRemoveShape:39,beforeDeselectShape:40,beforeSelectShape:41,beforeUpdateShape:42},null,[-1,-1])}get name(){return this.$$.ctx[1]}get isActive(){return this.$$.ctx[2]}set isActive(e){this.$$set({isActive:e}),ka()}get isActiveFraction(){return this.$$.ctx[3]}set isActiveFraction(e){this.$$set({isActiveFraction:e}),ka()}get isVisible(){return this.$$.ctx[4]}set isVisible(e){this.$$set({isVisible:e}),ka()}get stores(){return this.$$.ctx[5]}set stores(e){this.$$set({stores:e}),ka()}get locale(){return this.$$.ctx[6]}set locale(e){this.$$set({locale:e}),ka()}get markupEditorToolbar(){return this.$$.ctx[7]}set markupEditorToolbar(e){this.$$set({markupEditorToolbar:e}),ka()}get markupEditorToolStyles(){return this.$$.ctx[8]}set markupEditorToolStyles(e){this.$$set({markupEditorToolStyles:e}),ka()}get markupEditorToolRetainStyles(){return this.$$.ctx[9]}set markupEditorToolRetainStyles(e){this.$$set({markupEditorToolRetainStyles:e}),ka()}get markupEditorShapeStyleControls(){return this.$$.ctx[10]}set markupEditorShapeStyleControls(e){this.$$set({markupEditorShapeStyleControls:e}),ka()}get markupEditorToolSelectRadius(){return this.$$.ctx[11]}set markupEditorToolSelectRadius(e){this.$$set({markupEditorToolSelectRadius:e}),ka()}get markupEditorTextInputMode(){return this.$$.ctx[12]}set markupEditorTextInputMode(e){this.$$set({markupEditorTextInputMode:e}),ka()}get markupEditorToolShareStyles(){return this.$$.ctx[13]}set markupEditorToolShareStyles(e){this.$$set({markupEditorToolShareStyles:e}),ka()}get markupEditorWillStartInteraction(){return this.$$.ctx[14]}set markupEditorWillStartInteraction(e){this.$$set({markupEditorWillStartInteraction:e}),ka()}get markupEditorGridSize(){return this.$$.ctx[15]}set markupEditorGridSize(e){this.$$set({markupEditorGridSize:e}),ka()}get markupEditorSnapThreshold(){return this.$$.ctx[16]}set markupEditorSnapThreshold(e){this.$$set({markupEditorSnapThreshold:e}),ka()}get markupEditorSnapToContext(){return this.$$.ctx[17]}set markupEditorSnapToContext(e){this.$$set({markupEditorSnapToContext:e}),ka()}get annotateGridSize(){return this.$$.ctx[18]}set annotateGridSize(e){this.$$set({annotateGridSize:e}),ka()}get annotateSnapToContext(){return this.$$.ctx[19]}set annotateSnapToContext(e){this.$$set({annotateSnapToContext:e}),ka()}get willRenderShapePresetToolbar(){return this.$$.ctx[20]}set willRenderShapePresetToolbar(e){this.$$set({willRenderShapePresetToolbar:e}),ka()}get annotateTools(){return this.$$.ctx[21]}set annotateTools(e){this.$$set({annotateTools:e}),ka()}get annotateToolShapes(){return this.$$.ctx[22]}set annotateToolShapes(e){this.$$set({annotateToolShapes:e}),ka()}get annotateShapeControls(){return this.$$.ctx[23]}set annotateShapeControls(e){this.$$set({annotateShapeControls:e}),ka()}get annotateActiveTool(){return this.$$.ctx[0]}set annotateActiveTool(e){this.$$set({annotateActiveTool:e}),ka()}get annotateEnableButtonFlipVertical(){return this.$$.ctx[24]}set annotateEnableButtonFlipVertical(e){this.$$set({annotateEnableButtonFlipVertical:e}),ka()}get annotateEnableSelectImagePreset(){return this.$$.ctx[25]}set annotateEnableSelectImagePreset(e){this.$$set({annotateEnableSelectImagePreset:e}),ka()}get annotateEnableDropImagePreset(){return this.$$.ctx[26]}set annotateEnableDropImagePreset(e){this.$$set({annotateEnableDropImagePreset:e}),ka()}get annotatePresets(){return this.$$.ctx[27]}set annotatePresets(e){this.$$set({annotatePresets:e}),ka()}get annotateWillRenderShapePresetToolbar(){return this.$$.ctx[28]}set annotateWillRenderShapePresetToolbar(e){this.$$set({annotateWillRenderShapePresetToolbar:e}),ka()}get annotateWillRenderShapeStyleControls(){return this.$$.ctx[29]}set annotateWillRenderShapeStyleControls(e){this.$$set({annotateWillRenderShapeStyleControls:e}),ka()}get enableViewTool(){return this.$$.ctx[30]}set enableViewTool(e){this.$$set({enableViewTool:e}),ka()}get enableSelectToolToAddShape(){return this.$$.ctx[31]}set enableSelectToolToAddShape(e){this.$$set({enableSelectToolToAddShape:e}),ka()}get enableTapToAddText(){return this.$$.ctx[32]}set enableTapToAddText(e){this.$$set({enableTapToAddText:e}),ka()}get enableAutoSelectMoveTool(){return this.$$.ctx[33]}set enableAutoSelectMoveTool(e){this.$$set({enableAutoSelectMoveTool:e}),ka()}get enableMoveTool(){return this.$$.ctx[34]}set enableMoveTool(e){this.$$set({enableMoveTool:e}),ka()}get enableMultiSelect(){return this.$$.ctx[35]}set enableMultiSelect(e){this.$$set({enableMultiSelect:e}),ka()}get willRenderShapeControls(){return this.$$.ctx[36]}set willRenderShapeControls(e){this.$$set({willRenderShapeControls:e}),ka()}get willRenderShapeTextControls(){return this.$$.ctx[37]}set willRenderShapeTextControls(e){this.$$set({willRenderShapeTextControls:e}),ka()}get beforeAddShape(){return this.$$.ctx[38]}set beforeAddShape(e){this.$$set({beforeAddShape:e}),ka()}get beforeRemoveShape(){return this.$$.ctx[39]}set beforeRemoveShape(e){this.$$set({beforeRemoveShape:e}),ka()}get beforeDeselectShape(){return this.$$.ctx[40]}set beforeDeselectShape(e){this.$$set({beforeDeselectShape:e}),ka()}get beforeSelectShape(){return this.$$.ctx[41]}set beforeSelectShape(e){this.$$set({beforeSelectShape:e}),ka()}get beforeUpdateShape(){return this.$$.ctx[42]}set beforeUpdateShape(e){this.$$set({beforeUpdateShape:e}),ka()}}]};function kx(e){let t,o,i;function r(t){e[52](t)}let n={utilKey:e[1],stores:e[5],locale:e[6],isActive:e[2],isActiveFraction:e[3],isVisible:e[4],mapScreenPointToImagePoint:e[44],mapImagePointToScreenPoint:e[43],shapes:e[46],toolbar:e[20]||e[7],toolShapes:e[21]||e[8],toolRetainStyles:e[9],shapeControls:e[22]||e[10],shapePresets:e[26],enableSelectToolToAddShape:e[29],enableTapToAddText:e[30],enableViewTool:e[31],enableMoveTool:e[32],enableAutoSelectMoveTool:e[33],enableMultiSelect:e[34],snapThreshold:e[16],gridSize:Oo(e[18])?e[18]:e[15],enableSnapToContext:xx(e[19])?e[19]:e[17],enableToolShareStyles:e[13],enablePresetSelectImage:e[24],enablePresetDropImage:e[25],enableButtonFlipVertical:e[23],parentRect:e[45],toolSelectRadius:e[11],textInputMode:e[12],willStartInteraction:e[42],willRenderPresetToolbar:e[27]||e[14],willRenderShapeStyleControls:e[28],hooks:{willRenderShapeControls:e[35],willRenderShapeTextControls:e[36],beforeAddShape:e[37],beforeRemoveShape:e[38],beforeDeselectShape:e[39],beforeSelectShape:e[40],beforeUpdateShape:e[41]}};return void 0!==e[0]&&(n.toolActive=e[0]),t=new fx({props:n}),pa.push((()=>Va(t,"toolActive",r))),t.$on("measure",e[53]),{c(){Na(t.$$.fragment)},m(e,o){Ha(t,e,o),i=!0},p(e,i){const r={};32&i[0]&&(r.stores=e[5]),64&i[0]&&(r.locale=e[6]),4&i[0]&&(r.isActive=e[2]),8&i[0]&&(r.isActiveFraction=e[3]),16&i[0]&&(r.isVisible=e[4]),8192&i[1]&&(r.mapScreenPointToImagePoint=e[44]),4096&i[1]&&(r.mapImagePointToScreenPoint=e[43]),1048704&i[0]&&(r.toolbar=e[20]||e[7]),2097408&i[0]&&(r.toolShapes=e[21]||e[8]),512&i[0]&&(r.toolRetainStyles=e[9]),4195328&i[0]&&(r.shapeControls=e[22]||e[10]),67108864&i[0]&&(r.shapePresets=e[26]),536870912&i[0]&&(r.enableSelectToolToAddShape=e[29]),1073741824&i[0]&&(r.enableTapToAddText=e[30]),1&i[1]&&(r.enableViewTool=e[31]),2&i[1]&&(r.enableMoveTool=e[32]),4&i[1]&&(r.enableAutoSelectMoveTool=e[33]),8&i[1]&&(r.enableMultiSelect=e[34]),65536&i[0]&&(r.snapThreshold=e[16]),294912&i[0]&&(r.gridSize=Oo(e[18])?e[18]:e[15]),655360&i[0]&&(r.enableSnapToContext=xx(e[19])?e[19]:e[17]),8192&i[0]&&(r.enableToolShareStyles=e[13]),16777216&i[0]&&(r.enablePresetSelectImage=e[24]),33554432&i[0]&&(r.enablePresetDropImage=e[25]),8388608&i[0]&&(r.enableButtonFlipVertical=e[23]),2048&i[0]&&(r.toolSelectRadius=e[11]),4096&i[0]&&(r.textInputMode=e[12]),2048&i[1]&&(r.willStartInteraction=e[42]),134234112&i[0]&&(r.willRenderPresetToolbar=e[27]||e[14]),268435456&i[0]&&(r.willRenderShapeStyleControls=e[28]),2032&i[1]&&(r.hooks={willRenderShapeControls:e[35],willRenderShapeTextControls:e[36],beforeAddShape:e[37],beforeRemoveShape:e[38],beforeDeselectShape:e[39],beforeSelectShape:e[40],beforeUpdateShape:e[41]}),!o&&1&i[0]&&(o=!0,r.toolActive=e[0],xa((()=>o=!1))),t.$set(r)},i(e){i||(Ea(t.$$.fragment,e),i=!0)},o(e){Aa(t.$$.fragment,e),i=!1},d(e){ja(t,e)}}}function Cx(e,t,o){let i,r,n,a,s;let{isActive:l}=t,{isActiveFraction:c}=t,{isVisible:d}=t,{stores:u}=t,{locale:p={}}=t,{markupEditorToolbar:h}=t,{markupEditorToolStyles:m}=t,{markupEditorToolRetainStyles:g}=t,{markupEditorShapeStyleControls:$}=t,{markupEditorToolSelectRadius:f}=t,{markupEditorTextInputMode:y}=t,{markupEditorToolShareStyles:b}=t,{willRenderShapePresetToolbar:x}=t,{markupEditorGridSize:v}=t,{markupEditorSnapThreshold:w}=t,{markupEditorSnapToContext:S=!0}=t,{decorateGridSize:k}=t,{decorateSnapToContext:C}=t,{decorateTools:T}=t,{decorateToolShapes:M}=t,{decorateShapeControls:P}=t,{decorateActiveTool:R}=t,{decorateEnableButtonFlipVertical:I=!1}=t,{decorateEnableSelectImagePreset:E=!1}=t,{decorateEnableDropImagePreset:A=!0}=t,{decoratePresets:L=[]}=t,{decorateWillRenderShapePresetToolbar:F}=t,{decorateWillRenderShapeStyleControls:z}=t,{enableSelectToolToAddShape:D}=t,{enableTapToAddText:O}=t,{enableViewTool:B}=t,{enableMoveTool:W}=t,{enableAutoSelectMoveTool:_}=t,{enableMultiSelect:V}=t,{willRenderShapeControls:N}=t,{willRenderShapeTextControls:H}=t,{beforeAddShape:j}=t,{beforeRemoveShape:U}=t,{beforeDeselectShape:G}=t,{beforeSelectShape:Z}=t,{beforeUpdateShape:X}=t,{markupEditorWillStartInteraction:Y}=t;const{imageCropRect:q,imageDecoration:K,imageSelectionRectPresentation:J,imageTransformsInterpolated:Q}=u;return hn(e,J,(e=>o(50,a=e))),hn(e,Q,(e=>o(51,s=e))),e.$$set=e=>{"isActive"in e&&o(2,l=e.isActive),"isActiveFraction"in e&&o(3,c=e.isActiveFraction),"isVisible"in e&&o(4,d=e.isVisible),"stores"in e&&o(5,u=e.stores),"locale"in e&&o(6,p=e.locale),"markupEditorToolbar"in e&&o(7,h=e.markupEditorToolbar),"markupEditorToolStyles"in e&&o(8,m=e.markupEditorToolStyles),"markupEditorToolRetainStyles"in e&&o(9,g=e.markupEditorToolRetainStyles),"markupEditorShapeStyleControls"in e&&o(10,$=e.markupEditorShapeStyleControls),"markupEditorToolSelectRadius"in e&&o(11,f=e.markupEditorToolSelectRadius),"markupEditorTextInputMode"in e&&o(12,y=e.markupEditorTextInputMode),"markupEditorToolShareStyles"in e&&o(13,b=e.markupEditorToolShareStyles),"willRenderShapePresetToolbar"in e&&o(14,x=e.willRenderShapePresetToolbar),"markupEditorGridSize"in e&&o(15,v=e.markupEditorGridSize),"markupEditorSnapThreshold"in e&&o(16,w=e.markupEditorSnapThreshold),"markupEditorSnapToContext"in e&&o(17,S=e.markupEditorSnapToContext),"decorateGridSize"in e&&o(18,k=e.decorateGridSize),"decorateSnapToContext"in e&&o(19,C=e.decorateSnapToContext),"decorateTools"in e&&o(20,T=e.decorateTools),"decorateToolShapes"in e&&o(21,M=e.decorateToolShapes),"decorateShapeControls"in e&&o(22,P=e.decorateShapeControls),"decorateActiveTool"in e&&o(0,R=e.decorateActiveTool),"decorateEnableButtonFlipVertical"in e&&o(23,I=e.decorateEnableButtonFlipVertical),"decorateEnableSelectImagePreset"in e&&o(24,E=e.decorateEnableSelectImagePreset),"decorateEnableDropImagePreset"in e&&o(25,A=e.decorateEnableDropImagePreset),"decoratePresets"in e&&o(26,L=e.decoratePresets),"decorateWillRenderShapePresetToolbar"in e&&o(27,F=e.decorateWillRenderShapePresetToolbar),"decorateWillRenderShapeStyleControls"in e&&o(28,z=e.decorateWillRenderShapeStyleControls),"enableSelectToolToAddShape"in e&&o(29,D=e.enableSelectToolToAddShape),"enableTapToAddText"in e&&o(30,O=e.enableTapToAddText),"enableViewTool"in e&&o(31,B=e.enableViewTool),"enableMoveTool"in e&&o(32,W=e.enableMoveTool),"enableAutoSelectMoveTool"in e&&o(33,_=e.enableAutoSelectMoveTool),"enableMultiSelect"in e&&o(34,V=e.enableMultiSelect),"willRenderShapeControls"in e&&o(35,N=e.willRenderShapeControls),"willRenderShapeTextControls"in e&&o(36,H=e.willRenderShapeTextControls),"beforeAddShape"in e&&o(37,j=e.beforeAddShape),"beforeRemoveShape"in e&&o(38,U=e.beforeRemoveShape),"beforeDeselectShape"in e&&o(39,G=e.beforeDeselectShape),"beforeSelectShape"in e&&o(40,Z=e.beforeSelectShape),"beforeUpdateShape"in e&&o(41,X=e.beforeUpdateShape),"markupEditorWillStartInteraction"in e&&o(42,Y=e.markupEditorWillStartInteraction)},e.$$.update=()=>{1048576&e.$$.dirty[1]&&o(49,i=s?s.scale:1),786432&e.$$.dirty[1]&&o(44,r=e=>{const t=$e(e);return t.x-=a.x,t.y-=a.y,t.x/=i,t.y/=i,t}),786432&e.$$.dirty[1]&&o(43,n=e=>{const t=$e(e);return t.x*=i,t.y*=i,t.x+=a.x,t.y+=a.y,t})},[R,"decorate",l,c,d,u,p,h,m,g,$,f,y,b,x,v,w,S,k,C,T,M,P,I,E,A,L,F,z,D,O,B,W,_,V,N,H,j,U,G,Z,X,Y,n,r,q,K,J,Q,i,a,s,function(e){R=e,o(0,R)},function(t){da.call(this,e,t)}]}var Tx={util:["decorate",class extends Ga{constructor(e){super(),Ua(this,e,Cx,kx,ln,{name:1,isActive:2,isActiveFraction:3,isVisible:4,stores:5,locale:6,markupEditorToolbar:7,markupEditorToolStyles:8,markupEditorToolRetainStyles:9,markupEditorShapeStyleControls:10,markupEditorToolSelectRadius:11,markupEditorTextInputMode:12,markupEditorToolShareStyles:13,willRenderShapePresetToolbar:14,markupEditorGridSize:15,markupEditorSnapThreshold:16,markupEditorSnapToContext:17,decorateGridSize:18,decorateSnapToContext:19,decorateTools:20,decorateToolShapes:21,decorateShapeControls:22,decorateActiveTool:0,decorateEnableButtonFlipVertical:23,decorateEnableSelectImagePreset:24,decorateEnableDropImagePreset:25,decoratePresets:26,decorateWillRenderShapePresetToolbar:27,decorateWillRenderShapeStyleControls:28,enableSelectToolToAddShape:29,enableTapToAddText:30,enableViewTool:31,enableMoveTool:32,enableAutoSelectMoveTool:33,enableMultiSelect:34,willRenderShapeControls:35,willRenderShapeTextControls:36,beforeAddShape:37,beforeRemoveShape:38,beforeDeselectShape:39,beforeSelectShape:40,beforeUpdateShape:41,markupEditorWillStartInteraction:42},null,[-1,-1])}get name(){return this.$$.ctx[1]}get isActive(){return this.$$.ctx[2]}set isActive(e){this.$$set({isActive:e}),ka()}get isActiveFraction(){return this.$$.ctx[3]}set isActiveFraction(e){this.$$set({isActiveFraction:e}),ka()}get isVisible(){return this.$$.ctx[4]}set isVisible(e){this.$$set({isVisible:e}),ka()}get stores(){return this.$$.ctx[5]}set stores(e){this.$$set({stores:e}),ka()}get locale(){return this.$$.ctx[6]}set locale(e){this.$$set({locale:e}),ka()}get markupEditorToolbar(){return this.$$.ctx[7]}set markupEditorToolbar(e){this.$$set({markupEditorToolbar:e}),ka()}get markupEditorToolStyles(){return this.$$.ctx[8]}set markupEditorToolStyles(e){this.$$set({markupEditorToolStyles:e}),ka()}get markupEditorToolRetainStyles(){return this.$$.ctx[9]}set markupEditorToolRetainStyles(e){this.$$set({markupEditorToolRetainStyles:e}),ka()}get markupEditorShapeStyleControls(){return this.$$.ctx[10]}set markupEditorShapeStyleControls(e){this.$$set({markupEditorShapeStyleControls:e}),ka()}get markupEditorToolSelectRadius(){return this.$$.ctx[11]}set markupEditorToolSelectRadius(e){this.$$set({markupEditorToolSelectRadius:e}),ka()}get markupEditorTextInputMode(){return this.$$.ctx[12]}set markupEditorTextInputMode(e){this.$$set({markupEditorTextInputMode:e}),ka()}get markupEditorToolShareStyles(){return this.$$.ctx[13]}set markupEditorToolShareStyles(e){this.$$set({markupEditorToolShareStyles:e}),ka()}get willRenderShapePresetToolbar(){return this.$$.ctx[14]}set willRenderShapePresetToolbar(e){this.$$set({willRenderShapePresetToolbar:e}),ka()}get markupEditorGridSize(){return this.$$.ctx[15]}set markupEditorGridSize(e){this.$$set({markupEditorGridSize:e}),ka()}get markupEditorSnapThreshold(){return this.$$.ctx[16]}set markupEditorSnapThreshold(e){this.$$set({markupEditorSnapThreshold:e}),ka()}get markupEditorSnapToContext(){return this.$$.ctx[17]}set markupEditorSnapToContext(e){this.$$set({markupEditorSnapToContext:e}),ka()}get decorateGridSize(){return this.$$.ctx[18]}set decorateGridSize(e){this.$$set({decorateGridSize:e}),ka()}get decorateSnapToContext(){return this.$$.ctx[19]}set decorateSnapToContext(e){this.$$set({decorateSnapToContext:e}),ka()}get decorateTools(){return this.$$.ctx[20]}set decorateTools(e){this.$$set({decorateTools:e}),ka()}get decorateToolShapes(){return this.$$.ctx[21]}set decorateToolShapes(e){this.$$set({decorateToolShapes:e}),ka()}get decorateShapeControls(){return this.$$.ctx[22]}set decorateShapeControls(e){this.$$set({decorateShapeControls:e}),ka()}get decorateActiveTool(){return this.$$.ctx[0]}set decorateActiveTool(e){this.$$set({decorateActiveTool:e}),ka()}get decorateEnableButtonFlipVertical(){return this.$$.ctx[23]}set decorateEnableButtonFlipVertical(e){this.$$set({decorateEnableButtonFlipVertical:e}),ka()}get decorateEnableSelectImagePreset(){return this.$$.ctx[24]}set decorateEnableSelectImagePreset(e){this.$$set({decorateEnableSelectImagePreset:e}),ka()}get decorateEnableDropImagePreset(){return this.$$.ctx[25]}set decorateEnableDropImagePreset(e){this.$$set({decorateEnableDropImagePreset:e}),ka()}get decoratePresets(){return this.$$.ctx[26]}set decoratePresets(e){this.$$set({decoratePresets:e}),ka()}get decorateWillRenderShapePresetToolbar(){return this.$$.ctx[27]}set decorateWillRenderShapePresetToolbar(e){this.$$set({decorateWillRenderShapePresetToolbar:e}),ka()}get decorateWillRenderShapeStyleControls(){return this.$$.ctx[28]}set decorateWillRenderShapeStyleControls(e){this.$$set({decorateWillRenderShapeStyleControls:e}),ka()}get enableSelectToolToAddShape(){return this.$$.ctx[29]}set enableSelectToolToAddShape(e){this.$$set({enableSelectToolToAddShape:e}),ka()}get enableTapToAddText(){return this.$$.ctx[30]}set enableTapToAddText(e){this.$$set({enableTapToAddText:e}),ka()}get enableViewTool(){return this.$$.ctx[31]}set enableViewTool(e){this.$$set({enableViewTool:e}),ka()}get enableMoveTool(){return this.$$.ctx[32]}set enableMoveTool(e){this.$$set({enableMoveTool:e}),ka()}get enableAutoSelectMoveTool(){return this.$$.ctx[33]}set enableAutoSelectMoveTool(e){this.$$set({enableAutoSelectMoveTool:e}),ka()}get enableMultiSelect(){return this.$$.ctx[34]}set enableMultiSelect(e){this.$$set({enableMultiSelect:e}),ka()}get willRenderShapeControls(){return this.$$.ctx[35]}set willRenderShapeControls(e){this.$$set({willRenderShapeControls:e}),ka()}get willRenderShapeTextControls(){return this.$$.ctx[36]}set willRenderShapeTextControls(e){this.$$set({willRenderShapeTextControls:e}),ka()}get beforeAddShape(){return this.$$.ctx[37]}set beforeAddShape(e){this.$$set({beforeAddShape:e}),ka()}get beforeRemoveShape(){return this.$$.ctx[38]}set beforeRemoveShape(e){this.$$set({beforeRemoveShape:e}),ka()}get beforeDeselectShape(){return this.$$.ctx[39]}set beforeDeselectShape(e){this.$$set({beforeDeselectShape:e}),ka()}get beforeSelectShape(){return this.$$.ctx[40]}set beforeSelectShape(e){this.$$set({beforeSelectShape:e}),ka()}get beforeUpdateShape(){return this.$$.ctx[41]}set beforeUpdateShape(e){this.$$set({beforeUpdateShape:e}),ka()}get markupEditorWillStartInteraction(){return this.$$.ctx[42]}set markupEditorWillStartInteraction(e){this.$$set({markupEditorWillStartInteraction:e}),ka()}}]};function Mx(e){let t,o;return t=new fx({props:{stores:e[3],locale:e[4],isActive:e[0],isActiveFraction:e[1],isVisible:e[2],mapScreenPointToImagePoint:e[26],mapImagePointToScreenPoint:e[25],utilKey:"sticker",shapePresets:e[5],shapes:e[6]?e[35]:e[36],toolActive:"preset",imageFlipX:!!e[6]&&e[24],imageFlipY:!!e[6]&&e[23],imageRotation:e[6]?e[31]:0,parentRect:e[6]?e[37]:e[33],snapThreshold:e[29],gridSize:e[28],enableMultiSelect:e[12],enableSnapToContext:e[27],enablePresetDropImage:e[7],enablePresetSelectImage:e[30],enableButtonFlipVertical:e[10]||e[8],toolSelectRadius:e[15],willStartInteraction:e[22],willRenderPresetToolbar:e[11]||e[9]||e[16],hooks:{willRenderShapeControls:e[13],willRenderShapeTextControls:e[14],beforeAddShape:e[17],beforeRemoveShape:e[18],beforeDeselectShape:e[19],beforeSelectShape:e[20],beforeUpdateShape:e[21]}}}),t.$on("measure",e[60]),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};8&o[0]&&(i.stores=e[3]),16&o[0]&&(i.locale=e[4]),1&o[0]&&(i.isActive=e[0]),2&o[0]&&(i.isActiveFraction=e[1]),4&o[0]&&(i.isVisible=e[2]),67108864&o[0]&&(i.mapScreenPointToImagePoint=e[26]),33554432&o[0]&&(i.mapImagePointToScreenPoint=e[25]),32&o[0]&&(i.shapePresets=e[5]),64&o[0]&&(i.shapes=e[6]?e[35]:e[36]),16777280&o[0]&&(i.imageFlipX=!!e[6]&&e[24]),8388672&o[0]&&(i.imageFlipY=!!e[6]&&e[23]),64&o[0]|1&o[1]&&(i.imageRotation=e[6]?e[31]:0),64&o[0]&&(i.parentRect=e[6]?e[37]:e[33]),536870912&o[0]&&(i.snapThreshold=e[29]),268435456&o[0]&&(i.gridSize=e[28]),4096&o[0]&&(i.enableMultiSelect=e[12]),134217728&o[0]&&(i.enableSnapToContext=e[27]),128&o[0]&&(i.enablePresetDropImage=e[7]),1073741824&o[0]&&(i.enablePresetSelectImage=e[30]),1280&o[0]&&(i.enableButtonFlipVertical=e[10]||e[8]),32768&o[0]&&(i.toolSelectRadius=e[15]),4194304&o[0]&&(i.willStartInteraction=e[22]),68096&o[0]&&(i.willRenderPresetToolbar=e[11]||e[9]||e[16]),4087808&o[0]&&(i.hooks={willRenderShapeControls:e[13],willRenderShapeTextControls:e[14],beforeAddShape:e[17],beforeRemoveShape:e[18],beforeDeselectShape:e[19],beforeSelectShape:e[20],beforeUpdateShape:e[21]}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Px(e,t,o){let i,r,n,a,s,l,c,d,u,p,h,m,g,$,f;let{isActive:y}=t,{isActiveFraction:b}=t,{isVisible:x}=t,{stores:v}=t,{locale:w={}}=t,{stickers:S=[]}=t,{stickerForceEnable:k=!1}=t,{stickerStickToImage:C=!1}=t,{stickerEnableSelectImagePreset:T=!0}=t,{stickerEnableDropImagePreset:M=!0}=t,{stickerEnableButtonFlipVertical:P=!1}=t,{stickerWillRenderShapePresetToolbar:R}=t,{stickerEnableSelectImage:I=!0}=t,{stickersEnableButtonFlipVertical:E=!1}=t,{stickersWillRenderShapePresetToolbar:A}=t,{markupEditorGridSize:L=0}=t,{markupEditorSnapThreshold:F=0}=t,{markupEditorSnapToContext:z=!1}=t,{enableMultiSelect:D}=t,{annotateGridSize:O}=t,{annotateSnapToContext:B}=t,{decorateGridSize:W}=t,{decorateSnapToContext:_}=t,{willRenderShapeControls:V}=t,{willRenderShapeTextControls:N}=t,{markupEditorToolSelectRadius:H}=t,{willRenderShapePresetToolbar:j}=t,{beforeAddShape:U}=t,{beforeRemoveShape:G}=t,{beforeDeselectShape:Z}=t,{beforeSelectShape:X}=t,{beforeUpdateShape:Y}=t,{markupEditorWillStartInteraction:q}=t;const{rootRect:K,imageCropRect:J,imageSelectionRectPresentation:Q,imageAnnotation:ee,imageDecoration:te,imageSize:oe,imageTransforms:ie,imageTransformsInterpolated:re,imageRotation:ne,imageFlipX:ae,imageFlipY:se}=v;return hn(e,K,(e=>o(59,$=e))),hn(e,Q,(e=>o(55,d=e))),hn(e,oe,(e=>o(58,g=e))),hn(e,ie,(e=>o(57,m=e))),hn(e,re,(e=>o(56,h=e))),hn(e,ne,(e=>o(31,f=e))),hn(e,ae,(e=>o(24,p=e))),hn(e,se,(e=>o(23,u=e))),e.$$set=e=>{"isActive"in e&&o(0,y=e.isActive),"isActiveFraction"in e&&o(1,b=e.isActiveFraction),"isVisible"in e&&o(2,x=e.isVisible),"stores"in e&&o(3,v=e.stores),"locale"in e&&o(4,w=e.locale),"stickers"in e&&o(5,S=e.stickers),"stickerForceEnable"in e&&o(44,k=e.stickerForceEnable),"stickerStickToImage"in e&&o(6,C=e.stickerStickToImage),"stickerEnableSelectImagePreset"in e&&o(45,T=e.stickerEnableSelectImagePreset),"stickerEnableDropImagePreset"in e&&o(7,M=e.stickerEnableDropImagePreset),"stickerEnableButtonFlipVertical"in e&&o(8,P=e.stickerEnableButtonFlipVertical),"stickerWillRenderShapePresetToolbar"in e&&o(9,R=e.stickerWillRenderShapePresetToolbar),"stickerEnableSelectImage"in e&&o(46,I=e.stickerEnableSelectImage),"stickersEnableButtonFlipVertical"in e&&o(10,E=e.stickersEnableButtonFlipVertical),"stickersWillRenderShapePresetToolbar"in e&&o(11,A=e.stickersWillRenderShapePresetToolbar),"markupEditorGridSize"in e&&o(47,L=e.markupEditorGridSize),"markupEditorSnapThreshold"in e&&o(48,F=e.markupEditorSnapThreshold),"markupEditorSnapToContext"in e&&o(49,z=e.markupEditorSnapToContext),"enableMultiSelect"in e&&o(12,D=e.enableMultiSelect),"annotateGridSize"in e&&o(50,O=e.annotateGridSize),"annotateSnapToContext"in e&&o(51,B=e.annotateSnapToContext),"decorateGridSize"in e&&o(52,W=e.decorateGridSize),"decorateSnapToContext"in e&&o(53,_=e.decorateSnapToContext),"willRenderShapeControls"in e&&o(13,V=e.willRenderShapeControls),"willRenderShapeTextControls"in e&&o(14,N=e.willRenderShapeTextControls),"markupEditorToolSelectRadius"in e&&o(15,H=e.markupEditorToolSelectRadius),"willRenderShapePresetToolbar"in e&&o(16,j=e.willRenderShapePresetToolbar),"beforeAddShape"in e&&o(17,U=e.beforeAddShape),"beforeRemoveShape"in e&&o(18,G=e.beforeRemoveShape),"beforeDeselectShape"in e&&o(19,Z=e.beforeDeselectShape),"beforeSelectShape"in e&&o(20,X=e.beforeSelectShape),"beforeUpdateShape"in e&&o(21,Y=e.beforeUpdateShape),"markupEditorWillStartInteraction"in e&&o(22,q=e.markupEditorWillStartInteraction)},e.$$.update=()=>{33554432&e.$$.dirty[1]&&o(54,i=h?h.scale:1),49152&e.$$.dirty[1]&&o(30,r=!1!==T&&I),131072&e.$$.dirty[1]&&o(29,n=F),64&e.$$.dirty[0]|2686976&e.$$.dirty[1]&&o(28,a=C?Oo(O)?O:L:Oo(W)?W:L),64&e.$$.dirty[0]|5505024&e.$$.dirty[1]&&o(27,s=C?xx(B)?B:z:xx(_)?_:z),25165888&e.$$.dirty[0]|528482304&e.$$.dirty[1]&&o(26,l=C?e=>bx(e,$,g,h.origin,h.translation,m.rotation.z,h.scale,p,u):e=>{const t=$e(e);return t.x-=d.x,t.y-=d.y,t.x/=i,t.y/=i,t}),25165888&e.$$.dirty[0]|528482304&e.$$.dirty[1]&&o(25,c=C?e=>yx(e,$,g,h.origin,h.translation,m.rotation.z,h.scale,p,u):e=>{const t=$e(e);return t.x*=i,t.y*=i,t.x+=d.x,t.y+=d.y,t})},[y,b,x,v,w,S,C,M,P,R,E,A,D,V,N,H,j,U,G,Z,X,Y,q,u,p,c,l,s,a,n,r,f,K,J,Q,ee,te,oe,ie,re,ne,ae,se,"sticker",k,T,I,L,F,z,O,B,W,_,i,d,h,m,g,$,function(t){da.call(this,e,t)}]}var Rx={util:["sticker",class extends Ga{constructor(e){super(),Ua(this,e,Px,Mx,ln,{name:43,isActive:0,isActiveFraction:1,isVisible:2,stores:3,locale:4,stickers:5,stickerForceEnable:44,stickerStickToImage:6,stickerEnableSelectImagePreset:45,stickerEnableDropImagePreset:7,stickerEnableButtonFlipVertical:8,stickerWillRenderShapePresetToolbar:9,stickerEnableSelectImage:46,stickersEnableButtonFlipVertical:10,stickersWillRenderShapePresetToolbar:11,markupEditorGridSize:47,markupEditorSnapThreshold:48,markupEditorSnapToContext:49,enableMultiSelect:12,annotateGridSize:50,annotateSnapToContext:51,decorateGridSize:52,decorateSnapToContext:53,willRenderShapeControls:13,willRenderShapeTextControls:14,markupEditorToolSelectRadius:15,willRenderShapePresetToolbar:16,beforeAddShape:17,beforeRemoveShape:18,beforeDeselectShape:19,beforeSelectShape:20,beforeUpdateShape:21,markupEditorWillStartInteraction:22},null,[-1,-1])}get name(){return this.$$.ctx[43]}get isActive(){return this.$$.ctx[0]}set isActive(e){this.$$set({isActive:e}),ka()}get isActiveFraction(){return this.$$.ctx[1]}set isActiveFraction(e){this.$$set({isActiveFraction:e}),ka()}get isVisible(){return this.$$.ctx[2]}set isVisible(e){this.$$set({isVisible:e}),ka()}get stores(){return this.$$.ctx[3]}set stores(e){this.$$set({stores:e}),ka()}get locale(){return this.$$.ctx[4]}set locale(e){this.$$set({locale:e}),ka()}get stickers(){return this.$$.ctx[5]}set stickers(e){this.$$set({stickers:e}),ka()}get stickerForceEnable(){return this.$$.ctx[44]}set stickerForceEnable(e){this.$$set({stickerForceEnable:e}),ka()}get stickerStickToImage(){return this.$$.ctx[6]}set stickerStickToImage(e){this.$$set({stickerStickToImage:e}),ka()}get stickerEnableSelectImagePreset(){return this.$$.ctx[45]}set stickerEnableSelectImagePreset(e){this.$$set({stickerEnableSelectImagePreset:e}),ka()}get stickerEnableDropImagePreset(){return this.$$.ctx[7]}set stickerEnableDropImagePreset(e){this.$$set({stickerEnableDropImagePreset:e}),ka()}get stickerEnableButtonFlipVertical(){return this.$$.ctx[8]}set stickerEnableButtonFlipVertical(e){this.$$set({stickerEnableButtonFlipVertical:e}),ka()}get stickerWillRenderShapePresetToolbar(){return this.$$.ctx[9]}set stickerWillRenderShapePresetToolbar(e){this.$$set({stickerWillRenderShapePresetToolbar:e}),ka()}get stickerEnableSelectImage(){return this.$$.ctx[46]}set stickerEnableSelectImage(e){this.$$set({stickerEnableSelectImage:e}),ka()}get stickersEnableButtonFlipVertical(){return this.$$.ctx[10]}set stickersEnableButtonFlipVertical(e){this.$$set({stickersEnableButtonFlipVertical:e}),ka()}get stickersWillRenderShapePresetToolbar(){return this.$$.ctx[11]}set stickersWillRenderShapePresetToolbar(e){this.$$set({stickersWillRenderShapePresetToolbar:e}),ka()}get markupEditorGridSize(){return this.$$.ctx[47]}set markupEditorGridSize(e){this.$$set({markupEditorGridSize:e}),ka()}get markupEditorSnapThreshold(){return this.$$.ctx[48]}set markupEditorSnapThreshold(e){this.$$set({markupEditorSnapThreshold:e}),ka()}get markupEditorSnapToContext(){return this.$$.ctx[49]}set markupEditorSnapToContext(e){this.$$set({markupEditorSnapToContext:e}),ka()}get enableMultiSelect(){return this.$$.ctx[12]}set enableMultiSelect(e){this.$$set({enableMultiSelect:e}),ka()}get annotateGridSize(){return this.$$.ctx[50]}set annotateGridSize(e){this.$$set({annotateGridSize:e}),ka()}get annotateSnapToContext(){return this.$$.ctx[51]}set annotateSnapToContext(e){this.$$set({annotateSnapToContext:e}),ka()}get decorateGridSize(){return this.$$.ctx[52]}set decorateGridSize(e){this.$$set({decorateGridSize:e}),ka()}get decorateSnapToContext(){return this.$$.ctx[53]}set decorateSnapToContext(e){this.$$set({decorateSnapToContext:e}),ka()}get willRenderShapeControls(){return this.$$.ctx[13]}set willRenderShapeControls(e){this.$$set({willRenderShapeControls:e}),ka()}get willRenderShapeTextControls(){return this.$$.ctx[14]}set willRenderShapeTextControls(e){this.$$set({willRenderShapeTextControls:e}),ka()}get markupEditorToolSelectRadius(){return this.$$.ctx[15]}set markupEditorToolSelectRadius(e){this.$$set({markupEditorToolSelectRadius:e}),ka()}get willRenderShapePresetToolbar(){return this.$$.ctx[16]}set willRenderShapePresetToolbar(e){this.$$set({willRenderShapePresetToolbar:e}),ka()}get beforeAddShape(){return this.$$.ctx[17]}set beforeAddShape(e){this.$$set({beforeAddShape:e}),ka()}get beforeRemoveShape(){return this.$$.ctx[18]}set beforeRemoveShape(e){this.$$set({beforeRemoveShape:e}),ka()}get beforeDeselectShape(){return this.$$.ctx[19]}set beforeDeselectShape(e){this.$$set({beforeDeselectShape:e}),ka()}get beforeSelectShape(){return this.$$.ctx[20]}set beforeSelectShape(e){this.$$set({beforeSelectShape:e}),ka()}get beforeUpdateShape(){return this.$$.ctx[21]}set beforeUpdateShape(e){this.$$set({beforeUpdateShape:e}),ka()}get markupEditorWillStartInteraction(){return this.$$.ctx[22]}set markupEditorWillStartInteraction(e){this.$$set({markupEditorWillStartInteraction:e}),ka()}},({stickers:e,stickerEnableSelectImage:t,stickerEnableSelectImagePreset:o,stickerEnableDropImagePreset:i,stickerForceEnable:r})=>e&&e.length||t||o||i||r]};function Ix(e){let t,o,i=(e[14](e[36].value)||"")+"";return{c(){t=new Yn(!1),o=Bn(),t.a=o},m(e,r){t.m(i,e,r),An(e,o,r)},p(e,o){32&o[1]&&i!==(i=(e[14](e[36].value)||"")+"")&&t.p(i)},i:en,o:en,d(e){e&&Ln(o),e&&t.d()}}}function Ex(e){let t,o;return t=new mh({props:{items:e[16](e[36].value)}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};32&o[1]&&(i.items=e[16](e[36].value)),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Ax(e){let t,o,i,r,n,a,s,l,c=(R(e[36].label)?e[36].label(e[1]):e[36].label)+"";const d=[Ex,Ix],u=[];function p(e,t){return 32&t[1]&&(o=null),null==o&&(o=!!e[15](e[36].value)),o?0:1}return i=p(e,[-1,-1]),r=u[i]=d[i](e),{c(){t=Fn("div"),r.c(),n=On(),a=Fn("span"),s=Dn(c),Nn(t,"slot","option")},m(e,o){An(e,t,o),u[i].m(t,null),Rn(t,n),Rn(t,a),Rn(a,s),l=!0},p(e,o){let a=i;i=p(e,o),i===a?u[i].p(e,o):(Ra(),Aa(u[a],1,1,(()=>{u[a]=null})),Ia(),r=u[i],r?r.p(e,o):(r=u[i]=d[i](e),r.c()),Ea(r,1),r.m(t,n)),(!l||2&o[0]|32&o[1])&&c!==(c=(R(e[36].label)?e[36].label(e[1]):e[36].label)+"")&&Un(s,c)},i(e){l||(Ea(r),l=!0)},o(e){Aa(r),l=!1},d(e){e&&Ln(t),u[i].d()}}}function Lx(e){let t,o;return t=new Lu({props:{locale:e[1],class:"PinturaControlList",layout:"row",options:e[2],selectedIndex:e[6],onchange:e[12],$$slots:{option:[Ax,({option:e})=>({36:e}),({option:e})=>[0,e?32:0]]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};2&o[0]&&(i.locale=e[1]),4&o[0]&&(i.options=e[2]),64&o[0]&&(i.selectedIndex=e[6]),2&o[0]|96&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Fx(e){let t,o,i,r,n;return o=new Mb({props:{locale:e[1],class:"PinturaControlPanels",shapeProps:e[4],onchange:e[13],controls:e[3],scrollElasticity:e[7]}}),r=new Ah({props:{elasticity:e[10],$$slots:{default:[Lx]},$$scope:{ctx:e}}}),{c(){t=Fn("div"),Na(o.$$.fragment),i=On(),Na(r.$$.fragment),Nn(t,"slot","footer"),Zn(t,"transform",e[5])},m(e,a){An(e,t,a),Ha(o,t,null),Rn(t,i),Ha(r,t,null),n=!0},p(e,i){const n={};2&i[0]&&(n.locale=e[1]),16&i[0]&&(n.shapeProps=e[4]),8&i[0]&&(n.controls=e[3]),128&i[0]&&(n.scrollElasticity=e[7]),o.$set(n);const a={};70&i[0]|64&i[1]&&(a.$$scope={dirty:i,ctx:e}),r.$set(a),32&i[0]&&Zn(t,"transform",e[5])},i(e){n||(Ea(o.$$.fragment,e),Ea(r.$$.fragment,e),n=!0)},o(e){Aa(o.$$.fragment,e),Aa(r.$$.fragment,e),n=!1},d(e){e&&Ln(t),ja(o),ja(r)}}}function zx(e){let t,o;return t=new Tf({props:{$$slots:{footer:[Fx]},$$scope:{ctx:e}}}),t.$on("measure",e[25]),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};254&o[0]|64&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Dx(e,t,o){let i,r,n,a,s,l,c,d,u=en,p=()=>(u(),u=un(h,(e=>o(22,s=e))),h);e.$$.on_destroy.push((()=>u()));let{isActive:h}=t;p();let{stores:m}=t,{locale:g={}}=t,{frameStyles:$={}}=t,{frameOptions:f=[]}=t,{markupEditorShapeStyleControls:y}=t;const b=ca("elasticityMultiplier");hn(e,b,(e=>o(24,d=e)));const{history:x,animation:v,scrollElasticity:w,imageFrame:S,allowPan:k,allowZoom:C,allowZoomControls:T,allowPlayPause:M}=m;hn(e,v,(e=>o(23,l=e))),hn(e,S,(e=>o(4,c=e)));let P={};let R;const I=xc(l?20:0);return hn(e,I,(e=>o(21,a=e))),e.$$set=e=>{"isActive"in e&&p(o(0,h=e.isActive)),"stores"in e&&o(19,m=e.stores),"locale"in e&&o(1,g=e.locale),"frameStyles"in e&&o(20,$=e.frameStyles),"frameOptions"in e&&o(2,f=e.frameOptions),"markupEditorShapeStyleControls"in e&&o(3,y=e.markupEditorShapeStyleControls)},e.$$.update=()=>{4194304&e.$$.dirty[0]&&k.set(s),4194304&e.$$.dirty[0]&&C.set(s),4194304&e.$$.dirty[0]&&T.set(s),4194304&e.$$.dirty[0]&&s&&M.set(!0),16777216&e.$$.dirty[0]&&o(7,i=d*w),20&e.$$.dirty[0]&&o(6,r=c?f.findIndex((([e])=>e===c.id)):0),12582912&e.$$.dirty[0]&&l&&I.set(s?0:20),2097152&e.$$.dirty[0]&&o(5,n=a?`translateY(${a}px)`:"none")},[h,g,f,y,c,n,r,i,b,v,w,S,({value:e})=>{const t=$[e];if(!t||!t.shape)return S.set(void 0),void x.write();const{shape:o}=t,i={id:e,...xi(o),...Object.keys(P).reduce(((e,t)=>o[t]?(e[t]=P[t],e):e),{})};S.set(i),x.write()},function(e){Wo(e,"frameColor")&&(P.frameColor=e.frameColor),c&&(Cr(c,e),S.set(c),clearTimeout(R),R=setTimeout((()=>{x.write()}),200))},e=>{const t=$[e];var o;if(t&&t.thumb)return o=t.thumb,/div/i.test(o)||Pb(o)?o:/rect|path|circle|line|<g>/i.test(o)?`<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" stroke-width="1" stroke="currentColor" fill="none" aria-hidden="true" focusable="false" stroke-linecap="round" stroke-linejoin="round">${o}</svg>`:`<img src="${o}" alt=""/>`},e=>{const t=$[e];return!(!t||!t.thumb)&&_o(t.thumb)},e=>$[e].thumb,I,"frame",m,$,a,s,l,d,function(t){da.call(this,e,t)}]}var Ox={util:["frame",class extends Ga{constructor(e){super(),Ua(this,e,Dx,zx,ln,{name:18,isActive:0,stores:19,locale:1,frameStyles:20,frameOptions:2,markupEditorShapeStyleControls:3},null,[-1,-1])}get name(){return this.$$.ctx[18]}get isActive(){return this.$$.ctx[0]}set isActive(e){this.$$set({isActive:e}),ka()}get stores(){return this.$$.ctx[19]}set stores(e){this.$$set({stores:e}),ka()}get locale(){return this.$$.ctx[1]}set locale(e){this.$$set({locale:e}),ka()}get frameStyles(){return this.$$.ctx[20]}set frameStyles(e){this.$$set({frameStyles:e}),ka()}get frameOptions(){return this.$$.ctx[2]}set frameOptions(e){this.$$set({frameOptions:e}),ka()}get markupEditorShapeStyleControls(){return this.$$.ctx[3]}set markupEditorShapeStyleControls(e){this.$$set({markupEditorShapeStyleControls:e}),ka()}},({src:e})=>e&&!Zs(e)]};function Bx(e){let t,o,i,r,n,a,s,l;return{c(){t=Fn("div"),o=Fn("input"),r=On(),n=Fn("label"),a=Dn(e[1]),Nn(o,"id",e[0]),Nn(o,"type","number"),Nn(o,"min","1"),Nn(o,"inputmode","numeric"),Nn(o,"pattern","[0-9]*"),Nn(o,"data-state",e[3]),Nn(o,"autocomplete","off"),Nn(o,"placeholder",e[4]),o.value=i=void 0===e[5]?"":e[7](e[5]+""),Nn(n,"for",e[0]),Nn(n,"title",e[2]),Nn(n,"aria-label",e[2]),Nn(t,"class","PinturaInputDimension")},m(i,c){An(i,t,c),Rn(t,o),Rn(t,r),Rn(t,n),Rn(n,a),s||(l=Wn(o,"input",e[8]),s=!0)},p(e,[t]){1&t&&Nn(o,"id",e[0]),8&t&&Nn(o,"data-state",e[3]),16&t&&Nn(o,"placeholder",e[4]),160&t&&i!==(i=void 0===e[5]?"":e[7](e[5]+""))&&o.value!==i&&(o.value=i),2&t&&Un(a,e[1]),1&t&&Nn(n,"for",e[0]),4&t&&Nn(n,"title",e[2]),4&t&&Nn(n,"aria-label",e[2])},i:en,o:en,d(e){e&&Ln(t),s=!1,l()}}}function Wx(e,t,o){let{id:i}=t,{label:r}=t,{title:n}=t,{state:a}=t,{placeholder:s}=t,{value:l}=t,{onchange:c}=t,{format:d=(e=>e.replace(/\D/g,""))}=t;return e.$$set=e=>{"id"in e&&o(0,i=e.id),"label"in e&&o(1,r=e.label),"title"in e&&o(2,n=e.title),"state"in e&&o(3,a=e.state),"placeholder"in e&&o(4,s=e.placeholder),"value"in e&&o(5,l=e.value),"onchange"in e&&o(6,c=e.onchange),"format"in e&&o(7,d=e.format)},[i,r,n,a,s,l,c,d,e=>c(d(e.currentTarget.value))]}class _x extends Ga{constructor(e){super(),Ua(this,e,Wx,Bx,ln,{id:0,label:1,title:2,state:3,placeholder:4,value:5,onchange:6,format:7})}}function Vx(e){let t;return{c(){t=zn("g")},m(o,i){An(o,t,i),t.innerHTML=e[2]},p(e,o){4&o&&(t.innerHTML=e[2])},d(e){e&&Ln(t)}}}function Nx(e){let t,o,i,r,n,a,s,l;return n=new Sd({props:{$$slots:{default:[Vx]},$$scope:{ctx:e}}}),{c(){t=Fn("div"),o=Fn("input"),i=On(),r=Fn("label"),Na(n.$$.fragment),Nn(o,"id",e[0]),Nn(o,"class","implicit"),Nn(o,"type","checkbox"),o.checked=e[1],Nn(r,"for",e[0]),Nn(r,"title",e[3])},m(c,d){An(c,t,d),Rn(t,o),Rn(t,i),Rn(t,r),Ha(n,r,null),a=!0,s||(l=Wn(o,"change",e[5]),s=!0)},p(e,[t]){(!a||1&t)&&Nn(o,"id",e[0]),(!a||2&t)&&(o.checked=e[1]);const i={};68&t&&(i.$$scope={dirty:t,ctx:e}),n.$set(i),(!a||1&t)&&Nn(r,"for",e[0]),(!a||8&t)&&Nn(r,"title",e[3])},i(e){a||(Ea(n.$$.fragment,e),a=!0)},o(e){Aa(n.$$.fragment,e),a=!1},d(e){e&&Ln(t),ja(n),s=!1,l()}}}function Hx(e,t,o){let{id:i}=t,{locked:r}=t,{icon:n}=t,{title:a}=t,{onchange:s}=t;return e.$$set=e=>{"id"in e&&o(0,i=e.id),"locked"in e&&o(1,r=e.locked),"icon"in e&&o(2,n=e.icon),"title"in e&&o(3,a=e.title),"onchange"in e&&o(4,s=e.onchange)},[i,r,n,a,s,e=>s(e.currentTarget.checked)]}class jx extends Ga{constructor(e){super(),Ua(this,e,Hx,Nx,ln,{id:0,locked:1,icon:2,title:3,onchange:4})}}function Ux(e){let t;return{c(){t=Dn("Save")},m(e,o){An(e,t,o)},d(e){e&&Ln(t)}}}function Gx(e){let t,o,i,r,n,a,s,l,c,d,u,p,h,m=e[1].resizeLabelFormCaption+"";return l=new mh({props:{items:e[4]}}),d=new vh({props:{type:"submit",class:"implicit",$$slots:{default:[Ux]},$$scope:{ctx:e}}}),{c(){t=Fn("form"),o=Fn("div"),i=Fn("fieldset"),r=Fn("legend"),n=Dn(m),a=On(),s=Fn("div"),Na(l.$$.fragment),c=On(),Na(d.$$.fragment),Nn(r,"class","implicit"),Nn(s,"class","PinturaFieldsetInner"),Nn(o,"class","PinturaFormInner"),Nn(t,"slot","footer"),Zn(t,"transform",e[3])},m(m,g){An(m,t,g),Rn(t,o),Rn(o,i),Rn(i,r),Rn(r,n),Rn(i,a),Rn(i,s),Ha(l,s,null),e[66](s),Rn(o,c),Ha(d,o,null),u=!0,p||(h=[Wn(s,"focusin",e[15]),Wn(s,"focusout",e[16]),Wn(t,"submit",_n(e[17]))],p=!0)},p(e,o){(!u||2&o[0])&&m!==(m=e[1].resizeLabelFormCaption+"")&&Un(n,m);const i={};16&o[0]&&(i.items=e[4]),l.$set(i);const r={};32&o[3]&&(r.$$scope={dirty:o,ctx:e}),d.$set(r),8&o[0]&&Zn(t,"transform",e[3])},i(e){u||(Ea(l.$$.fragment,e),Ea(d.$$.fragment,e),u=!0)},o(e){Aa(l.$$.fragment,e),Aa(d.$$.fragment,e),u=!1},d(o){o&&Ln(t),ja(l),e[66](null),ja(d),p=!1,an(h)}}}function Zx(e){let t,o;return t=new Tf({props:{$$slots:{footer:[Gx]},$$scope:{ctx:e}}}),t.$on("measure",e[67]),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};30&o[0]|32&o[3]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Xx(e,t,o){let i,r,n,a,s,l,c,d,u,p,h,g,$,f,y,b,x,v,w,S,k,C,T,M,P,I,E,A,F,z,D=en,O=()=>(D(),D=un(W,(e=>o(50,h=e))),W);e.$$.on_destroy.push((()=>D()));const B=(e,t=0,o=9999)=>{if(m(e)&&!(e=e.replace(/\D/g,"")).length)return;const i=Math.round(e);return Number.isNaN(i)?void 0:$s(i,t,o)};let{isActive:W}=t;O();let{stores:_}=t,{locale:V={}}=t,{resizeMinSize:N=Ne(1,1)}=t,{resizeMaxSize:H=Ne(9999,9999)}=t,{resizeAspectRatioLocked:j=!1}=t,{resizeEnableButtonLockAspectRatio:U=!0}=t,{resizeSizePresetOptions:G}=t,{resizeWidthPresetOptions:Z}=t,{resizeHeightPresetOptions:q}=t,{resizeWillRenderFooter:K=Y}=t,{resizeFormatIconButtonMaintainAspectRatio:J=function(e){const{active:t,activeFraction:o}=e;return{active:t,activeFraction:3*(o-1)}}}=t;const Q=xc(0,{stiffness:.15,damping:.3});hn(e,Q,(e=>o(55,b=e)));const{animation:ee,imageSize:te,imageCropRect:oe,imageCropRectAspectRatio:ie,imageCropAspectRatio:re,imageOutputSize:ne,imageSelectionZoom:ae,imageSelectionPan:se,history:le,env:ce,allowPan:de,allowZoom:ue,allowZoomControls:pe,allowPlayPause:me}=_;hn(e,ee,(e=>o(51,g=e))),hn(e,te,(e=>o(74,A=e))),hn(e,oe,(e=>o(53,f=e))),hn(e,ie,(e=>o(54,y=e))),hn(e,re,(e=>o(73,M=e))),hn(e,ne,(e=>o(62,T=e))),hn(e,ae,(e=>o(75,F=e))),hn(e,se,(e=>o(76,z=e))),hn(e,ce,(e=>o(52,$=e)));const ge=L();let $e,fe,ye,be,xe,ve,we=he();const Se=(e,t,o,i,r)=>null!=e&&o!==t?e>=i[t]&&e<=r[t]?"valid":"invalid":"undetermined",ke=(e,t,o)=>Math.round(null!=e?e/t:o.height),Ce=()=>{j&&fe&&ye&&("width"===be?o(40,ye=Math.round(fe/y)):"height"===be?o(39,fe=Math.round(ye*y)):("width"===xe?o(40,ye=Math.round(fe/y)):"height"===xe&&o(39,fe=Math.round(ye*y)),Te()))},Te=e=>{let t=B(fe),i=B(ye),r=t,n=i,a=r&&n,s=e||y;if(!r&&!n)return;r&&!n?n=Math.round(r/s):n&&!r&&(r=Math.round(n*s)),s=e||a?X(r,n):y;let l=Ne(r,n);Ze(H,l)||(l=St(H,s)),Ze(l,N)||(l=wt(N,s)),o(39,fe=null!=t?Math.round(l.width):void 0),o(40,ye=null!=i?Math.round(l.height):void 0)},Me=()=>{Te();const{width:e,height:t}=T||{};e===fe&&t===ye||(fe||ye?(fe&&ye&&vn(re,M=fe/ye,M),vn(ne,T=Ne(fe,ye),T)):(vn(re,M=A.width/A.height,M),vn(re,M=void 0,M),vn(ne,T=void 0,T)),le.write())},Pe=ne.subscribe((e=>{if(!e)return o(39,fe=void 0),void o(40,ye=void 0);o(39,fe=e.width),o(40,ye=e.height),Te()})),Re=re.subscribe((e=>{(fe||ye)&&e&&(fe&&ye&&X(fe,ye)!==e?(o(40,ye=fe/e),Te(e)):Te())})),Ie=e=>m(e[0])?(e[1]=e[1].map(Ie),e):Oo(e)?[e,""+e]:e,Ee=e=>{if(m(e[0]))return e[1]=e[1].map(Ee),e;let[t,o]=e;if(Oo(t)&&Oo(o)){const[e,i]=[t,o];o=`${e} × ${i}`,t=[e,i]}return[t,o]},Ae=Ya();hn(e,Ae,(e=>o(61,C=e)));const Le=Ya();hn(e,Le,(e=>o(65,E=e)));const Fe=Ya();hn(e,Fe,(e=>o(59,S=e)));const ze=Ya();hn(e,ze,(e=>o(64,I=e)));const De=Ya();hn(e,De,(e=>o(57,v=e)));const Oe=Ya();hn(e,Oe,(e=>o(63,P=e)));const Be=qa([ne,Le],(([e,t],o)=>{if(!t)return o(-1);const i=t.findIndex((([t])=>{if(!t&&!e)return!0;if(!t)return!1;const[o,i]=t;return e.width===o&&e.height===i}));o(i<0?0:i)}));hn(e,Be,(e=>o(60,k=e)));const We=qa([ne,ze],(([e,t],o)=>{if(!t)return o(-1);const i=t.findIndex((([t])=>!t&&!e||!!t&&e.width===t));o(i<0?0:i)}));hn(e,We,(e=>o(58,w=e)));const Ve=qa([ne,Oe],(([e,t],o)=>{if(!t)return o(-1);const i=t.findIndex((([t])=>!t&&!e||!!t&&e.height===t));o(i<0?0:i)}));hn(e,Ve,(e=>o(56,x=e)));let He=void 0,je=void 0;const Ue=ca("redrawTrigger"),Ge=xc(g?20:0);return hn(e,Ge,(e=>o(49,p=e))),aa((()=>{Pe(),Re()})),e.$$set=e=>{"isActive"in e&&O(o(0,W=e.isActive)),"stores"in e&&o(30,_=e.stores),"locale"in e&&o(1,V=e.locale),"resizeMinSize"in e&&o(31,N=e.resizeMinSize),"resizeMaxSize"in e&&o(32,H=e.resizeMaxSize),"resizeAspectRatioLocked"in e&&o(28,j=e.resizeAspectRatioLocked),"resizeEnableButtonLockAspectRatio"in e&&o(33,U=e.resizeEnableButtonLockAspectRatio),"resizeSizePresetOptions"in e&&o(34,G=e.resizeSizePresetOptions),"resizeWidthPresetOptions"in e&&o(35,Z=e.resizeWidthPresetOptions),"resizeHeightPresetOptions"in e&&o(36,q=e.resizeHeightPresetOptions),"resizeWillRenderFooter"in e&&o(37,K=e.resizeWillRenderFooter),"resizeFormatIconButtonMaintainAspectRatio"in e&&o(38,J=e.resizeFormatIconButtonMaintainAspectRatio)},e.$$.update=()=>{524288&e.$$.dirty[1]&&de.set(!h),524288&e.$$.dirty[1]&&ue.set(!h),524288&e.$$.dirty[1]&&pe.set(!h),524288&e.$$.dirty[1]&&h&&me.set(!0),1073741832&e.$$.dirty[1]&&G&&(vn(Ae,C=G.map(Ee),C),vn(Le,E=iu(C),E)),1073741824&e.$$.dirty[1]&&o(48,a=!!C),536870912&e.$$.dirty[1]|8&e.$$.dirty[2]&&o(47,i=k>-1&&E[k][1]),268435472&e.$$.dirty[1]&&Z&&(vn(Fe,S=Z.map(Ie),S),vn(ze,I=iu(S),I)),268566528&e.$$.dirty[1]&&o(45,s=!a&&S),134217728&e.$$.dirty[1]|4&e.$$.dirty[2]&&o(46,r=w>-1&&I[w][1]),67108896&e.$$.dirty[1]&&q&&(vn(De,v=q.map(Ie),v),vn(Oe,P=iu(v),P)),67239936&e.$$.dirty[1]&&o(44,l=!a&&v),33554432&e.$$.dirty[1]|2&e.$$.dirty[2]&&o(43,n=x>-1&&P[x][1]),155648&e.$$.dirty[1]&&o(42,c=!a&&!s&&!l),268435458&e.$$.dirty[0]|2145648583&e.$$.dirty[1]&&o(4,d=Ue&&lm((()=>{return K([a&&["Dropdown","size-presets",{label:i,options:C,onchange:e=>{return(t=e.value)&&!He&&(He={...f},je=M),t?(vn(re,M=X(t[0],t[1]),M),vn(ne,T=_e(t),T)):(vn(oe,f=He,f),vn(re,M=je,M),vn(ne,T=void 0,T),He=void 0,je=void 0),void le.write();var t},selectedIndex:k}],s&&["Dropdown","width-presets",{label:r,options:S,onchange:e=>{o(39,fe=e.value),Me()},selectedIndex:w}],s&&l&&["span","times",{class:"PinturaResizeLabel",innerHTML:"×"}],l&&["Dropdown","height-presets",{label:n,options:v,onchange:e=>{o(40,ye=e.value),Me()},selectedIndex:x}],c&&[_x,"width-input",{id:"width-"+ge,title:V.resizeTitleInputWidth,label:V.resizeLabelInputWidth,placeholder:(e=B(ye),t=y,d=f,Math.round(null!=e?e*t:d.width)),value:fe,state:Se(B(fe),"width",be,N,H),onchange:e=>{o(39,fe=e),Ce()}}],c&&U&&[jx,"aspect-ratio-lock",{id:"aspect-ratio-lock-"+ge,title:V.resizeTitleButtonMaintainAspectRatio,icon:R(V.resizeIconButtonMaintainAspectRatio)?V.resizeIconButtonMaintainAspectRatio(j,b):Il(V.resizeIconButtonMaintainAspectRatio,J({active:j,activeFraction:b}),"{","}"),locked:j,onchange:e=>{o(28,j=e),Ce()}}],c&&[_x,"height-input",{id:"height-"+ge,title:V.resizeTitleInputHeight,label:V.resizeLabelInputHeight,placeholder:ke(B(fe),y,f),value:ye,state:Se(B(ye),"height",be,N,H),onchange:e=>{o(40,ye=e),Ce()}}]].filter(Boolean),{...$},(()=>Ue.set({})));var e,t,d})).filter(Boolean)),268435456&e.$$.dirty[0]&&Q.set(j?1:0),1024&e.$$.dirty[1]&&be&&(xe=be),524288&e.$$.dirty[1]&&h&&(we=z,ve=F),524288&e.$$.dirty[1]|1&e.$$.dirty[2]&&(h?setTimeout((()=>{return e=T,vn(se,z=he(),z),void vn(ae,F=e&&f?e.width/f.width||e.height/f.height:1,F);var e}),0):(vn(se,z=we,z),vn(ae,F=ve,F))),1572864&e.$$.dirty[1]&&g&&Ge.set(h?0:20),262144&e.$$.dirty[1]&&o(3,u=p?`translateY(${p}px)`:"none")},[W,V,$e,u,d,Q,ee,te,oe,ie,re,ne,ae,se,ce,e=>{const t=e.target.id;/width/.test(t)?o(41,be="width"):/height/.test(t)?o(41,be="height"):/aspectRatio/i.test(t)?o(41,be="lock"):o(41,be=void 0)},e=>{$e.contains(e.relatedTarget)||Me(),o(41,be=void 0)},Me,Ae,Le,Fe,ze,De,Oe,Be,We,Ve,Ge,j,"resize",_,N,H,U,G,Z,q,K,J,fe,ye,be,c,n,l,s,r,i,a,p,h,g,$,f,y,b,x,v,w,S,k,C,T,P,I,E,function(e){pa[e?"unshift":"push"]((()=>{$e=e,o(2,$e)}))},function(t){da.call(this,e,t)}]}var Yx={util:["resize",class extends Ga{constructor(e){super(),Ua(this,e,Xx,Zx,ln,{name:29,isActive:0,stores:30,locale:1,resizeMinSize:31,resizeMaxSize:32,resizeAspectRatioLocked:28,resizeEnableButtonLockAspectRatio:33,resizeSizePresetOptions:34,resizeWidthPresetOptions:35,resizeHeightPresetOptions:36,resizeWillRenderFooter:37,resizeFormatIconButtonMaintainAspectRatio:38},null,[-1,-1,-1,-1])}get name(){return this.$$.ctx[29]}get isActive(){return this.$$.ctx[0]}set isActive(e){this.$$set({isActive:e}),ka()}get stores(){return this.$$.ctx[30]}set stores(e){this.$$set({stores:e}),ka()}get locale(){return this.$$.ctx[1]}set locale(e){this.$$set({locale:e}),ka()}get resizeMinSize(){return this.$$.ctx[31]}set resizeMinSize(e){this.$$set({resizeMinSize:e}),ka()}get resizeMaxSize(){return this.$$.ctx[32]}set resizeMaxSize(e){this.$$set({resizeMaxSize:e}),ka()}get resizeAspectRatioLocked(){return this.$$.ctx[28]}set resizeAspectRatioLocked(e){this.$$set({resizeAspectRatioLocked:e}),ka()}get resizeEnableButtonLockAspectRatio(){return this.$$.ctx[33]}set resizeEnableButtonLockAspectRatio(e){this.$$set({resizeEnableButtonLockAspectRatio:e}),ka()}get resizeSizePresetOptions(){return this.$$.ctx[34]}set resizeSizePresetOptions(e){this.$$set({resizeSizePresetOptions:e}),ka()}get resizeWidthPresetOptions(){return this.$$.ctx[35]}set resizeWidthPresetOptions(e){this.$$set({resizeWidthPresetOptions:e}),ka()}get resizeHeightPresetOptions(){return this.$$.ctx[36]}set resizeHeightPresetOptions(e){this.$$set({resizeHeightPresetOptions:e}),ka()}get resizeWillRenderFooter(){return this.$$.ctx[37]}set resizeWillRenderFooter(e){this.$$set({resizeWillRenderFooter:e}),ka()}get resizeFormatIconButtonMaintainAspectRatio(){return this.$$.ctx[38]}set resizeFormatIconButtonMaintainAspectRatio(e){this.$$set({resizeFormatIconButtonMaintainAspectRatio:e}),ka()}}]};function qx(e){let t,o;return t=new fx({props:{stores:e[3],locale:e[4],isActive:e[0],isActiveFraction:e[1],isVisible:e[2],mapScreenPointToImagePoint:e[10],mapImagePointToScreenPoint:e[9],enableMultiSelect:e[6],utilKey:"redact",imageRotation:e[11],imageFlipX:e[8],imageFlipY:e[7],shapes:e[12],toolbar:["rect"],toolShapes:{rectangle:[{x:0,y:0,width:0,height:0}]},toolActive:"rectangle",parentRect:e[14],enablePresetDropImage:!1,enablePresetSelectImage:!1,willStartInteraction:e[5],hooks:{willRenderShapeControls:e[25]}}}),t.$on("measure",e[26]),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,[o]){const i={};8&o&&(i.stores=e[3]),16&o&&(i.locale=e[4]),1&o&&(i.isActive=e[0]),2&o&&(i.isActiveFraction=e[1]),4&o&&(i.isVisible=e[2]),1024&o&&(i.mapScreenPointToImagePoint=e[10]),512&o&&(i.mapImagePointToScreenPoint=e[9]),64&o&&(i.enableMultiSelect=e[6]),2048&o&&(i.imageRotation=e[11]),256&o&&(i.imageFlipX=e[8]),128&o&&(i.imageFlipY=e[7]),32&o&&(i.willStartInteraction=e[5]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Kx(e,t,o){let i,r,n,a,s,l,c,d,u;let{isActive:p}=t,{isActiveFraction:h}=t,{isVisible:m}=t,{stores:g}=t,{locale:$={}}=t,{markupEditorWillStartInteraction:f}=t,{enableMultiSelect:y}=t;const{imageRedaction:b,rootRect:x,imageSize:v,imageRotation:w,imageFlipX:S,imageFlipY:k,imageTransforms:C,imageTransformsInterpolated:T}=g;hn(e,x,(e=>o(24,d=e))),hn(e,v,(e=>o(23,c=e))),hn(e,w,(e=>o(11,u=e))),hn(e,S,(e=>o(8,a=e))),hn(e,k,(e=>o(7,n=e))),hn(e,C,(e=>o(22,l=e))),hn(e,T,(e=>o(21,s=e)));return e.$$set=e=>{"isActive"in e&&o(0,p=e.isActive),"isActiveFraction"in e&&o(1,h=e.isActiveFraction),"isVisible"in e&&o(2,m=e.isVisible),"stores"in e&&o(3,g=e.stores),"locale"in e&&o(4,$=e.locale),"markupEditorWillStartInteraction"in e&&o(5,f=e.markupEditorWillStartInteraction),"enableMultiSelect"in e&&o(6,y=e.enableMultiSelect)},e.$$.update=()=>{31457664&e.$$.dirty&&o(10,i=e=>bx(e,d,c,s.origin,s.translation,l.rotation.z,s.scale,a,n)),31457664&e.$$.dirty&&o(9,r=e=>yx(e,d,c,s.origin,s.translation,l.rotation.z,s.scale,a,n))},[p,h,m,g,$,f,y,n,a,r,i,u,b,x,v,w,S,k,C,T,"redact",s,l,c,d,e=>{const t=ng(e[0]);return sg("to-front",t),e},function(t){da.call(this,e,t)}]}var Jx={util:["redact",class extends Ga{constructor(e){super(),Ua(this,e,Kx,qx,ln,{name:20,isActive:0,isActiveFraction:1,isVisible:2,stores:3,locale:4,markupEditorWillStartInteraction:5,enableMultiSelect:6})}get name(){return this.$$.ctx[20]}get isActive(){return this.$$.ctx[0]}set isActive(e){this.$$set({isActive:e}),ka()}get isActiveFraction(){return this.$$.ctx[1]}set isActiveFraction(e){this.$$set({isActiveFraction:e}),ka()}get isVisible(){return this.$$.ctx[2]}set isVisible(e){this.$$set({isVisible:e}),ka()}get stores(){return this.$$.ctx[3]}set stores(e){this.$$set({stores:e}),ka()}get locale(){return this.$$.ctx[4]}set locale(e){this.$$set({locale:e}),ka()}get markupEditorWillStartInteraction(){return this.$$.ctx[5]}set markupEditorWillStartInteraction(e){this.$$set({markupEditorWillStartInteraction:e}),ka()}get enableMultiSelect(){return this.$$.ctx[6]}set enableMultiSelect(e){this.$$set({enableMultiSelect:e}),ka()}},({src:e})=>e&&!Zs(e)]};function Qx(e){let t;return{c(){t=Fn("div")},m(e,o){An(e,t,o)},p:en,d(e){e&&Ln(t)}}}function ev(e){let t,o,i,r;return{c(){t=Fn("div"),Nn(t,"class","PinturaFillTile")},m(n,a){An(n,t,a),i||(r=wn(o=sv.call(null,t,e[31].value)),i=!0)},p(e,t){o&&sn(o.update)&&1&t[1]&&o.update.call(null,e[31].value)},d(e){e&&Ln(t),i=!1,r()}}}function tv(e){let t,o,i;return{c(){t=Fn("div"),o=Fn("img"),dn(o.src,i=e[31].value)||Nn(o,"src",i),Nn(o,"alt",""),Nn(o,"width","48"),Nn(o,"height","64"),Nn(t,"class","PinturaFillTile")},m(e,i){An(e,t,i),Rn(t,o)},p(e,t){1&t[1]&&!dn(o.src,i=e[31].value)&&Nn(o,"src",i)},d(e){e&&Ln(t)}}}function ov(e){let t,o,i=(R(e[31].label)?e[31].label(e[1]):e[31].label)+"";return{c(){t=Fn("span"),o=Dn(i)},m(e,i){An(e,t,i),Rn(t,o)},p(e,t){2&t[0]|1&t[1]&&i!==(i=(R(e[31].label)?e[31].label(e[1]):e[31].label)+"")&&Un(o,i)},d(e){e&&Ln(t)}}}function iv(e){let t,o,i,r;function n(e,t){return 1&t[1]&&(o=null),1&t[1]&&(i=null),null==o&&(o=!!m(e[31].value)),o?tv:(null==i&&(i=!!_o(e[31].value)),i?ev:Qx)}let a=n(e,[-1,-1]),s=a(e),l=e[31].label&&ov(e);return{c(){t=Fn("div"),s.c(),r=On(),l&&l.c(),Nn(t,"slot","option")},m(e,o){An(e,t,o),s.m(t,null),Rn(t,r),l&&l.m(t,null)},p(e,o){a===(a=n(e,o))&&s?s.p(e,o):(s.d(1),s=a(e),s&&(s.c(),s.m(t,r))),e[31].label?l?l.p(e,o):(l=ov(e),l.c(),l.m(t,null)):l&&(l.d(1),l=null)},d(e){e&&Ln(t),s.d(),l&&l.d()}}}function rv(e){let t,o;return t=new Lu({props:{locale:e[1],class:"PinturaControlList",layout:"row",options:e[2],selectedIndex:e[4],onchange:e[10],$$slots:{option:[iv,({option:e})=>({31:e}),({option:e})=>[0,e?1:0]]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};2&o[0]&&(i.locale=e[1]),4&o[0]&&(i.options=e[2]),16&o[0]&&(i.selectedIndex=e[4]),2&o[0]|3&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function nv(e){let t,o,i;return o=new Ah({props:{elasticity:e[5],$$slots:{default:[rv]},$$scope:{ctx:e}}}),{c(){t=Fn("div"),Na(o.$$.fragment),Nn(t,"slot","footer"),Zn(t,"transform",e[3])},m(e,r){An(e,t,r),Ha(o,t,null),i=!0},p(e,i){const r={};32&i[0]&&(r.elasticity=e[5]),22&i[0]|2&i[1]&&(r.$$scope={dirty:i,ctx:e}),o.$set(r),8&i[0]&&Zn(t,"transform",e[3])},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Ln(t),ja(o)}}}function av(e){let t,o;return t=new Tf({props:{$$slots:{footer:[nv]},$$scope:{ctx:e}}}),t.$on("measure",e[21]),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};62&o[0]|2&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function sv(e){const t=document.createElement("div");return e.append(t),{update(o){const[i,r,n,a]=o.map(((e,t)=>t<3?Math.round(255*e):e));e.dataset.transparent=a<1,t.style.backgroundColor=`rgba(${i},${r},${n},${a})`}}}function lv(e,t,o){let i,r,n,a,s,l,c,d,u,p,h=en,g=()=>(h(),h=un($,(e=>o(16,l=e))),$);e.$$.on_destroy.push((()=>h()));let{isActive:$}=t;g();let{stores:f}=t,{locale:y={}}=t,{fillOptions:b=[]}=t;const x=e=>e.map((e=>(e=>_o(e)&&m(e[0])&&_o(e[1]))(e)?[e[0],x(e[1]),e[2]]:(e=>[Array.isArray(e)&&3===e.length?[...e,1]:e,void 0,{disabled:!1}])(e))),v=ca("elasticityMultiplier");hn(e,v,(e=>o(20,p=e)));const{history:w,animation:S,scrollElasticity:k,imageBackgroundColor:C,imageBackgroundImage:T,allowPan:M,allowZoom:P,allowZoomControls:R,allowPlayPause:I}=f;hn(e,S,(e=>o(17,c=e))),hn(e,C,(e=>o(19,u=e))),hn(e,T,(e=>o(18,d=e)));const E=xc(c?20:0);return hn(e,E,(e=>o(15,s=e))),e.$$set=e=>{"isActive"in e&&g(o(0,$=e.isActive)),"stores"in e&&o(13,f=e.stores),"locale"in e&&o(1,y=e.locale),"fillOptions"in e&&o(14,b=e.fillOptions)},e.$$.update=()=>{16384&e.$$.dirty[0]&&o(2,i=x(b)),65536&e.$$.dirty[0]&&M.set(l),65536&e.$$.dirty[0]&&P.set(l),65536&e.$$.dirty[0]&&R.set(l),65536&e.$$.dirty[0]&&l&&I.set(!0),1048576&e.$$.dirty[0]&&o(5,r=p*k),786436&e.$$.dirty[0]&&o(4,n=i.findIndex((([e])=>d?e===d:Array.isArray(e)?vs(e,u):void 0))||0),196608&e.$$.dirty[0]&&c&&E.set(l?0:20),32768&e.$$.dirty[0]&&o(3,a=s?`translateY(${s}px)`:"none")},[$,y,i,a,n,r,v,S,C,T,({value:e})=>{m(e)&&(vn(C,u=void 0,u),vn(T,d=e,d)),_o(e)&&(vn(C,u=e,u),vn(T,d=void 0,d)),w.write()},E,"fill",f,b,s,l,c,d,u,p,function(t){da.call(this,e,t)}]}var cv={util:["fill",class extends Ga{constructor(e){super(),Ua(this,e,lv,av,ln,{name:12,isActive:0,stores:13,locale:1,fillOptions:14},null,[-1,-1])}get name(){return this.$$.ctx[12]}get isActive(){return this.$$.ctx[0]}set isActive(e){this.$$set({isActive:e}),ka()}get stores(){return this.$$.ctx[13]}set stores(e){this.$$set({stores:e}),ka()}get locale(){return this.$$.ctx[1]}set locale(e){this.$$set({locale:e}),ka()}get fillOptions(){return this.$$.ctx[14]}set fillOptions(e){this.$$set({fillOptions:e}),ka()}},({src:e,fillOptions:t})=>e&&!Zs(e)&&t&&t.length]};function dv(e){let t,o,i;function r(t){e[42](t)}let n={utilKey:"retouch",stores:e[4],locale:e[5],isActive:e[1],isActiveFraction:e[2],isVisible:e[3],mapScreenPointToImagePoint:e[27],mapImagePointToScreenPoint:e[26],imageRotation:e[28],imageFlipX:e[25],imageFlipY:e[24],toolbar:e[6],toolbarLayout:"stack",shapes:e[30],toolShapes:e[7],enableMultiSelect:e[23],enableViewTool:e[14],enableMoveTool:e[13],enableToolShareStyles:!1,shapeControls:e[8],enablePresetSelectImage:!1,enablePresetDropImage:!1,parentRect:e[31],willStartInteraction:e[12],willRenderHeaderTools:e[10]||e[17],willRenderShapeStyleControls:e[9],hooks:{willRenderShapeControls:e[11]||e[15],willRenderShapeTextControls:e[16],beforeAddShape:e[18],beforeRemoveShape:e[19],beforeDeselectShape:e[20],beforeSelectShape:e[21],beforeUpdateShape:e[22]}};return void 0!==e[0]&&(n.toolActive=e[0]),t=new fx({props:n}),pa.push((()=>Va(t,"toolActive",r))),t.$on("measure",e[43]),{c(){Na(t.$$.fragment)},m(e,o){Ha(t,e,o),i=!0},p(e,i){const r={};16&i[0]&&(r.stores=e[4]),32&i[0]&&(r.locale=e[5]),2&i[0]&&(r.isActive=e[1]),4&i[0]&&(r.isActiveFraction=e[2]),8&i[0]&&(r.isVisible=e[3]),134217728&i[0]&&(r.mapScreenPointToImagePoint=e[27]),67108864&i[0]&&(r.mapImagePointToScreenPoint=e[26]),268435456&i[0]&&(r.imageRotation=e[28]),33554432&i[0]&&(r.imageFlipX=e[25]),16777216&i[0]&&(r.imageFlipY=e[24]),64&i[0]&&(r.toolbar=e[6]),128&i[0]&&(r.toolShapes=e[7]),8388608&i[0]&&(r.enableMultiSelect=e[23]),16384&i[0]&&(r.enableViewTool=e[14]),8192&i[0]&&(r.enableMoveTool=e[13]),256&i[0]&&(r.shapeControls=e[8]),4096&i[0]&&(r.willStartInteraction=e[12]),132096&i[0]&&(r.willRenderHeaderTools=e[10]||e[17]),512&i[0]&&(r.willRenderShapeStyleControls=e[9]),8226816&i[0]&&(r.hooks={willRenderShapeControls:e[11]||e[15],willRenderShapeTextControls:e[16],beforeAddShape:e[18],beforeRemoveShape:e[19],beforeDeselectShape:e[20],beforeSelectShape:e[21],beforeUpdateShape:e[22]}),!o&&1&i[0]&&(o=!0,r.toolActive=e[0],xa((()=>o=!1))),t.$set(r)},i(e){i||(Ea(t.$$.fragment,e),i=!0)},o(e){Aa(t.$$.fragment,e),i=!1},d(e){ja(t,e)}}}function uv(e,t,o){let i,r,n,a,s,l,c,d,u;let{isActive:p}=t,{isActiveFraction:h}=t,{isVisible:m}=t,{stores:g}=t,{locale:$={}}=t,{retouchTools:f}=t,{retouchToolShapes:y}=t,{retouchShapeControls:b}=t,{retouchActiveTool:x}=t,{retouchWillRenderShapeStyleControls:v}=t,{retouchWillRenderHeaderTools:w}=t,{retouchWillRenderShapeControls:S}=t,{markupEditorWillStartInteraction:k}=t,{retouchEnableMoveTool:C}=t,{retouchEnableViewTool:T}=t,{willRenderShapeControls:M}=t,{willRenderShapeTextControls:P}=t,{willRenderHeaderTools:R}=t,{beforeAddShape:I}=t,{beforeRemoveShape:E}=t,{beforeDeselectShape:A}=t,{beforeSelectShape:L}=t,{beforeUpdateShape:F}=t,{enableMultiSelect:z}=t;const{rootRect:D,imageManipulation:O,imageSize:B,imageRotation:W,imageFlipX:_,imageFlipY:V,imageTransforms:N,imageTransformsInterpolated:H}=g;return hn(e,D,(e=>o(41,d=e))),hn(e,B,(e=>o(40,c=e))),hn(e,W,(e=>o(28,u=e))),hn(e,_,(e=>o(25,a=e))),hn(e,V,(e=>o(24,n=e))),hn(e,N,(e=>o(39,l=e))),hn(e,H,(e=>o(38,s=e))),e.$$set=e=>{"isActive"in e&&o(1,p=e.isActive),"isActiveFraction"in e&&o(2,h=e.isActiveFraction),"isVisible"in e&&o(3,m=e.isVisible),"stores"in e&&o(4,g=e.stores),"locale"in e&&o(5,$=e.locale),"retouchTools"in e&&o(6,f=e.retouchTools),"retouchToolShapes"in e&&o(7,y=e.retouchToolShapes),"retouchShapeControls"in e&&o(8,b=e.retouchShapeControls),"retouchActiveTool"in e&&o(0,x=e.retouchActiveTool),"retouchWillRenderShapeStyleControls"in e&&o(9,v=e.retouchWillRenderShapeStyleControls),"retouchWillRenderHeaderTools"in e&&o(10,w=e.retouchWillRenderHeaderTools),"retouchWillRenderShapeControls"in e&&o(11,S=e.retouchWillRenderShapeControls),"markupEditorWillStartInteraction"in e&&o(12,k=e.markupEditorWillStartInteraction),"retouchEnableMoveTool"in e&&o(13,C=e.retouchEnableMoveTool),"retouchEnableViewTool"in e&&o(14,T=e.retouchEnableViewTool),"willRenderShapeControls"in e&&o(15,M=e.willRenderShapeControls),"willRenderShapeTextControls"in e&&o(16,P=e.willRenderShapeTextControls),"willRenderHeaderTools"in e&&o(17,R=e.willRenderHeaderTools),"beforeAddShape"in e&&o(18,I=e.beforeAddShape),"beforeRemoveShape"in e&&o(19,E=e.beforeRemoveShape),"beforeDeselectShape"in e&&o(20,A=e.beforeDeselectShape),"beforeSelectShape"in e&&o(21,L=e.beforeSelectShape),"beforeUpdateShape"in e&&o(22,F=e.beforeUpdateShape),"enableMultiSelect"in e&&o(23,z=e.enableMultiSelect)},e.$$.update=()=>{50331648&e.$$.dirty[0]|1920&e.$$.dirty[1]&&o(27,i=e=>bx(e,d,c,s.origin,s.translation,l.rotation.z,s.scale,a,n)),50331648&e.$$.dirty[0]|1920&e.$$.dirty[1]&&o(26,r=e=>yx(e,d,c,s.origin,s.translation,l.rotation.z,s.scale,a,n))},[x,p,h,m,g,$,f,y,b,v,w,S,k,C,T,M,P,R,I,E,A,L,F,z,n,a,r,i,u,D,O,B,W,_,V,N,H,"retouch",s,l,c,d,function(e){x=e,o(0,x)},function(t){da.call(this,e,t)}]}var pv={util:["retouch",class extends Ga{constructor(e){super(),Ua(this,e,uv,dv,ln,{name:37,isActive:1,isActiveFraction:2,isVisible:3,stores:4,locale:5,retouchTools:6,retouchToolShapes:7,retouchShapeControls:8,retouchActiveTool:0,retouchWillRenderShapeStyleControls:9,retouchWillRenderHeaderTools:10,retouchWillRenderShapeControls:11,markupEditorWillStartInteraction:12,retouchEnableMoveTool:13,retouchEnableViewTool:14,willRenderShapeControls:15,willRenderShapeTextControls:16,willRenderHeaderTools:17,beforeAddShape:18,beforeRemoveShape:19,beforeDeselectShape:20,beforeSelectShape:21,beforeUpdateShape:22,enableMultiSelect:23},null,[-1,-1])}get name(){return this.$$.ctx[37]}get isActive(){return this.$$.ctx[1]}set isActive(e){this.$$set({isActive:e}),ka()}get isActiveFraction(){return this.$$.ctx[2]}set isActiveFraction(e){this.$$set({isActiveFraction:e}),ka()}get isVisible(){return this.$$.ctx[3]}set isVisible(e){this.$$set({isVisible:e}),ka()}get stores(){return this.$$.ctx[4]}set stores(e){this.$$set({stores:e}),ka()}get locale(){return this.$$.ctx[5]}set locale(e){this.$$set({locale:e}),ka()}get retouchTools(){return this.$$.ctx[6]}set retouchTools(e){this.$$set({retouchTools:e}),ka()}get retouchToolShapes(){return this.$$.ctx[7]}set retouchToolShapes(e){this.$$set({retouchToolShapes:e}),ka()}get retouchShapeControls(){return this.$$.ctx[8]}set retouchShapeControls(e){this.$$set({retouchShapeControls:e}),ka()}get retouchActiveTool(){return this.$$.ctx[0]}set retouchActiveTool(e){this.$$set({retouchActiveTool:e}),ka()}get retouchWillRenderShapeStyleControls(){return this.$$.ctx[9]}set retouchWillRenderShapeStyleControls(e){this.$$set({retouchWillRenderShapeStyleControls:e}),ka()}get retouchWillRenderHeaderTools(){return this.$$.ctx[10]}set retouchWillRenderHeaderTools(e){this.$$set({retouchWillRenderHeaderTools:e}),ka()}get retouchWillRenderShapeControls(){return this.$$.ctx[11]}set retouchWillRenderShapeControls(e){this.$$set({retouchWillRenderShapeControls:e}),ka()}get markupEditorWillStartInteraction(){return this.$$.ctx[12]}set markupEditorWillStartInteraction(e){this.$$set({markupEditorWillStartInteraction:e}),ka()}get retouchEnableMoveTool(){return this.$$.ctx[13]}set retouchEnableMoveTool(e){this.$$set({retouchEnableMoveTool:e}),ka()}get retouchEnableViewTool(){return this.$$.ctx[14]}set retouchEnableViewTool(e){this.$$set({retouchEnableViewTool:e}),ka()}get willRenderShapeControls(){return this.$$.ctx[15]}set willRenderShapeControls(e){this.$$set({willRenderShapeControls:e}),ka()}get willRenderShapeTextControls(){return this.$$.ctx[16]}set willRenderShapeTextControls(e){this.$$set({willRenderShapeTextControls:e}),ka()}get willRenderHeaderTools(){return this.$$.ctx[17]}set willRenderHeaderTools(e){this.$$set({willRenderHeaderTools:e}),ka()}get beforeAddShape(){return this.$$.ctx[18]}set beforeAddShape(e){this.$$set({beforeAddShape:e}),ka()}get beforeRemoveShape(){return this.$$.ctx[19]}set beforeRemoveShape(e){this.$$set({beforeRemoveShape:e}),ka()}get beforeDeselectShape(){return this.$$.ctx[20]}set beforeDeselectShape(e){this.$$set({beforeDeselectShape:e}),ka()}get beforeSelectShape(){return this.$$.ctx[21]}set beforeSelectShape(e){this.$$set({beforeSelectShape:e}),ka()}get beforeUpdateShape(){return this.$$.ctx[22]}set beforeUpdateShape(e){this.$$set({beforeUpdateShape:e}),ka()}get enableMultiSelect(){return this.$$.ctx[23]}set enableMultiSelect(e){this.$$set({enableMultiSelect:e}),ka()}},({src:e})=>e&&!Zs(e)]};const hv='<g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M18 6L6 18M6 6l12 12"></path></path></g>',mv='<path fill="none" d="M9 15 L12 9 L15 15 M10 13.5 h3" stroke="currentColor" stroke-width=".125em"/>';var gv={labelReset:"Reset",labelDefault:"Default",labelAuto:"Auto",labelNone:"None",labelEdit:"Edit",labelClose:"Close",labelSupportError:"{features} not supported on this browser",labelColor:"Color",labelWidth:"Width",labelSize:"Size",labelOffset:"Offset",labelAmount:"Amount",labelInset:"Inset",labelRadius:"Radius",labelColorPalette:"Color palette",labelSizeExtraSmall:"Extra small",labelSizeSmall:"Small",labelSizeMediumSmall:"Medium small",labelSizeMedium:"Medium",labelSizeMediumLarge:"Medium large",labelSizeLarge:"Large",labelSizeExtraLarge:"Extra large",labelButtonCancel:"Cancel",labelButtonUndo:"Undo",labelButtonRedo:"Redo",labelButtonRevert:"Revert",labelButtonExport:"Done",labelZoom:"Zoom",labelZoomIn:"Zoom in",labelZoomOut:"Zoom out",labelZoomFit:"Fit to view",labelZoomActual:"Actual size",iconZoomIn:'<path stroke="currentColor" stroke-width=".125em" d="M8 12 h8 M12 8 v8" />',iconZoomOut:'<path stroke="currentColor" stroke-width=".125em" d="M9 12 h6" />',iconSupportError:'<g fill="none" stroke="currentColor" stroke-width="2"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/><g><line x1="12" y1="9" x2="12" y2="13"/><line x1="12" y1="17" x2="12.01" y2="17"/></g>',iconButtonClose:hv,iconButtonRevert:'<g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M7.388 18.538a8 8 0 10-2.992-9.03"/><path fill="currentColor" d="M2.794 11.696L2.37 6.714l5.088 3.18z"/><path d="M12 8v4M12 12l4 2"/></g>',iconButtonUndo:'<g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M10 8h4c2.485 0 5 2 5 5s-2.515 5-5 5h-4"/><path fill="currentColor" d="M5 8l4-3v6z"/></g>',iconButtonRedo:'<g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M14 8h-4c-2.485 0-5 2-5 5s2.515 5 5 5h4"/><path fill="currentColor" d="M19 8l-4-3v6z"/></g>',iconButtonExport:'<polyline points="20 6 9 17 4 12" fill="none" stroke="currentColor" stroke-width=".125em"></polyline>',statusLabelButtonClose:"Close",statusIconButtonClose:hv,statusImageLoadNone:"Waiting for image",statusImageLoadMinSize:"Minimum image size is {minWidth} × {minHeight}",statusImageLoadPrepare:"Preparing image…",statusImageLoadBusy:"Loading image…",statusImageLoadError:"Error loading image",statusImageProcessBusy:"Processing image…",statusImageProcessError:"Error processing image",statusImageUploadBusy:"Uploading image…",statusImageUploadError:"Error uploading image"};const $v={shapeLabelButtonSelectSticker:"Select image",shapeIconButtonSelectSticker:'<g fill="none" stroke="currentColor" stroke-width="0.0625em"><path d="M8 21 L15 11 L19 15"/><path d="M15 2 v5 h5"/><path d="M8 2 h8 l4 4 v12 q0 4 -4 4 h-8 q-4 0 -4 -4 v-12 q0 -4 4 -4z"/></g><circle fill="currentColor" cx="10" cy="8" r="1.5"/>',shapeIconButtonFlipHorizontal:'<g stroke="currentColor" stroke-width=".125em"><path fill="none" d="M6 6.5h5v11H6z"/><path fill="currentColor" d="M15 6.5h3v11h-3z"/><path d="M11 4v16" fill="currentColor"/></g>',shapeIconButtonFlipVertical:'<g stroke="currentColor" stroke-width=".125em"><rect x="7" y="8" width="11" height="5" fill="none"/><rect x="7" y="17" width="11" height="2" fill="currentColor"/><line x1="5" y1="13" x2="20" y2="13"/></g>',shapeIconButtonRemove:'<g fill="none" fill-rule="evenodd"><path stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M7.5 7h9z"/><path d="M7.916 9h8.168a1 1 0 01.99 1.14l-.972 6.862a2 2 0 01-1.473 1.653c-.877.23-1.753.345-2.629.345-.876 0-1.752-.115-2.628-.345a2 2 0 01-1.473-1.653l-.973-6.862A1 1 0 017.916 9z" fill="currentColor"/><rect fill="currentColor" x="10" y="5" width="4" height="3" rx="1"/></g>',shapeIconButtonDuplicate:'<g fill="none" fill-rule="evenodd"><path d="M15 13.994V16a2 2 0 01-2 2H8a2 2 0 01-2-2v-5a2 2 0 012-2h2.142" stroke="currentColor" stroke-width=".125em"/><path d="M15 9V8a1 1 0 00-2 0v1h-1a1 1 0 000 2h1v1a1 1 0 002 0v-1h1a1 1 0 000-2h-1zm-4-4h6a2 2 0 012 2v6a2 2 0 01-2 2h-6a2 2 0 01-2-2V7a2 2 0 012-2z" fill="currentColor"/></g>',shapeIconButtonMoveToFront:'<g fill="none" fill-rule="evenodd"><rect fill="currentColor" x="11" y="13" width="8" height="2" rx="1"/><rect fill="currentColor" x="9" y="17" width="10" height="2" rx="1"/><path d="M11.364 8H10a5 5 0 000 10M12 6.5L14.5 8 12 9.5z" stroke="currentColor" stroke-width=".125em" stroke-linecap="round"/></g>',shapeIconButtonTextLayoutAutoWidth:""+mv,shapeIconButtonTextLayoutAutoHeight:'<g fill="currentColor"><circle cx="4" cy="12" r="1.5"/><circle cx="20" cy="12" r="1.5"/></g>'+mv,shapeIconButtonTextLayoutFixedSize:'<g fill="currentColor"><circle cx="5" cy="6" r="1.5"/><circle cx="19" cy="6" r="1.5"/><circle cx="19" cy="19" r="1.5"/><circle cx="5" cy="19" r="1.5"/></g>'+mv,shapeTitleButtonTextLayoutAutoWidth:"Auto width",shapeTitleButtonTextLayoutAutoHeight:"Auto height",shapeTitleButtonTextLayoutFixedSize:"Fixed size",shapeTitleButtonFlipHorizontal:"Flip Horizontal",shapeTitleButtonFlipVertical:"Flip Vertical",shapeTitleButtonRemove:"Remove",shapeTitleButtonDuplicate:"Duplicate",shapeTitleButtonMoveToFront:"Move to front",shapeLabelInputText:"Edit text",shapeIconInputCancel:'<g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M18 6L6 18M6 6l12 12"/></g>',shapeIconInputConfirm:'<g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><polyline points="20 6 9 17 4 12"/></g>',shapeLabelInputCancel:"Cancel",shapeLabelInputConfirm:"Confirm",shapeLabelStrokeNone:"No outline",shapeLabelFontStyleNormal:"Normal",shapeLabelFontStyleBold:"Bold",shapeLabelFontStyleItalic:"Italic",shapeLabelFontStyleItalicBold:"Bold Italic",shapeTitleBackgroundColor:"Fill color",shapeTitleCornerRadius:"Corner radius",shapeTitleFontFamily:"Font",shapeTitleFontSize:"Font size",shapeTitleFontStyle:"Font style",shapeTitleLineHeight:"Line height",shapeTitleLineStart:"Start",shapeTitleLineEnd:"End",shapeTitleStrokeWidth:"Line width",shapeTitleStrokeColor:"Line color",shapeTitleLineDecorationBar:"Bar",shapeTitleLineDecorationCircle:"Circle",shapeTitleLineDecorationSquare:"Square",shapeTitleLineDecorationArrow:"Arrow",shapeTitleLineDecorationCircleSolid:"Circle solid",shapeTitleLineDecorationSquareSolid:"Square solid",shapeTitleLineDecorationArrowSolid:"Arrow solid",shapeIconLineDecorationBar:'<g stroke="currentColor" stroke-linecap="round" stroke-width=".125em"><path d="M5,12 H16"/><path d="M16,8 V16"/></g>',shapeIconLineDecorationCircle:'<g stroke="currentColor" stroke-linecap="round"><path stroke-width=".125em" d="M5,12 H12"/><circle fill="none" stroke-width=".125em" cx="16" cy="12" r="4"/></g>',shapeIconLineDecorationSquare:'<g stroke="currentColor" stroke-linecap="round"><path stroke-width=".125em" d="M5,12 H12"/><rect fill="none" stroke-width=".125em" x="12" y="8" width="8" height="8"/></g>',shapeIconLineDecorationArrow:'<g stroke="currentColor" stroke-linecap="round" stroke-width=".125em"><path d="M5,12 H16 M13,7 l6,5 l-6,5" fill="none"/></g>',shapeIconLineDecorationCircleSolid:'<g stroke="currentColor" stroke-linecap="round"><path stroke-width=".125em" d="M5,12 H12"/><circle fill="currentColor" cx="16" cy="12" r="4"/></g>',shapeIconLineDecorationSquareSolid:'<g stroke="currentColor" stroke-linecap="round"><path stroke-width=".125em" d="M5,12 H12"/><rect fill="currentColor" x="12" y="8" width="8" height="8"/></g>',shapeIconLineDecorationArrowSolid:'<g stroke="currentColor" stroke-linecap="round" stroke-width=".125em"><path d="M5,12 H16"/><path d="M13,7 l6,5 l-6,5z" fill="currentColor"/></g>',shapeTitleColorTransparent:"Transparent",shapeTitleColorWhite:"White",shapeTitleColorSilver:"Silver",shapeTitleColorGray:"Gray",shapeTitleColorBlack:"Black",shapeTitleColorNavy:"Navy",shapeTitleColorBlue:"Blue",shapeTitleColorAqua:"Aqua",shapeTitleColorTeal:"Teal",shapeTitleColorOlive:"Olive",shapeTitleColorGreen:"Green",shapeTitleColorYellow:"Yellow",shapeTitleColorOrange:"Orange",shapeTitleColorRed:"Red",shapeTitleColorMaroon:"Maroon",shapeTitleColorFuchsia:"Fuchsia",shapeTitleColorPurple:"Purple",shapeTitleTextOutline:"Text outline",shapeTitleTextOutlineWidth:"Width",shapeTitleTextShadow:"Text shadow",shapeTitleTextShadowBlur:"Blur",shapeTitleTextColor:"Font color",shapeTitleTextAlign:"Text align",shapeTitleTextAlignLeft:"Left align text",shapeTitleTextAlignCenter:"Center align text",shapeTitleTextAlignRight:"Right align text",shapeIconTextAlignLeft:'<g stroke-width=".125em" stroke="currentColor"><line x1="5" y1="8" x2="15" y2="8"/><line x1="5" y1="12" x2="19" y2="12"/><line x1="5" y1="16" x2="14" y2="16"/></g>',shapeIconTextAlignCenter:'<g stroke-width=".125em" stroke="currentColor"><line x1="7" y1="8" x2="17" y2="8"/><line x1="5" y1="12" x2="19" y2="12"/><line x1="8" y1="16" x2="16" y2="16"/></g>',shapeIconTextAlignRight:'<g stroke-width=".125em" stroke="currentColor"><line x1="9" y1="8" x2="19" y2="8"/><line x1="5" y1="12" x2="19" y2="12"/><line x1="11" y1="16" x2="19" y2="16"/></g>',shapeLabelToolMove:"Move",shapeLabelToolView:"View",shapeLabelToolSharpie:"Sharpie",shapeLabelToolEraser:"Eraser",shapeLabelToolPath:"Path",shapeLabelToolRectangle:"Rectangle",shapeLabelToolEllipse:"Ellipse",shapeLabelToolArrow:"Arrow",shapeLabelToolLine:"Line",shapeLabelToolText:"Text",shapeLabelToolPreset:"Stickers",shapeIconToolView:'<g stroke-width=".125em" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path d="M10.98 9.703V2.567c0-1.19 1.19-1.785 1.784-1.785.595 0 1.784.595 1.784 1.785v3.568"/><path d="M14.548 9.703V4.35c0-1.19 1.19-1.784 1.784-1.784.595 0 1.784.594 1.784 1.784v2.973"/><path d="M18.116 10.244V7.271c0-1.19 1.19-1.784 1.784-1.784.595 0 1.785.595 1.785 1.784 0 1.19 0 8.92-1.19 12.488-1.19 3.569-10.704 4.758-13.678 0-2.973-4.757-2.973-4.757-4.163-6.541-1.189-1.784-1.153-2.974-.594-3.568.558-.595 1.784-1.19 2.973.594 1.277 1.916 2.07 2.907 2.379 2.974V5.487c0-1.19 1.19-1.784 1.784-1.784.595 0 1.784.595 1.784 1.784V8.46"/></g>',shapeIconToolMove:'<g stroke-width=".125em" stroke="currentColor" fill="none"><path d="M6 2 L6 19 L18 13 Z M13 18 L16 24" stroke="currentColor" stroke-width=".125em" fill="none" fill-rule="evenodd" stroke-linejoin="round"/></g>',shapeIconToolSharpie:'<g stroke-width=".125em" stroke="currentColor" fill="none"><path d="M2.025 5c5.616-2.732 8.833-3.857 9.65-3.374C12.903 2.351.518 12.666 2.026 14 3.534 15.334 16.536.566 17.73 2.566 18.924 4.566 3.98 17.187 4.831 18c.851.813 9.848-6 11.643-6 1.087 0-2.53 5.11-2.92 7-.086.41 3.323-1.498 4.773-1 .494.17.64 2.317 1.319 3 .439.443 1.332.776 2.679 1" stroke="currentColor" stroke-width=".125em" fill="none" fill-rule="evenodd" stroke-linejoin="round"/></g>',shapeIconToolEraser:'<g stroke-width=".125em" stroke="currentColor" stroke-linecap="round" fill="none"><g transform="translate(3, 15) rotate(-45)"><rect x="0" y="0" width="18" height="10" rx="3"/></g><line x1="11" y1="21" x2="18" y2="21"/><line x1="20" y1="21" x2="22" y2="21"/></g>',shapeIconToolPath:'<g stroke-width=".125em" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" fill="none"><circle cx="21" cy="3" r="2"/><circle cx="9" cy="9" r="2"/><circle cx="3" cy="21" r="2"/><path d="M19 4 11 8 M8 11 4 19"/></g>',shapeIconToolRectangle:'<g stroke-width=".125em" stroke="currentColor" fill="none"><rect x="1" y="1" width="22" height="22" rx="4"/></g>',shapeIconToolEllipse:'<g stroke-width=".125em" stroke="currentColor" fill="none"><circle cx="12" cy="12" r="11"/></g>',shapeIconToolArrow:'<g stroke-width=".125em" stroke="currentColor" fill="none"><line x1="20" y1="3" x2="6" y2="21"/><path d="m10 6 L21.5 1 L20 13.5" fill="currentColor" stroke="none"/></g>',shapeIconToolLine:'<g stroke-width=".125em" stroke="currentColor" fill="none"><line x1="20" y1="3" x2="6" y2="21"/></g>',shapeIconToolText:'<g stroke="none" fill="currentColor" transform="translate(6,0)"><path d="M8.14 20.085c.459 0 .901-.034 1.329-.102a8.597 8.597 0 001.015-.21v1.984c-.281.135-.695.247-1.242.336a9.328 9.328 0 01-1.477.133c-3.312 0-4.968-1.745-4.968-5.235V6.804H.344v-1.25l2.453-1.078L3.89.819h1.5v3.97h4.97v2.015H5.39v10.078c0 1.031.245 1.823.735 2.375s1.161.828 2.015.828z"/>',shapeIconToolPreset:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M12 22c2.773 0 1.189-5.177 3-7 1.796-1.808 7-.25 7-3 0-5.523-4.477-10-10-10S2 6.477 2 12s4.477 10 10 10z"></path><path d="M20 17c-3 3-5 5-8 5"></path></g>',shapeTitleSelectionMode:"Selection mode",shapeTitleBrushSize:"Brush size",shapeLabelSelectionModeNew:"New",shapeLabelSelectionModeAdd:"Add",shapeLabelSelectionModeSubtract:"Remove",shapeLabelToolSelectionBrush:"Brush",shapeLabelToolSelectionLassoo:"Lassoo",shapeLabelToolSelectionRectangle:"Rectangle marquee",shapeLabelToolSelectionEllipse:"Ellipse marquee",shapeIconSelectionModeNew:'<g fill="none" fill-rule="evenodd" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="M6.5 17H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v1.5"/><rect width="12" height="12" x="9" y="9" fill="currentColor" fill-opacity=".25" rx="2"/></g>',shapeIconSelectionModeAdd:'<g fill="none" fill-rule="evenodd" stroke="currentColor"><path fill="currentColor" fill-opacity=".25" stroke-linecap="round" stroke-linejoin="round" d="M15 3a2 2 0 0 1 2 2v4h2a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-8a2 2 0 0 1-2-2v-2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h10Z"/><path d="M13 15h4M15 13v4"/></g>',shapeIconSelectionModeSubtract:'<g fill="none" fill-rule="evenodd" stroke="currentColor"><path fill="currentColor" fill-opacity=".25" stroke-linecap="round" stroke-linejoin="round" d="M15 3a2 2 0 0 1 2 2v4h-6a2 2 0 0 0-1.995 1.85L9 11v6H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h10Z"/><rect width="12" height="12" x="9" y="9" stroke-linecap="round" stroke-linejoin="round" rx="2"/><path d="M13 15h4"/></g>',shapeIconToolSelectionBrush:'<g stroke-width=".125em" stroke="currentColor" fill="none"><path d="M2.025 5c5.616-2.732 8.833-3.857 9.65-3.374C12.903 2.351.518 12.666 2.026 14 3.534 15.334 16.536.566 17.73 2.566 18.924 4.566 3.98 17.187 4.831 18c.851.813 9.848-6 11.643-6 1.087 0-2.53 5.11-2.92 7-.086.41 3.323-1.498 4.773-1 .494.17.64 2.317 1.319 3 .439.443 1.332.776 2.679 1" stroke="currentColor" fill-rule="evenodd" stroke-linejoin="round"/></g>',shapeIconToolSelectionLassoo:'<g fill="none" fill-rule="evenodd" stroke-width=".125em" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M11.428 17.702a18.46 18.46 0 0 0 4.085-1.595c5.851-3.112 9.019-8.599 7.074-12.256-1.945-3.657-8.265-4.1-14.116-.988C2.619 5.974-.55 11.46 1.396 15.118c.63 1.186 1.72 2.033 3.105 2.532"/><ellipse cx="8" cy="18.5" rx="3.5" ry="2.833" transform="rotate(-15 8 18.5)"/><path stroke-linecap="round" d="M5 18c3.347 1.048 5.514 1.881 6.5 2.5.859.54 1.517.994 1.5 2.364"/></g>',shapeIconToolSelectionRectangle:'<g stroke-width=".125em" stroke="currentColor"><path d="M9 1 h6 m4 0 h4v4 m0 4 v6 m0 4 v4h-4 m-4 0 h-6 m-4 0 h-4v-4 m0 -4 v-6 m0 -4 v-4h4" fill="none" /></g>',shapeIconToolSelectionEllipse:'<path stroke-width=".125em" stroke="currentColor" d="M1.21 9.853a11.054 11.054 0 0 0 0 4.294m1.643 3.965a11.054 11.054 0 0 0 3.035 3.035m3.965 1.644a11.054 11.054 0 0 0 4.294 0m3.965-1.644a11.054 11.054 0 0 0 3.035-3.035m1.644-3.965a11.054 11.054 0 0 0 0-4.294m-1.644-3.965a11.054 11.054 0 0 0-3.035-3.035m-3.965-1.644a11.054 11.054 0 0 0-4.294 0M5.888 2.853a11.054 11.054 0 0 0-3.035 3.035"/>'};var fv={cropLabel:"Crop",cropIcon:'<g stroke-width=".125em" stroke="currentColor" fill="none"><path d="M23 17H9a2 2 0 0 1-2-2v-5m0-3V1 M1 7h14a2 2 0 0 1 2 2v7m0 4v3"/></g>',cropIconButtonRecenter:'<path stroke="currentColor" fill="none" stroke-width="2" stroke-linejoin="bevel" d="M1.5 7.5v-6h6M1.5 16.5v6h6M22.5 16.5v6h-6M22.5 7.5v-6h-6"/><circle cx="12" cy="12" r="3.5" fill="currentColor" stroke="none"/>',cropIconButtonRotateLeft:'<g stroke="none" fill="currentColor"><path fill="none" d="M-1-1h582v402H-1z"/><rect x="3" rx="1" height="12" width="12" y="9"/><path d="M15 5h-1a5 5 0 015 5 1 1 0 002 0 7 7 0 00-7-7h-1.374l.747-.747A1 1 0 0011.958.84L9.603 3.194a1 1 0 000 1.415l2.355 2.355a1 1 0 001.415-1.414l-.55-.55H15z"/></g>',cropIconButtonRotateRight:'<g stroke="none" fill="currentColor"><path fill="none" d="M-1-1h582v402H-1z"/><path d="M11.177 5H10a5 5 0 00-5 5 1 1 0 01-2 0 7 7 0 017-7h1.374l-.747-.747A1 1 0 0112.042.84l2.355 2.355a1 1 0 010 1.415l-2.355 2.354a1 1 0 01-1.415-1.414l.55-.55z"/><rect rx="1" height="12" width="12" y="9" x="9"/></g>',cropIconButtonFlipVertical:'<g stroke="none" fill="currentColor"><path d="M19.993 12.143H7a1 1 0 0 1-1-1V5.994a1 1 0 0 1 1.368-.93l12.993 5.15a1 1 0 0 1-.368 1.93z"/><path d="M19.993 14a1 1 0 0 1 .368 1.93L7.368 21.078A1 1 0 0 1 6 20.148V15a1 1 0 0 1 1-1h12.993z" opacity=".6"/></g>',cropIconButtonFlipHorizontal:'<g stroke="none" fill="currentColor"><path d="M11.93 7.007V20a1 1 0 0 1-1 1H5.78a1 1 0 0 1-.93-1.368l5.15-12.993a1 1 0 0 1 1.929.368z"/><path d="M14 7.007V20a1 1 0 0 0 1 1h5.149a1 1 0 0 0 .93-1.368l-5.15-12.993A1 1 0 0 0 14 7.007z" opacity=".6"/></g>',cropIconSelectPreset:'<g fill="currentColor">\n <rect opacity="{a}" x="2" y="4" width="10" height="18" rx="1"/>\n <rect opacity="{b}" x="4" y="8" width="14" height="14" rx="1"/>\n <rect opacity="{c}" x="6" y="12" width="17" height="10" rx="1"/>\n </g>',cropIconCropBoundary:'<g fill="currentColor">\n <rect opacity="{a}" x="2" y="3" width="20" height="20" rx="1"/>\n <rect opacity="{b}" x="7" y="8" width="10" height="10" rx="1"/>\n <rect opacity="{c}" x="4" y="8" width="14" height="14" rx="1"/>\n <rect opacity="{d}" x="12" y="4" width="10" height="10" rx="1"/>\n </g>',cropLabelButtonRecenter:"Recenter",cropLabelButtonRotateLeft:"Rotate left",cropLabelButtonRotateRight:"Rotate right",cropLabelButtonFlipHorizontal:"Flip horizontal",cropLabelButtonFlipVertical:"Flip vertical",cropLabelSelectPreset:"Crop shape",cropLabelCropBoundary:"Crop boundary",cropLabelCropBoundaryEdge:"Edge of image",cropLabelCropBoundaryNone:"None",cropLabelTabRotation:"Rotation",cropLabelTabZoom:"Scale"},yv={fillLabel:"Fill",fillIcon:'\n <g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em">\n <g transform="rotate(60, 12, 12)">\n <rect x="4" y="4" width="14" height="16" rx="3"/>\n </g>\n <path d="M21 13 L21 21"></path>\n <path d="M4.5 12.5 L19 12.5"></path>\n </g>\n '},bv={resizeLabel:"Resize",resizeIcon:'<g stroke-width=".125em" stroke="currentColor" fill="none"><rect x="2" y="12" width="10" height="10" rx="2"/><path d="M4 11.5V4a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-5.5"/><path d="M14 10l3.365-3.365M14 6h4v4"/></g>',resizeLabelFormCaption:"Image output size",resizeLabelInputWidth:"w",resizeTitleInputWidth:"Width",resizeLabelInputHeight:"h",resizeTitleInputHeight:"Height",resizeTitleButtonMaintainAspectRatio:"Maintain aspectratio",resizeIconButtonMaintainAspectRatio:'<defs><mask id="mask1" x="-2" y="-2" width="24" height="24"><rect x="0" y="0" width="24" height="10" fill="#fff" stroke="none"/></mask></defs><g fill="none" fill-rule="evenodd"><g mask="url(#mask1)"><path transform="translate(0 {activeFraction})" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" d="M9.401 10.205v-.804a2.599 2.599 0 0 1 5.198 0V17"/></g><rect fill="currentColor" x="7" y="10" width="10" height="7" rx="1.5"/></g>'},xv={frameLabel:"Frame",frameIcon:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em">\n <rect x="2" y="2" width="20" height="20" rx="4"/>\n <rect x="6" y="6" width="12" height="12" rx="1"/>\n </g>',frameLabelMatSharp:"Mat",frameLabelMatRound:"Bevel",frameLabelLineSingle:"Line",frameLabelLineMultiple:"Zebra",frameLabelEdgeSeparate:"Inset",frameLabelEdgeOverlap:"Plus",frameLabelEdgeCross:"Lumber",frameLabelCornerHooks:"Hook",frameLabelPolaroid:"Polaroid"},vv={redactLabel:"Redact",redactIcon:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M 4 5 l 1 -1"/><path d="M 4 10 l 6 -6"/><path d="M 4 15 l 11 -11"/><path d="M 4 20 l 16 -16"/><path d="M 9 20 l 11 -11"/><path d="M 14 20 l 6 -6"/><path d="M 19 20 l 1 -1"/></g>'},wv={retouchLabel:"Retouch",retouchIcon:'\n <g fill="none" fill-rule="evenodd"><path fill="currentColor" d="m17 6-2-1-2 1 1-2-1-2 2 1 2-1-1 2zM5.5 5.5 3 4 .5 5.5 2 3 .5.5 3 2 5.5.5 4 3zM9 21l-3-1.5L3 21l1.5-3L3 15l3 1.5L9 15l-1.5 3z"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m9.266 6.705 13.529 13.529c-.071.78-.34 1.371-.765 1.796-.425.425-1.015.694-1.796.765h0L6.705 9.266c.071-.78.34-1.371.765-1.796.425-.425 1.015-.694 1.796-.765h0Z"/><path stroke="currentColor" stroke-width="1.5" d="M12 9.5c-.657.323-1.157.657-1.5 1-.343.343-.677.843-1 1.5"/></g>\n '},Sv=(e,t)=>{const o=Object.getOwnPropertyDescriptors(e);Object.keys(o).forEach((i=>{o[i].get?Object.defineProperty(t,i,{get:()=>e[i],set:t=>e[i]=t}):t[i]=e[i]}))},kv=e=>{const t={},{sub:o,pub:i}=Qo();d()&&null!==document.doctype||console.warn("Browser is in quirks mode, add <!DOCTYPE html> to page to fix render issues");const r=zs();Sv(r,t);const a=((e,t)=>{const o={},i=new Map,r=new Um({target:e,props:{stores:t,pluginComponents:Array.from(Jm)}});let n=!1;const a=()=>{n||(d()&&window.removeEventListener("pagehide",a),r&&(n=!0,r.$destroy()))};function s(e,t){return i.get(e)===t||(i.set(e,t),!1)}Ym||(Ym=new Set($d(Um).filter((e=>!Zm.includes(e))))),Ym.forEach((e=>{Object.defineProperty(o,e,{get:()=>r[e],set:Xm.includes(e)?t=>{s(e,t)||(r[e]={...r[e],...t})}:t=>{s(e,t)||(r[e]=t)}})})),Object.defineProperty(o,"previewImageData",{get:()=>r.imagePreviewCurrent}),qm.forEach((e=>{const t=Km[e],i=t[0];Object.defineProperty(o,e,{get:()=>r.pluginInterface[i][e],set:o=>{if(s(e,o))return;const i=t.reduce(((t,i)=>(t[i]={...r.pluginOptions[i],[e]:o},t)),{});r.pluginOptions={...r.pluginOptions,...i}}})})),Object.defineProperty(o,"element",{get:()=>r.root,set:()=>{}});const l=r.history;return ss(o,{on:(e,t)=>{if(n)return()=>{};if(/undo|redo|revert|writehistory/.test(e))return l.on(e,t);const o=[r.sub(e,t),r.$on(e,(e=>t(e instanceof CustomEvent&&!e.detail?void 0:e)))].filter(Boolean);return()=>o.forEach((e=>e()))},updateImagePreview:e=>{r.imagePreviewSrc=e},close:()=>!n&&r.pub("close"),destroy:a}),Object.defineProperty(o,"history",{get:()=>({undo:()=>l.undo(),redo:()=>l.redo(),revert:()=>l.revert(),get:()=>l.get(),getCollapsed:()=>l.get().splice(0,l.index+1),set:e=>l.set(e),write:e=>l.write(e),get length(){return l.length()},get index(){return l.index},set index(e){l.index=e}})}),d()&&window.addEventListener("pagehide",a),o})(e,r.stores);Sv(a,t);const s=["loadImage","processImage","abortProcessImage","abortLoadImage"].map((e=>a.on(e,(t=>{const o=r[e](t&&t.detail);o instanceof Promise&&o.catch(n)})))),l=(e,t)=>{const i=o(e,t),n=r.on(e,t),s=a.on(e,t);return()=>{i(),n(),s()}};t.handleEvent=n;const c=eg.map((e=>l(e,(o=>t.handleEvent(e,o)))));return ss(t,{on:l,updateImage:e=>new Promise(((o,i)=>{const n=t.history.get(),a=t.history.index,s=t.imageState;r.loadImage(e).then((e=>{t.history.set(n),t.history.index=a,t.imageState=s,o(e)})).catch(i)})),close:()=>{i("close")},destroy:()=>{[...s,...c].forEach((e=>e())),a.destroy(),r.destroy(),i("destroy")}}),setTimeout((()=>i("init",t)),0),t};const Cv="pintura-editor";var Tv=()=>new Promise((e=>{if(!Mv)return e([]);var t;t=Cv,document.createElement(t).constructor===HTMLElement&&customElements.define(Cv,Mv),customElements.whenDefined(Cv).then((()=>e(document.querySelectorAll(Cv))))}));const Mv=d()&&class extends HTMLElement{constructor(){super(),this._editor=void 0,this._unsubs=void 0}static get observedAttributes(){return["src"]}attributeChangedCallback(e,t,o){this[e]=o}connectedCallback(){this._editor=kv(this),Sv(this._editor,this),this._editor.src=this.getAttribute("src"),this._unsubs=tg(this._editor,this)}disconnectedCallback(){this._editor.destroy(),this._unsubs.forEach((e=>e()))}},Pv="pintura-editor";var Rv=(e,t={})=>{const o=m(e)?document.querySelector(e):e;if(!jt(o))return;t.class=t.class?"pintura-editor "+t.class:Pv;const i=kv(o);return Object.assign(i,t)};const{document:Iv,window:Ev}=za;function Av(e){let t,o,i,r;return ba(e[28]),{c(){t=On(),o=Fn("div"),Nn(o,"class",e[4]),Zn(o,"--editor-modal",1),Zn(o,"--viewport-pad-footer",e[5]),Zn(o,"opacity",e[7]),Zn(o,"height",e[6])},m(n,a){An(n,t,a),An(n,o,a),e[29](o),i||(r=[Wn(Ev,"keydown",e[12]),Wn(Ev,"orientationchange",e[13]),Wn(Ev,"resize",e[28]),Wn(Iv.body,"focusin",(function(){sn(!e[1]&&e[9])&&(!e[1]&&e[9]).apply(this,arguments)})),Wn(Iv.body,"focusout",(function(){sn(e[2]&&e[10])&&(e[2]&&e[10]).apply(this,arguments)})),Wn(o,"wheel",e[11],{passive:!1})],i=!0)},p(t,i){e=t,16&i[0]&&Nn(o,"class",e[4]),32&i[0]&&Zn(o,"--viewport-pad-footer",e[5]),128&i[0]&&Zn(o,"opacity",e[7]),64&i[0]&&Zn(o,"height",e[6])},i:en,o:en,d(n){n&&Ln(t),n&&Ln(o),e[29](null),i=!1,an(r)}}}function Lv(e,t,o){let i,r,n,a,s,l,c,u,p;const h=sa();let{root:m}=t,{preventZoomViewport:g=!0}=t,{preventScrollBodyIfNeeded:f=!0}=t,{preventFooterOverlapIfNeeded:y=!0}=t,{class:b}=t,x=!0,v=!1,w=!1,S=d()&&document.documentElement,k=d()&&document.body,C=d()&&document.head;const T=xc(0,{precision:.001,damping:.5});hn(e,T,(e=>o(27,p=e)));const M=T.subscribe((e=>{w&&e>=1?(o(21,w=!1),o(1,x=!1),h("show")):v&&e<=0&&(o(20,v=!1),o(1,x=!0),h("hide"))}));let P=!1,R=void 0,I=void 0,E=void 0;const A=()=>document.querySelector("meta[name=viewport]"),L=()=>Array.from(document.querySelectorAll("meta[name=theme-color]"));let F;const z=(e,t)=>{const o=()=>{e()?t():requestAnimationFrame(o)};requestAnimationFrame(o)};let D,O,B=0,W=void 0;const _=()=>{O||(O=$("div",{style:"position:fixed;height:100vh;top:0"}),k.append(O))};ra((()=>{y&&vo()&&_()})),na((()=>{O&&(o(23,W=O.offsetHeight),O.remove(),O=void 0)}));let V=void 0;const N=()=>S.style.setProperty("--pintura-document-height",window.innerHeight+"px");return aa((()=>{S.classList.remove("PinturaModalBodyLock"),M()})),e.$$set=e=>{"root"in e&&o(0,m=e.root),"preventZoomViewport"in e&&o(14,g=e.preventZoomViewport),"preventScrollBodyIfNeeded"in e&&o(15,f=e.preventScrollBodyIfNeeded),"preventFooterOverlapIfNeeded"in e&&o(16,y=e.preventFooterOverlapIfNeeded),"class"in e&&o(17,b=e.class)},e.$$.update=()=>{137363458&e.$$.dirty[0]&&o(26,i=w||v?p:x?0:1),16384&e.$$.dirty[0]&&(r="width=device-width,height=device-height,initial-scale=1"+(g?",maximum-scale=1,user-scalable=0":"")),3145730&e.$$.dirty[0]&&o(24,n=!w&&!x&&!v),12&e.$$.dirty[0]&&(P||o(22,D=B)),67108864&e.$$.dirty[0]&&o(7,a=i),4194304&e.$$.dirty[0]&&o(6,s=D+"px"),8388616&e.$$.dirty[0]&&o(5,l=Oo(W)?"--viewport-pad-footer:"+(W>B?0:1):void 0),131072&e.$$.dirty[0]&&o(4,c=Xc(["pintura-editor","PinturaModal",b])),32768&e.$$.dirty[0]&&o(25,u=f&&vo()&&/15_/.test(navigator.userAgent)),50331648&e.$$.dirty[0]&&u&&(e=>{e?(V=window.scrollY,S.classList.add("PinturaDocumentLock"),N(),window.addEventListener("resize",N)):(window.removeEventListener("resize",N),S.classList.remove("PinturaDocumentLock"),Oo(V)&&window.scrollTo(0,V),V=void 0)})(n)},[m,x,P,B,c,l,s,a,T,e=>{_d(e.target)&&(o(2,P=!0),F=B)},e=>{if(_d(e.target))if(clearTimeout(undefined),F===B)o(2,P=!1);else{const e=B;z((()=>B!==e),(()=>o(2,P=!1)))}},e=>{e.target&&/PinturaStage/.test(e.target.className)&&e.preventDefault()},e=>{const{key:t}=e;if(!/escape/i.test(t))return;const o=e.target;if(o&&/input|textarea/i.test(o.nodeName))return;const i=document.querySelectorAll(".PinturaModal");i[i.length-1]===m&&h("close")},_,g,f,y,b,()=>{if(w||!x)return;o(21,w=!0);const e=A()||$("meta",{name:"viewport"});R=!R&&e.getAttribute("content"),e.setAttribute("content",r+(/cover/.test(R)?",viewport-fit=cover":"")),e.parentNode||C.append(e);const t=getComputedStyle(m).getPropertyValue("--color-background"),i=L();if(i.length)I=i.map((e=>e.getAttribute("content")));else{const e=$("meta",{name:"theme-color"});C.append(e),i.push(e)}i.forEach((e=>e.setAttribute("content",`rgb(${t})`))),clearTimeout(E),E=setTimeout((()=>T.set(1)),250)},()=>{if(v||x)return;clearTimeout(E),o(20,v=!0);const e=A();R?e.setAttribute("content",R):e.remove();const t=L();I?t.forEach(((e,t)=>{e.setAttribute("content",I[t])})):t.forEach((e=>e.remove())),T.set(0)},v,w,D,W,n,u,i,p,function(){o(3,B=Ev.innerHeight)},function(e){pa[e?"unshift":"push"]((()=>{m=e,o(0,m)}))}]}class Fv extends Ga{constructor(e){super(),Ua(this,e,Lv,Av,ln,{root:0,preventZoomViewport:14,preventScrollBodyIfNeeded:15,preventFooterOverlapIfNeeded:16,class:17,show:18,hide:19},null,[-1,-1])}get root(){return this.$$.ctx[0]}set root(e){this.$$set({root:e}),ka()}get preventZoomViewport(){return this.$$.ctx[14]}set preventZoomViewport(e){this.$$set({preventZoomViewport:e}),ka()}get preventScrollBodyIfNeeded(){return this.$$.ctx[15]}set preventScrollBodyIfNeeded(e){this.$$set({preventScrollBodyIfNeeded:e}),ka()}get preventFooterOverlapIfNeeded(){return this.$$.ctx[16]}set preventFooterOverlapIfNeeded(e){this.$$set({preventFooterOverlapIfNeeded:e}),ka()}get class(){return this.$$.ctx[17]}set class(e){this.$$set({class:e}),ka()}get show(){return this.$$.ctx[18]}get hide(){return this.$$.ctx[19]}}const zv=(e,t,o,i)=>{const r=me(t.x-e.x,t.y-e.y),n=xe(r),a=5*o;let s;s=i?.5*a:Math.ceil(.5*(a-1));const l=Me($e(n),s);return{anchor:$e(e),offset:l,normal:n,solid:i,size:a,sizeHalf:s}},Dv=(e,t,o)=>{const{strokeWidth:i,strokeColor:r,strokeJoin:n,strokeCap:a,...s}=e,{anchor:l,offset:c,normal:d,solid:u,size:p,sizeHalf:h}=t,m=l.x,g=l.y,$=Me($e(d),p),f=me(m+$.x,g+$.y);if(Me($,.55),u){ke(o,c);const e=Me($e(d),.5*h);return[{...s,points:[me(m-e.x,g-e.y),me(f.x-$.y,f.y+$.x),me(f.x+$.y,f.y-$.x)],pathClose:!0,backgroundColor:r}]}{const e=Me((e=>{const t=e.x;return e.x=-e.y,e.y=t,e})($e(d)),.5),t=me(m-e.x,g-e.y),o=me(m+e.x,g+e.y);return[{...s,points:[me(f.x+$.y,f.y-$.x),t,me(m,g),o,me(f.x-$.y,f.y+$.x)],pathClose:!1,strokeWidth:i,strokeColor:r,strokeJoin:n,strokeCap:a}]}},Ov=(e,t,o)=>{const{strokeWidth:i,strokeColor:r,...n}=e,{anchor:a,solid:s,offset:l,normal:c,sizeHalf:d}=t;return ke(o,l),s&&ke(o,fe($e(c))),[{...n,x:a.x,y:a.y,rx:d,ry:d,backgroundColor:s?r:void 0,strokeWidth:s?void 0:i,strokeColor:s?void 0:r}]},Bv=(e,t)=>{const{strokeWidth:o,strokeColor:i,strokeJoin:r,strokeCap:n,...a}=e,{anchor:s,offset:l}=t;return[{...a,points:[me(s.x-l.y,s.y+l.x),me(s.x+l.y,s.y-l.x)],strokeWidth:o,strokeColor:i,strokeJoin:r,strokeCap:n}]},Wv=(e,t,o)=>{const{strokeWidth:i,strokeColor:r,...n}=e,{anchor:a,solid:s,offset:l,normal:c,sizeHalf:d}=t;return ke(o,l),[{...n,x:a.x-d,y:a.y-d,width:2*d,height:2*d,rotation:(u=c,Math.atan2(u.y,u.x)),backgroundColor:s?r:void 0,strokeWidth:s?void 0:i,strokeColor:s?void 0:r}];var u},_v=(e={})=>t=>{if(!t.lineStart&&!t.lineEnd)return;const o=[],{x1:i,y1:r,x2:n,y2:a,lineStart:s,lineEnd:l,strokeWidth:c,strokeColor:d,strokeJoin:u,strokeCap:p,strokeDash:h,bitmap:m,aboveFrame:g,opacity:$}=t,f=me(i,r),y=me(n,a),b=[f,y],x={bitmap:m,aboveFrame:g,opacity:$,strokeColor:d,strokeWidth:c,strokeJoin:u,strokeCap:p};if(s){const[t,i]=s.split("-"),r=e[t];if(r){const e=zv(f,y,c,!!i);o.push(...r(x,e,f))}}if(l){const[t,i]=l.split("-"),r=e[t];if(r){const e=zv(y,f,c,!!i);o.push(...r(x,e,y))}}return[{...x,strokeDash:h,points:b},...o]},Vv=()=>({arrow:Dv,circle:Ov,square:Wv,bar:Bv}),Nv=(e,t)=>{const o=parseFloat(e)*t;return m(e)?o+"%":o},Hv=(e,t)=>m(e)?mr(e,t):e,jv=e=>[{...e,frameStyle:"line",frameInset:0,frameOffset:0,frameSize:e.frameSize?Nv(e.frameSize,2):"2.5%",frameRadius:e.frameRound?Nv(e.frameSize,2):0}],Uv=({width:e,height:t,frameImage:o,frameSize:i="15%",frameOutset:r=0,frameSlices:n={x1:.15,y1:.15,x2:.85,y2:.85}},{isPreview:a})=>{if(!o)return[];const s=Math.sqrt(e*t),l=Hv(i,s),c=a?l:Math.round(l),d=c,u=Hv(r,s),p=2*u,{x1:h,x2:m,y1:g,y2:$}=n,f={x0:0,y0:0,x1:c,y1:d,x2:e-c,y2:t-d,x3:e,y3:t,cw:c,ch:d,ew:e-c-c,eh:t-d-d},y=a?1:0,b=2*y,x=u>0,v={expandsCanvas:x,width:f.cw,height:f.ch,backgroundImage:o};return[{expandsCanvas:x,x:f.x1-y-u,y:f.y0-u,width:f.ew+b+p,height:f.ch,backgroundCorners:[{x:h,y:0},{x:m,y:0},{x:m,y:g},{x:h,y:g}],backgroundImage:o},{expandsCanvas:x,x:f.x1-y-u,y:f.y2+u,width:f.ew+b+p,height:f.ch,backgroundCorners:[{x:h,y:$},{x:m,y:$},{x:m,y:1},{x:h,y:1}],backgroundImage:o},{expandsCanvas:x,x:f.x0-u,y:f.y1-y-u,width:f.cw,height:f.eh+b+p,backgroundCorners:[{x:0,y:g},{x:h,y:g},{x:h,y:$},{x:0,y:$}],backgroundImage:o},{expandsCanvas:x,x:f.x2+u,y:f.y1-y-u,width:f.cw,height:f.eh+b+p,backgroundCorners:[{x:m,y:g},{x:1,y:g},{x:1,y:$},{x:m,y:$}],backgroundImage:o},{...v,x:f.x0-u,y:f.y0-u,backgroundCorners:[{x:0,y:0},{x:h,y:0},{x:h,y:g},{x:0,y:g}]},{...v,x:f.x2+u,y:f.y0-u,backgroundCorners:[{x:m,y:0},{x:1,y:0},{x:1,y:g},{x:m,y:g}]},{...v,x:f.x2+u,y:f.y2+u,backgroundCorners:[{x:m,y:$},{x:1,y:$},{x:1,y:1},{x:m,y:1}]},{...v,x:f.x0-u,y:f.y2+u,backgroundCorners:[{x:0,y:$},{x:h,y:$},{x:h,y:1},{x:0,y:1}]}]},Gv=({x:e,y:t,width:o,height:i,frameInset:r="3.5%",frameSize:n=".25%",frameColor:a=[1,1,1],frameOffset:s="5%",frameAmount:l=1,frameRadius:c=0,expandsCanvas:d=!1},{isPreview:u})=>{const p=Math.sqrt(o*i);let h=Hv(n,p);const m=Hv(r,p),g=Hv(s,p);let $=0;u||(h=Math.max(1,Math.round(h)),$=h%2==0?0:.5);const f=Hv(Nv(c,l),p);return new Array(l).fill(void 0).map(((r,n)=>{const s=g*n;let l=e+m+s,c=t+m+s,p=e+o-m-s,y=t+i-m-s;u||(l=Math.round(l),c=Math.round(c),p=Math.round(p),y=Math.round(y));return{x:l+$,y:c+$,width:p-l,height:y-c,cornerRadius:f>0?f-s:0,strokeWidth:h,strokeColor:a,expandsCanvas:d}}))},Zv=({x:e,y:t,width:o,height:i,frameSize:r=".25%",frameOffset:n=0,frameInset:a="2.5%",frameColor:s=[1,1,1]},{isPreview:l})=>{const c=Math.sqrt(o*i);let d=Hv(r,c),u=Hv(a,c),p=Hv(n,c),h=0;l||(d=Math.max(1,Math.round(d)),u=Math.round(u),p=Math.round(p),h=d%2==0?0:.5);const m=p-u,g=e+u+h,$=t+u+h,f=e+o-u-h,y=t+i-u-h;return[{points:[me(g+m,$),me(f-m,$)]},{points:[me(f,$+m),me(f,y-m)]},{points:[me(f-m,y),me(g+m,y)]},{points:[me(g,y-m),me(g,$+m)]}].map((e=>(e.strokeWidth=d,e.strokeColor=s,e)))},Xv=({x:e,y:t,width:o,height:i,frameSize:r=".25%",frameInset:n="2.5%",frameLength:a="2.5%",frameColor:s=[1,1,1]},{isPreview:l})=>{const c=Math.sqrt(o*i);let d=Hv(r,c),u=Hv(n,c),p=Hv(a,c),h=0;l||(d=Math.max(1,Math.round(d)),u=Math.round(u),p=Math.round(p),h=d%2==0?0:.5);const m=e+u+h,g=t+u+h,$=e+o-u-h,f=t+i-u-h;return[{points:[me(m,g+p),me(m,g),me(m+p,g)]},{points:[me($-p,g),me($,g),me($,g+p)]},{points:[me($,f-p),me($,f),me($-p,f)]},{points:[me(m+p,f),me(m,f),me(m,f-p)]}].map((e=>(e.strokeWidth=d,e.strokeColor=s,e)))},Yv=({x:e,y:t,width:o,height:i,frameColor:r=[1,1,1]},{isPreview:n})=>{const a=Math.sqrt(o*i),s=.1*a;let l=.2*a,c=0;const d=.5*s;return n?c=1:l=Math.ceil(l),r.length=3,[{id:"border",x:e-d+c,y:t-d+c,width:o+s-2*c,height:i+l-2*c,frameStyle:"line",frameInset:0,frameOffset:0,frameSize:s,frameColor:r,expandsCanvas:!0},{id:"chin",x:e-d,y:i-c,width:o+s,height:l,backgroundColor:r,expandsCanvas:!0}].filter(Boolean)},qv=(e={})=>(t,o)=>{if(!Wo(t,"frameStyle"))return;const i=t.frameStyle,r=e[i];if(!r)return;const{frameStyle:n,...a}=t;return r(a,o)},Kv=()=>({solid:jv,hook:Xv,line:Gv,edge:Zv,polaroid:Yv,nine:Uv}),Jv=e=>{const t=(o,i={isPreview:!0})=>{const r=e.map((e=>{const r=e(o,i);if(r)return r.map((e=>t(e,i)))})).filter(Boolean).flat();return r.length?r.flat().map(((e,t)=>(e.id=o.id+"_"+t,e))):o};return t};"undefined"!=typeof window&&(e=>{if(!e)return;const[t,o,i,r]=[[108,111,99,97,116,105,111,110],[82,101,103,69,120,112],[116,101,115,116],[112,113,105,110,97,92,46,110,108]].map((e=>e.map((e=>String.fromCharCode(e))).join("")));e._dwkgrvd=new e[o](r)[i](e[t])})(window);const Qv=Sl,ew=Cl,tw=(e,...t)=>(o,i)=>{var r;r=e,(Array.isArray(r)||R(r))&&(t=[e,...t]);const n=T(e)?e:{};n.testSrcSupport=!0,t=Array.isArray(t)?t.reduce(((e,t)=>[...e,...Array.isArray(t)?[...t]:[t]]),[]):t;for(let e=0;e<t.length;e++){const r=t[e](o,i,n);if(Array.isArray(r))return r}},ow=()=>({read:l,apply:C}),iw=(e={})=>{const{blurAmount:t,dataSizeScalar:o,scrambleAmount:i,backgroundColor:r}=e;return(e,n)=>(async(e,t={})=>{if(!e)return;const{width:o,height:i}=e,{dataSize:r=96,dataSizeScalar:n=1,scrambleAmount:a=4,blurAmount:s=6,outputFormat:l="canvas",backgroundColor:c=[0,0,0]}=t,d=Math.round(r*n),u=Math.min(d/o,d/i),p=Math.floor(o*u),h=Math.floor(i*u),m=$("canvas",{width:p,height:h}),g=m.getContext("2d",{willReadFrequently:!0});if(c.length=3,g.fillStyle=Xo(c),g.fillRect(0,0,p,h),b(e)){const t=$("canvas",{width:o,height:i});t.getContext("2d",{willReadFrequently:!0}).putImageData(e,0,0),g.drawImage(t,0,0,p,h),y(t)}else g.drawImage(e,0,0,p,h);const f=g.getImageData(0,0,p,h),x=[];if(a>0&&x.push([hc,{amount:a}]),s>0)for(let e=0;e<s;e++)x.push([Ao,{matrix:mc}]);let v;if(x.length){const e=(t,o)=>`(err, imageData) => {\n(${t[o][0].toString()})(Object.assign({ imageData: imageData }, filterInstructions[${o}]), \n${t[o+1]?e(t,o+1):"done"})\n}`,t=`function (options, done) {\nconst filterInstructions = options.filterInstructions;\nconst imageData = options.imageData;\n(${e(x,0)})(null, imageData)\n}`,o=await z(t,[{imageData:f,filterInstructions:x.map((e=>e[1]))}],[f.data.buffer]);v=Ro(o)}else v=f;return"canvas"===l?(g.putImageData(v,0,0),m):v})(e,{blurAmount:t,scrambleAmount:i,backgroundColor:r,...n,dataSizeScalar:o||n.dataSizeScalar})},rw=zs,nw=g$,aw=h$,sw=cf,lw={markupEditorToolbar:g$(),markupEditorToolStyles:h$(),markupEditorShapeStyleControls:cf()},cw=Qm,dw=vy,uw=Py,pw=Dy,hw=Sx,mw=Tx,gw=Rx,$w=Ox,fw=Jx,yw=Yx,bw=cv,xw=pv,vw=Wg,ww=kg,Sw=qg,kw=gv,Cw=$v,Tw=fv,Mw=yv,Pw={filterLabel:"Filter",filterIcon:'<g stroke-width=".125em" stroke="currentColor" fill="none"><path d="M18.347 9.907a6.5 6.5 0 1 0-1.872 3.306M3.26 11.574a6.5 6.5 0 1 0 2.815-1.417 M10.15 17.897A6.503 6.503 0 0 0 16.5 23a6.5 6.5 0 1 0-6.183-8.51"/></g>',filterLabelChrome:"Chrome",filterLabelFade:"Fade",filterLabelCold:"Cold",filterLabelWarm:"Warm",filterLabelPastel:"Pastel",filterLabelMonoDefault:"Mono",filterLabelMonoNoir:"Noir",filterLabelMonoWash:"Wash",filterLabelMonoStark:"Stark",filterLabelSepiaDefault:"Sepia",filterLabelSepiaBlues:"Blues",filterLabelSepiaRust:"Rust",filterLabelSepiaColor:"Color"},Rw={finetuneLabel:"Finetune",finetuneIcon:'<g stroke-width=".125em" stroke="currentColor" fill="none"><path d="M4 1v5.5m0 3.503V23M12 1v10.5m0 3.5v8M20 1v15.5m0 3.5v3M2 7h4M10 12h4M18 17h4"/></g>',finetuneLabelBrightness:"Brightness",finetuneLabelContrast:"Contrast",finetuneLabelSaturation:"Saturation",finetuneLabelExposure:"Exposure",finetuneLabelTemperature:"Temperature",finetuneLabelGamma:"Gamma",finetuneLabelClarity:"Clarity",finetuneLabelVignette:"Vignette"},Iw=bv,Ew={decorateLabel:"Decorate",decorateIcon:'<g fill="none" fill-rule="evenodd"><path stroke="currentColor" stroke-width=".125em" stroke-linecap="round" stroke-linejoin="round" d="M12 18.5l-6.466 3.4 1.235-7.2-5.23-5.1 7.228-1.05L12 2l3.233 6.55 7.229 1.05-5.231 5.1 1.235 7.2z"/></g>'},Aw={annotateLabel:"Annotate",annotateIcon:'<g stroke-width=".125em" stroke="currentColor" fill="none"><path d="M17.086 2.914a2.828 2.828 0 1 1 4 4l-14.5 14.5-5.5 1.5 1.5-5.5 14.5-14.5z"/></g>'},Lw={stickerLabel:"Sticker",stickerIcon:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M12 22c2.773 0 1.189-5.177 3-7 1.796-1.808 7-.25 7-3 0-5.523-4.477-10-10-10S2 6.477 2 12s4.477 10 10 10z"/><path d="M20 17c-3 3-5 5-8 5"/></g>'},Fw=xv,zw=vv,Dw=wv,Ow=(e,t,o={})=>(m(t)?Array.from(document.querySelectorAll(t)):t).filter(Boolean).map((t=>e(t,P(o)))),Bw=Rv,Ww=(e={},t)=>{const{sub:o,pub:i}=Qo(),r={},a=((e={},t)=>new Fv({target:t||document.body,props:{class:e.class,preventZoomViewport:e.preventZoomViewport,preventScrollBodyIfNeeded:e.preventScrollBodyIfNeeded,preventFooterOverlapIfNeeded:e.preventFooterOverlapIfNeeded}}))(e,t),s=()=>{a.hide&&a.hide()},l=()=>{a.show&&a.show()},c=kv(a.root);Sv(c,r),r.handleEvent=n,c.handleEvent=(e,t)=>{if("init"===e)return r.handleEvent(e,r);r.handleEvent(e,t)},c.on("close",(async()=>{const{willClose:t}=e;if(!t)return s();await t()&&s()}));const d=(e,t)=>/show|hide/.test(e)?o(e,t):c.on(e,t),u=["show","hide"].map((e=>d(e,(t=>r.handleEvent(e,t))))),p=()=>{u.forEach((e=>e())),s(),a.$destroy(),c.destroy()};return ss(r,{on:d,destroy:p,hide:s,show:l}),Object.defineProperty(r,"modal",{get:()=>a.root,set:()=>{}}),a.$on("close",c.close),a.$on("show",(()=>i("show"))),a.$on("hide",(()=>{i("hide"),!1!==e.enableAutoDestroy&&p()})),!1!==e.enableAutoHide&&c.on("process",s),c.on("loadstart",l),!1!==e.enableButtonClose&&(e.enableButtonClose=!0),delete e.class,Object.assign(r,e),r},_w=(e,t)=>Rv(e,{...t,layout:"overlay"}),Vw=Jv,Nw=(e=[])=>Jv([qv(Kv()),_v(Vv()),...e]),Hw=(e={})=>{let t,o=void 0;Array.isArray(e.imageReader)||(o=e.imageReader,delete e.imageReader),Array.isArray(e.imageWriter)?t=ew():(t=R(e.imageWriter)?e.imageWriter:ew(e.imageWriter),delete e.imageWriter);let i=void 0;return R(e.imageScrambler)||(i=e.imageScrambler,delete e.imageScrambler),{imageReader:Qv(o),imageWriter:t,imageOrienter:ow(),imageScrambler:iw(i)}},jw=(e,t={})=>{const o=Hw(t),i="function"==typeof t.shapePreprocessor?t.shapePreprocessor:Nw(t.shapePreprocessor);return delete t.shapePreprocessor,t=Ka([{...o,shapePreprocessor:i,stickerStickToImage:!0},t]),Ds(e,t)},Uw=(e={})=>{Qm(dw,uw,pw,hw,mw,gw,$w,fw,yw,bw);const t=Hw(e),o={...kw,...Cw,...Tw,...Mw,...Pw,...Rw,...Fw,...zw,...Iw,...Ew,...Aw,...Lw,...e.locale};delete e.locale;const i="function"==typeof e.shapePreprocessor?e.shapePreprocessor:Nw(e.shapePreprocessor);if(delete e.shapePreprocessor,e.markupEditorShapeStyleControls){Object.entries(e.markupEditorShapeStyleControls).every((([e,t])=>/Options$/.test(e)||!Array.isArray(t)))&&(e.markupEditorShapeStyleControls=sw({...e.markupEditorShapeStyleControls}))}if(e.markupEditorToolStyles){Object.values(e.markupEditorToolStyles).every((e=>!Array.isArray(e)))&&(e.markupEditorToolStyles=Object.entries(e.markupEditorToolStyles).reduce(((e,[t,o])=>(e[t]=p$(t,o),e)),aw()))}return Ka([{...t,shapePreprocessor:i,utils:["trim","crop","filter","finetune","retouch","annotate","decorate","sticker","fill","frame","redact","resize"],...vw,...ww,...Sw,...lw,stickerStickToImage:!0,locale:o},e])},Gw=async(e={})=>{const t=await Tv();return t.forEach((t=>Object.assign(t,P(e)))),t},Zw=(e,t)=>Bw(e,Uw(t)),Xw=(e,t,o,i)=>new Promise((async(r,n)=>{const{format:a="canvas",backgroundColor:s=[0,0,0],foregroundColor:l=[1,1,1],scope:c="mask",padding:d=0,maxSize:u=t,targetSize:p,forceSquareCanvas:h=!1,precision:m=7}=i||{},{flipX:g,flipY:f,rotation:y}=o,b=Math.min(1,2048/t.width),x=je({...t},b),v=Ge({...t},y),w=Ge({...x},y),S={x:.5*(x.width-w.width),y:.5*(x.height-w.height),...w},k=void 0===l||0===l[3],C=k?[1,1,1]:l,T={imageAnnotation:e.map((e=>((e,t,o)=>{const i={...e};return Rr(i,t),i.width||i.rx?i.backgroundColor=o:i.points&&!i.pathClose?(i.strokeJoin="round",i.strokeCap="round",i.strokeColor=o):i.points&&(i.backgroundColor=o,i.strokeColor=[0,0,0,0]),i})(e,b,C))),imageBackgroundColor:"image"===c?[0,0,0]:void 0,imageCropLimitToImage:!1,imageCrop:S,imageFlipX:g,imageFlipY:f,imageRotation:y,imageWriter:{format:"canvas"}},{dest:M}=await jw($("canvas",x),{...T}),P=M.getContext("2d",{desynchronized:!0,willReadFrequently:!0});let R,I;{const e=Number.MAX_SAFE_INTEGER,{width:t,height:o}=M,i=P.getImageData(0,0,t,o).data;let r,n,a=Math.max(1,parseInt(m,10)),s=t-a,l=o-a,[c,d,p,h]=[e,-e,-e,e];for(r=0;r<=l;r+=a)for(n=0;n<=s;n+=a){i[4*(n+r*t)+3]<=32||(n<h?h=n:n>d&&(d=n),r<c?c=r:r>p&&(p=r))}const g=it([c-m,d+m,p+m,h-m]),$=ct(g),f=Math.min(g.width,u.width),y=Math.min(g.height,u.height);R=lt($.x-.5*f,$.y-.5*y,f,y)}ut(R,1/b,he());let E=d,A=d;if("mask"===c){const e=We(R);if(e.width+=2*E,e.height+=2*A,h){const t=Math.max(e.width,e.height);E+=.5*(t-e.width),A+=.5*(t-e.height),e.width=t,e.height=t}let t=1;p&&(t=Math.min(p.width/e.width,p.height/e.height,1)),je(e,t);const o=$("canvas",e),i=o.getContext("2d");i.fillStyle=Xo(s),i.fillRect(0,0,o.width,o.height),k&&(i.globalCompositeOperation="destination-out"),i.scale(t,t),i.drawImage(M,-R.x+E,-R.y+A,v.width,v.height),I=o}else I=M;const L=ot(t);L.x+=.5*(v.width-t.width),L.y+=.5*(v.height-t.height);const[F]=bt(L,y),z=ct({...R}),D=me(z.x-F.x,z.y-F.y);R.x=Math.cos(y)*D.x+Math.sin(y)*D.y-.5*R.width,R.y=Math.cos(y)*D.y-Math.sin(y)*D.x-.5*R.height;const O={...R};if(O.x=R.x,O.y=R.y,g&&f?(O.flipX=!0,O.flipY=!0,O.rotation=-y):g?(O.flipX=!0,O.rotation=y):f?(O.flipY=!0,O.rotation=y):O.rotation=-y,g||f){const e={x:O.x+.5*O.width,y:O.y+.5*O.height};g&&(e.x=Math.abs(t.width-e.x),O.x=e.x-.5*O.width),f&&(e.y=Math.abs(t.height-e.y),O.y=e.y-.5*O.height)}if(E||A){const e=E/(R.width+2*E),t=A/(R.height+2*A);O.backgroundCorners=[{x:e,y:t},{x:1-e,y:t},{x:1-e,y:1-t},{x:e,y:1-t}],R.x-=E,R.y-=A,R.width+=2*E,R.height+=2*A}const B={canvas:I,rect:R,shape:O};"blob"!==a?r({...B,blob:void 0}):I.toBlob((e=>r({...B,blob:e})))}));return e.appendDefaultEditor=Zw,e.appendDefaultEditors=(e,t)=>Ow(Zw,e,t),e.appendEditor=Bw,e.appendEditors=(e,t)=>Ow(Bw,e,t),e.appendNode=(e,t)=>{if(ig(t))return t.push(e);t[3]=[...ng(t),e]},e.blobToFile=Z,e.canvasToBlob=_,e.colorStringToColorArray=Dp,e.createDefaultColorOptions=$$,e.createDefaultFontFamilyOptions=S$,e.createDefaultFontScaleOptions=b$,e.createDefaultFontSizeOptions=f$,e.createDefaultFontStyleOptions=C$,e.createDefaultFrameStyles=Kv,e.createDefaultImageOrienter=ow,e.createDefaultImageReader=Qv,e.createDefaultImageScrambler=iw,e.createDefaultImageWriter=ew,e.createDefaultLineEndStyleOptions=w$,e.createDefaultLineEndStyles=Vv,e.createDefaultLineHeightOptions=y$,e.createDefaultLineHeightScaleOptions=x$,e.createDefaultMediaWriter=tw,e.createDefaultShapePreprocessor=Nw,e.createDefaultStrokeScaleOptions=v$,e.createDefaultStrokeWidthOptions=()=>[1,2,3,4,6,8,12,16,20,24,32,48,64],e.createDefaultTextAlignOptions=k$,e.createEditor=rw,e.createFrameStyleProcessor=qv,e.createLineEndProcessor=_v,e.createMarkupEditorBackgroundColorControl=V$,e.createMarkupEditorBrushSizeControl=d$,e.createMarkupEditorColorControl=W$,e.createMarkupEditorColorOptions=T$,e.createMarkupEditorFontColorControl=N$,e.createMarkupEditorFontFamilyControl=O$,e.createMarkupEditorFontFamilyOptions=I$,e.createMarkupEditorFontScaleOptions=M$,e.createMarkupEditorFontSizeControl=J$,e.createMarkupEditorFontSizeOptions=e=>e.map(t$),e.createMarkupEditorFontStyleControl=Y$,e.createMarkupEditorFontStyleOptions=E$,e.createMarkupEditorLineEndStyleControl=X$,e.createMarkupEditorLineEndStyleOptions=A$,e.createMarkupEditorLineHeightControl=Q$,e.createMarkupEditorLineHeightOptions=e=>e.map(t$),e.createMarkupEditorLineHeightScaleOptions=P$,e.createMarkupEditorLineStartStyleControl=Z$,e.createMarkupEditorOptionControl=U$,e.createMarkupEditorOptionsControl=(e,t={})=>["Dropdown",{...t,options:e}],e.createMarkupEditorSelectionModeControl=c$,e.createMarkupEditorSelectionToolStyles=(e,t)=>{const{tools:o=l$}=t||{};return o.reduce(((t,o)=>{const[i,r]=s$[o],n=p$(i,{...r,action:e},{position:"absolute",isSelection:!0});return Object.assign(t,{[`selection-${o}-${e}`]:n})}),{})},e.createMarkupEditorSelectionTools=(e,t)=>{const{tools:o=l$,hideLabel:i=!0}=t||{};return o.map((t=>[`selection-${t}-${e}`,e$(t,"shapeLabelToolSelection"),{hideLabel:i,icon:e$(t,"shapeIconToolSelection")}]))},e.createMarkupEditorShapeStyleControls=sw,e.createMarkupEditorStrokeColorControl=H$,e.createMarkupEditorStrokeScaleOptions=R$,e.createMarkupEditorStrokeWidthControl=j$,e.createMarkupEditorStrokeWidthOptions=e=>e.map(t$),e.createMarkupEditorTextAlignControl=ef,e.createMarkupEditorToolStyle=p$,e.createMarkupEditorToolStyles=aw,e.createMarkupEditorToolbar=nw,e.createNode=function(e,t,o,i){return Array.isArray(o)&&(i=o,o={}),[e,t,o||{},i||[]]},e.createRetouchShape=async(e,t,o,i,r,n)=>{const{retouches:a=[],maxSize:s=t,targetSize:l,padding:c=0,mimeType:d,foregroundColor:u,maskFormat:p="blob",imageFormat:h="blob",forceSquareCanvas:m=!1,didCreateDraft:g=(()=>{})}=n||{},$=[...i],f=[...a],y=new AbortController,{blob:b,canvas:x,rect:v,shape:w}=await Xw($,t,o,{scope:"mask",format:p,padding:c,maxSize:s,targetSize:l,forceSquareCanvas:m,foregroundColor:u}),S=((e,t={})=>({id:e,...t,selectionStyle:"hook",disableStyle:["backgroundColor","cornerRadius","opacity","strokeWidth","strokeColor"],disableFlip:!0,disableReorder:!0,disableMove:!0,disableRotate:!0,disableDuplicate:!0,disableSelect:!0}))(L(),{...w});var k;k=S,Object.assign(k,{status:"loading",cornerRadius:15,strokeWidth:1.5,strokeColor:[0,0,0,.25],backgroundColor:[0,0,0,.1],selectionOpacity:0}),g(S,{selection:$});let C={};(d||l||"canvas"===h)&&(C={imageWriter:{}},d&&(C.imageWriter.mimeType=d),l&&(C.imageWriter.targetSize=l),h&&(C.imageWriter.format=h));const{flipX:T,flipY:M,rotation:P}=o,{dest:R}=await jw(e,{imageFlipX:T,imageFlipY:M,imageRotation:P,imageCrop:v,imageManipulation:f,imageCropLimitToImage:!1,...C});let I;try{await r(R,b||x,{shape:S,controller:y}),I="ok"}catch{I="error"}return(e=>(Object.assign(e,{selectionOpacity:1,cornerRadius:0,strokeWidth:0,strokeColor:[0,0,0,0],backgroundColor:[0,0,0,0]}),"error"!==e.status&&delete e.status,e))({...S,status:I,disableSelect:!1})},e.createShapePreprocessor=Vw,e.defineCustomElements=Gw,e.defineDefaultCustomElements=e=>Gw(Uw(e)),e.degToRad=Ul,e.dispatchEditorEvents=tg,e.effectBrightness=Eg,e.effectClarity=Og,e.effectContrast=Ag,e.effectExposure=Fg,e.effectGamma=zg,e.effectSaturation=Lg,e.effectTemperature=Bg,e.effectVignette=Dg,e.filterChrome=ug,e.filterCold=mg,e.filterFade=pg,e.filterInvert=()=>[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],e.filterMonoDefault=gg,e.filterMonoNoir=$g,e.filterMonoStark=yg,e.filterMonoWash=fg,e.filterPastel=dg,e.filterSepiaBlues=xg,e.filterSepiaColor=wg,e.filterSepiaDefault=bg,e.filterSepiaRust=vg,e.filterWarm=hg,e.findNode=lg,e.frameEdgeCross=Gg,e.frameEdgeOverlap=Zg,e.frameEdgeSeparate=Ug,e.frameHook=Xg,e.frameLineMultiple=jg,e.frameLineSingle=Hg,e.framePolaroid=Yg,e.frameSolidRound=Ng,e.frameSolidSharp=Vg,e.getCropperDefaults=(e={})=>{Qm(dw);const t=Hw(e),o={...kw,...Tw,...e.locale};return delete e.locale,Ka([{...t,utils:["crop"],locale:o},e])},e.getEditorDefaults=Uw,e.getEditorProps=()=>(()=>{const e=As.map(Ls),t=ns.map((([e])=>e)).filter((e=>!Es.includes(e)));return e.concat(t)})().concat((Ym=new Set($d(Um).filter((e=>!Zm.includes(e)))),[...Ym,...qm])),e.getShapeById=(e,t)=>e.find((e=>e.id===t)),e.getUniqueId=L,e.imageStateToCanvas=(e,t,o)=>{const{targetCanvas:i,targetSize:r,disableDraw:n=!1,shapePreprocessor:a}=o||{},s=i||document.createElement("canvas"),{crop:l,colorMatrix:c,convolutionMatrix:d}=t,u=ro(e),p={width:u?e.videoWidth:e.width,height:u?e.videoHeight:e.height},{upscale:h=!1,fit:m="contain",width:g,height:f}=r||{};let y=1;"contain"===m?y=Math.min((g||Number.MAX_SAFE_INTEGER)/l.width,(f||Number.MAX_SAFE_INTEGER)/l.height):"cover"===m&&(y=Math.max((g||l.width)/l.width,(f||l.height)/l.height)),h||(y=Math.min(y,1));const b="force"===m?g:Math.floor(l.width*y),x="force"===m?f:Math.floor(l.height*y),v=u?pc(b):b,w=u?pc(x):x,S=uc(s,{alpha:!0});S.resize(v,w,1);const k=S.textureCreate();let C;S.setCanvasColor([0,0,0,0]),S.drawToCanvas(),S.disableMask(),S.disablePreviewStencil();{const e=Object.values(c||{}).filter(Boolean);e.length&&(C=Jr(e))}const T={x:0,y:0,width:v,height:w},{origin:M,translation:P,rotation:R,scale:I}=Tl(T,T,p,l,{x:0,y:0,width:v,height:w},y,{x:0,y:0},1,t.rotation,t.flipX,t.flipY),E=[p,M.x,M.y,P.x,P.y,R.x,R.y,R.z,I,C,1,d&&d.clarity,Oo(t.gamma)?t.gamma:1,t.vignette||0,[1,0,1,0,1,w,1,v],void 0,void 0,void 0,void 0,!1];let A=!1;const L=t.decoration.length||t.annotation.length,F=L&&S.textureCreate(),z=()=>{S.textureUpdate(k,e,{filterParam:S.textureFilterLinear,wrapParam:S.textureClamp})},D=()=>{z(),S.drawImage(k,...E),L&&A&&S.drawRect(T,0,!1,!1,[0,0,0,0],void 0,F)};return z(),!n&&D(),{canvas:s,prepare:async()=>{if(!L)return;const{dest:e}=await Ds($("canvas",p),{shapePreprocessor:a,imageReader:[[async(e,t,o)=>{const{src:i}=e,r=parseInt(i.width,10),n=parseInt(i.height,10),a=await _(i);return{...e,dest:a,size:{width:r,height:n}}},"read-canvas"]],imageWriter:Cl({format:"canvas"}),imageState:{...t,redaction:[],frame:void 0,gamma:void 0,convolutionMatrix:void 0,colorMatrix:void 0,backgroundColor:[0,0,0,0],backgroundImage:void 0,trim:void 0,vignette:void 0,volume:void 0}});S.textureUpdate(F,e,{filterParam:S.textureFilterLinear,wrapParam:S.textureClamp}),A=!0,!n&&D()},redraw:D,destroy:()=>{S.release()}}},e.insertNodeAfter=(e,t,o)=>ag(e,t,o,(e=>e+1)),e.insertNodeBefore=(e,t,o)=>ag(e,t,o),e.isSupported=()=>(null===Ig&&(Ig=d()&&!("[object OperaMini]"===Object.prototype.toString.call(window.operamini))&&"visibilityState"in document&&"Promise"in window&&"File"in window&&"URL"in window&&"createObjectURL"in window.URL&&"performance"in window),Ig),e.legacyDataToImageState=(e,t,o={})=>{const i={};if(!((e={})=>{if("markup"in e||"color"in e||"filter"in e)return!0;const{crop:t}=e;return!(!t||!("flip"in t||"center"in t||"aspectRatio"in t||"rotation"in t))})(o))return o;if(o.crop&&Object.assign(i,Rg(t,o.crop)),o.markup){const e=Array.isArray(o.markup)?o.markup:Object.values(o.markup);i.decoration=e.map((e=>((e,t,o)=>{const i=Object.keys(o).reduce(((t,i)=>{let r=o[i];return i=Cg[i]||i,/px$/.test(r)?r=Tg(r):/^(?:x|y|left|right|top|bottom|width|height|fontSize|borderWidth|strokeWidth)$/.test(i)&&"number"==typeof r&&("strokeWidth"!==i&&"borderWidth"!==i&&"fontSize"!==i||(r=Math.min(e.width,e.height)*r+"px"),r=Tg(r)),/color/i.test(i)&&r&&(r=Dp(r)),null===r&&(r=void 0),t[i]=r,t}),{});if("line"===t&&(i.lineDecoration.length>=1&&(i.lineEnd="arrow"),2===i.lineDecoration.length&&(i.lineStart="arrow"),i.x1=i.x,i.y1=i.y,i.x2=Mg(i.x,i.width),i.y2=Mg(i.y,i.height),delete i.x,delete i.y,delete i.width,delete i.height,delete i.lineDecoration,delete i.lineStyle),"text"===t){if(!Oo(i.y)){const t=Math.min(e.width,e.height);i.y=t*(parseFloat(i.y)/100)}i.y=i.y-i.fontSize,delete i.width,delete i.height,delete i.borderStyle,i.lineHeight=i.lineHeight||"120%"}if("ellipse"===t){let t,o;if(/%$/.test(i.width)){t=parseFloat(i.width)/100,o=parseFloat(i.height)/100;const r=t*e.width,n=o*e.height;t=r/e.width*100,o=n/e.height*100}else t=i.width,o=i.height;i.rx=.5*t,i.ry=.5*o,/%$/.test(i.width)&&(i.rx+="%",i.ry+="%"),i.x=Mg(i.x,i.rx),i.y=Mg(i.y,i.ry),delete i.width,delete i.height,delete i.borderStyle}if("rect"===t&&delete i.borderStyle,"path"===t){let e,t=[];for(const o of i.points)e?Ie(e,o)<1e-9||(t.push(o),e=o,e=o):(t.push(o),e=o);i.points=t.map((e=>({x:Tg(e.x),y:Tg(e.y)})))}return i})(i.crop||t,e[0],e[1])))}if(o.color||o.colors){const e=o.color||o.colors;Object.keys(e).filter((t=>e[t])).map((t=>[t,Array.isArray(e[t].matrix)?e[t].matrix:Object.values(e[t].matrix)])).forEach((([e,t])=>{i.colorMatrix||(i.colorMatrix={}),i.colorMatrix[e]=t}))}if(o.filter||o.filters){const t=o.filters||o.filter;i.colorMatrix||(i.colorMatrix={});const r=e?e.filterFunctions:Sg;i.colorMatrix.filter="string"==typeof t&&r[t]?r[t]():t.matrix}const r=o.size?o.size:!!o.resize&&o.resize.size;return r&&r.width&&r.height&&(i.targetSize={width:r.width,height:r.height}),i},e.locale_en_gb=kw,e.markup_editor_defaults=lw,e.markup_editor_locale_en_gb=Cw,e.naturalAspectRatioToNumber=e=>{if(void 0===e||Oo(e))return e;if(!m(e))return!1;const t=e;if(!t.length)return;const[o,i]=t.split(/\/|:/g).map((e=>parseFloat(e.replace(/,/,".")))).filter(Boolean);return!!o&&(i?Math.abs(o/i):o)},e.openDefaultEditor=(e,t)=>Ww(Uw(e),t),e.openEditor=Ww,e.overlayDefaultEditor=(e,t)=>_w(e,Uw(t)),e.overlayEditor=_w,e.plugin_annotate=hw,e.plugin_annotate_locale_en_gb=Aw,e.plugin_crop=dw,e.plugin_crop_locale_en_gb=Tw,e.plugin_decorate=mw,e.plugin_decorate_locale_en_gb=Ew,e.plugin_fill=bw,e.plugin_fill_locale_en_gb=Mw,e.plugin_filter=uw,e.plugin_filter_defaults=ww,e.plugin_filter_locale_en_gb=Pw,e.plugin_finetune=pw,e.plugin_finetune_defaults=vw,e.plugin_finetune_locale_en_gb=Rw,e.plugin_frame=$w,e.plugin_frame_defaults=Sw,e.plugin_frame_locale_en_gb=Fw,e.plugin_redact=fw,e.plugin_redact_locale_en_gb=zw,e.plugin_resize=yw,e.plugin_resize_locale_en_gb=Iw,e.plugin_retouch=xw,e.plugin_retouch_locale_en_gb=Dw,e.plugin_sticker=gw,e.plugin_sticker_locale_en_gb=Lw,e.processDefaultImage=jw,e.processImage=Ds,e.removeNode=sg,e.selectionToMask=Xw,e.setPlugins=cw,e.shapeGetCenter=Ir,e.shapeGetLength=e=>{if(e.x1)return Ee(me(e.x1,e.y1),me(e.x2,e.y2))},e.shapeGetLevel=(e,t)=>{let o=!1;t.flipX&&e.flipX?o=!0:!t.flipX&&e.flipX?o=!1:t.flipX&&!e.flipX&&(o=!0);let i=!1;t.flipY&&e.flipY?i=!0:!t.flipY&&e.flipY?i=!1:t.flipY&&!e.flipY&&(i=!0);let r=-t.rotation;return!o&&!i||o&&i||(r=-r),{flipX:o,flipY:i,rotation:r}},e.supportsWebGL=tm,e.updateNode=(e,t)=>{const[,,o]=e;Object.assign(o,t)},e.updateShapeById=(e,t,o)=>e.map((e=>e.id!==t?e:o(e))),Object.defineProperty(e,"__esModule",{value:!0}),e}({});
|
|
11
|
+
var pintura=function(e){"use strict";const t=[{value:65504,name:"jfif"},{value:65498,name:"sos"},{value:65505,subvalue:17784,name:"exif"},{value:65505,subvalue:26740,name:"xmp"},{value:65506,subvalue:19792,name:"mpf"},{value:65506,name:"app2"}];var o=(e,o,i)=>{if(!e)return;const n=new DataView(e),r=(e=>{if(65496!==e.getUint16(0))return;const o=e.byteLength;let i,n=2,r=void 0;for(;n<o&&255===e.getUint8(n);){i=e.getUint16(n);const o=t.find((t=>t.value===i&&(!t.subvalue||t.subvalue===e.getUint16(n+2+2))));if(o){const{name:t}=o;r||(r={}),r[t]||(r[t]={offset:n,size:e.getUint16(n+2)})}if(65498===i)break;n+=2+e.getUint16(n+2)}return r})(n);if(!r||!r.exif)return;const a=((e,t)=>{if(65505!==e.getUint16(t))return;const o=e.getUint16(t+2);if(t+=4,1165519206!==e.getUint32(t))return;t+=6;const i=e.getUint16(t);if(18761!==i&&19789!==i)return;const n=18761===i;if(t+=2,42!==e.getUint16(t,n))return;t+=e.getUint32(t+2,n);const r=i=>{const r=[];let a=t;const s=Math.min(e.byteLength,t+o-16);for(;a<s;a+=12){const t=a;e.getUint16(t,n)===i&&r.push(t)}return r};return{read:t=>{const o=r(t);if(o.length)return e.getUint16(o[0]+8,n)},write:(t,o)=>{const i=r(t);return!!i.length&&(i.forEach((t=>e.setUint16(t+8,o,n))),!0)}}})(n,r.exif.offset);return a?void 0===i?a.read(o):a.write(o,i):void 0};const i="__pqina_webapi__";var n=e=>window[i]?window[i][e]:window[e],r=(...e)=>{};const a={ArrayBuffer:"readAsArrayBuffer"};var s=(e,t=r,o={})=>new Promise(((i,r)=>{const{dataFormat:s=a.ArrayBuffer}=o,l=new(n("FileReader"));l.onload=()=>i(l.result),l.onerror=()=>r(l.error),l.onprogress=t,l[s](e)})),l=async(e,t)=>{const i=await(async(e,t=[0,e.size],o)=>await s(e.slice(...t),o))(e,[0,262144],t);return o(i,274)||1};let c=null;var d=()=>(null===c&&(c="undefined"!=typeof window&&void 0!==window.document),c);let u=null;var p=()=>new Promise((e=>{if(null===u){const t="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4QA6RXhpZgAATU0AKgAAAAgAAwESAAMAAAABAAYAAAEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wAALCAABAAIBASIA/8QAJgABAAAAAAAAAAAAAAAAAAAAAxABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAAPwBH/9k=";let o=d()?new Image:{};return o.onload=()=>{u=1===o.naturalWidth,o=void 0,e(u)},void(o.src=t)}return e(u)})),h=e=>e.getContext("2d").getImageData(0,0,e.width,e.height),m=e=>"string"==typeof e;function g(e,t){t.split(";").forEach((t=>{const[o,i]=t.split(":");if(!o.length||!i)return;const[n,r]=i.split("!important");e.style.setProperty(o,n,m(r)?"important":void 0)}))}var $=(e,t,o=[])=>{const i=document.createElement(e),n=Object.getOwnPropertyDescriptors(i.__proto__);for(const e in t)"style"===e?g(i,t[e]):n[e]&&n[e].set||/textContent|innerHTML/.test(e)||"function"==typeof t[e]?i[e]=t[e]:i.setAttribute(e,t[e]);return o.forEach((e=>i.appendChild(e))),i};const f={1:()=>[1,0,0,1,0,0],2:e=>[-1,0,0,1,e,0],3:(e,t)=>[-1,0,0,-1,e,t],4:(e,t)=>[1,0,0,-1,0,t],5:()=>[0,1,1,0,0,0],6:(e,t)=>[0,1,-1,0,t,0],7:(e,t)=>[0,-1,-1,0,t,e],8:e=>[0,-1,1,0,0,e]};var y=e=>{e.width=1,e.height=1;const t=e.getContext("2d");t&&t.clearRect(0,0,1,1)},b=e=>"data"in e,x=e=>d()?RegExp(e).test(window.navigator.userAgent):void 0;let v=null;var w=()=>(null===v&&(v=x(/Android/)),v),S=(e,t)=>{const o=$("canvas",{width:e.width,height:e.height});return o.getContext("2d",t).drawImage(e,0,0),o},k=async(e,t=1)=>{const o=await p(),[i,n]=o||t<5?[e.width,e.height]:[e.height,e.width],r=$("canvas",{width:i,height:n}),a=r.getContext("2d",{willReadFrequently:!0});if(b(e)&&!o&&t>1){const t=$("canvas",{width:e.width,height:e.height});t.getContext("2d",{willReadFrequently:!0}).putImageData(e,0,0),e=t}if(!o&&t>1&&a.transform.apply(a,((e,t,o=-1)=>(-1===o&&(o=1),f[o](e,t)))(e.width,e.height,t)),b(e)){if(a.putImageData(e,0,0),w())return S(r)}else a.drawImage(e,0,0);return e instanceof HTMLCanvasElement&&y(e),r},C=async(e,t=1)=>1===t||await p()?e:h(await k(e,t)),T=e=>"object"==typeof e;const M=e=>e instanceof HTMLElement?e:T(e)?P(e):e,P=e=>{let t;return Array.isArray(e)?(t=[],e.forEach(((e,o)=>{t[o]=M(e)}))):(t={},null!==e&&Object.keys(e).forEach((o=>{const i=e[o];t[o]=M(i)}))),t};var R=e=>"function"==typeof e,I=(e,t)=>new Promise(((o,i)=>{const n=()=>o(((e,{width:t,height:o,canvasMemoryLimit:i,contextOptions:n})=>{let r=t||e.naturalWidth,a=o||e.naturalHeight;r||a||(r=300,a=150);const s=r*a;if(i&&s>i){const e=Math.sqrt(i)/Math.sqrt(s);r=Math.floor(r*e),a=Math.floor(a*e)}const l=$("canvas");return l.width=r,l.height=a,l.getContext("2d",n).drawImage(e,0,0,r,a),l})(e,t));e.complete&&e.width?n():(e.onload=n,e.onerror=()=>i(new Error("Failed to load image")))})),E=()=>"createImageBitmap"in window,A=e=>/svg/.test(e.type),L=()=>Math.random().toString(36).substring(2,9);const F=new Map;var z=(e,t,o)=>new Promise(((i,n)=>{const r=e.toString();let a=F.get(r);if(!a){const t=(e=>`function () {self.onmessage = function (message) {(${e.toString()}).apply(null, message.data.content.concat([function (err, response) {\n response = response || {};\n const transfer = 'data' in response ? [response.data.buffer] : 'width' in response ? [response] : [];\n return self.postMessage({ id: message.data.id, content: response, error: err }, transfer);\n}]))}}`)(e),o=URL.createObjectURL((e=>new Blob(["(","function"==typeof e?e.toString():e,")()"],{type:"application/javascript"}))(t)),i=new Map,n=new Worker(o);a={url:o,worker:n,messages:i,terminationTimeout:void 0,terminate:()=>{clearTimeout(a.terminationTimeout),a.worker.terminate(),URL.revokeObjectURL(o),F.delete(r)}},n.onmessage=function(e){const{id:t,content:o,error:n}=e.data;if(clearTimeout(a.terminationTimeout),a.terminationTimeout=setTimeout((()=>{i.size>0||a.terminate()}),500),!i.has(t))return;const r=i.get(t);i.delete(t),null!=n?r.reject(n):r.resolve(o)},F.set(r,a)}const s=L();a.messages.set(s,{resolve:i,reject:n}),a.worker.postMessage({id:s,content:t},o)}));let D=null;var O=()=>(null===D&&(D=x(/Firefox/)),D);const B=async(e,t)=>{const o=await(async(e,t)=>{const o=$("img",{src:URL.createObjectURL(e)}),i=await I(o,t);return URL.revokeObjectURL(o.src),i})(e,{canvasMemoryLimit:t,contextOptions:{willReadFrequently:!0}}),i=h(o);return y(o),i};var W=async(e,t)=>{if(w()&&!O())return await B(e,t);let o;if(E()&&!A(e)&&"OffscreenCanvas"in window)try{o=await z(((e,t,o)=>{createImageBitmap(e).then((e=>{let i=e.width,n=e.height;const r=i*n;if(t&&r>t){const e=Math.sqrt(t)/Math.sqrt(r);i=Math.floor(i*e),n=Math.floor(n*e)}const a=new OffscreenCanvas(i,n),s=a.getContext("2d",{willReadFrequently:!0});s.drawImage(e,0,0,i,n);const l=s.getImageData(0,0,a.width,a.height);o(null,l)})).catch((e=>{o(e)}))}),[e,t])}catch(e){}return o&&o.width?o:await B(e,t)},_=(e,t,o)=>new Promise(((i,n)=>{try{e.toBlob((e=>{if(!e)return n(new Error("Failed to create blob"));i(e)}),t,o)}catch(e){n(e)}})),V=async(e,t,o)=>{const i=await k(e),n=await _(i,t,o);return y(i),n};const N={matroska:"mkv"};var H=e=>{const t=(e.match(/\/([a-z0-9]+)/)||[])[1];if(/^x/.test(t)){const[,t=""]=e.split("/x-");return N[t]}return t},j=e=>e.substring(0,e.lastIndexOf("."))||e;const U=/avif|bmp|gif|jpg|jpeg|jpe|jif|jfif|png|svg|tiff|webp/;var G=e=>{return e&&(t=(o=e,o.split(".").pop()).toLowerCase(),U.test(t)?"image/"+(/jfif|jif|jpe|jpg/.test(t)?"jpeg":"svg"===t?"svg+xml":t):"");var t,o},Z=(e,t,o)=>{const i=(new Date).getTime(),r=e.type.length&&!/null|text/.test(e.type),a=r?e.type:o,s=((e,t)=>{const o=G(e);if(o===t)return e;const i=H(t)||o;return`${j(e)}.${i}`})(t,a);try{return new(n("File"))([e],s,{lastModified:i,type:r?e.type:a})}catch(t){const o=r?e.slice():e.slice(0,e.size,a);return o.lastModified=i,o.name=s,o}},X=(e,t)=>e/t,Y=e=>e;const q=Math.PI,K=Math.PI/2,J=K/2;var Q=e=>{const t=Math.abs(e)%Math.PI;return t>J&&t<Math.PI-J};const ee={Top:"t",Right:"r",Bottom:"b",Left:"l",TopLeft:"tl",TopRight:"tr",BottomRight:"br",BottomLeft:"bl"},{Top:te,Right:oe,Bottom:ie,Left:ne,TopLeft:re,TopRight:ae,BottomRight:se,BottomLeft:le}=ee;var ce={[te]:[.5,0],[oe]:[1,.5],[ie]:[.5,1],[ne]:[0,.5],[re]:[0,0],[ae]:[1,0],[se]:[1,1],[le]:[0,1]},de=(e,t=12)=>parseFloat(e.toFixed(t));const ue=(e,t,o)=>o+(e-o)*t,pe=e=>({x:e.x+.5*e.width,y:e.y+.5*e.height,rx:.5*e.width,ry:.5*e.height}),he=()=>me(0,0),me=(e,t)=>({x:e,y:t}),ge=e=>me(e.pageX,e.pageY),$e=e=>me(e.x,e.y),fe=e=>(e.x=-e.x,e.y=-e.y,e),ye=(e,t,o=he())=>{const i=Math.cos(t),n=Math.sin(t),r=e.x-o.x,a=e.y-o.y;return e.x=o.x+i*r-n*a,e.y=o.y+n*r+i*a,e},be=e=>Math.sqrt(e.x*e.x+e.y*e.y),xe=e=>{const t=Math.sqrt(e.x*e.x+e.y*e.y);return 0===t?he():(e.x/=t,e.y/=t,e)},ve=(e,t)=>Math.atan2(t.y-e.y,t.x-e.x),we=(e,t)=>e.x===t.x&&e.y===t.y,Se=(e,t)=>(e.x=t(e.x),e.y=t(e.y),e),ke=(e,t)=>(e.x+=t.x,e.y+=t.y,e),Ce=(e,t)=>(e.x-=t.x,e.y-=t.y,e),Te=(e,t)=>(e.x/=t,e.y/=t,e),Me=(e,t)=>(e.x*=t,e.y*=t,e),Pe=(e,t)=>e.x*t.x+e.y*t.y,Re=(e,t)=>e.x*t.y-e.y*t.x,Ie=(e,t=he())=>{const o=e.x-t.x,i=e.y-t.y;return o*o+i*i},Ee=(e,t=he())=>Math.sqrt(Ie(e,t)),Ae=(e,t,o)=>(e.x=ue(e.x,t,o.x),e.y=ue(e.y,t,o.y),e),Le=e=>{let t=0,o=0;return e.forEach((e=>{t+=e.x,o+=e.y})),me(t/e.length,o/e.length)},Fe=(e,t,o,i,n)=>(e.forEach((e=>{e.x=t?i-(e.x-i):e.x,e.y=o?n-(e.y-n):e.y})),e),ze=(e,t,o,i)=>{const n=Math.sin(t),r=Math.cos(t);return e.forEach((e=>{e.x-=o,e.y-=i;const t=e.x*r-e.y*n,a=e.x*n+e.y*r;e.x=o+t,e.y=i+a})),e},De=(e,t)=>({width:e,height:t}),Oe=e=>De(e.width,e.height),Be=e=>De(e.width,e.height),We=e=>De(e.width,e.height),_e=e=>De(e[0],e[1]),Ve=e=>{return/img/i.test(e.nodeName)?De((t=e).naturalWidth,t.naturalHeight):Be(e);var t},Ne=(e,t)=>De(e,t),He=(e,t,o=Y)=>o(e.width)===o(t.width)&&o(e.height)===o(t.height),je=(e,t)=>(e.width*=t,e.height*=t,e),Ue=e=>me(.5*e.width,.5*e.height),Ge=(e,t)=>{const o=Math.abs(t),i=Math.abs(Math.cos(o)),n=Math.abs(Math.sin(o)),r=i*e.width+n*e.height,a=n*e.width+i*e.height;return e.width=r,e.height=a,e},Ze=(e,t)=>e.width>=t.width&&e.height>=t.height,Xe=(e,t)=>(e.width=t(e.width),e.height=t(e.height),e),Ye=(e,t)=>({start:e,end:t}),qe=e=>Ye($e(e.start),$e(e.end)),Ke=(e,t)=>{if(0===t)return e;const o=me(e.start.x-e.end.x,e.start.y-e.end.y),i=xe(o),n=Me(i,t);return e.start.x+=n.x,e.start.y+=n.y,e.end.x-=n.x,e.end.y-=n.y,e},Je=[me(-1,-1),me(-1,1),me(1,1),me(1,-1)],Qe=(e,t,o,i)=>({x:e,y:t,width:o,height:i}),et=e=>Qe(e.x,e.y,e.width,e.height),tt=()=>Qe(0,0,0,0),ot=e=>Qe(0,0,e.width,e.height),it=e=>Qe(e[3],e[0],e[1]-e[3],e[2]-e[0]),nt=e=>Qe(e.x||0,e.y||0,e.width||0,e.height||0),rt=e=>{let t=e[0].x,o=e[0].x,i=e[0].y,n=e[0].y;return e.forEach((e=>{t=Math.min(t,e.x),o=Math.max(o,e.x),i=Math.min(i,e.y),n=Math.max(n,e.y)})),Qe(t,i,o-t,n-i)},at=e=>lt(e.x-e.rx,e.y-e.ry,2*e.rx,2*e.ry),st=(e,t)=>Qe(e.x-.5*t.width,e.y-.5*t.height,t.width,t.height),lt=(e,t,o,i)=>Qe(e,t,o,i),ct=e=>me(e.x+.5*e.width,e.y+.5*e.height),dt=(e,t)=>(e.x+=t.x,e.y+=t.y,e),ut=(e,t,o)=>(o=o||ct(e),e.x=t*(e.x-o.x)+o.x,e.y=t*(e.y-o.y)+o.y,e.width=t*e.width,e.height=t*e.height,e),pt=(e,t,o,i)=>{const n=(i.x-e.x)/e.width,r=(i.y-e.y)/e.height;let a=Math.max(t.width,e.width),s=Math.max(t.height,e.height);return a=Math.min(o.width,a),s=Math.min(o.height,s),e.x=i.x-n*a,e.y=i.y-r*s,e.width=a,e.height=s,e},ht=(e,t)=>{const[o,i]=ce[t],n=o*e.width,r=i*e.height;return me(e.x+n,e.y+r)},mt=(e,t)=>(e.x*=t,e.y*=t,e.width*=t,e.height*=t,e),gt=(e,t,o=Y)=>o(e.x)===o(t.x)&&o(e.y)===o(t.y)&&o(e.width)===o(t.width)&&o(e.height)===o(t.height),$t=e=>X(e.width,e.height),ft=(e,t,o,i,n)=>(e.x=t,e.y=o,e.width=i,e.height=n,e),yt=(e,t)=>(e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e),bt=(e,t,o)=>(o||(o=ct(e)),Ct(e).map((e=>ye(e,t,o)))),xt=(e,t)=>Qe(.5*e.width-.5*t.width,.5*e.height-.5*t.height,t.width,t.height),vt=(e,t)=>!(t.x<e.x)&&(!(t.y<e.y)&&(!(t.x>e.x+e.width)&&!(t.y>e.y+e.height))),wt=(e,t,o=he())=>{if(0===e.width||0===e.height)return tt();const i=$t(e);t||(t=i);let n=e.width,r=e.height;return t>i?n=r*t:r=n/t,Qe(o.x+.5*(e.width-n),o.y+.5*(e.height-r),n,r)},St=(e,t=$t(e),o=he())=>{if(0===e.width||0===e.height)return tt();let i=e.width,n=i/t;return n>e.height&&(n=e.height,i=n*t),Qe(o.x+.5*(e.width-i),o.y+.5*(e.height-n),i,n)},kt=e=>[Math.min(e.y,e.y+e.height),Math.max(e.x,e.x+e.width),Math.max(e.y,e.y+e.height),Math.min(e.x,e.x+e.width)],Ct=e=>[me(e.x,e.y),me(e.x+e.width,e.y),me(e.x+e.width,e.y+e.height),me(e.x,e.y+e.height)],Tt=(e,t)=>{if(e)return e.x=t(e.x),e.y=t(e.y),e.width=t(e.width),e.height=t(e.height),e},Mt=(e,t,o=ct(e))=>Ct(e).map(((e,i)=>{const n=Je[i];return me(ue(e.x,1+n.x*t.x,o.x),ue(e.y,1+n.y*t.y,o.y))})),Pt=e=>(e.x=0,e.y=0,e),Rt=e=>{const t=e[0],o=e[e.length-1];e=we(t,o)?e:[...e,t];const i=t.x,n=t.y;let r,a,s,l=0,c=0,d=0,u=0;const p=e.length;for(;c<p;c++)r=e[c],a=e[c+1>p-1?0:c+1],s=(r.y-n)*(a.x-i)-(a.y-n)*(r.x-i),l+=s,d+=(r.x+a.x-2*i)*s,u+=(r.y+a.y-2*n)*s;return s=3*l,me(i+d/s,n+u/s)},It=(e,t)=>Et(e.start,e.end,t.start,t.end),Et=(e,t,o,i)=>{const n=(i.y-o.y)*(t.x-e.x)-(i.x-o.x)*(t.y-e.y);if(0===n)return;const r=((i.x-o.x)*(e.y-o.y)-(i.y-o.y)*(e.x-o.x))/n,a=((t.x-e.x)*(e.y-o.y)-(t.y-e.y)*(e.x-o.x))/n;return r<0||r>1||a<0||a>1?void 0:me(e.x+r*(t.x-e.x),e.y+r*(t.y-e.y))},At=(e,t,{ignoreIdenticalLines:o=!1,breakOnIntersection:i=!1}={})=>{const n=t.length,r=[];for(let a=0;a<n-1;a++){if(o&&(we(e.start,t[a])||we(e.start,t[a+1])||we(e.end,t[a])||we(e.end,t[a+1])))continue;const n=Et(e.start,e.end,t[a],t[a+1]);if(n){if(i)return[n];r.push(n)}}return r.length?r:void 0},Lt=(e,t)=>{let o=0,i=0,n=!1;const r=t.length;for(o=0,i=r-1;o<r;i=o++)t[o].y>e.y!=t[i].y>e.y&&e.x<(t[i].x-t[o].x)*(e.y-t[o].y)/(t[i].y-t[o].y)+t[o].x&&(n=!n);return n},Ft=(e,t,o,i)=>({x:(1-i)*(1-i)*e.x+2*(1-i)*i*t.x+i*i*o.x,y:(1-i)*(1-i)*e.y+2*(1-i)*i*t.y+i*i*o.y}),zt=(e,t,o,i,n)=>{const r=((e,t,o,i)=>{let n=(t.x-e.x)*i,r=(t.y-e.y)*i;return Ee(o,t)<Ee(t,e)&&(n*=.15,r*=.15),{x:t.x+n,y:t.y+r}})(e,t,o,n),a=[];for(let e=0;e<=i;e++){const n=e/i;a.push(Ft(t,r,o,n))}return a},Dt=e=>{const t=[];for(let o=0;o<e.length;o++){let i=o+1;i===e.length&&(i=0),t.push(Ye($e(e[o]),$e(e[i])))}return t},Ot=(e,t=0)=>Dt(e).map((e=>Ke(e,t))),Bt=(e,t,o,i=0,n=!1,r=!1,a=12)=>{const s=[];for(let i=0;i<a;i++)s.push(me(e.x+t*Math.cos(i*(2*Math.PI)/a),e.y+o*Math.sin(i*(2*Math.PI)/a)));return(n||r)&&Fe(s,n,r,e.x,e.y),i&&ze(s,i,e.x,e.y),s},Wt=(e,t,o,i)=>{const n=me(e.x-o.x,e.y-o.y),r=me(i.x-o.x,i.y-o.y),a=Pe(r,r);let s=Pe(n,r)/a;s=s<0?0:s,s=s>1?1:s;const l=me(r.x*s+o.x-e.x,r.y*s+o.y-e.y);return Pe(l,l)<=t*t},_t=(e,t,o)=>{const i=o.length;for(let n=0;n<i-1;n++)if(Wt(e,t,o[n],o[n+1]))return!0;return!1},Vt=(e,t,o)=>!!Lt(e,o)||(!!_t(e,t,o)||Wt(e,t,o[0],o[o.length-1])),Nt=(e,t,o,i,n)=>Vt(e,t,bt(o,i,n||ct(o)));var Ht=(e,t)=>{const o=ot(e),i=ct(o),n=bt(o,t,i);return Pt(rt(n))},jt=(e,t)=>e instanceof HTMLElement&&(!t||new RegExp(`^${t}$`,"i").test(e.nodeName)),Ut=e=>e instanceof File,Gt=async(e,t,o)=>{const i=await _(e,t,o);return Z(i,"canvas")},Zt=e=>e.split("/").pop().split(/\?|\#/).shift();const Xt=d()&&!!Node.prototype.replaceChildren?(e,t)=>e.replaceChildren(t):(e,t)=>{for(;e.lastChild;)e.removeChild(e.lastChild);void 0!==t&&e.append(t)},Yt=d()&&$("div",{class:"PinturaMeasure",style:"position:absolute;left:0;top:0;width:99999px;height:0;pointer-events:none;contain:strict;margin:0;padding:0;"});let qt;var Kt=e=>(Xt(Yt,e),Yt.parentNode||document.body.append(Yt),clearTimeout(qt),qt=setTimeout((()=>{Yt.remove()}),500),e);let Jt=null;var Qt=()=>(null===Jt&&(Jt=d()&&/^((?!chrome|android).)*(safari|iphone|ipad)/i.test(navigator.userAgent)),Jt),eo=e=>new Promise(((t,o)=>{let i=!1;!e.parentNode&&Qt()&&(i=!0,e.style.cssText="position:absolute;visibility:hidden;pointer-events:none;left:0;top:0;width:0;height:0;",Kt(e));const n=()=>{const o=e.naturalWidth,n=e.naturalHeight;o&&n&&(i&&e.remove(),clearInterval(r),t({width:o,height:n}))};e.onerror=e=>{clearInterval(r),o(e)};const r=setInterval(n,1);n()})),to=e=>new Promise(((t,o)=>{const i=()=>{t({width:e.videoWidth,height:e.videoHeight})};if(e.readyState>=1)return i();e.onloadedmetadata=i,e.onerror=()=>o(e.error)})),oo=e=>/^image/.test(e.type),io=e=>new Promise((t=>{const o=m(e)?e:URL.createObjectURL(e),i=()=>{const e=new Image;e.src=o,t(e)};if(e instanceof Blob&&oo(e))return i();const n=document.createElement("video");n.preload="metadata",n.onloadedmetadata=()=>t(n),n.onerror=i,n.src=o})),no=e=>"VIDEO"===e.nodeName,ro=async e=>{let t,o;t=e.src?e:await io(e);try{o=no(t)?await to(t):await eo(t)}finally{Ut(e)&&URL.revokeObjectURL(t.src)}return o};var ao=async e=>{const t=await ro(e),o=await(e=>new Promise(((t,o)=>{if(e.complete)return t(e);e.onload=()=>t(e),e.onerror=()=>o(new Error("Failed to load image"))})))(e),i=$("canvas",t);i.getContext("2d",{willReadFrequently:!0}).drawImage(o,0,0);const n=await _(i);return Z(n,Zt(o.src))},so=(e=0,t=!0)=>new(n("ProgressEvent"))("progress",{loaded:100*e,total:100,lengthComputable:t}),lo=(e,t,o=(e=>e))=>e.getAllResponseHeaders().indexOf(t)>=0?o(e.getResponseHeader(t)):void 0,co=e=>{if(!e)return null;const t=e.split(/filename=|filename\*=.+''/).splice(1).map((e=>e.trim().replace(/^["']|[;"']{0,2}$/g,""))).filter((e=>e.length));return t.length?decodeURI(t[t.length-1]):null};const uo="URL_REQUEST";class po extends Error{constructor(e,t,o){super(e),this.name="EditorError",this.code=t,this.metadata=o}}var ho=(e,t)=>{const{headers:o={},credentials:i}=t||{};Object.entries(o).forEach((([t,o])=>e.setRequestHeader(t,o))),i&&(e.withCredentials="omit"!==i)},mo=(e,t,o)=>/^data:/.test(e)?(async(e,t="data-uri",o=r)=>{o(so(0));const i=await fetch(e);o(so(.33));const n=await i.blob();let a;oo(n)||(a="image/"+(e.includes(",/9j/")?"jpeg":"png")),o(so(.66));const s=Z(n,t,a);return o(so(1)),s})(e,void 0,t):((e,t,o)=>new Promise(((i,n)=>{const r=()=>n(new po("Error fetching image",uo,a)),a=new XMLHttpRequest;a.onprogress=t,a.onerror=r,a.onload=()=>{if(!a.response||a.status>=300||a.status<200)return r();const t=lo(a,"Content-Type"),o=lo(a,"Content-Disposition",co)||Zt(e);i(Z(a.response,o,t||G(o)))};const{willRequest:s}=o;Promise.resolve(s&&s(e,{resourceType:"image"})).then((t=>{if(!1===t)return n("Image load rejected");a.open("GET",e,!0),ho(a,t),a.responseType="blob",a.send()})).catch(console.error)})))(e,t,o),go=e=>e instanceof Blob&&!(e instanceof File),$o=e=>"close"in e,fo=async(e,t,o)=>{if(Ut(e)||go(e))return e;if(m(e))return await mo(e,t,o);if(jt(e,"canvas"))return await Gt(e);if(jt(e,"img"))return await ao(e);if(b(e)||$o(e))return await Gt(await k(e));throw new po("Invalid image source","invalid-image-source")};let yo=null;var bo=()=>(null===yo&&(yo=d()&&/^mac/i.test(navigator.platform)),yo);let xo=null;var vo=()=>(null===xo&&(xo=d()&&(x(/iPhone|iPad|iPod/)||bo()&&navigator.maxTouchPoints>=1)),xo),wo=async(e,t=1)=>await p()||vo()||t<5?e:Ne(e.height,e.width),So=e=>/jpeg/.test(e.type),ko=e=>{return"object"!=typeof(t=e)||t.constructor!=Object?e:JSON.stringify(e);var t},Co=(e,t=0,o)=>(0===t||(e.translate(o.x,o.y),e.rotate(t),e.translate(-o.x,-o.y)),e),To=(e,t,o)=>(e.scale(t,o),e),Mo=async(e,t={})=>{const{flipX:o,flipY:i,rotation:n,crop:r}=t,a=Be(e),s=o||i,l=!!n,c=r&&(r.x||r.y||r.width||r.height),d=c&>(r,ot(a)),u=c&&!d;if(!s&&!l&&!u)return e;let p,h=$("canvas",{width:e.width,height:e.height});if(h.getContext("2d",{willReadFrequently:!0}).putImageData(e,0,0),s){const e=$("canvas",{width:h.width,height:h.height}).getContext("2d",{willReadFrequently:!0});To(e,o?-1:1,i?-1:1),e.drawImage(h,o?-h.width:0,i?-h.height:0),e.restore(),y(h),h=e.canvas}if(l){const e=Xe(We(rt(bt(nt(h),n))),Math.floor),t=$("canvas",{width:r.width,height:r.height}).getContext("2d",{willReadFrequently:!0});((e,t,o)=>{e.translate(t,o)})(t,-r.x,-r.y),Co(t,n,Ue(e)),t.drawImage(h,.5*(e.width-h.width),.5*(e.height-h.height)),t.restore(),y(h),h=t.canvas}else if(u){return p=h.getContext("2d",{willReadFrequently:!0}).getImageData(r.x,r.y,r.width,r.height),y(h),p}return p=h.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,h.width,h.height),y(h),p},Po=(e,t)=>{const{imageData:o,width:i,height:n}=e,r=o.width,a=o.height,s=Math.round(i),l=Math.round(n),c=o.data,d=new Uint8ClampedArray(s*l*4),u=r/s,p=a/l,h=Math.ceil(.5*u),m=Math.ceil(.5*p);for(let e=0;e<l;e++)for(let t=0;t<s;t++){const o=4*(t+e*s);let i=0,n=0,a=0,l=0,g=0,$=0,f=0;const y=(e+.5)*p;for(let o=Math.floor(e*p);o<(e+1)*p;o++){const e=Math.abs(y-(o+.5))/m,s=(t+.5)*u,d=e*e;for(let e=Math.floor(t*u);e<(t+1)*u;e++){let t=Math.abs(s-(e+.5))/h;const u=Math.sqrt(d+t*t);if(u<-1||u>1)continue;if(i=2*u*u*u-3*u*u+1,i<=0)continue;t=4*(e+o*r);const p=c[t+3];f+=i*p,a+=i,p<255&&(i=i*p/250),l+=i*c[t],g+=i*c[t+1],$+=i*c[t+2],n+=i}}d[o]=l/n,d[o+1]=g/n,d[o+2]=$/n,d[o+3]=f/a}t(null,{data:d,width:s,height:l})},Ro=e=>{if(e instanceof ImageData)return e;let t;try{t=new ImageData(e.width,e.height)}catch(o){t=$("canvas").getContext("2d").createImageData(e.width,e.height)}return t.data.set(e.data),t},Io=async(e,t={},o)=>{const{width:i,height:n,fit:r,upscale:a}=t;if(!i&&!n)return e;let s=i,l=n;if(i?n||(l=i):s=n,"force"!==r){const t=s/e.width,o=l/e.height;let i=1;if("cover"===r?i=Math.max(t,o):"contain"===r&&(i=Math.min(t,o)),i>1&&!1===a)return e;s=Math.round(e.width*i),l=Math.round(e.height*i)}return s=Math.max(s,1),l=Math.max(l,1),e.width===s&&e.height===l?e:o?o(e,s,l):(e=await z(Po,[{imageData:e,width:s,height:l}],[e.data.buffer]),Ro(e))},Eo=(e,t)=>{const{imageData:o,matrix:i}=e;if(!i)return t(null,o);const n=o.data,r=n.length,a=i[0],s=i[1],l=i[2],c=i[3],d=i[4],u=i[5],p=i[6],h=i[7],m=i[8],g=i[9],$=i[10],f=i[11],y=i[12],b=i[13],x=i[14],v=i[15],w=i[16],S=i[17],k=i[18],C=i[19];let T=0,M=0,P=0,R=0,I=0,E=0,A=0,L=0,F=0,z=0,D=0,O=0;for(;T<r;T+=4)M=n[T]/255,P=n[T+1]/255,R=n[T+2]/255,I=n[T+3]/255,E=M*a+P*s+R*l+I*c+d,A=M*u+P*p+R*h+I*m+g,L=M*$+P*f+R*y+I*b+x,F=M*v+P*w+R*S+I*k+C,z=Math.max(0,E*F)+(1-F),D=Math.max(0,A*F)+(1-F),O=Math.max(0,L*F)+(1-F),n[T]=255*Math.max(0,Math.min(1,z)),n[T+1]=255*Math.max(0,Math.min(1,D)),n[T+2]=255*Math.max(0,Math.min(1,O)),n[T+3]=255*I;t(null,{data:n,width:o.width,height:o.height})},Ao=(e,t)=>{const{imageData:o,matrix:i}=e;if(!i)return t(null,o);let n=i.reduce(((e,t)=>e+t));n=n<=0?1:n;const r=o.width,a=o.height,s=o.data;let l=0,c=0,d=0;const u=Math.round(Math.sqrt(i.length)),p=Math.floor(u/2);let h=0,m=0,g=0,$=0,f=0,y=0,b=0,x=0,v=0,w=0;const S=new Uint8ClampedArray(r*a*4);for(d=0;d<a;d++)for(c=0;c<r;c++){for(h=0,m=0,g=0,$=0,y=0;y<u;y++)for(f=0;f<u;f++)b=d+y-p,x=c+f-p,b<0&&(b=a-1),b>=a&&(b=0),x<0&&(x=r-1),x>=r&&(x=0),v=4*(b*r+x),w=i[y*u+f],h+=s[v]*w,m+=s[v+1]*w,g+=s[v+2]*w,$+=s[v+3]*w;S[l]=h/n,S[l+1]=m/n,S[l+2]=g/n,S[l+3]=$/n,l+=4}t(null,{data:S,width:r,height:a})},Lo=(e,t)=>{let{imageData:o,strength:i}=e;if(!i)return t(null,o);const n=o.width,r=o.height,a=o.data,s=(e,t)=>(l=e-v,c=t-w,Math.sqrt(l*l+c*c));let l,c,d,u,p,h,m,g,$,f,y,b=0,x=0,v=.5*n,w=.5*r,S=s(0,0);for(i>0?(d=0,u=0,p=0):(i=Math.abs(i),d=1,u=1,p=1),x=0;x<r;x++)for(b=0;b<n;b++)k=4*(b+x*n),C=a,T=a,M=s(b,x)*i/S,h=C[k]/255,m=C[k+1]/255,g=C[k+2]/255,$=C[k+3]/255,f=1-M,y=f*$+M,T[k]=(f*$*h+M*d)/y*255,T[k+1]=(f*$*m+M*u)/y*255,T[k+2]=(f*$*g+M*p)/y*255,T[k+3]=255*y;var k,C,T,M;t(null,{data:a,width:o.width,height:o.height})},Fo=(e,t)=>{const{imageData:o,level:i,monochrome:n=!1}=e;if(!i)return t(null,o);const r=o.data,a=r.length;let s,l,c,d=0;const u=()=>255*(2*Math.random()-1)*i,p=n?()=>{const e=u();return[e,e,e]}:()=>[u(),u(),u()];for(;d<a;d+=4)[s,l,c]=p(),r[d]=r[d]+s,r[d+1]=r[d+1]+l,r[d+2]=r[d+2]+c;t(null,{data:r,width:o.width,height:o.height})},zo=(e,t)=>{const{imageData:o,level:i}=e;if(!i)return t(null,o);const n=o.data,r=n.length;let a,s,l,c=0;for(;c<r;c+=4)a=n[c]/255,s=n[c+1]/255,l=n[c+2]/255,n[c]=255*Math.pow(a,i),n[c+1]=255*Math.pow(s,i),n[c+2]=255*Math.pow(l,i);t(null,{data:n,width:o.width,height:o.height})},Do=async(e,t={})=>{const{colorMatrix:o,convolutionMatrix:i,gamma:n,noise:r,vignette:a}=t,s=[];if(i&&s.push([Ao,{matrix:i.clarity}]),n>0&&s.push([zo,{level:1/n}]),o&&!(e=>{const t=e.length;let o;const i=t>=20?6:t>=16?5:3;for(let n=0;n<t;n++){if(o=e[n],1===o&&n%i!=0)return!1;if(0!==o&&1!==o)return!1}return!0})(o)&&s.push([Eo,{matrix:o}]),(r>0||r<0)&&s.push([Fo,{level:r}]),(a>0||a<0)&&s.push([Lo,{strength:a}]),!s.length)return e;const l=(e,t)=>`(err, imageData) => {\n (${e[t][0].toString()})(Object.assign({ imageData: imageData }, filterInstructions[${t}]), \n ${e[t+1]?l(e,t+1):"done"})\n }`,c=`function (options, done) {\n const filterInstructions = options.filterInstructions;\n const imageData = options.imageData;\n (${l(s,0)})(null, imageData)\n }`;return e=await z(c,[{imageData:e,filterInstructions:s.map((e=>e[1]))}],[e.data.buffer]),Ro(e)},Oo=e=>"number"==typeof e,Bo=e=>m(e)&&null!==e.match(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|\ud83c[\ude32-\ude3a]|\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/g),Wo=(e,t)=>e.hasOwnProperty(t),_o=e=>Array.isArray(e);let Vo=64,No=102,Ho=112,jo=!1;var Uo=(e,t)=>(!jo&&d()&&(/^win/i.test(navigator.platform)&&(No=103),(vo()||bo())&&(Vo=63.5,No=110,Ho=123),jo=!0),`<svg${t?` aria-label="${t}"`:""} width="128" height="128" viewBox="0 0 128 128" preserveAspectRatio="xMinYMin meet" xmlns="http://www.w3.org/2000/svg"><text x="${Vo}" y="${No}" alignment-baseline="text-top" dominant-baseline="text-top" text-anchor="middle" font-size="${Ho}px">${e}</text></svg>`),Go=e=>e instanceof Blob,Zo=(e,t)=>e/t*100+"%",Xo=e=>`rgba(${Math.round(255*e[0])}, ${Math.round(255*e[1])}, ${Math.round(255*e[2])}, ${Oo(e[3])?e[3]:1})`,Yo=e=>Object.values(e).join("_");const qo=async(e,t=0)=>{const o=$("canvas",{width:80,height:80}).getContext("2d");return await((e=0)=>new Promise((t=>{setTimeout(t,e)})))(t),o.drawImage(e,0,0,80,80),!((e=>!new Uint32Array(e.getImageData(0,0,e.canvas.width,e.canvas.height).data.buffer).some((e=>0!==e)))(o)&&t<=256)||await qo(e,t+16)},Ko=new Map;var Jo=e=>new Promise(((t,o)=>{const i=new FileReader;i.onerror=()=>o(i.error),i.onload=()=>t(i.result),i.readAsDataURL(e)})),Qo=()=>{let e=[];return{sub:(t,o)=>(e.push({event:t,callback:o}),()=>e=e.filter((e=>e.event!==t||e.callback!==o))),pub:(t,o)=>{e.filter((e=>e.event===t)).forEach((e=>e.callback(o)))}}};const ei=32,ti=({color:e=[0,0,0],fontSize:t=16,fontFamily:o="sans-serif",fontVariant:i="normal",fontWeight:n="normal",fontStyle:r="normal",textAlign:a="left",letterSpacing:s="normal",lineHeight:l=20},c=1)=>`font-size:${t*c}px;font-style:${r};font-weight:${n};font-family:${o};font-variant:${i};line-height:${l*c}px;text-align:${a};letter-spacing:${Oo(s)?s+"px":"normal"};color:${Xo(e)};`,oi=(e,t,o=1)=>{const{width:i,height:n,disableNewline:r}=t,a=!i,s=!1===r?((e="")=>e.split("\n").length)(e):void 0,l=a?"normal":"break-word",c=a&&!s?"nowrap":"pre-line";return`max-width:none;min-width:auto;width:${a?"auto":i*o+"px"};height:${n?n*o+"px":"auto"};margin-top:0;margin-bottom:0;padding-top:${(({fontSize:e=16,lineHeight:t=20}={})=>.5*Math.max(0,e-t))(t)*o}px;word-break:${l};word-wrap:normal;white-space:${c};`},ii=new Map,ni=e=>{const t=[];for(const o of Array.from(e.childNodes))o.nodeType===Node.TEXT_NODE?t.push(ai(o)):t.push(...ni(o));return t},ri="pointer-events:none;visibility:hidden;position:absolute;left:0;top:0;",ai=e=>{const t=e.nodeValue;if(!t)return[];const o=t.length,i=document.createRange();i.selectNodeContents(e);const n=[];for(let r=0;r<o;r++){i.setStart(e,0),i.setEnd(e,r+1);const o=i.getClientRects().length-1,a=t.charAt(r);n[o]?n[o]+=a:n.push(a)}const r=i.getClientRects();return n.map(((e,t)=>({rect:r[t],text:e})))},si=new Map,li=(e="",t)=>{const{width:o=0,height:i=0}=t;if(o&&i)return Ne(o,i);let{fontSize:n=16,fontFamily:r,lineHeight:a=20,fontWeight:s,fontStyle:l,fontVariant:c,letterSpacing:d}=t;const u=Yo({text:e,fontFamily:r,fontWeight:s,fontStyle:l,fontVariant:c,fontSize:n,letterSpacing:d,lineHeight:a,width:o});let p=si.get(u);if(p)return p;let h=1;n>1e3&&O()&&(h=n/1e3,n=1e3,a/=h);const m=Kt($("pre",{contenteditable:"true",spellcheck:"false",style:`${ri}${ti({...t,fontSize:n,lineHeight:a})};${oi(e,t)}"`,innerHTML:e})).getBoundingClientRect();return p=Be(m),p=Xe(p,(e=>e*h)),o&&(p.width=o),si.set(u,p),p},ci=new Map,di=(e,t)=>new Promise(((o,i)=>{let n=ci.get(e);void 0===n&&(n=((e,t)=>{const{sub:o,pub:i}=Qo();let n,r;return Promise.resolve(t&&t(e,{resourceType:"stylesheet"})).then((t=>{if(!1===t)return r="requestPrevented",i("error",r);const{headers:o,credentials:a}=t||{};fetch(e,{headers:o,credentials:a}).then((e=>e.text())).then((e=>{n=e,i("load",n)})).catch((e=>{r=e,i("error",r)}))})),{sub:(e,t)=>"load"===e&&n?t(n):"error"===e&&r?t(r):void o(e,t)}})(e,t),ci.set(e,n)),n.sub("load",o),n.sub("error",i)})),ui=async(e,t,o)=>{let i;try{i=await di(e,t)}catch(e){return[]}const n={innerHTML:i,id:L()};o&&(n.nonce=o);const r=$("style",n);document.head.append(r);const a=Array.from(document.styleSheets).find((e=>e.ownerNode.id===r.id));return r.remove(),Array.from(a.cssRules)},pi=new Map,hi=async(e,t,o)=>{if(pi.has(e.href))return pi.get(e.href);let i;try{i=Array.from(e.cssRules);for(const e of(e=>e.filter((e=>e instanceof CSSImportRule)))(i)){const n=e.href;if(pi.has(n)){const e=pi.get(n);i=[...i,...e];continue}const r=await ui(n,t,o);pi.set(n,r),i=[...i,...r]}}catch(n){const r=e.href;i=await ui(r,t,o),pi.set(r,i)}return(e=>e.filter((e=>e instanceof CSSFontFaceRule)))(i)},mi=(e,t)=>e.style.getPropertyValue(t),gi=(e,t)=>{if(!e.style)return!1;return mi(e,"font-family").replace(/^"|"$/g,"")==t},$i=async(e,t,o)=>{const i=((e,t)=>{const o=[];for(const i of e)gi(i,t)&&o.push(i);return o})(await(async(e,t)=>{const o=Array.from(document.styleSheets).map((o=>hi(o,e,t))),i=await Promise.all(o),n=[];return i.forEach((e=>n.push(...e))),n})(t,o),e);return i.length?i.map((e=>{const t=e.parentStyleSheet&&e.parentStyleSheet.href&&new URL(e.parentStyleSheet.href),o=t?t.origin+(e=>e.pathname.split("/").slice(0,-1).join("/"))(t)+"/":"",i=e.style.getPropertyValue("src").match(/url\("?(.*?)"?\)/)[1],n=Array.from(e.style).filter((e=>"src"!=e)).reduce(((t,o)=>t+=o+":"+mi(e,o)+";"),"");return[/^http/.test(i)?i:o+i,n]})):[]},fi=new Map,yi=new Map;var bi=async(e="",t)=>{if(!e.length)return;let{color:o,imageWidth:i=300,imageHeight:n=150,paddingTop:r=0,paddingRight:a=ei,paddingBottom:s=0,paddingLeft:l=ei,fontFamily:c,fontSize:d,pixelRatio:u=1,willRequest:p,outline:h,blur:m,styleNonce:g}=t,$=1,f="";d>1e3&&O()&&($=d/1e3,f=`transform-origin:0 0;transform:scale(${$})`);const y=u/$,b=(i+l+a)*u,x=(n+s+r)*u,v=await(async(e,t,o)=>{if(fi.get(e))return;let i=yi.get(e);if(!i){const r=await $i(e,t,o);if(!r.length)return void fi.set(e,!0);const a=[];for(const[e,t]of r){const o=await fetch(e).then((e=>e.blob())),i=!(n=o.type)||/woff2/.test(n)?"woff2":/woff/.test(n)?"woff":/ttf|truetype/.test(n)?"truetype":/otf|opentype/.test(n)?"opentype":/svg/.test(n)?"svg":"woff2",r=await Jo(o);a.push(`@font-face { src:url(${r}) format('${i}');${t};font-display:block; }`)}i=a.join(""),yi.set(e,i)}var n;return i})(c,p,g);let w="";v&&(w=`<style${g?` nonce="${g}"`:""}>${v}</style>`);const S=e.replace(/%/g,"%25").replace(/#/g,"%23").replace(/ /g," ").replace(/&(?!#\d{4};|[a-z]+;)/gi,"&").replace(/<br>|\n/g,"<br/>"),k=`top:${r*y}px;right:${a*y}px;bottom:${s*y}px;left:${l*y}px`;let C=o,T="",M="";if(h||m){const e=Xo(o);h&&(C=[0,0,0,0],T=`-webkit-text-stroke: ${2*h*y}px ${e}`),m&&(Qt()?M=`filter:blur(${m*y*.4}px)`:(C=[0,0,0,0],M=`text-shadow: 0 0 ${m*y}px ${e}`))}return((e,{safariCacheKey:t="*"}={})=>new Promise(((o,i)=>{const n=new Image;n.onerror=()=>i(new Error("Failed to load SVG")),n.onload=()=>{if(!Qt()||!e.includes("@font-face")||Ko.has(t))return o(n);qo(n).then((()=>{Ko.set(t,!0),o(n)}))},n.src="data:image/svg+xml,"+e})))(`<svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${x}" viewBox="0 0 ${b} ${x}"><foreignObject x="0" y="0" width="${b}" height="${x}"><div xmlns="http://www.w3.org/1999/xhtml">${w}<pre contenteditable="true" spellcheck="false" style="position:absolute;${k};${ti({...t,color:C,fontSize:d},y)};${oi(e,t,y)};${f};${T};${M}">${S}</pre></div></foreignObject></svg>`,{safariCacheKey:c})};const xi=e=>{const t={...e};return P(t)},vi=(e,t={})=>{const o=$t(e);let i,n;const r=t.width||t.rx,a=t.height||t.ry;if(r&&a)return Oe(t);if(r||a){i=parseFloat(r||Number.MAX_SAFE_INTEGER),n=parseFloat(a||Number.MAX_SAFE_INTEGER);const e=Math.min(i,n);m(r)||m(a)?(i=e+"%",n=e*o+"%"):(i=e,n=e)}else{const e=10;i=e+"%",n=e*o+"%"}return{[(t.width?"width":t.rx?"rx":void 0)||"width"]:i,[(t.width?"height":t.rx?"ry":void 0)||"height"]:n}},wi=(e,t={})=>{return{width:void 0,height:void 0,...t,aspectRatio:1,backgroundImage:(o=Uo(e),"data:image/svg+xml,"+o.replace("<","%3C").replace(">","%3E"))};var o},Si=(e,t={})=>({backgroundColor:[0,0,0,0],...Ei(t)?{}:{width:void 0,height:void 0,aspectRatio:void 0},...t,backgroundImage:m(e)?e:Go(e)?URL.createObjectURL(e):e}),ki=(e,t)=>{let o;if(m(e)||Go(e)){const i={...vi(t),backgroundSize:"contain"};o=Bo(e)?wi(e,i):Si(e,i)}else if(e.src){const i=vi(t,e.shape||e),n={...e.shape,...i};if(e.width&&e.height&&!Wo(n,"aspectRatio")){const e=kn(i,"width",t),o=kn(i,"height",t);n.aspectRatio=X(e,o)}n.backgroundSize||e.shape||e.width&&e.height||(n.backgroundSize="contain"),o=Bo(e.src)?wi(e.src,n):Si(e.src,n)}else e.shape&&(o=xi(e.shape));return Wo(o,"backgroundImage")&&(Wo(o,"backgroundColor")||(o.backgroundColor=[0,0,0,0]),Wo(o,"disableStyle")||(o.disableStyle=["cornerRadius","backgroundColor","strokeColor","strokeWidth"])),t?wn(o,t):o},Ci=e=>me(e.x1,e.y1),Ti=e=>me(e.x2,e.y2),Mi=e=>Wo(e,"text"),Pi=e=>Mi(e)&&!(Vi(e)||Wo(e,"width")),Ri=e=>Mi(e)&&(Vi(e)||Wo(e,"width")),Ii=e=>!Mi(e)&&Ni(e),Ei=e=>Wo(e,"rx"),Ai=e=>Wo(e,"x1"),Li=e=>Wo(e,"points"),Fi=e=>Mi(e)&&e.isEditing,zi=e=>!Wo(e,"opacity")||e.opacity>0,Di=e=>e.isSelected,Oi=e=>e.isEditing,Bi=e=>e._isDraft,Wi=e=>Wo(e,"width")&&Wo(e,"height"),_i=e=>{const t=Wo(e,"right"),o=Wo(e,"bottom");return t||o},Vi=e=>(Wo(e,"x")||Wo(e,"left"))&&Wo(e,"right")||(Wo(e,"y")||Wo(e,"top"))&&Wo(e,"bottom"),Ni=e=>Wi(e)||Vi(e),Hi=e=>(e._isDraft=!0,e),ji=e=>(e._isDraft=!1,e),Ui=(e,t)=>!0!==e.disableStyle&&(!_o(e.disableStyle)||!t||!e.disableStyle.includes(t)),Gi=e=>!0!==e.disableSelect,Zi=e=>!0!==e.disableRemove,Xi=e=>!0!==e.disableDuplicate&&tn(e),Yi=e=>!e.disableFlip&&(!Bi(e)&&!_i(e)&&(e=>Wo(e,"backgroundImage")||Wo(e,"text"))(e)),qi=(e,t)=>!!Mi(e)&&(!0!==e.disableInput&&(R(e.disableInput)?e.disableInput(null!=t?t:e.text):t||!0)),Ki=(e,t)=>!0!==e.disableTextLayout&&(!_o(e.disableTextLayout)||!t||!e.disableTextLayout.includes(t)),Ji=e=>Qi(e)&&e.points.length>3,Qi=e=>!!Li(e)&&(void 0!==e.disableAddPoints&&!0!==e.disableAddPoints),en=e=>!0!==e.disableManipulate&&!Bi(e)&&!_i(e),tn=e=>en(e)&&!0!==e.disableMove,on=e=>(delete e.left,delete e.right,delete e.top,delete e.bottom,e),nn=e=>(delete e.rotation,e),rn=e=>(e.strokeWidth=e.strokeWidth||1,e.strokeColor=e.strokeColor||[0,0,0],e),an=e=>(e.backgroundColor=e.backgroundColor?e.backgroundColor:e.strokeWidth||e.backgroundImage?void 0:[0,0,0],e),sn=e=>{let t=e.text;t=t.replace(/&(#[0-9]+|[a-z]+);/gi,((e,t)=>`___${t}___`)),t=t.replace(/&/,"&"),e.text=t.replace(/___(#[0-9]+|[a-z]+)___/gi,((e,t)=>`&${t};`))},ln=e=>{if(!e.textShadow)return e;const[t,o,i,n]=e.textShadow;return e.textShadowX=t,e.textShadowY=o,e.textShadowBlur=i,e.textShadowColor=n,delete e.textShadow,e},cn=e=>{if(!e.textOutline)return e;const[t,o]=e.textOutline;e.textOutlineWidth=t,e.textOutlineColor=o,delete e.textOutline},dn=e=>(e.fontSize=e.fontSize||"4%",e.fontFamily=e.fontFamily||"sans-serif",e.fontWeight=e.fontWeight||"normal",e.fontStyle=e.fontStyle||"normal",e.fontVariant=e.fontVariant||"normal",e.lineHeight=e.lineHeight||"120%",e.color=e.color||[0,0,0],e.format="html"===e.format?"html":"text",ln(e),cn(e),"html"===e.format?sn(e):(e=>{sn(e);let t=e.text;t=t.replace(/</g,">"),t=t.replace(/>/g,"<"),e.text=t})(e),Pi(e)?un(e):pn(e)),un=e=>(!1!==e.disableNewline&&(delete e.textAlign,e.text=e.text.replace(/\n/g," ")),on(e)),pn=e=>(e.textAlign=e.textAlign||"left",e),hn=e=>((e=>{m(e.id)||(e.id=L()),Wo(e,"rotation")||(e.rotation=0),Wo(e,"opacity")||(e.opacity=1),Wo(e,"disableErase")||(e.disableErase=!0)})(e),Mi(e)?dn(e):Ii(e)?(e=>{e.cornerRadius=e.cornerRadius||0,e.strokeWidth=e.strokeWidth||0,e.strokeColor=e.strokeColor||[0,0,0],an(e)})(e):Li(e)?(e=>{rn(e),nn(e),Wo(e,"pathClose")||(e.disableResize=!0,Wo(e,"disableMove")||(e.disableMove=!0)),on(e)})(e):Ai(e)?(e=>{rn(e),e.lineStart=e.lineStart||void 0,e.lineEnd=e.lineEnd||void 0,nn(e),on(e)})(e):Ei(e)&&(e=>{e.strokeWidth=e.strokeWidth||0,e.strokeColor=e.strokeColor||[0,0,0],an(e)})(e),e),mn=e=>Mi(e)?"text":Ii(e)?"rectangle":Li(e)?"path":Ai(e)?"line":Ei(e)?"ellipse":void 0,gn=(e,t)=>parseFloat(e)/100*t,$n=new RegExp(/^x|left|right|^width|rx|fontSize|eraseRadius|feather|cornerRadius|strokeWidth|strokeDash/,"i"),fn=new RegExp(/^y|top|bottom|^height|ry/,"i"),yn=(e,t,{width:o,height:i})=>{if(Array.isArray(t))return t.map((t=>(T(t)&&vn(t,{width:o,height:i}),m(t)&&(t=yn(e,t,{width:o,height:i})),t)));if("string"!=typeof t)return t;if(!t.endsWith("%"))return t;const n=parseFloat(t)/100;return $n.test(e)?de(o*n,6):fn.test(e)?de(i*n,6):t},bn=yn,xn=["lineHeight","textOutlineWidth","textShadowX","textShadowY","textShadowBlur"],vn=(e,t)=>{Object.entries(e).map((([o,i])=>{e[o]=yn(o,i,t)})),e.text&&xn.filter((t=>m(e[t]))).forEach((t=>{var o,i;e[t]=(o=e[t],i=e.fontSize,Math.round(i*(parseFloat(o)/100)))}))},wn=(e,t)=>(vn(e,t),Rn(e,t),e),Sn=(e,t)=>{let o;return/^x|width|rx|fontSize|strokeWidth|cornerRadius/.test(e)?o=t.width:/^y|height|ry/.test(e)&&(o=t.height),o},kn=(e,t,o)=>Array.isArray(e[t])?e[t].map((e=>Object.entries(e).reduce(((e,[t,i])=>(e[t]=m(i)?gn(i,Sn(t,o)):i,e)),{}))):m(e[t])?gn(e[t],Sn(t,o)):e[t],Cn=(e,t,o)=>t.reduce(((t,i)=>{const n=kn(e,i,o);return t[i]=n,t}),{}),Tn=(e,t,o)=>(Object.keys(t).forEach((i=>((e,t,o,i)=>{if(!m(e[t]))return e[t]=o,e;const n=Sn(t,i);return e[t]=void 0===n?o:Zo(o,n),e})(e,i,t[i],o))),e),Mn=(e,t)=>{const o=e.filter((e=>e.x<0||e.y<0||e.x1<0||e.y1<0)).reduce(((e,t)=>{const[o,i,n,r]=(e=>{const t=tt(),o=e.strokeWidth||0;if(Ii(e))t.x=e.x-.5*o,t.y=e.y-.5*o,t.width=e.width+o,t.height=e.height+o;else if(Ai(e)){const{x1:i,y1:n,x2:r,y2:a}=e,s=Math.abs(Math.min(i,r)),l=Math.abs(Math.max(i,r)),c=Math.abs(Math.min(n,a)),d=Math.abs(Math.min(n,a));t.x=s+.5*o,t.y=l+.5*o,t.width=l-s+o,t.height=d-c+o}else Ei(e)&&(t.x=e.x-e.rx+.5*o,t.y=e.y-e.ry+.5*o,t.width=2*e.rx+o,t.height=2*e.ry+o);return t&&Wo(e,"rotation")&&bt(t,e.rotation),kt(t)})(t);return e.top=Math.min(o,e.top),e.left=Math.min(r,e.left),e.bottom=Math.max(n,e.bottom),e.right=Math.max(i,e.right),e}),{top:0,right:0,bottom:0,left:0});return o.right>0&&(o.right-=t.width),o.bottom>0&&(o.bottom-=t.height),o},Pn=(e,t,o)=>{const i=xi(e);wn(i,t);const n=o(i);return Array.isArray(n)?n:[n]},Rn=(e,t)=>{if(Wo(e,"left")&&(e.x=e.left),Wo(e,"right")&&!m(e.right)){const o=t.width-e.right;Wo(e,"left")?(e.x=e.left,e.width=Math.max(0,o-e.left)):Wo(e,"width")&&(e.x=o-e.width)}if(Wo(e,"top")&&(e.y=e.top),Wo(e,"bottom")&&!m(e.bottom)){const o=t.height-e.bottom;Wo(e,"top")?(e.y=e.top,e.height=Math.max(0,o-e.top)):Wo(e,"height")&&(e.y=o-e.height)}return e},In=(e,t)=>(Li(e)&&e.points.filter((e=>Oo(e.x))).forEach((e=>{e.x*=t,e.y*=t})),Ai(e)&&Oo(e.x1)&&(e.x1*=t,e.y1*=t,e.x2*=t,e.y2*=t),Oo(e.x)&&Oo(e.y)&&(e.x*=t,e.y*=t),Oo(e.width)&&Oo(e.height)&&(e.width*=t,e.height*=t),Oo(e.rx)&&Oo(e.ry)&&(e.rx*=t,e.ry*=t),(e=>Oo(e.strokeWidth)&&e.strokeWidth>0)(e)&&(e.strokeWidth*=t),Mi(e)&&(e._scale=t,Oo(e.fontSize)&&(e.fontSize*=t),Oo(e.lineHeight)&&(e.lineHeight*=t),Oo(e.width)&&!Oo(e.height)&&(e.width*=t)),Wo(e,"cornerRadius")&&Oo(e.cornerRadius)&&(e.cornerRadius*=t),e),En=e=>{if(Ii(e))return me(e.x+.5*e.width,e.y+.5*e.height);if(Ei(e))return me(e.x,e.y);if(e.text){if(Ri(e)){const t=e.height||li(e.text,e).height;return me(e.x+.5*e.width,e.y+.5*t)}const t=li(e.text,e);return me(e.x+.5*t.width,e.y+.5*t.height)}return Li(e)?Le(e.points):Ai(e)?Le([Ci(e),Ti(e)]):void 0};var An=e=>/canvas/i.test(e.nodeName),Ln=(e,t)=>new Promise(((o,i)=>{let n=e,r=!1;const a=()=>{r||(r=!0,R(t)&&Promise.resolve().then((()=>t(Ne(n.naturalWidth,n.naturalHeight)))))};if(n.src||(n=new Image,m(e)&&new URL(e,location.href).origin!==location.origin&&(n.crossOrigin="anonymous"),n.src=m(e)?e:URL.createObjectURL(e)),n.complete)return a(),o(n);R(t)&&eo(n).then(a).catch(i),n.onload=()=>{a(),o(n)},n.onerror=()=>i(new Error("Failed to load image"))}));const Fn=new Map([]),zn=(e,t={})=>new Promise(((o,i)=>{const{onMetadata:n=r,onLoad:a=o,onError:s=i,onComplete:l=r}=t;let c=Fn.get(e);if(c||(c={loading:!1,complete:!1,error:!1,image:void 0,size:void 0,bus:Qo()},Fn.set(e,c)),c.bus.sub("meta",n),c.bus.sub("load",a),c.bus.sub("error",s),c.bus.sub("complete",l),An(e)){const t=e,o=t.cloneNode();c.complete=!0,c.image=o,c.size=Ve(t)}if(c.complete)return c.bus.pub("meta",{size:c.size}),c.error?c.bus.pub("error",c.error):c.bus.pub("load",c.image),c.bus.pub("complete"),void(c.bus=Qo());c.loading||(c.loading=!0,Ln(e,(e=>{c.size=e,c.bus.pub("meta",{size:e})})).then((e=>{c.image=e,c.bus.pub("load",e)})).catch((e=>{c.error=e,c.bus.pub("error",e)})).finally((()=>{c.complete=!0,c.loading=!1,c.bus.pub("complete"),c.bus=Qo()})))})),Dn=(e,t,o,i)=>e.drawImage(t,o.x,o.x,o.width,o.height,i.x,i.y,i.width,i.height);var On=async(e,t,o,i,n=Dn,r)=>{e.save(),e.clip(),await n(e,t,o,i,r),e.restore()};const Bn=(e,t,o,i,n)=>{const r=et(e);if(i){const e=Tt(rt(i),de);return e.x*=o.width,e.width*=o.width,e.y*=o.height,e.height*=o.height,{srcRect:e,destRect:r}}const a=lt(0,0,o.width,o.height);if("contain"===t){const t=St(e,$t(a));r.width=t.width,r.height=t.height,n?(r.x+=n.x,r.y+=n.y):(r.x+=t.x,r.y+=t.y)}else if("cover"===t){const e=wt(r,a.width/a.height);r.width=e.width,r.height=e.height,n?(r.x+=n.x,r.y+=n.y):(r.x+=e.x,r.y+=e.y)}else t?(r.width=t.width,r.height=t.height,n&&(r.x+=n.x,r.y+=n.y)):n&&(r.width=o.width,r.height=o.height,r.x+=n.x,r.y+=n.y);return{srcRect:a,destRect:r}},Wn=(e,t)=>(t.cornerRadius>0?((e,t,o,i,n,r)=>{i<2*r&&(r=i/2),n<2*r&&(r=n/2),e.beginPath(),e.moveTo(t+r,o),e.arcTo(t+i,o,t+i,o+n,r),e.arcTo(t+i,o+n,t,o+n,r),e.arcTo(t,o+n,t,o,r),e.arcTo(t,o,t+i,o,r),e.closePath()})(e,t.x,t.y,t.width,t.height,t.cornerRadius):e.rect(t.x,t.y,t.width,t.height),e),_n=(e,t)=>(t.backgroundColor&&e.fill(),e),Vn=(e,t)=>(t.strokeWidth&&e.stroke(),e);var Nn=async(e,t,o={})=>{const{drawImage:i}=o;if(e.lineWidth=t.strokeWidth?t.strokeWidth:1,e.strokeStyle=t.strokeColor?Xo(t.strokeColor):"none",e.fillStyle=t.backgroundColor?Xo(t.backgroundColor):"none",e.globalAlpha=t.opacity,t.backgroundImage){let o;if(o=An(t.backgroundImage)?t.backgroundImage:await zn(t.backgroundImage),Wn(e,t),_n(e,t),"repeat"===t.backgroundRepeat){const n=t.backgroundPosition||{x:0,y:0},{srcRect:r,destRect:a}=Bn(t,t.backgroundSize||Ve(o),Ve(o),t.backgroundCorners,{x:0,y:0}),s=document.createElement("canvas");s.width=a.width,s.height=a.height;const l=s.getContext("2d",{willReadFrequently:!1,desynchronized:!0});await i(l,o,r,{...a,x:0,y:0});const c=e.createPattern(s,"repeat");e.fillStyle=c,e.save(),e.beginPath(),e.rect(t.x+n.x,t.y+n.y,t.width-n.x,t.height-n.y),e.clip(),e.translate(a.x+n.x,a.y+n.y),e.fill(),y(s),e.restore()}else{const{srcRect:n,destRect:r}=Bn(t,t.backgroundSize,Ve(o),t.backgroundCorners,t.backgroundPosition);await On(e,o,n,r,i,{feather:t.feather})}return e.beginPath(),Wn(e,t),Vn(e,t),[]}return Wn(e,t),_n(e,t),Vn(e,t),[]},Hn=async(e,t,o={})=>new Promise((async(i,n)=>{const{drawImage:r}=o;if(e.lineWidth=t.strokeWidth||1,e.strokeStyle=t.strokeColor?Xo(t.strokeColor):"none",e.fillStyle=t.backgroundColor?Xo(t.backgroundColor):"none",e.globalAlpha=t.opacity,e.ellipse(t.x,t.y,t.rx,t.ry,0,0,2*Math.PI),t.backgroundColor&&e.fill(),t.backgroundImage){let o;try{o=await zn(t.backgroundImage)}catch(e){n(e)}const a=lt(t.x-t.rx,t.y-t.ry,2*t.rx,2*t.ry),{srcRect:s,destRect:l}=Bn(a,t.backgroundSize,Ve(o),t.backgroundCorners,t.backgroundPosition);await On(e,o,s,l,r),t.strokeWidth&&e.stroke(),i([])}else t.strokeWidth&&e.stroke(),i([])})),jn=async(e,t,o)=>{const i=Oo(t.width)?Math.floor(t.width):void 0,n=Oo(t.height)?Math.floor(t.height):void 0,r=i&&n?Be(t):li(t.text,{...t,width:i,height:n}),a={x:t.x,y:t.y,width:r.width,height:r.height};if(Nn(e,{...t,...a,options:o}),!t.text.length)return[];const{textOutlineWidth:s=0,textShadowX:l=0,textShadowY:c=0,textShadowBlur:d=0,textShadowColor:u,outline:p,blur:h,...m}=t,g=!!t.height;if(g&&(e.rect(a.x,a.y,a.width,a.height),e.save(),e.clip()),l||c||d){e.save(),e.translate(l,c);const r={...a};g||(r.height+=ei+d),await Un(e,r,{...t,width:i,height:n},{...o,paddingLeft:ei+d,paddingRight:ei+d,paddingTop:d,paddingBottom:d+(g?-1*c:t.fontSize),shapeExtendedProps:{color:u,blur:d}}),e.restore()}if(s){const r={...a};g||(r.height+=ei+s),await Un(e,r,{...t,width:i,height:n},{...o,paddingLeft:ei+s,paddingRight:ei+s,paddingTop:s,paddingBottom:s+g?0:t.fontSize,shapeExtendedProps:{color:t.textOutlineColor,outline:s}})}return g&&e.restore(),await Un(e,a,{...m,width:i,height:n},{...o,paddingLeft:ei,paddingRight:ei,paddingTop:0,paddingBottom:g?0:t.fontSize}),[]};const Un=async(e,t,o,i)=>{const{willRequest:n,shapeExtendedProps:r,paddingLeft:a,paddingRight:s,paddingTop:l,paddingBottom:c,styleNonce:d}=i,u=Oo(o.width)?Math.floor(t.width):void 0,p=Oo(o.height)?Math.floor(t.height):void 0,h=Math.ceil(t.width),m=Math.ceil(t.height),g=await bi(o.text,{...o,...r,...t,width:u,height:p,paddingLeft:a,paddingRight:s,paddingTop:l,paddingBottom:c,imageWidth:h,imageHeight:m,willRequest:n,styleNonce:d});e.drawImage(g,o.x-a,o.y-l,g.width,g.height)};var Gn=async(e,t)=>new Promise((async o=>{e.lineWidth=t.strokeWidth||1,e.strokeStyle=t.strokeColor?Xo(t.strokeColor):"none",e.globalAlpha=t.opacity,t.bitmap&&(e.lineCap=t.strokeCap,e.lineJoin=t.strokeJoin,e.setLineDash(t.strokeDash||[]));let i=Ci(t),n=Ti(t);e.moveTo(i.x,i.y),e.lineTo(n.x,n.y),t.strokeWidth&&e.stroke(),o([])})),Zn=async(e,t)=>new Promise(((o,i)=>{if(t.bitmap&&1===t.points.length)return void Hn(e,{x:t.points[0].x,y:t.points[0].y,rx:.5*t.strokeWidth,ry:.5*t.strokeWidth,backgroundColor:t.strokeColor}).then((()=>o([])));e.lineWidth=t.strokeWidth||1,e.strokeStyle=t.strokeColor?Xo(t.strokeColor):"none",e.fillStyle=t.backgroundColor?Xo(t.backgroundColor):"none",e.globalAlpha=t.opacity;const{points:n}=t;t.bitmap&&(e.lineCap=t.strokeCap,e.lineJoin=t.strokeJoin,e.setLineDash(t.strokeDash||[])),t.pathClose&&e.beginPath(),e.moveTo(n[0].x,n[0].y);const r=n.length;for(let t=1;t<r;t++)e.lineTo(n[t].x,n[t].y);t.pathClose&&e.closePath(),t.strokeWidth&&e.stroke(),t.backgroundColor&&e.fill(),o([])})),Xn=(e,t,o,i)=>t||o?(e.translate(i.x,i.y),e.scale(t?-1:1,o?-1:1),e.translate(-i.x,-i.y),e):e;const Yn=async(e,t,o)=>{e.globalCompositeOperation="subtract"===t.drawMode?"destination-out":"source-over";const i=En(t);let n;if(Co(e,t.rotation,i),Xn(e,t.flipX,t.flipY,i),Ii(t)?n=Nn:Ei(t)?n=Hn:Ai(t)?n=Gn:Li(t)?n=Zn:Mi(t)&&(n=jn),n){const i=await n(e,t,o);if(!i.length)return[];return[t,...await qn(e,i,o)]}return[]};var qn=async(e,t,o)=>{let i=[];for(const n of t)e.save(),e.beginPath(),i=[...i,...await Yn(e,n,o)],e.restore();return i},Kn=async(e,t={})=>{const{shapes:o=[],contextBounds:i=e,transform:n=r,drawImage:a,willRequest:s,styleNonce:l,canvasMemoryLimit:c,computeShape:d=Y,preprocessShape:u=Y}=t;if(!o.length)return e;const p=$("canvas");p.width=i.width,p.height=i.height;const h=p.getContext("2d",{willReadFrequently:!0});h.putImageData(e,i.x||0,i.y||0);const m=o.map(xi).map(d).map(u).flat().filter(Boolean);n(h),await qn(h,m,{drawImage:a,canvasMemoryLimit:c,willRequest:s,styleNonce:l});const g=h.getImageData(0,0,p.width,p.height);return y(p),g},Jn=async(e,t={})=>{const{backgroundColor:o,backgroundImage:i}=t,n=!(!o||o&&0===o[3]);if(!i&&!n)return e;const r=$("canvas");r.width=e.width,r.height=e.height;const a=r.getContext("2d",{willReadFrequently:!0});if(a.putImageData(e,0,0),a.globalCompositeOperation="destination-over",n&&(a.fillStyle=Xo(o),a.fillRect(0,0,r.width,r.height)),i){let t;t=An(i)?i:await zn(i);const{srcRect:o,destRect:n}=Bn({x:0,y:0,width:e.width,height:e.height},"cover",{width:t.width,height:t.height});a.drawImage(t,o.x,o.y,o.width,o.height,n.x,n.y,n.width,n.height)}const s=a.getImageData(0,0,r.width,r.height);return y(r),s},Qn=e=>e.length?e.reduce(((e,t)=>((e,t)=>{const o=new Array(20);return o[0]=e[0]*t[0]+e[1]*t[5]+e[2]*t[10]+e[3]*t[15],o[1]=e[0]*t[1]+e[1]*t[6]+e[2]*t[11]+e[3]*t[16],o[2]=e[0]*t[2]+e[1]*t[7]+e[2]*t[12]+e[3]*t[17],o[3]=e[0]*t[3]+e[1]*t[8]+e[2]*t[13]+e[3]*t[18],o[4]=e[0]*t[4]+e[1]*t[9]+e[2]*t[14]+e[3]*t[19]+e[4],o[5]=e[5]*t[0]+e[6]*t[5]+e[7]*t[10]+e[8]*t[15],o[6]=e[5]*t[1]+e[6]*t[6]+e[7]*t[11]+e[8]*t[16],o[7]=e[5]*t[2]+e[6]*t[7]+e[7]*t[12]+e[8]*t[17],o[8]=e[5]*t[3]+e[6]*t[8]+e[7]*t[13]+e[8]*t[18],o[9]=e[5]*t[4]+e[6]*t[9]+e[7]*t[14]+e[8]*t[19]+e[9],o[10]=e[10]*t[0]+e[11]*t[5]+e[12]*t[10]+e[13]*t[15],o[11]=e[10]*t[1]+e[11]*t[6]+e[12]*t[11]+e[13]*t[16],o[12]=e[10]*t[2]+e[11]*t[7]+e[12]*t[12]+e[13]*t[17],o[13]=e[10]*t[3]+e[11]*t[8]+e[12]*t[13]+e[13]*t[18],o[14]=e[10]*t[4]+e[11]*t[9]+e[12]*t[14]+e[13]*t[19]+e[14],o[15]=e[15]*t[0]+e[16]*t[5]+e[17]*t[10]+e[18]*t[15],o[16]=e[15]*t[1]+e[16]*t[6]+e[17]*t[11]+e[18]*t[16],o[17]=e[15]*t[2]+e[16]*t[7]+e[17]*t[12]+e[18]*t[17],o[18]=e[15]*t[3]+e[16]*t[8]+e[17]*t[13]+e[18]*t[18],o[19]=e[15]*t[4]+e[16]*t[9]+e[17]*t[14]+e[18]*t[19]+e[19],o})([...e],t)),e.shift()):[],er=(e,t)=>{const o=e.width*e.height,i=t.reduce(((e,t)=>(t.width>e.width&&t.height>e.height&&(e.width=t.width,e.height=t.height),e)),{width:0,height:0}),n=i.width*i.height;return((e,t=2)=>Math.round(e*t)/t)(Math.max(.5,.5+(1-n/o)/2),5)};function tr(){}const or=e=>e;function ir(e,t){for(const o in t)e[o]=t[o];return e}function nr(e){return e()}function rr(){return Object.create(null)}function ar(e){e.forEach(nr)}function sr(e){return"function"==typeof e}function lr(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}let cr;function dr(e,t){return cr||(cr=document.createElement("a")),cr.href=t,e===cr.href}function ur(e,...t){if(null==e)return tr;const o=e.subscribe(...t);return o.unsubscribe?()=>o.unsubscribe():o}function pr(e){let t;return ur(e,(e=>t=e))(),t}function hr(e,t,o){e.$$.on_destroy.push(ur(t,o))}function mr(e,t,o,i){if(e){const n=gr(e,t,o,i);return e[0](n)}}function gr(e,t,o,i){return e[1]&&i?ir(o.ctx.slice(),e[1](i(t))):o.ctx}function $r(e,t,o,i){if(e[2]&&i){const n=e[2](i(o));if(void 0===t.dirty)return n;if("object"==typeof n){const e=[],o=Math.max(t.dirty.length,n.length);for(let i=0;i<o;i+=1)e[i]=t.dirty[i]|n[i];return e}return t.dirty|n}return t.dirty}function fr(e,t,o,i,n,r){if(n){const a=gr(t,o,i,r);e.p(a,n)}}function yr(e){if(e.ctx.length>32){const t=[],o=e.ctx.length/32;for(let e=0;e<o;e++)t[e]=-1;return t}return-1}function br(e){const t={};for(const o in e)"$"!==o[0]&&(t[o]=e[o]);return t}function xr(e,t){const o={};t=new Set(t);for(const i in e)t.has(i)||"$"===i[0]||(o[i]=e[i]);return o}function vr(e,t,o){return e.set(o),t}function wr(e){return e&&sr(e.destroy)?e.destroy:tr}const Sr="undefined"!=typeof window;let kr=Sr?()=>window.performance.now():()=>Date.now(),Cr=Sr?e=>requestAnimationFrame(e):tr;const Tr=new Set;function Mr(e){Tr.forEach((t=>{t.c(e)||(Tr.delete(t),t.f())})),0!==Tr.size&&Cr(Mr)}function Pr(e){let t;return 0===Tr.size&&Cr(Mr),{promise:new Promise((o=>{Tr.add(t={c:e,f:o})})),abort(){Tr.delete(t)}}}function Rr(e,t){e.appendChild(t)}function Ir(e){if(!e)return document;const t=e.getRootNode?e.getRootNode():e.ownerDocument;return t&&t.host?t:e.ownerDocument}function Er(e){const t=Fr("style");return function(e,t){Rr(e.head||e,t),t.sheet}(Ir(e),t),t.sheet}function Ar(e,t,o){e.insertBefore(t,o||null)}function Lr(e){e.parentNode.removeChild(e)}function Fr(e){return document.createElement(e)}function zr(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function Dr(e){return document.createTextNode(e)}function Or(){return Dr(" ")}function Br(){return Dr("")}function Wr(e,t,o,i){return e.addEventListener(t,o,i),()=>e.removeEventListener(t,o,i)}function _r(e){return function(t){return t.preventDefault(),e.call(this,t)}}function Vr(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function Nr(e,t,o){null==o?e.removeAttribute(t):e.getAttribute(t)!==o&&e.setAttribute(t,o)}function Hr(e,t){const o=Object.getOwnPropertyDescriptors(e.__proto__);for(const i in t)null==t[i]?e.removeAttribute(i):"style"===i?e.style.cssText=t[i]:"__value"===i?e.value=e[i]=t[i]:o[i]&&o[i].set?e[i]=t[i]:Nr(e,i,t[i])}function jr(e,t){Object.keys(t).forEach((o=>{!function(e,t,o){t in e?e[t]="boolean"==typeof e[t]&&""===o||o:Nr(e,t,o)}(e,o,t[o])}))}function Ur(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function Gr(e,t){e.value=null==t?"":t}function Zr(e,t,o,i){null===o?e.style.removeProperty(t):e.style.setProperty(t,o,i?"important":"")}function Xr(e,t,{bubbles:o=!1,cancelable:i=!1}={}){const n=document.createEvent("CustomEvent");return n.initCustomEvent(e,o,i,t),n}class Yr{constructor(e=!1){this.is_svg=!1,this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,t,o=null){this.e||(this.is_svg?this.e=zr(t.nodeName):this.e=Fr(t.nodeName),this.t=t,this.c(e)),this.i(o)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.childNodes)}i(e){for(let t=0;t<this.n.length;t+=1)Ar(this.t,this.n[t],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(Lr)}}function qr(e,t){return new e(t)}const Kr=new Map;let Jr,Qr=0;function ea(e,t,o,i,n,r,a,s=0){const l=16.666/i;let c="{\n";for(let e=0;e<=1;e+=l){const i=t+(o-t)*r(e);c+=100*e+`%{${a(i,1-i)}}\n`}const d=c+`100% {${a(o,1-o)}}\n}`,u=`__svelte_${function(e){let t=5381,o=e.length;for(;o--;)t=(t<<5)-t^e.charCodeAt(o);return t>>>0}(d)}_${s}`,p=Ir(e),{stylesheet:h,rules:m}=Kr.get(p)||function(e,t){const o={stylesheet:Er(t),rules:{}};return Kr.set(e,o),o}(p,e);m[u]||(m[u]=!0,h.insertRule(`@keyframes ${u} ${d}`,h.cssRules.length));const g=e.style.animation||"";return e.style.animation=`${g?g+", ":""}${u} ${i}ms linear ${n}ms 1 both`,Qr+=1,u}function ta(e,t){const o=(e.style.animation||"").split(", "),i=o.filter(t?e=>e.indexOf(t)<0:e=>-1===e.indexOf("__svelte")),n=o.length-i.length;n&&(e.style.animation=i.join(", "),Qr-=n,Qr||Cr((()=>{Qr||(Kr.forEach((e=>{const{ownerNode:t}=e.stylesheet;t&&Lr(t)})),Kr.clear())})))}function oa(e){Jr=e}function ia(){if(!Jr)throw new Error("Function called outside component initialization");return Jr}function na(e){ia().$$.on_mount.push(e)}function ra(e){ia().$$.after_update.push(e)}function aa(e){ia().$$.on_destroy.push(e)}function sa(){const e=ia();return(t,o,{cancelable:i=!1}={})=>{const n=e.$$.callbacks[t];if(n){const r=Xr(t,o,{cancelable:i});return n.slice().forEach((t=>{t.call(e,r)})),!r.defaultPrevented}return!0}}function la(e,t){return ia().$$.context.set(e,t),t}function ca(e){return ia().$$.context.get(e)}function da(e,t){const o=e.$$.callbacks[t.type];o&&o.slice().forEach((e=>e.call(this,t)))}const ua=[],pa=[],ha=[],ma=[],ga=Promise.resolve();let $a=!1;function fa(){$a||($a=!0,ga.then(ka))}function ya(){return fa(),ga}function ba(e){ha.push(e)}function xa(e){ma.push(e)}const va=new Set;let wa,Sa=0;function ka(){const e=Jr;do{for(;Sa<ua.length;){const e=ua[Sa];Sa++,oa(e),Ca(e.$$)}for(oa(null),ua.length=0,Sa=0;pa.length;)pa.pop()();for(let e=0;e<ha.length;e+=1){const t=ha[e];va.has(t)||(va.add(t),t())}ha.length=0}while(ua.length);for(;ma.length;)ma.pop()();$a=!1,va.clear(),oa(e)}function Ca(e){if(null!==e.fragment){e.update(),ar(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(ba)}}function Ta(e,t,o){e.dispatchEvent(Xr(`${t?"intro":"outro"}${o}`))}const Ma=new Set;let Pa;function Ra(){Pa={r:0,c:[],p:Pa}}function Ia(){Pa.r||ar(Pa.c),Pa=Pa.p}function Ea(e,t){e&&e.i&&(Ma.delete(e),e.i(t))}function Aa(e,t,o,i){if(e&&e.o){if(Ma.has(e))return;Ma.add(e),Pa.c.push((()=>{Ma.delete(e),i&&(o&&e.d(1),i())})),e.o(t)}else i&&i()}const La={duration:0};function Fa(e,t,o,i){let n=t(e,o),r=i?0:1,a=null,s=null,l=null;function c(){l&&ta(e,l)}function d(e,t){const o=e.b-r;return t*=Math.abs(o),{a:r,b:e.b,d:o,duration:t,start:e.start,end:e.start+t,group:e.group}}function u(t){const{delay:o=0,duration:i=300,easing:u=or,tick:p=tr,css:h}=n||La,m={start:kr()+o,b:t};t||(m.group=Pa,Pa.r+=1),a||s?s=m:(h&&(c(),l=ea(e,r,t,i,o,u,h)),t&&p(0,1),a=d(m,i),ba((()=>Ta(e,t,"start"))),Pr((t=>{if(s&&t>s.start&&(a=d(s,i),s=null,Ta(e,a.b,"start"),h&&(c(),l=ea(e,r,a.b,a.duration,0,u,n.css))),a)if(t>=a.end)p(r=a.b,1-r),Ta(e,a.b,"end"),s||(a.b?c():--a.group.r||ar(a.group.c)),a=null;else if(t>=a.start){const e=t-a.start;r=a.a+a.d*u(e/a.duration),p(r,1-r)}return!(!a&&!s)})))}return{run(e){sr(n)?(wa||(wa=Promise.resolve(),wa.then((()=>{wa=null}))),wa).then((()=>{n=n(),u(e)})):u(e)},end(){c(),a=s=null}}}const za="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function Da(e,t){e.d(1),t.delete(e.key)}function Oa(e,t){Aa(e,1,1,(()=>{t.delete(e.key)}))}function Ba(e,t,o,i,n,r,a,s,l,c,d,u){let p=e.length,h=r.length,m=p;const g={};for(;m--;)g[e[m].key]=m;const $=[],f=new Map,y=new Map;for(m=h;m--;){const e=u(n,r,m),s=o(e);let l=a.get(s);l?i&&l.p(e,t):(l=c(s,e),l.c()),f.set(s,$[m]=l),s in g&&y.set(s,Math.abs(m-g[s]))}const b=new Set,x=new Set;function v(e){Ea(e,1),e.m(s,d),a.set(e.key,e),d=e.first,h--}for(;p&&h;){const t=$[h-1],o=e[p-1],i=t.key,n=o.key;t===o?(d=t.first,p--,h--):f.has(n)?!a.has(i)||b.has(i)?v(t):x.has(n)?p--:y.get(i)>y.get(n)?(x.add(i),v(t)):(b.add(n),p--):(l(o,a),p--)}for(;p--;){const t=e[p];f.has(t.key)||l(t,a)}for(;h;)v($[h-1]);return $}function Wa(e,t){const o={},i={},n={$$scope:1};let r=e.length;for(;r--;){const a=e[r],s=t[r];if(s){for(const e in a)e in s||(i[e]=1);for(const e in s)n[e]||(o[e]=s[e],n[e]=1);e[r]=s}else for(const e in a)n[e]=1}for(const e in i)e in o||(o[e]=void 0);return o}function _a(e){return"object"==typeof e&&null!==e?e:{}}function Va(e,t,o){const i=e.$$.props[t];void 0!==i&&(e.$$.bound[i]=o,o(e.$$.ctx[i]))}function Na(e){e&&e.c()}function Ha(e,t,o,i){const{fragment:n,after_update:r}=e.$$;n&&n.m(t,o),i||ba((()=>{const t=e.$$.on_mount.map(nr).filter(sr);e.$$.on_destroy?e.$$.on_destroy.push(...t):ar(t),e.$$.on_mount=[]})),r.forEach(ba)}function ja(e,t){const o=e.$$;null!==o.fragment&&(ar(o.on_destroy),o.fragment&&o.fragment.d(t),o.on_destroy=o.fragment=null,o.ctx=[])}function Ua(e,t,o,i,n,r,a,s=[-1]){const l=Jr;oa(e);const c=e.$$={fragment:null,ctx:[],props:r,update:tr,not_equal:n,bound:rr(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(l?l.$$.context:[])),callbacks:rr(),dirty:s,skip_bound:!1,root:t.target||l.$$.root};a&&a(c.root);let d=!1;if(c.ctx=o?o(e,t.props||{},((t,o,...i)=>{const r=i.length?i[0]:o;return c.ctx&&n(c.ctx[t],c.ctx[t]=r)&&(!c.skip_bound&&c.bound[t]&&c.bound[t](r),d&&function(e,t){-1===e.$$.dirty[0]&&(ua.push(e),fa(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}(e,t)),o})):[],c.update(),d=!0,ar(c.before_update),c.fragment=!!i&&i(c.ctx),t.target){if(t.hydrate){const e=function(e){return Array.from(e.childNodes)}(t.target);c.fragment&&c.fragment.l(e),e.forEach(Lr)}else c.fragment&&c.fragment.c();t.intro&&Ea(e.$$.fragment),Ha(e,t.target,t.anchor,t.customElement),ka()}oa(l)}class Ga{$destroy(){ja(this,1),this.$destroy=tr}$on(e,t){if(!sr(t))return tr;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(t),()=>{const e=o.indexOf(t);-1!==e&&o.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Za=[];function Xa(e,t){return{subscribe:Ya(e,t).subscribe}}function Ya(e,t=tr){let o;const i=new Set;function n(t){if(lr(e,t)&&(e=t,o)){const t=!Za.length;for(const t of i)t[1](),Za.push(t,e);if(t){for(let e=0;e<Za.length;e+=2)Za[e][0](Za[e+1]);Za.length=0}}}return{set:n,update:function(t){n(t(e))},subscribe:function(r,a=tr){const s=[r,a];return i.add(s),1===i.size&&(o=t(n)||tr),r(e),()=>{i.delete(s),0===i.size&&(o(),o=null)}}}}function qa(e,t,o){const i=!Array.isArray(e),n=i?[e]:e,r=t.length<2;return Xa(o,(e=>{let o=!1;const a=[];let s=0,l=tr;const c=()=>{if(s)return;l();const o=t(i?a[0]:a,e);r?e(o):l=sr(o)?o:tr},d=n.map(((e,t)=>ur(e,(e=>{a[t]=e,s&=~(1<<t),o&&c()}),(()=>{s|=1<<t}))));return o=!0,c(),function(){ar(d),l()}}))}var Ka=e=>e.reduce(((e,t)=>Object.assign(e,t)),{});const Ja=e=>({updateValue:e}),Qa=e=>({defaultValue:e}),es=e=>({store:e}),ts=e=>({store:(t,o)=>qa(...e(o))}),os=e=>({store:(t,o)=>{const[i,n,r=(()=>!1)]=e(o);let a,s=!0;return qa(i,((e,t)=>{n(e,(e=>{!s&&r(a,e)||(a=e,s=!1,t(e))}))}))}}),is=e=>({store:(t,o)=>{const[i,n={},r]=e(o);let a=[];const s={},l=e=>i(e,s),c=e=>{(a.length||e.length)&&(a=e,d())},d=()=>{const e=a.map(l);r&&e.sort(r),a=[...e],p(e)};Object.entries(n).map((([e,t])=>t.subscribe((t=>{s[e]=t,t&&d()}))));const{subscribe:u,set:p}=Ya(t||[]);return{set:c,update:e=>c(e(a)),subscribe:u}}});var ns=e=>{const t={},o={};return e.forEach((([e,...i])=>{const n=Ka(i),a=t[e]=((e,t,o)=>{const{store:i=(e=>Ya(e)),defaultValue:n=r,updateValue:a}=o,s=i(n(),t,e),{subscribe:l,update:c=r}=s;let d;const u=e=>{let t=!0;d&&d(),d=l((o=>{if(t)return t=!1;e(o),d(),d=void 0}))},p=a?a(e):Y;return s.set=e=>c((t=>p(e,t,u))),s.defaultValue=n,s})(o,t,n),s={get:()=>pr(a),set:a.set};Object.defineProperty(o,e,s)})),{stores:t,accessors:o}};var rs=[["src",es((()=>{let e;const{subscribe:t,set:o}=Ya(),i=t=>{e!==t&&(e=t,o(e))};return{set:i,subscribe:t,update:t=>i(t(e))}}))],["imageReader"],["imageWriter"],["imageScrambler"],["imageRedactionRendering",Qa((()=>"pixelated"))],["images",Qa((()=>[]))],["shapePreprocessor"],["willRequestResource"],["willRequest"],["csp"]],as=e=>e.charAt(0).toUpperCase()+e.slice(1),ss=(e,t)=>{Object.keys(t).forEach((o=>{const i=R(t[o])?{value:t[o],writable:!1}:t[o];Object.defineProperty(e,o,i)}))};const ls=(e,t)=>{let o,i,n,r,a,s,l,c,d,u;const p=t.length;for(o=0;o<p;o++)if(i=t[o],n=t[o+1>p-1?0:o+1],r=i.x-e.x,a=i.y-e.y,s=n.x-e.x,l=n.y-e.y,c=r-s,d=a-l,u=c*a-d*r,u<-1e-5)return!1;return!0},cs=1e4;var ds=(e,t)=>{const o=Dt(t),i=he();Ct(e).forEach((e=>{ke(e,i),ls(e,t)||o.forEach((t=>{const o=Math.atan2(t.start.y-t.end.y,t.start.x-t.end.x),n=Math.sin(Math.PI-o)*cs,r=Math.cos(Math.PI-o)*cs,a=me(e.x+n,e.y+r),s=Ke(qe(t),cs),l=It(Ye(e,a),s);l&&ke(i,Ce($e(l),e))}))}));const n=et(e);ke(n,i);return!!Ct(n).every((e=>ls(e,t)))&&(yt(e,n),!0)},us=(e,t)=>{const o=Ct(e),i=Ot(t,5),n=ct(e),r=[];o.forEach((e=>{const t=((e,t)=>{if(0===t)return e;const o=me(e.start.x-e.end.x,e.start.y-e.end.y),i=xe(o),n=Me(i,t);return e.end.x+=n.x,e.end.y+=n.y,e})(Ye($e(n),$e(e)),1e6);let o=!1;i.map(qe).forEach((e=>{const i=It(t,e);i&&!o&&(r.push(i),o=!0)}))}));const a=Ee(r[0],r[2])<Ee(r[1],r[3])?[r[0],r[2]]:[r[1],r[3]],s=rt(a);return s.width<e.width&&(yt(e,s),!0)},ps=(e,t,o={x:0,y:0})=>{const i=ot(e),n=ct(i),r=Mt(i,o,n).map((e=>ye(e,t,n))),a=rt(r);return r.map((e=>Ce(e,a)))},hs=(e,t=0,o=$t(e))=>{let i,n;if(0!==t){const r=Math.atan2(1,o),a=Math.sign(t)*t,s=a%Math.PI,l=a%K;let c;c=s>J&&s<K+J?l>J?a:K-l:l>J?K-l:a;const d=Math.min(Math.abs(e.height/Math.sin(r+c)),Math.abs(e.width/Math.cos(r-c)));i=Math.cos(r)*d,n=i/o}else i=e.width,n=i/o,n>e.height&&(n=e.height,i=n*o);return Ne(i,n)},ms=(e,t,o,i,n,r,a,s)=>{const l=Oe(a),c=Oe(s),d=de(Math.max(t.width/c.width,t.height/c.height)),u=de(Math.min(t.width/l.width,t.height/l.height)),p=et(t);if(u<1||d>1){const o=ct(e),i=ct(t),n=u<1?u:d,r=(i.x+o.x)/2,a=(i.y+o.y)/2,s=p.width/n,l=p.height/n;ft(p,r-.5*s,a-.5*l,s,l)}return r?(((e,t,o=0,i=he(),n)=>{if(Oo(o)&&0!==o||i.x||i.y){const n=$t(e),r=ps(t,o,i),a=hs(t,o,n);if(!(e.width<a.width&&e.height<a.height)){const t=.5*e.width-.5*a.width,o=.5*e.height-.5*a.height;e.width>a.width&&(e.width=a.width,e.x+=t),e.height>a.height&&(e.height=a.height,e.y+=o)}ds(e,r),us(e,r)&&ds(e,r)}else{const o=$t(e);e.width=Math.min(e.width,t.width),e.height=Math.min(e.height,t.height),e.x=Math.max(e.x,0),e.x+e.width>t.width&&(e.x-=e.x+e.width-t.width),e.y=Math.max(e.y,0),e.y+e.height>t.height&&(e.y-=e.y+e.height-t.height);const i=ct(e),r=St(e,o);r.width=Math.max(n.width,r.width),r.height=Math.max(n.height,r.height),r.x=i.x-.5*r.width,r.y=i.y-.5*r.height,yt(e,r)}})(p,o,i,n,l),{crop:p}):{crop:p}},gs=(e,t,o)=>{const i=ot(e),n=ct(i),r=bt(i,o,n),a=ct(Pt(rt(r))),s=ct(t),l=ye(s,-o,a),c=Ce(l,a),d=Se(ke(n,c),de);return lt(d.x-.5*t.width,d.y-.5*t.height,t.width,t.height)},$s=(e,t,o)=>Math.max(t,Math.min(e,o));const fs=["cropLimitToImage","cropMinSize","cropMaxSize","cropAspectRatio","flipX","flipY","rotation","crop","colorMatrix","convolutionMatrix","gamma","vignette","manipulation","redaction","annotation","decoration","selection","frame","backgroundColor","backgroundImage","targetSize","metadata","trim","volume","minDuration","maxDuration","currentTime"],ys=e=>_o(e)?e.map(ys):go(e)||Ut(e)?e:T(e)?{...e}:e,bs=e=>e.map((e=>Object.entries(e).reduce(((e,[t,o])=>(t.startsWith("_")||(e[t]=o),e)),{})));const xs=(e,t)=>e===t;var vs=(e,t,o=xs)=>{if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!o(e[i],t[i]))return!1;return!0};const ws=(e,t,o)=>{const i=Se(ct(e),(e=>de(e,8))),n=ot(t),r=ct(n),a=bt(n,o,r),s=Se(Ue(rt(a)),(e=>de(e,8))),l=Math.abs(s.x-i.x),c=Math.abs(s.y-i.y);return l<1&&c<1},Ss=(e,t,o,i,n)=>{if(!n)return[-1/0,1/0];const r=Math.max(o.width/i.width,o.height/i.height),a=Ne(i.width*r,i.height*r),s=(l=a,Math.sqrt(l.width*l.width+l.height*l.height));var l;if(s<Math.min(e.width,e.height))return[-1/0,1/0];const c=t?e.height:e.width,d=t?e.width:e.height,u=Math.acos(a.height/s),p=u-Math.acos(d/s),h=Math.asin(c/s)-u;if(Number.isNaN(p)&&Number.isNaN(h))return[-1/0,1/0];const m=Number.isNaN(p)?h:Number.isNaN(h)?p:Math.min(p,h);return[-m,m]},ks=(e,t)=>{const{context:o,props:i}=t;return e._isFormatted||((e=hn(e))._isFormatted=!0,Object.assign(e,i)),e._isDraft||!Vi(e)||e._context&>(o,e._context)||(Rn(e,o),e._context={...o}),e},Cs=(e,t)=>(e._isFormatted||(e.disableMove=!0,e.disableSelect=!0,e.disableResize=!0,e.disableRotate=!0),ks(e,t));var Ts=[["file"],["size"],["loadState"],["processState"],["aspectRatio",ts((({size:e})=>[e,e=>e?$t(e):void 0]))],["perspectiveX",Qa((()=>0))],["perspectiveY",Qa((()=>0))],["perspective",ts((({perspectiveX:e,perspectiveY:t})=>[[e,t],([e,t])=>({x:e,y:t})]))],["rotation",Qa((()=>0)),Ja((e=>(t,o,i)=>{if(t===o)return t;const{loadState:n,size:r,rotationRange:a,cropMinSize:s,cropMaxSize:l,crop:c,perspective:d,cropLimitToImage:u,cropOrigin:p}=e;if(!c||!n||!n.beforeComplete)return t;const h=u&&((e,t,o)=>{const i=hs(t,o,$t(e));return He(Xe(i,Math.round),Xe(Oe(e),Math.round))})(c,r,o),m=u&&ws(c,r,o),g=((e,t,o,i,n,r,a,s,l,c)=>{const d=Oe(l),u=Oe(c);a&&(u.width=Math.min(c.width,n.width),u.height=Math.min(c.height,n.height));let p=!1;const h=(t,o)=>{const l=gs(n,i,t),c=ot(n),m=ct(c),g=Mt(c,r,m),$=Ce($e(m),Rt(g)),f=ye(ct(l),o,m),y=Ce($e(m),f);g.forEach((e=>ye(e,o,m)));const b=rt(g),x=Rt(g),v=ke(Ce(Ce(x,y),b),$),w=lt(v.x-.5*l.width,v.y-.5*l.height,l.width,l.height);if(s&&ut(w,s.width/w.width),a){const e=ps(n,o,r);us(w,e)}const S=de(Math.min(w.width/d.width,w.height/d.height),8),k=de(Math.max(w.width/u.width,w.height/u.height),8);return(S<1||k>1)&&de(Math.abs(o-t))===de(Math.PI/2)&&!p?(p=!0,h(e,e+Math.sign(o-t)*Math.PI)):{rotation:o,crop:Tt(w,(e=>de(e,8)))}},m=Math.sign(t)*Math.round(Math.abs(t)/K)*K,g=$s(t,m+o[0],m+o[1]);return h(e,g)})(o,t,a,c,r,d,u,p,s,l);if(h&&m){const e=hs(r,t,$t(g.crop));g.crop.x+=.5*g.crop.width,g.crop.y+=.5*g.crop.height,g.crop.x-=.5*e.width,g.crop.y-=.5*e.height,g.crop.width=e.width,g.crop.height=e.height}return i((()=>{e.crop=Tt(g.crop,(e=>de(e,8)))})),g.rotation}))],["flipX",Qa((()=>!1))],["flipY",Qa((()=>!1))],["flip",ts((({flipX:e,flipY:t})=>[[e,t],([e,t])=>({x:e,y:t})]))],["isRotatedSideways",os((({rotation:e})=>[[e],([e],t)=>t(Q(e)),(e,t)=>e!==t]))],["crop",Ja((e=>(t,o=t)=>{const{loadState:i,size:n,cropMinSize:r,cropMaxSize:a,cropLimitToImage:s,cropAspectRatio:l,rotation:c,perspective:d}=e;if(!t&&!o||!i||!i.beforeComplete)return t;t||(t=ot(hs(n,c,l||$t(n))));const u=ms(o,t,n,c,d,s,r,a),p=Tt(u.crop,(e=>de(e,8)));return gt(o,p)?o:p}))],["cropAspectRatio",Ja((e=>(t,o)=>{const{loadState:i,crop:n,size:r,rotation:a,cropLimitToImage:s}=e,l=(e=>{if(e){if(/:/.test(e)){const[t,o]=e.split(":");return t/o}return parseFloat(e)}})(t);if(!l)return;if(!n||!i||!i.beforeComplete)return l;const c=o?Math.abs(t-o):1;if(ws(n,r,a)&&s&&c>=.1){const o=((e,t)=>{const o=e.width,i=e.height;return Q(t)&&(e.width=i,e.height=o),e})(Oe(r),a);e.crop=Tt(St(ot(o),t),de)}else{const t={width:n.height*l,height:n.height},o=.5*(n.width-t.width),i=.5*(n.height-t.height);e.crop=Tt(lt(n.x+o,n.y+i,t.width,t.height),de)}return l}))],["cropOrigin"],["cropMinSize",Qa((()=>({width:1,height:1})))],["cropMaxSize",Qa((()=>({width:32768,height:32768})))],["cropLimitToImage",Qa((()=>!0)),Ja((e=>(t,o,i)=>{const{crop:n}=e;return n?(!o&&t&&i((()=>e.crop=et(e.crop))),t):t}))],["cropSize",os((({crop:e})=>[[e],([e],t)=>{e&&t(Ne(e.width,e.height))},(e,t)=>He(e,t)]))],["cropRectAspectRatio",ts((({cropSize:e})=>[[e],([e],t)=>{e&&t(de($t(e),5))}]))],["cropRange",os((({size:e,rotation:t,cropRectAspectRatio:o,cropMinSize:i,cropMaxSize:n,cropLimitToImage:r})=>[[e,t,o,i,n,r],([e,t,o,i,n,r],a)=>{if(!e)return;a(((e,t,o,i,n,r)=>{const a=Oe(i),s=Oe(n);return r?[a,Xe(hs(e,t,o),Math.round)]:[a,s]})(e,t,o,i,n,r))},(e,t)=>vs(e,t)]))],["rotationRange",os((({size:e,isRotatedSideways:t,cropMinSize:o,cropSize:i,cropLimitToImage:n})=>[[e,t,o,i,n],([e,t,o,i,n],r)=>{if(!e||!i)return;r(Ss(e,t,o,i,n))},(e,t)=>vs(e,t)]))],["backgroundColor",Ja((()=>e=>((e=[0,0,0,0],t=1)=>4===e.length?e:[...e,t])(e)))],["backgroundImage"],["targetSize"],["colorMatrix"],["convolutionMatrix"],["gamma"],["noise"],["vignette"],["duration"],["currentTime"],["minDuration",Qa((()=>1/24))],["maxDuration",Qa((()=>1/0))],["volume",Qa((()=>1))],["trim"],["redaction",is((({size:e})=>[ks,{context:e}]))],["manipulation",is((({size:e})=>[ks,{context:e}]))],["annotation",is((({size:e})=>[ks,{context:e}]))],["decoration",is((({crop:e})=>[ks,{context:e}]))],["selection",is((({size:e})=>[Cs,{context:e}]))],["frame",Ja((()=>e=>{if(!e)return;const t={frameStyle:void 0,x:0,y:0,width:"100%",height:"100%",disableStyle:["backgroundColor","strokeColor","strokeWidth"]};return m(e)?t.frameStyle=e:Object.assign(t,e),t}))],["metadata"],["state",es(((e,t,o)=>{const i=fs.map((e=>t[e]));let n=!1;const r=Ya({}),{subscribe:a}=qa([...i,r],((e,t)=>{if(n)return;const o=fs.reduce(((t,o,i)=>(t[o]=ys(e[i]),t)),{});o.crop&&Tt(o.crop,Math.round),o.manipulation=o.manipulation&&bs(o.manipulation),o.redaction=o.redaction&&bs(o.redaction),o.annotation=o.annotation&&bs(o.annotation),o.decoration=o.decoration&&bs(o.decoration),o.selection=o.selection&&bs(o.selection),t(o)})),s=e=>{e&&(n=!0,o.cropOrigin=void 0,fs.filter((t=>Wo(e,t))).forEach((t=>{const i=e[t];o[t]=null===i?void 0:ys(i)})),n=!1,r.set({}))};return{set:s,update:e=>s(e(null)),subscribe:a}}))]],Ms=async(e,t,o={},i)=>{const{ontaskstart:n,ontaskprogress:a,ontaskend:s,token:l}=i;let c=!1;const d={cancel:r};l.cancel=()=>{c=!0,d.cancel()};for(const[i,r]of t.entries()){if(c)return;const[t,l]=r;n(i,l);try{e=await t(e,{...o,taskCancelToken:d},(e=>a(i,l,e)))}catch(e){throw c=!0,e}s(i,l)}return e};const Ps=e=>console.warn(`Pintura: ${e} is a required prop.`),Rs=["loadstart","loadabort","loaderror","loadprogress","load","processstart","processabort","processerror","processprogress","process"],Is=["flip","cropOrigin","isRotatedSideways","perspective","perspectiveX","perspectiveY","cropRange"],Es=["images"],As=Ts.map((([e])=>e)).filter((e=>!Is.includes(e))),Ls=e=>"image"+as(e),Fs=e=>Wo(e,"crop");var zs=()=>{const{stores:e,accessors:t}=ns(rs),{sub:o,pub:i}=Qo(),n=()=>t.images?t.images[0]:{};let a={};const s={};As.forEach((e=>{Object.defineProperty(t,Ls(e),{get:()=>{const t=n();if(t)return t.accessors[e]},set:t=>{a[Ls(e)]=t,s[Ls(e)]=t;const o=n();o&&(o.accessors[e]=t)}})}));const l=()=>t.images&&t.images[0];let c;const d=e.src.subscribe((e=>{if(!e)return t.images=[];t.imageReader?(t.images.length&&(a={}),p(e)):c=setTimeout((()=>Ps("imageReader")),32)})),u=e.imageReader.subscribe((e=>{e&&(clearTimeout(c),t.images.length||t.src&&p(t.src))})),p=e=>{Promise.resolve().then((()=>g(e,a))).catch((()=>{}))};let h;const g=(e,o={})=>new Promise(((n,c)=>{let d=l();const u=!(!1===o.cropLimitToImage||!1===o.imageCropLimitToImage||!1===s.imageCropLmitedToImage),p=o.cropMinSize||o.imageCropMinSize||s.imageCropMinSize,m=u?p:d&&d.accessors.cropMinSize,g=o.minDuration||o.imageMinDuration;d&&f(),d=(({minSize:e={width:1,height:1},minDuration:t=0}={})=>{const{stores:o,accessors:i}=ns(Ts),{pub:n,sub:a}=Qo(),s=(e,t)=>{const o=()=>i[e]||{},r=t=>{i[e]={...o(),...t,timeStamp:Date.now()}},a=()=>o().error,s=e=>{a()||(r({error:e}),n(t+"error",{...o()}))};return{start(){n(t+"start")},onabort(){r({abort:!0}),n(t+"abort",{...o()})},ontaskstart(e,i){a()||(r({index:e,task:i,taskProgress:void 0,taskLengthComputable:void 0}),n(t+"taskstart",{...o()}))},ontaskprogress(e,i,s){a()||(r({index:e,task:i,taskProgress:s.loaded/s.total,taskLengthComputable:s.lengthComputable}),n(t+"taskprogress",{...o()}),n(t+"progress",{...o()}))},ontaskend(e,i){a()||(r({index:e,task:i}),n(t+"taskend",{...o()}))},ontaskerror(e){s(e)},error(e){s(e)},beforeComplete(e){a()||(r({beforeComplete:!0}),n("before"+t,e))},complete(e){a()||(r({complete:!0}),n(t,e))}}};return ss(i,{read:(o,{reader:n},a={})=>{if(!n)return;Object.assign(i,{file:void 0,size:void 0,loadState:void 0});let l={cancel:r},c=!1;const d=s("loadState","load"),u={token:l,...d},p={src:o,size:void 0,dest:void 0,duration:void 0};return Promise.resolve().then((async()=>{try{if(d.start(),c)return d.onabort();const o=await Ms(p,n,a,u);if(c)return d.onabort();const{size:r,duration:s,dest:h}=o||{};if(!r||!r.width||!r.height)throw new po("Image size missing","IMAGE_SIZE_MISSING",o);if(s>0&&s<t)throw new po("Video too short","VIDEO_TOO_SHORT",{...o,minDuration:t});if(r.width<e.width||r.height<e.height)throw new po("Image too small","IMAGE_TOO_SMALL",{...o,minWidth:e.width,minHeight:e.height});Object.assign(i,{file:h,size:r,duration:s}),d.beforeComplete(o),d.complete(o)}catch(e){d.error(e)}finally{l=void 0}})),()=>{c=!0,l&&l.cancel(),d.onabort()}},write:(e,t)=>{if(!i.loadState.complete)return;i.processState=void 0;const o=s("processState","process"),n={src:i.file,imageState:i.state,dest:void 0};if(R(e)&&(e=e(i.file,i.state)),!e)return o.start(),void o.complete(n);let a={cancel:r},l=!1;const c=t,d={token:a,...o};return Promise.resolve().then((async()=>{try{if(o.start(),l)return o.onabort();const t=await Ms(n,e,c,d);if(l)return o.onabort();o.complete(t)}catch(e){o.error(e)}finally{a=void 0}})),()=>{l=!0,a&&a.cancel()}},on:a}),{accessors:i,stores:o}})({minSize:m,minDuration:g}),Rs.map((e=>{return d.accessors.on(e,(t=e,e=>i(t,e)));var t}));const $=()=>{a={},y.forEach((e=>e()))},y=[];y.push(d.accessors.on("loaderror",(e=>{$(),c(e)}))),y.push(d.accessors.on("loadabort",(()=>{$(),c({name:"AbortError"})}))),y.push(d.accessors.on("load",(e=>{h=void 0,$(),n(e)}))),y.push(d.accessors.on("beforeload",(()=>((e,o)=>{if(Fs(o))return void(t.imageState=o);if(!o.imageCrop){const t=e.accessors.size,i=o.imageRotation||0,n=Ge(Oe(t),i),r=ot(n);r.width=de(Math.abs(r.width),6),r.height=de(Math.abs(r.height),6);const a=o.imageCropAspectRatio||(o.imageCropLimitToImage?$t(t):$t(r));let s;o.imageCropLimitToImage?s=St(r,a):(s=wt(r,a),s.x=(t.width-s.width)/2,s.y=(t.height-s.height)/2),o.imageCrop=s}if(e.accessors.duration&&!o.imageTrim&&o.imageMaxDuration){const{duration:t}=e.accessors;o.imageTrim=[[0,Math.min(o.imageMaxDuration/t,1)]]}const i=["imageCropLimitToImage","imageCrop","imageCropAspectRatio","imageRotation"];i.filter((e=>Wo(o,e))).forEach((e=>{t[e]=o[e],delete o[e]}));const n=Object.keys(o).filter((e=>!i.includes(e))).reduce(((e,t)=>(e[t]=o[t],e)),{});Object.assign(t,n)})(d,o)))),t.images=[d],o.imageReader&&(t.imageReader=o.imageReader),o.imageWriter&&(t.imageWriter=o.imageWriter),h=d.accessors.read(e,{reader:t.imageReader},{willRequest:t.willRequest})}));let $;const f=()=>{const e=l();e&&(h&&h(),e.accessors.loadState=void 0,t.images=[])};return Object.defineProperty(t,"stores",{get:()=>e}),ss(t,{on:o,loadImage:g,abortLoadImage:()=>{h&&h(),t.images=[]},editImage:(e,o)=>new Promise(((i,n)=>{g(e,o).then((()=>{const{images:e}=t,o=e[0],r=()=>{a(),s()},a=o.accessors.on("processerror",(e=>{r(),n(e)})),s=o.accessors.on("process",(e=>{r(),i(e)}))})).catch(n)})),removeImage:f,processImage:(e,o)=>new Promise(((i,n)=>{try{const r=[],a=()=>{$=void 0,r.forEach((e=>e()))};(async()=>{if((e=>m(e)||Go(e)||jt(e))(e))try{await g(e,o)}catch(e){n(e)}else e&&(Fs(e)?t.imageState=e:Object.assign(t,e));const s=l();if(!s)return n("no image");r.push(s.accessors.on("processerror",(e=>{a(),n(e)}))),r.push(s.accessors.on("processabort",(()=>{a(),n({name:"AbortError"})}))),r.push(s.accessors.on("process",(e=>{a(),i(e)}))),$=s.accessors.write(t.imageWriter,{redactionRenderStyle:t.imageRedactionRendering,shapePreprocessor:t.shapePreprocessor||Y,imageScrambler:t.imageScrambler,willRequest:t.willRequest,csp:t.csp||{},willRequestResource:t.willRequestResource})})()}catch(e){n(e)}})),abortProcessImage:()=>{const e=l();e&&($&&$(),e.accessors.processState=void 0)},destroy:()=>{d&&d(),u&&u()}}),t};const Ds=(e,t)=>{const{processImage:o}=zs();return o(e,t)};var Os=()=>Qt()?vo()?/15_|16_/.test(navigator.userAgent)?14745600:16777216:/15_/.test(navigator.userAgent)?16777216:1/0:1/0,Bs=(e,t)=>Object.keys(e).filter((e=>!t.includes(e))).reduce(((t,o)=>(t[o]=e[o],t)),{}),Ws=e=>new Promise((t=>{if(e.duration===1/0)return e.ontimeupdate=()=>{e.ontimeupdate=void 0,t(e)},void(e.currentTime=Number.MAX_SAFE_INTEGER);t(e)}));const _s=e=>new Promise((t=>{const o=new FileReader;o.onload=()=>t(o.result),o.readAsArrayBuffer(e)})),Vs=1836476516,Ns=(e,t=0,o=e.byteLength)=>{const i=[],n=t+o;for(;t<n;){const o=e.getUint32(t);if(o<0)break;const n=e.getUint32(t+4);if(i.push({type:n,size:o,offset:t,bodyOffset:t+8,bodySize:o-8}),o<8)break;t+=o}return i},Hs=(e,{limit:t=1024}={})=>{let o=0;o+=4;if(1718909296!==e.getUint32(o))return 0;o+=4;const i=e.getUint32(o);return 1836069938===i?((e,t,o)=>{let i=!1,n=-1;for(let r=t;r<o;r++)if(i||1953653099!==e.getUint32(r)||(i=!0,r+=4),i&&64==e.getUint8(r)){n=r;break}if(n<0)return 0;const r=e.getUint32(n-28),a=e.getUint32(n-20),s=e.getUint32(n-32),l=e.getUint32(n-16);return 65536===r&&4294901760===a?90:4294901760===s&&4294901760===l?180:4294901760===r&&65536===a?270:0})(e,o,t):1903435808===i?(e=>{const t=Ns(e).find((e=>1836019574===e.type));if(!t)return 0;const o=Ns(e,t.bodyOffset,t.bodySize);o.filter((e=>1953653099===e.type)).forEach((t=>{o.push(...Ns(e,t.bodyOffset,t.bodySize))}));const i=[Vs,1953196132],n=o.filter((e=>i.includes(e.type)));for(const{type:t,bodyOffset:o}of n){const i=e.getUint8(o);let n=o+4;n+=t===Vs?32:36,n+=1===i?12:0;const r=e.getInt32(n),a=e.getInt32(n+4);if(0===r&&a>0)return 90;if(r<0&&0===a)return 180;if(0===r&&a<0)return 270}return 0})(e):0};var js=e=>new Promise(((t,o)=>{(O()?(async e=>{const t=await _s(e),o=new DataView(t);return Hs(o)})(e):Promise.resolve(0)).then((i=>{const n=document.createElement("video");n.onerror=()=>o(n.error),n.playsInline=!0,n.preload="auto",n.onseeked=()=>{n.onseeked=void 0,t(n)},n.onloadeddata=()=>{n.onloadeddata=void 0,n.dataset.rotation=i?""+i:"0",Ws(n).then(t),n.currentTime=0},vo()&&Qt()?(n.srcObject=e,n.load()):n.src=URL.createObjectURL(e)}))})),Us=(e,t)=>new Promise((o=>{if(e.currentTime===t)return o(e);let i=e.onseeked;e.onseeked=()=>{e.onseeked=i,o(e)},e.currentTime=$s(t,0,e.duration)})),Gs=(e,t=0)=>new Promise(((o,i)=>{js(e).then((e=>{Us(e,t).then((e=>{const t=$("canvas");to(e).then((({width:i,height:n})=>{t.width=i,t.height=n;const r=t.getContext("2d",{willReadFrequently:!0}),a=()=>{r.drawImage(e,0,0,t.width,t.height);const i=r.getImageData(0,0,t.width,t.height);y(t),URL.revokeObjectURL(e.src),o(i)};Qt()?setTimeout(a,16):a()}))}))}))})),Zs=e=>/video/.test(e.type);const Xs=({imageDataResizer:e,canvasMemoryLimit:t}={})=>async(o,i,n,r,a)=>{n.width=Math.max(n.width,1),n.height=Math.max(n.height,1),r.width=Math.max(r.width,1),r.height=Math.max(r.height,1);const{dest:s}=await Ds(i,{imageReader:Sl(),imageWriter:Cl({format:"canvas",targetSize:{...r,upscale:!0},imageDataResizer:e,canvasMemoryLimit:t}),imageCrop:n}),{feather:l=0}=a||{};if(l>0){const e=$("canvas");e.width=s.width,e.height=s.height;const t=e.getContext("2d",{willReadFrequently:!0}),o=1/l;let i=0;for(i=0;i<l;i++){const e=i*o;t.strokeStyle=`rgba(0,0,0,${e*e})`,t.strokeRect(i+.5,i+.5,s.width-2*i-1,s.height-2*i-1)}t.fillStyle="#000",t.fillRect(i,i,s.width+.5-2*i,s.height+.5-2*i);const n=s.getContext("2d");n.globalCompositeOperation="destination-in",n.drawImage(e,0,0),y(e)}o.drawImage(s,r.x,r.y,r.width,r.height),y(s)},Ys=(e,t=((...e)=>e),o)=>async(i,n,r)=>{r(so(0,!1));let a=!1;const s=await e(...t(i,n,(e=>{a=!0,r(e)})));return o&&o(i,s),a||r(so(1,!1)),i},qs=({willRequest:e,srcProp:t="src",destProp:o="dest"}={})=>[Ys(fo,((o,i,n)=>[o[t],n,{...i,willRequest:e}]),((e,t)=>e[o]=t)),"any-to-file"],Ks=({srcProp:e="dest",destProp:t="dest"}={})=>[Ys((async e=>{if(/octet-stream/.test(e.type)){console.warn(`Pintura: File has unknown mime type "${e.type}", make sure your server sets the correct Content-Type header.`);let t="image";const o=await io(e);/video/i.test(o.nodeName)&&(t="video");const i={type:t+"/unknown"};return Ut(e)?new File([e],e.name,{...i,lastModified:e.lastModified}):new Blob([e],i)}return e}),(t=>[t[e]]),((e,o)=>e[t]=o)),"any-to-file"],Js=({srcProp:e="src",destProp:t="size"}={})=>[Ys(ro,(t=>[t[e]]),((e,o)=>e[t]=o)),"read-image-size"],Qs=async e=>{const t=await io(e);if(no(t))return await(e=>new Promise(((t,o)=>{const i=()=>{Ws(e).then((()=>{t(e.duration)}))};if(e.readyState>=1)return i();e.onloadedmetadata=i,e.onerror=()=>o(e.error)})))(t)},el=({srcProp:e="src",destProp:t="duration"}={})=>[Ys(Qs,(t=>[t[e]]),((e,o)=>e[t]=o)),"read-media-duration"],tl=({srcSize:e="size",srcOrientation:t="orientation",destSize:o="size"}={})=>[Ys(wo,(o=>[o[e],o[t]]),((e,t)=>e[o]=t)),"image-size-match-orientation"],ol=({srcProp:e="src",destProp:t="copy"}={})=>[Ys(((e,t)=>So(e)?s(e,t):void 0),(t=>[t[e],onprogress]),((e,o)=>e[t]=o)),"read-image-head"],il=({srcProp:e="copy",destProp:t="orientation"}={})=>[Ys(o,(t=>[t[e],274]),((e,o=1)=>e[t]=o)),"read-exif-orientation-tag"],nl=({srcProp:e="copy"}={})=>[Ys(o,(t=>[t[e],274,1])),"clear-exif-orientation-tag"],rl=({srcImageSize:e="size",srcCanvasSize:t="imageData",srcImageState:o="imageState",destImageSize:i="size",destScalar:n="scalar"}={})=>[Ys(((e,t)=>[Math.min(t.width/e.width,t.height/e.height),Be(t)]),(i=>[i[e],i[t],i[o]]),((e,[t,o])=>{e[n]=t,e[i]=o})),"calculate-canvas-scalar"],al=({srcProp:e="src",destProp:t="imageData",canvasMemoryLimit:o,srcImageState:i="imageState"}={})=>[Ys(((e,t,o)=>Zs(e)?Gs(e,o.currentTime):W(e,t)),(t=>[t[e],o,t[i]]),((e,o)=>e[t]=o)),"blob-to-image-data"],sl=({srcImageData:e="imageData",srcOrientation:t="orientation"}={})=>[Ys(C,(o=>[o[e],o[t]]),((e,t)=>e.imageData=t)),"image-data-match-orientation"],ll=({srcImageData:e="imageData",srcImageState:t="imageState"}={})=>[Ys(Jn,(o=>[o[e],{backgroundColor:o[t].backgroundColor,backgroundImage:o[t].backgroundImage}]),((e,t)=>e.imageData=t)),"image-data-fill"],cl=({srcImageData:e="imageData",srcImageState:t="imageState",destScalar:o="scalar"}={})=>[Ys(Mo,(i=>{const n=i[o];let{crop:r}=i[t];return r&&1!==n&&(r=ut(et(r),n,he())),[i[e],{crop:r,rotation:i[t].rotation,flipX:i[t].flipX,flipY:i[t].flipY}]}),((e,t)=>e.imageData=t)),"image-data-crop"],dl=({targetSize:e={width:void 0,height:void 0,fit:void 0,upscale:void 0},imageDataResizer:t,srcProp:o="imageData",srcImageState:i="imageState",destImageScaledSize:n="imageScaledSize"})=>[Ys(Io,(n=>{const r=Math.min(e.width||Number.MAX_SAFE_INTEGER,n[i].targetSize&&n[i].targetSize.width||Number.MAX_SAFE_INTEGER),a=Math.min(e.height||Number.MAX_SAFE_INTEGER,n[i].targetSize&&n[i].targetSize.height||Number.MAX_SAFE_INTEGER);return[n[o],{width:r,height:a,fit:e.fit||"contain",upscale:(s=n[i],!!(s.targetSize&&s.targetSize.width||s.targetSize&&s.targetSize.height)||(e.upscale||!1))},t];var s}),((e,t)=>{He(e.imageData,t)||(e[n]=Be(t)),e.imageData=t})),"image-data-resize"],ul=({srcImageData:e="imageData",srcImageState:t="imageState",destImageData:o="imageData"}={})=>[Ys(Do,(o=>{const{colorMatrix:i}=o[t],n=i&&Object.keys(i).map((e=>i[e])).filter(Boolean);return[o[e],{colorMatrix:n&&Qn(n),convolutionMatrix:o[t].convolutionMatrix,gamma:o[t].gamma,noise:o[t].noise,vignette:o[t].vignette}]}),((e,t)=>e[o]=t)),"image-data-filter"],pl=({srcImageData:e="imageData",srcImageState:t="imageState",destImageData:o="imageData",destScalar:i="scalar"}={})=>[Ys((async(e,t,o,i,n,r)=>{if(!t||!i.length)return e;let a;try{const n={dataSizeScalar:er(e,i)};o&&o[3]>0&&(n.backgroundColor=[...o]),a=await t(e,n)}catch(e){}const s=$("canvas");s.width=e.width,s.height=e.height;const l=s.getContext("2d",{willReadFrequently:!0});if(l.putImageData(e,0,0),"auto"===r){const t=Math.sqrt(e.width*e.height);l.filter=`blur(${Math.round(t/100)}px)`}const c=new Path2D;i.forEach((e=>{const t=lt(e.x,e.y,e.width,e.height);mt(t,n);const o=bt(et(t),e.rotation),i=new Path2D;o.forEach(((e,t)=>{if(0===t)return i.moveTo(e.x,e.y);i.lineTo(e.x,e.y)})),c.addPath(i)})),l.clip(c,"nonzero"),l.imageSmoothingEnabled=!1,l.drawImage(a,0,0,s.width,s.height),y(a);const d=l.getImageData(0,0,s.width,s.height);return y(s),d}),((o,{imageScrambler:n,redactionRenderStyle:r})=>[o[e],n,o[t].backgroundColor,o[t].redaction,o[i],r]),((e,t)=>e[o]=t)),"image-data-redact"],hl=({srcImageData:e="imageData",srcSize:t="size",srcImageState:o="imageState",srcShapes:i="annotation",destImageData:n="imageData",destImageScaledSize:r="imageScaledSize",destScalar:a="scalar",imageDataResizer:s,canvasMemoryLimit:l,shapeFilter:c=Y,shapeClip:d=!0,destImageContext:u="imageContext"}={})=>[Ys(Kn,((n,{shapePreprocessor:p,willRequestResource:h,csp:m,willRequest:g})=>{const $=n[o][i].filter(c);if(!$.length)return[n[e]];const f=n[a],{crop:y}=n[o],b=n[t];let x=f;const v=n[r];v&&(x=Math.min(v.width/y.width,v.height/y.height));const w={width:b.width/f,height:b.height/f};return[n[e],{shapes:$,computeShape:e=>(e=wn(e,w),e=Bs(e,["left","right","top","bottom"]),e=In(e,x)),transform:e=>{const i=n[t],{rotation:a=0,flipX:s,flipY:l,cropLimitToImage:c}=n[o],{crop:p=ot(i)}=n[o];let h=1;h=n[r]?x:f;const m={width:i.width/f*h,height:i.height/f*h},g=Ht(m,a),$=g.width,y=g.height,b=.5*m.width-.5*$,v=.5*m.height-.5*y,w=Ue(m);e.translate(-b,-v),e.translate(-p.x*h,-p.y*h),e.translate(w.x,w.y),e.rotate(a),e.translate(-w.x,-w.y);const S=n[u]||{x:0,y:0};e.translate(S.x,S.y),e.scale(s?-1:1,l?-1:1),e.translate(s?-m.width*f:0,l?-m.height*f:0),c&&d&&(e.rect(0,0,m.width,m.height),e.clip())},drawImage:Xs({imageDataResizer:s,canvasMemoryLimit:l}),preprocessShape:e=>p(e,{isPreview:!1,...n[o]}),canvasMemoryLimit:l,willRequest:g||h,styleNonce:m.styleNonce}]}),((e,t)=>e[n]=t)),"image-data-annotate"],ml=({srcImageData:e="imageData",srcImageState:t="imageState",destImageData:o="imageData",destImageScaledSize:i="imageScaledSize",imageDataResizer:n,canvasMemoryLimit:r,destScalar:a="scalar",shapeFilter:s=Y,destImageContext:l="imageContext"}={})=>[Ys(Kn,((o,{shapePreprocessor:c,willRequestResource:d,willRequest:u,csp:p})=>{let h=o[t].decoration.filter(s);if("undefined"!=typeof window&&(e=>{if(e&&e._v94ofot)return;const[i]=[[85,110,108,105,99,101,110,115,101,100,32,80,105,110,116,117,114,97,32,105,110,115,116,97,110,99,101,32]].map((e=>e.map((e=>String.fromCharCode(e))).join(""))),{width:n,height:r}=o[t].crop,a=r/15;h=[...h,{x:.5*-a,y:.5*-a,width:1.5*n,height:1.25*r,text:Array(50).fill(i).join(""),fontWeight:900,lineHeight:a,fontSize:a,color:[1,1,1,.05]}]})(window),!h.length)return[o[e]];let m=o[a];const{crop:g}=o[t],$=o[i];if($){const e=Math.min($.width/g.width,$.height/g.height);m=e}return[o[e],{shapes:h,drawImage:Xs({imageDataResizer:n,canvasMemoryLimit:r}),computeShape:e=>(e=wn(e,g),e=Bs(e,["left","right","top","bottom"]),e=In(e,m)),preprocessShape:e=>c(e,{isPreview:!1,...o[t]}),canvasMemoryLimit:r,willRequest:u||d,styleNonce:p.styleNonce,transform:e=>{const t=o[l]||{x:0,y:0};e.translate(t.x,t.y)}}]}),((e,t)=>e[o]=t)),"image-data-decorate"],gl=({srcImageData:e="imageData",srcImageState:t="imageState",destImageData:o="imageData",destImageScaledSize:i="imageScaledSize",imageDataResizer:n,canvasMemoryLimit:r,destScalar:a="scalar",destImageContext:s="imageContext"}={})=>[Ys(((e,t)=>new Promise((o=>{if(!t)return o([e]);Kn(e,t).then((e=>{o([e,t.contextBounds])}))}))),((o,{shapePreprocessor:s,willRequestResource:l,willRequest:c,csp:d})=>{const u=o[t].frame;if(!u)return[o[e]];const p=o[a];let{crop:h}=o[t];h&&1!==p&&(h=ut(et(h),p,he()));const m={...h},g=Mn(Pn(u,m,s),m);m.x=Math.abs(g.left),m.y=Math.abs(g.top),m.width+=Math.abs(g.left)+Math.abs(g.right),m.height+=Math.abs(g.top)+Math.abs(g.bottom);const $=o[i],f=$?Math.min($.width/h.width,$.height/h.height):1;return mt(m,f),m.x=Math.floor(m.x),m.y=Math.floor(m.y),m.width=Math.floor(m.width),m.height=Math.floor(m.height),[o[e],{shapes:[u],contextBounds:m,computeShape:t=>wn(t,o[e]),transform:e=>{e.translate(m.x,m.y)},drawImage:Xs({imageDataResizer:n,canvasMemoryLimit:r}),preprocessShape:e=>s(e,{isPreview:!1,...o[t]}),canvasMemoryLimit:r,willRequest:c||l,styleNonce:d.styleNonce}]}),((e,[t,i])=>{e[s]=i,e[o]=t})),"image-data-frame"],$l=({mimeType:e,quality:t,srcImageData:o="imageData",srcFile:i="src",destBlob:n="blob"}={})=>[Ys(V,(n=>[n[o],e||G(n[i].name)||n[i].type,t]),((e,t)=>e[n]=t)),"image-data-to-blob"],fl=({srcImageData:e="imageData",srcOrientation:t="orientation",destCanvas:o="dest"}={})=>[Ys(k,(o=>[o[e],o[t]]),((e,t)=>e[o]=t)),"image-data-to-canvas"],yl=async(e,t)=>{if(!So(e)||!t)return e;const o=(e,t)=>{let o=2;const i=new DataView(e),n=i.byteLength;for(t(i.getUint8(0),0,2,n);o<n&&255==i.getUint8(o);){const e=i.getUint8(o+1),r=i.getUint16(o+2)+2;if(!1===t(e,o,r,n))break;o+=r}},i=e=>e>=224&&e<=237,n=(e=>{const t=[];return o(e,((o,n,r)=>{if(218===o)return!1;i(o)&&t.push(new Uint8Array(e,n,r))})),t})(t),r=((e,t)=>{const n=[];o(e,((o,r,a,s)=>0===r?(n.push(new Uint8Array(e,r,a)),void n.push(...t)):218===o?(n.push(new Uint8Array(e,r,s-r)),!1):void(i(o)||n.push(new Uint8Array(e,r,a)))));let r=n.reduce(((e,t)=>e+t.length),0),a=new Uint8Array(r),s=0;return n.forEach((e=>{a.set(e,s),s+=e.length})),a})(await s(e),n);return new Blob([r],{type:"image/jpeg"})},bl=(e="blob",t="copy",o="blob")=>[Ys(yl,(o=>[o[e],o[t]]),((e,t)=>e[o]=t)),"blob-write-image-head"],xl=({renameFile:e,srcBlob:t="blob",srcFile:o="src",destFile:i="dest",defaultFilename:n}={})=>[Ys(Z,(i=>[i[t],e?e(i[o]):i[o].name||`${n}.${H(i[t].type)}`]),((e,t)=>e[i]=t)),"blob-to-file"],vl=({url:e="./",dataset:t=(e=>[["dest",e.dest,e.dest.name],["imageState",e.imageState]]),destStore:o="store",credentials:i,headers:n={}})=>[Ys((async(t,o)=>await((e,t,o)=>new Promise(((i,n)=>{const{token:a={},beforeSend:s=r,onprogress:l=r}=o;a.cancel=()=>c.abort();const c=new XMLHttpRequest;c.upload.onprogress=l,c.onload=()=>c.status>=200&&c.status<300?i(c):n(c),c.onerror=()=>n(c),c.ontimeout=()=>n(c),c.open("POST",encodeURI(e)),s(c),c.send(t instanceof FormData?t:t.reduce(((e,t)=>(e.append(...t.map(ko)),e)),new FormData))})))(e,t,{onprogress:o,beforeSend:e=>ho(e,{headers:n,credentials:i})})),((e,o,i)=>[t(e),i]),((e,t)=>e[o]=t)),"store"],wl=e=>[Ys((t=>e&&e.length?(Object.keys(t).forEach((o=>{e.includes(o)||delete t[o]})),t):t)),"prop-filter"],Sl=(e={})=>{const{orientImage:t=!0,outputProps:o=["src","dest","size","duration"],preprocessImageFile:i,request:n={}}=e;return[qs({willRequest:()=>n}),Ks(),i&&[Ys(i,((e,t,o)=>[e.dest,t,o]),((e,t)=>e.dest=t)),"preprocess-image-file"],Js({srcProp:"dest"}),el({srcProp:"dest"}),t&&ol({srcProp:"dest"}),t&&il(),t&&tl(),wl(o)].filter(Boolean)},kl=e=>e&&(m(e)?vl({url:e}):R(e)?[e,"store"]:vl(e)),Cl=(e={})=>(t,o,i={})=>{let{canvasMemoryLimit:n=Os(),orientImage:r=!0,copyImageHead:a=!0,mimeType:s,quality:l,renameFile:c,targetSize:d,imageDataResizer:u,store:p,format:h="file",outputProps:m=["src","dest","imageState","store"],preprocessImageSource:g,preprocessImageState:$,postprocessImageData:f,postprocessImageBlob:y,testSrcSupport:b=!1}={...e,...i};if(!b||oo(t))return"blob"===h&&(h="file"),[g&&[Ys(g,((e,t,o)=>[e.src,t,o,e.imageState]),((e,t)=>e.src=t)),"preprocess-image-source"],(r||a)&&ol(),r&&il(),Js(),$&&[Ys($,((e,t,o,i)=>[e.imageState,t,o,{size:e.size,orientation:e.orientation}]),((e,t)=>e.imageState=t)),"preprocess-image-state"],al({canvasMemoryLimit:n}),r&&tl(),r&&sl(),rl(),pl(),cl(),dl({imageDataResizer:u,targetSize:d}),hl({imageDataResizer:u,canvasMemoryLimit:n,srcShapes:"manipulation"}),ul(),ll(),hl({imageDataResizer:u,canvasMemoryLimit:n,srcShapes:"annotation",shapeFilter:e=>!e.aboveFrame}),ml({imageDataResizer:u,canvasMemoryLimit:n,shapeFilter:e=>!e.aboveFrame}),gl({imageDataResizer:u,canvasMemoryLimit:n}),hl({imageDataResizer:u,canvasMemoryLimit:n,srcShapes:"annotation",shapeFilter:e=>e.aboveFrame,shapeClip:!1}),ml({imageDataResizer:u,canvasMemoryLimit:n,shapeFilter:e=>e.aboveFrame}),f&&[Ys(f,((e,t,o)=>[e.imageData,t,o]),((e,t)=>e.imageData=t)),"postprocess-image-data"],"file"===h?$l({mimeType:s,quality:l}):"canvas"===h?fl():[e=>(e.dest=e.imageData,e)],"file"===h&&r&&nl(),"file"===h&&a&&bl(),y&&[Ys(y,(({blob:e,imageData:t,src:o},i,n)=>[{blob:e,imageData:t,src:o},i,n]),((e,t)=>e.blob=t)),"postprocess-image-file"],"file"===h&&xl({defaultFilename:"image",renameFile:c}),"file"===h?kl(p):R(p)&&[p,"store"],wl(m)].filter(Boolean)};var Tl=(e,t,o,i,n,r,a,s,l,c,d)=>{if(!(e&&t&&o&&i&&s))return;s*=r;const u=Pt(et(t)),p=ct(u),h=ct(e),m=ot(o),g=ct(m),$=gs(o,i,l),f=ct($),y=Ce($e(g),f),b=Ce($e(h),p);y.x+=b.x,y.y+=b.y;const x=fe($e(y));x.x+=b.x,x.y+=b.y;const v=ct(dt(dt(et(n),a),e)),w=Ce(v,h);return ke(y,w),{origin:x,translation:y,rotation:{x:d?Math.PI:0,y:c?Math.PI:0,z:l},scale:s}};let Ml=null;var Pl=()=>{if(null===Ml)if("WebGL2RenderingContext"in window){let e;try{e=$("canvas"),Ml=!!e.getContext("webgl2")}catch(e){Ml=!1}e&&y(e),e=void 0}else Ml=!1;return Ml},Rl=e=>0==(e&e-1),Il=(e,t={},o="",i="")=>Object.keys(t).filter((e=>!T(t[e]))).reduce(((e,n)=>e.replace(new RegExp(o+n+i),t[n])),e);const El={head:"#version 300 es\n\nin vec4 aPosition;uniform mat4 uMatrix;",text:"\nin vec2 aTexCoord;out vec2 vTexCoord;",matrix:"\ngl_Position=uMatrix*vec4(aPosition.x,aPosition.y,0,1);"},Al={head:"#version 300 es\nprecision highp float;\n\nout vec4 fragColor;",mask:"\nuniform float uMaskFeather[8];uniform float uMaskBounds[4];uniform float uMaskOpacity;float mask(float x,float y,float bounds[4],float opacity){return 1.0-(1.0-(smoothstep(bounds[3],bounds[3]+1.0,x)*(1.0-smoothstep(bounds[1]-1.0,bounds[1],x))*(1.0-step(bounds[0],y))*step(bounds[2],y)))*(1.0-opacity);}",init:"\nfloat a=1.0;vec4 fillColor=uColor;vec4 textureColor=texture(uTexture,vTexCoord);textureColor*=(1.0-step(uRepeat.y,vTexCoord.y))*step(0.0,vTexCoord.y)*(1.0-step(uRepeat.x,vTexCoord.x))*step(0.0,vTexCoord.x);",colorize:"\nif(uTextureColor.a!=0.0&&textureColor.a>0.0){vec3 colorFlattened=textureColor.rgb/textureColor.a;if(colorFlattened.r>=.9999&&colorFlattened.g==0.0&&colorFlattened.b>=.9999){textureColor.rgb=uTextureColor.rgb*textureColor.a;}textureColor*=uTextureColor.a;}",maskapply:"\nfloat m=mask(gl_FragCoord.x,gl_FragCoord.y,uMaskBounds,uMaskOpacity);",maskfeatherapply:"\nfloat leftFeatherOpacity=step(uMaskFeather[1],gl_FragCoord.x)*uMaskFeather[0]+((1.0-uMaskFeather[0])*smoothstep(uMaskFeather[1],uMaskFeather[3],gl_FragCoord.x));float rightFeatherOpacity=(1.0-step(uMaskFeather[7],gl_FragCoord.x))*uMaskFeather[4]+((1.0-uMaskFeather[4])*smoothstep(uMaskFeather[7],uMaskFeather[5],gl_FragCoord.x));a*=leftFeatherOpacity*rightFeatherOpacity;",rectaa:"\nvec2 scaledPoint=vec2(vRectCoord.x*uSize.x,vRectCoord.y*uSize.y);a*=smoothstep(0.0,uEdgeFeather,uSize.x-scaledPoint.x);a*=smoothstep(0.0,uEdgeFeather,uSize.y-scaledPoint.y);a*=smoothstep(0.0,uEdgeFeather,scaledPoint.x);a*=smoothstep(0.0,uEdgeFeather,scaledPoint.y);",cornerradius:"\nvec2 s=(uSize-2.0)*.5;vec2 r=(vRectCoord*uSize)-1.0;vec2 p=r-s;float cornerRadius=uCornerRadius[0];bool left=r.x<s.x;bool top=r.y<s.y;if(!left&&top){cornerRadius=uCornerRadius[1];}if(!left&&!top){cornerRadius=uCornerRadius[3];}if(left&&!top){cornerRadius=uCornerRadius[2];}a*=1.0-clamp(length(max(abs(p)-(s-cornerRadius),0.0))-cornerRadius,0.0,1.0);",fragcolor:"\nif(m<=0.0)discard;fillColor.a*=a;fillColor.rgb*=fillColor.a;fillColor.rgb*=m;fillColor.rgb+=(1.0-m)*(uCanvasColor.rgb*fillColor.a);textureColor*=uTextureOpacity;textureColor.a*=a;textureColor.rgb*=m*a;textureColor.rgb+=(1.0-m)*(uCanvasColor.rgb*textureColor.a);fragColor=textureColor+(fillColor*(1.0-textureColor.a));"},Ll=(e,t,o)=>{const i=e.createShader(o),n=((e,t,o)=>(t=Il(t,o===e.VERTEX_SHADER?El:Al,"##").trim(),Pl()?t:(t=(t=t.replace(/#version.+/gm,"").trim()).replace(/^\/\/\#/gm,"#"),o===e.VERTEX_SHADER&&(t=t.replace(/in /gm,"attribute ").replace(/out /g,"varying ")),o===e.FRAGMENT_SHADER&&(t=t.replace(/in /gm,"varying ").replace(/out.*?;/gm,"").replace(/texture\(/g,"texture2D(").replace(/fragColor/g,"gl_FragColor")),""+t)))(e,t,o);return e.shaderSource(i,n),e.compileShader(i),e.getShaderParameter(i,e.COMPILE_STATUS)||console.error(e.getShaderInfoLog(i)),i},Fl=(e,t,o,i,n)=>{const r=Ll(e,t,e.VERTEX_SHADER),a=Ll(e,o,e.FRAGMENT_SHADER),s=e.createProgram();e.attachShader(s,r),e.attachShader(s,a),e.linkProgram(s);const l={};return i.forEach((t=>{l[t]=e.getAttribLocation(s,t)})),n.forEach((t=>{l[t]=e.getUniformLocation(s,t)})),{program:s,locations:l,destroy(){e.detachShader(s,r),e.detachShader(s,a),e.deleteShader(r),e.deleteShader(a),e.deleteProgram(s)}}},zl=e=>"VIDEO"!==e.nodeName&&(!!Pl()||Rl(e.width)&&Rl(e.height)),Dl=(e,t,o,i)=>(e.bindTexture(e.TEXTURE_2D,t),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,o),((e,t,o)=>{e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,zl(t)?e.LINEAR_MIPMAP_LINEAR:e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,o.filterParam),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,o.wrapParam),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,o.wrapParam),zl(t)&&e.generateMipmap(e.TEXTURE_2D)})(e,o,i),e.bindTexture(e.TEXTURE_2D,null),t),Ol=(e,t=1)=>e?[e[0],e[1],e[2],Oo(e[3])?t*e[3]:t]:[0,0,0,0],Bl=()=>{const e=new Float32Array(16);return e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},Wl=(e,t,o,i,n,r,a)=>{const s=1/(t-o),l=1/(i-n),c=1/(r-a);e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+o)*s,e[13]=(n+i)*l,e[14]=(a+r)*c,e[15]=1},_l=(e,t,o,i)=>{e[12]=e[0]*t+e[4]*o+e[8]*i+e[12],e[13]=e[1]*t+e[5]*o+e[9]*i+e[13],e[14]=e[2]*t+e[6]*o+e[10]*i+e[14],e[15]=e[3]*t+e[7]*o+e[11]*i+e[15]},Vl=(e,t)=>{e[0]*=t,e[1]*=t,e[2]*=t,e[3]*=t,e[4]*=t,e[5]*=t,e[6]*=t,e[7]*=t,e[8]*=t,e[9]*=t,e[10]*=t,e[11]*=t},Nl=(e,t)=>{const o=Math.sin(t),i=Math.cos(t),n=e[4],r=e[5],a=e[6],s=e[7],l=e[8],c=e[9],d=e[10],u=e[11];e[4]=n*i+l*o,e[5]=r*i+c*o,e[6]=a*i+d*o,e[7]=s*i+u*o,e[8]=l*i-n*o,e[9]=c*i-r*o,e[10]=d*i-a*o,e[11]=u*i-s*o},Hl=(e,t)=>{const o=Math.sin(t),i=Math.cos(t),n=e[0],r=e[1],a=e[2],s=e[3],l=e[8],c=e[9],d=e[10],u=e[11];e[0]=n*i-l*o,e[1]=r*i-c*o,e[2]=a*i-d*o,e[3]=s*i-u*o,e[8]=n*o+l*i,e[9]=r*o+c*i,e[10]=a*o+d*i,e[11]=s*o+u*i},jl=(e,t)=>{const o=Math.sin(t),i=Math.cos(t),n=e[0],r=e[1],a=e[2],s=e[3],l=e[4],c=e[5],d=e[6],u=e[7];e[0]=n*i+l*o,e[1]=r*i+c*o,e[2]=a*i+d*o,e[3]=s*i+u*o,e[4]=l*i-n*o,e[5]=c*i-r*o,e[6]=d*i-a*o,e[7]=u*i-s*o};var Ul=e=>e*Math.PI/180,Gl=(e,t)=>Pl()?e.getContext("webgl2",t):e.getContext("webgl",t)||e.getContext("experimental-webgl",t);const Zl=(e,t)=>{const o=e.length;return t>=o?e[t%o]:t<0?e[t%o+o]:e[t]},Xl=(e,t,o,i)=>{const n=me(o.x-t.x,o.y-t.y),r=me(i.x-o.x,i.y-o.y),a=me(t.x-i.x,t.y-i.y),s=me(e.x-t.x,e.y-t.y),l=me(e.x-o.x,e.y-o.y),c=me(e.x-i.x,e.y-i.y),d=Re(n,s),u=Re(r,l),p=Re(a,c);return d<=0&&u<=0&&p<=0},Yl=e=>{if(e.length<3)return[];if((e=>{const t=e.length;for(let o=0;o<t;o++){const t=Ye(e[o],Zl(e,o+1));if(At(t,e,{ignoreIdenticalLines:!0,breakOnIntersection:!0}))return!0}return!1})(e))return[];(e=>{let t,o,i,n,r,a=0;const s=e.length;for(t=0;t<s;t++)o=e[t],i=e[(t+1)%s],n=i.x-o.x,r=(i.y+o.y)/2,a+=n*r;return a})(e)<0&&e.reverse();const t=e.length,o=[...Array(t).keys()],i=[];let n,r,a,s,l,c,d,u,p,h,m,g,$=1024;for(;o.length>3;){if($<=0)return[];for($--,n=0;n<o.length;n++)if(a=o[n],s=Zl(o,n-1),l=Zl(o,n+1),c=e[a],d=e[s],u=e[l],p=me(d.x-c.x,d.y-c.y),h=me(u.x-c.x,u.y-c.y),!(Re(p,h)<0)){for(m=!0,r=0;r<t;r++)if(r!==a&&r!==s&&r!==l&&(g=e[r],Xl(g,d,c,u))){m=!1;break}if(m){i.push([d,c,u]),o.splice(n,1);break}}}return i.push([e[o[0]],e[o[1]],e[o[2]]]),i},ql=(e,t,o,i,n)=>{const r=xe(me(i.x-o.x,i.y-o.y)),a=xe(me(n.x-i.x,n.y-i.y)),s=xe(me(r.x+a.x,r.y+a.y)),l=me(-s.y,s.x),c=me(-r.y,r.x),d=Math.min(1/Pe(l,c),5);e[t]=i.x,e[t+1]=i.y,e[t+2]=l.x*d,e[t+3]=l.y*d,e[t+4]=-1,e[t+5]=i.x,e[t+6]=i.y,e[t+7]=l.x*d,e[t+8]=l.y*d,e[t+9]=1},Kl=e=>{const t=new Float32Array(8);return t[0]=e[3].x,t[1]=e[3].y,t[2]=e[0].x,t[3]=e[0].y,t[4]=e[2].x,t[5]=e[2].y,t[6]=e[1].x,t[7]=e[1].y,t},Jl=(e,t=0,o,i)=>{const n=Ct(e),r=e.x+.5*e.width,a=e.y+.5*e.height;return(o||i)&&Fe(n,o,i,r,a),0!==t&&ze(n,t,r,a),n},Ql=(e,t,o,i,n)=>{const r=Math.min(20,Math.max(4,Math.round(i/2)));let a=0,s=0,l=0,c=0,d=0;for(;d<r;d++)a=d/r,s=n*K+a*K,l=i*Math.cos(s),c=i*Math.sin(s),e.push(me(t+l,o+c))};let ec=null;var tc=()=>{if(null!==ec)return ec;let e=$("canvas");const t=Gl(e);return ec=t?t.getParameter(t.MAX_TEXTURE_SIZE):void 0,y(e),e=void 0,ec},oc=()=>d()&&!!window.chrome;const ic=new Float32Array([0,1,0,0,1,1,1,0]),nc=new Float32Array([1,0,0,0,1,1,0,1]),rc=d()&&O(),ac=[0,0,0,0,1,0,0,0,0],sc=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],lc=[0,0,0,0],cc=[0,0,0,0],dc=(e,t,o,i,n)=>{if(!o||!i)return ic;let r=i.x/o.width,a=i.y/o.height,s=e/o.width/n,l=t/o.height/n;s-=r,l-=a;return new Float32Array([-r,l,-r,-a,s,l,s,-a])};var uc=(e,t={})=>{const{alpha:o=!1}=t,i={width:0,height:0},n={width:0,height:0},r=tc()||1024;let a,s,l;const c=Bl(),d=Bl();let u,p,h,m,g,$,f,b,x,v=0,w=0,S=0,k=1;const C=new Map([]),T=()=>{R.stencilOp(R.KEEP,R.KEEP,R.KEEP),R.stencilFunc(R.ALWAYS,1,255),R.stencilMask(255)},M=Ul(30),P=Math.tan(M/2),R=Gl(e,{alpha:o,antialias:!1,premultipliedAlpha:!0,stencil:!0});if(!R)return;R.getExtension("OES_standard_derivatives"),R.disable(R.DEPTH_TEST),R.enable(R.STENCIL_TEST),R.enable(R.BLEND),R.blendFunc(R.ONE,R.ONE_MINUS_SRC_ALPHA),R.pixelStorei(R.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!(!o&&O())),T();const I=R.createTexture();R.bindTexture(R.TEXTURE_2D,I),R.texImage2D(R.TEXTURE_2D,0,R.RGBA,1,1,0,R.RGBA,R.UNSIGNED_BYTE,new Uint8Array(lc)),C.set(0,I);const E=R.createTexture();C.set(2,E);const A=R.createFramebuffer(),L=R.createTexture();C.set(1,L);const F=R.createFramebuffer(),z=Fl(R,"\n##head\n##text\nvoid main(){vTexCoord=aTexCoord;gl_Position=uMatrix*aPosition;}","\n##head\nin vec2 vTexCoord;uniform sampler2D uTexture;uniform sampler2D uTextureOverlay;uniform sampler2D uTextureBlend;uniform vec2 uTextureSize;uniform float uOpacity;uniform int uAntialias;uniform vec4 uOverlayColor;uniform mat4 uColorMatrix;uniform vec4 uColorOffset;uniform float uClarityKernel[9];uniform float uClarityKernelWeight;uniform float uColorGamma;uniform float uColorVignette;uniform float uMaskClip;uniform float uMaskOpacity;uniform float uMaskBounds[4];uniform float uMaskCornerRadius[4];uniform float uMaskFeather[8];vec4 applyGamma(vec4 c,float g){c.r=pow(c.r,g);c.g=pow(c.g,g);c.b=pow(c.b,g);return c;}vec4 applyColorMatrix(vec4 c,mat4 m,vec4 o){vec4 res=(c*m)+(o*c.a);res=clamp(res,0.0,1.0);return res;}vec4 applyConvolutionMatrix(vec4 c,float k0,float k1,float k2,float k3,float k4,float k5,float k6,float k7,float k8,float w){vec2 pixel=vec2(1)/uTextureSize;vec4 colorSum=texture(uTexture,vTexCoord-pixel)*k0+texture(uTexture,vTexCoord+pixel*vec2(0.0,-1.0))*k1+texture(uTexture,vTexCoord+pixel*vec2(1.0,-1.0))*k2+texture(uTexture,vTexCoord+pixel*vec2(-1.0,0.0))*k3+texture(uTexture,vTexCoord)*k4+texture(uTexture,vTexCoord+pixel*vec2(1.0,0.0))*k5+texture(uTexture,vTexCoord+pixel*vec2(-1.0,1.0))*k6+texture(uTexture,vTexCoord+pixel*vec2(0.0,1.0))*k7+texture(uTexture,vTexCoord+pixel)*k8;vec4 color=vec4(clamp((colorSum/w),0.0,1.0).rgb,c.a);return color;}vec4 blendPremultipliedAlpha(vec4 back,vec4 front){return front+(back*(1.0-front.a));}vec4 applyVignette(vec4 c,vec2 pos,vec2 center,float v){float d=distance(pos,center)/length(center);float f=1.0-(d*abs(v));if(v>0.0){c.rgb*=f;}else if(v<0.0){c.rgb+=(1.0-f)*(1.0-c.rgb);}return c;}void main(){float x=gl_FragCoord.x;float y=gl_FragCoord.y;float a=1.0;float maskTop=uMaskBounds[0];float maskRight=uMaskBounds[1];float maskBottom=uMaskBounds[2];float maskLeft=uMaskBounds[3];float leftFeatherOpacity=step(uMaskFeather[1],x)*uMaskFeather[0]+((1.0-uMaskFeather[0])*smoothstep(uMaskFeather[1],uMaskFeather[3],x));float rightFeatherOpacity=(1.0-step(uMaskFeather[7],x))*uMaskFeather[4]+((1.0-uMaskFeather[4])*smoothstep(uMaskFeather[7],uMaskFeather[5],x));a*=leftFeatherOpacity*rightFeatherOpacity;float overlayColorAlpha=(smoothstep(maskLeft,maskLeft+1.0,x)*(1.0-smoothstep(maskRight-1.0,maskRight,x))*(1.0-step(maskTop,y))*step(maskBottom,y));if(uOverlayColor.a==0.0){a*=overlayColorAlpha;}vec2 offset=vec2(maskLeft,maskBottom);vec2 size=vec2(maskRight-maskLeft,maskTop-maskBottom)*.5;vec2 center=offset.xy+size.xy;int pixelX=int(step(center.x,x));int pixelY=int(step(y,center.y));float cornerRadius=0.0;if(pixelX==0&&pixelY==0)cornerRadius=uMaskCornerRadius[0];if(pixelX==1&&pixelY==0)cornerRadius=uMaskCornerRadius[1];if(pixelX==0&&pixelY==1)cornerRadius=uMaskCornerRadius[2];if(pixelX==1&&pixelY==1)cornerRadius=uMaskCornerRadius[3];float cornerOffset=sign(cornerRadius)*length(max(abs(gl_FragCoord.xy-size-offset)-size+cornerRadius,0.0))-cornerRadius;float cornerOpacity=1.0-smoothstep(0.0,1.0,cornerOffset);a*=cornerOpacity;if(uAntialias==1){vec2 scaledPoint=vec2(vTexCoord.x*uTextureSize.x,vTexCoord.y*uTextureSize.y);a*=smoothstep(0.0,1.0,uTextureSize.x-scaledPoint.x);a*=smoothstep(0.0,1.0,uTextureSize.y-scaledPoint.y);a*=smoothstep(0.0,1.0,scaledPoint.x);a*=smoothstep(0.0,1.0,scaledPoint.y);}vec4 color=texture(uTexture,vTexCoord);if(uClarityKernelWeight!=-1.0){color=applyConvolutionMatrix(color,uClarityKernel[0],uClarityKernel[1],uClarityKernel[2],uClarityKernel[3],uClarityKernel[4],uClarityKernel[5],uClarityKernel[6],uClarityKernel[7],uClarityKernel[8],uClarityKernelWeight);}color=blendPremultipliedAlpha(color,texture(uTextureBlend,vTexCoord));color=applyGamma(color,uColorGamma);color=applyColorMatrix(color,uColorMatrix,uColorOffset);color*=a;if(uColorVignette!=0.0){vec2 pos=gl_FragCoord.xy-offset;color=applyVignette(color,pos,center-offset,uColorVignette);}color=blendPremultipliedAlpha(color,texture(uTextureOverlay,vTexCoord));if(overlayColorAlpha<=0.0){color*=1.0-uOverlayColor.a;}color*=uOpacity;fragColor=color;}",["aPosition","aTexCoord"],["uMatrix","uTexture","uTextureBlend","uTextureOverlay","uTextureSize","uColorGamma","uColorVignette","uColorOffset","uColorMatrix","uClarityKernel","uClarityKernelWeight","uOpacity","uMaskOpacity","uMaskBounds","uMaskCornerRadius","uMaskFeather","uOverlayColor","uAntialias"]),D=R.createBuffer(),B=R.createBuffer();R.bindBuffer(R.ARRAY_BUFFER,B),R.bufferData(R.ARRAY_BUFFER,ic,R.STATIC_DRAW);const W=R.createBuffer();R.bindBuffer(R.ARRAY_BUFFER,W),R.bufferData(R.ARRAY_BUFFER,nc,R.STATIC_DRAW);const _=Fl(R,"#version 300 es\n\nin vec4 aPosition;in vec2 aNormal;in float aMiter;out vec2 vNormal;out float vMiter;out float vWidth;uniform float uWidth;uniform float uSharpness;uniform mat4 uMatrix;void main(){vMiter=aMiter;vNormal=aNormal;vWidth=(uWidth*.5)+uSharpness;gl_Position=uMatrix*vec4(aPosition.x+(aNormal.x*vWidth*aMiter),aPosition.y+(aNormal.y*vWidth*aMiter),0,1);}","\n##head\n##mask\nin vec2 vNormal;in float vMiter;in float vWidth;uniform float uWidth;uniform vec4 uColor;uniform vec4 uCanvasColor;void main(){vec4 fillColor=uColor;float m=mask(gl_FragCoord.x,gl_FragCoord.y,uMaskBounds,uMaskOpacity);if(m<=0.0)discard;fillColor.a*=clamp(smoothstep(vWidth-.5,vWidth-1.0,abs(vMiter)*vWidth),0.0,1.0);fillColor.rgb*=fillColor.a;fillColor.rgb*=m;fillColor.rgb+=(1.0-m)*(uCanvasColor.rgb*fillColor.a);fragColor=fillColor;}",["aPosition","aNormal","aMiter"],["uColor","uCanvasColor","uMatrix","uWidth","uSharpness","uMaskBounds","uMaskOpacity"]),V=R.createBuffer();oc()&&(R.bindBuffer(R.ARRAY_BUFFER,V),R.bufferData(R.ARRAY_BUFFER,1,R.DYNAMIC_DRAW));const N=(e,t,o,i=!1)=>{const{program:n,locations:r}=_;R.useProgram(n),R.enableVertexAttribArray(r.aPosition),R.enableVertexAttribArray(r.aNormal),R.enableVertexAttribArray(r.aMiter);const a=((e,t)=>{let o,i,n,r=0;const a=e.length,s=new Float32Array(10*(t?a+1:a)),l=e[0],c=e[a-1];for(r=0;r<a;r++)o=e[r-1],i=e[r],n=e[r+1],o||(o=t?c:me(i.x+(i.x-n.x),i.y+(i.y-n.y))),n||(n=t?l:me(i.x+(i.x-o.x),i.y+(i.y-o.y))),ql(s,10*r,o,i,n);return t&&ql(s,10*a,c,l,e[1]),s})(e,i),s=5*Float32Array.BYTES_PER_ELEMENT,c=2*Float32Array.BYTES_PER_ELEMENT,d=4*Float32Array.BYTES_PER_ELEMENT;R.uniform1f(r.uWidth,t),R.uniform1f(r.uSharpness,l),R.uniform4fv(r.uColor,o),R.uniformMatrix4fv(r.uMatrix,!1,u),R.uniform4f(r.uCanvasColor,v,w,S,k),R.uniform1fv(r.uMaskBounds,f),R.uniform1f(r.uMaskOpacity,$),R.bindBuffer(R.ARRAY_BUFFER,V),R.bufferData(R.ARRAY_BUFFER,a,R.STATIC_DRAW),R.vertexAttribPointer(r.aPosition,2,R.FLOAT,!1,s,0),R.vertexAttribPointer(r.aNormal,2,R.FLOAT,!1,s,c),R.vertexAttribPointer(r.aMiter,1,R.FLOAT,!1,s,d),R.drawArrays(R.TRIANGLE_STRIP,0,a.length/5),R.disableVertexAttribArray(r.aPosition),R.disableVertexAttribArray(r.aNormal),R.disableVertexAttribArray(r.aMiter)},H=Fl(R,"\n##head\nvoid main(){\n##matrix\n}","\n##head\n##mask\nuniform vec4 uColor;uniform vec4 uCanvasColor;void main(){vec4 fillColor=uColor;\n##maskapply\nfillColor.rgb*=fillColor.a;fillColor.rgb*=m;fillColor.rgb+=(1.0-m)*(uCanvasColor.rgb*fillColor.a);fragColor=fillColor;}",["aPosition"],["uColor","uCanvasColor","uMatrix","uMaskBounds","uMaskOpacity"]),j=R.createBuffer(),U=Fl(R,"\n##head\n##text\nin vec2 aRectCoord;out vec2 vRectCoord;void main(){vTexCoord=aTexCoord;vRectCoord=aRectCoord;\n##matrix\n}","\n##head\n##mask\nin vec2 vTexCoord;in vec2 vRectCoord;uniform sampler2D uTexture;uniform vec4 uTextureColor;uniform float uTextureOpacity;uniform vec2 uRepeat;uniform vec4 uColor;uniform float uCornerRadius[4];uniform vec2 uSize;uniform vec2 uPosition;uniform vec4 uCanvasColor;uniform int uInverted;uniform float uEdgeFeather;void main(){\n##init\n##colorize\n##rectaa\n##cornerradius\n##maskfeatherapply\nif(uInverted==1)a=1.0-a;\n##maskapply\n##fragcolor\n}",["aPosition","aTexCoord","aRectCoord"],["uTexture","uColor","uMatrix","uCanvasColor","uTextureColor","uTextureOpacity","uRepeat","uPosition","uSize","uMaskBounds","uMaskOpacity","uMaskFeather","uCornerRadius","uInverted","uEdgeFeather"]),G=R.createBuffer(),Z=R.createBuffer(),Y=R.createBuffer(),q=Fl(R,"\n##head\n##text\nout vec2 vTexCoordDouble;void main(){vTexCoordDouble=vec2(aTexCoord.x*2.0-1.0,aTexCoord.y*2.0-1.0);vTexCoord=aTexCoord;\n##matrix\n}","\n##head\n##mask\nin vec2 vTexCoord;in vec2 vTexCoordDouble;uniform sampler2D uTexture;uniform float uTextureOpacity;uniform vec2 uTextureAdjust;uniform vec2 uRepeat;uniform vec2 uRadius;uniform vec4 uColor;uniform int uInverted;uniform vec4 uCanvasColor;void main(){\n##init\nfloat ar=uRadius.x/uRadius.y;vec2 rAA=vec2(uRadius.x-1.0,uRadius.y-(1.0/ar));vec2 scaledPointSq=vec2((vTexCoordDouble.x*uTextureAdjust.x*uRadius.x)*(vTexCoordDouble.x*uTextureAdjust.x*uRadius.x),(vTexCoordDouble.y*uTextureAdjust.y*uRadius.y)*(vTexCoordDouble.y*uTextureAdjust.y*uRadius.y));float p=(scaledPointSq.x/(uRadius.x*uRadius.x))+(scaledPointSq.y/(uRadius.y*uRadius.y));float pAA=(scaledPointSq.x/(rAA.x*rAA.x))+(scaledPointSq.y/(rAA.y*rAA.y));a=smoothstep(1.0,p/pAA,p);if(uInverted==1)a=1.0-a;\n##maskapply\n##fragcolor\n}",["aPosition","aTexCoord"],["uTexture","uTextureOpacity","uTextureAdjust","uRepeat","uColor","uCanvasColor","uMatrix","uRadius","uInverted","uMaskBounds","uMaskOpacity"]),K=R.createBuffer(),J=R.createBuffer(),Q=new Map,ee={2:{width:0,height:0},1:{width:0,height:0}},te=(e,t,o,n=1)=>{const a=Math.min(Math.min(4096,r)/o.width,Math.min(4096,r)/o.height,n),l=Math.floor(a*o.width),c=Math.floor(a*o.height);He(o,ee[e])?R.bindFramebuffer(R.FRAMEBUFFER,t):(R.bindTexture(R.TEXTURE_2D,C.get(e)),R.texImage2D(R.TEXTURE_2D,0,R.RGBA,l,c,0,R.RGBA,R.UNSIGNED_BYTE,null),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_MIN_FILTER,R.LINEAR),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_S,R.CLAMP_TO_EDGE),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_T,R.CLAMP_TO_EDGE),R.bindFramebuffer(R.FRAMEBUFFER,t),R.framebufferTexture2D(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_2D,C.get(e),0),ee[e]=o);const p=o.width*s,h=o.height*s;var m,g;Wl(d,0,p,h,0,-1,1),_l(d,0,h,0),g=1,(m=d)[0]*=g,m[1]*=g,m[2]*=g,m[3]*=g,((e,t)=>{e[4]*=t,e[5]*=t,e[6]*=t,e[7]*=t})(d,-1),u=d,R.viewport(0,0,l,c),R.colorMask(!0,!0,!0,!0),R.clearColor(0,0,0,0),R.clear(R.COLOR_BUFFER_BIT),x=[1,0,1,0,1,Math.max(i.width,o.width),1,Math.max(i.width,o.width)]},oe=(e,t)=>{const{forceRelease:o=!1}=t||{},{src:i}=Q.get(e);i instanceof HTMLCanvasElement&&(o||i.dataset.retain||y(i)),Q.delete(e),R.deleteTexture(e)},ie=e=>Q.get(e).isRotatedVideo;return{drawPath:(e,t=0,o=!1,i=!1,n,r,a,l,c)=>{if(e.length<2)return;const d=e.map((e=>({x:e.x*s,y:e.y*s}))),p=n*s;if(p>0&&N(d,p,Ol(r,c),a),d.length<3||!l||0===l[3]||!a)return;const h=Yl(d),m=new Float32Array(6*h.length);h.forEach((([e,t,o],i)=>{const n=6*i;m[n+0]=e.x,m[n+1]=e.y,m[n+2]=t.x,m[n+3]=t.y,m[n+4]=o.x,m[n+5]=o.y})),((e,t)=>{const{program:o,locations:i}=H;R.useProgram(o),R.enableVertexAttribArray(i.aPosition),R.uniform4fv(i.uColor,t),R.uniformMatrix4fv(i.uMatrix,!1,u),R.uniform1fv(i.uMaskBounds,f),R.uniform1f(i.uMaskOpacity,$),R.uniform4f(i.uCanvasColor,v,w,S,k),R.bindBuffer(R.ARRAY_BUFFER,j),R.bufferData(R.ARRAY_BUFFER,e,R.STATIC_DRAW),R.vertexAttribPointer(i.aPosition,2,R.FLOAT,!1,0,0),R.drawArrays(R.TRIANGLES,0,e.length/2),R.disableVertexAttribArray(i.aPosition)})(m,Ol(l,c))},drawRect:(e,t=0,o=!1,i=!1,n,r,a,l,c,d=!1,p,h,m,g,y,b=1/s,C,T)=>{const M=mt(et(e),s),P=n.map((t=>((e,t)=>Math.floor($s(e,0,Math.min(.5*(t.width-1),.5*(t.height-1)))))(t||0,e))).map((e=>e*s));if(r||a){const e=et(M);e.x-=.5,e.y-=.5,e.width+=1,e.height+=1;const n=Jl(e,t,o,i),h=Kl(n);let m;C&&(m=Ol(C),0===m[3]&&(m[3]=.001));const E=l&&d?[e.width/l.width,e.height/l.height]:[1,1];((e,t,o,i,n,r=I,a,l=1,c=lc,d=ic,p=x,h=1,m)=>{const{program:g,locations:y}=U;R.useProgram(g),R.enableVertexAttribArray(y.aPosition),R.enableVertexAttribArray(y.aTexCoord),R.enableVertexAttribArray(y.aRectCoord),R.uniform4fv(y.uColor,n),R.uniform2fv(y.uSize,[t,o]),R.uniform2fv(y.uPosition,[e[2],e[3]]),R.uniform2fv(y.uRepeat,a),R.uniform1i(y.uInverted,m?1:0),R.uniform1fv(y.uCornerRadius,i),R.uniform4f(y.uCanvasColor,v,w,S,k),R.uniform1fv(y.uMaskFeather,p.map(((e,t)=>t%2==0?e:e*s))),R.uniform1fv(y.uMaskBounds,f),R.uniform1f(y.uMaskOpacity,$),R.uniform1f(y.uEdgeFeather,Math.max(0,h)),R.uniformMatrix4fv(y.uMatrix,!1,u),R.uniform1i(y.uTexture,4),R.uniform4fv(y.uTextureColor,c),R.uniform1f(y.uTextureOpacity,l),R.activeTexture(R.TEXTURE0+4),R.bindTexture(R.TEXTURE_2D,r),R.bindBuffer(R.ARRAY_BUFFER,Z),R.bufferData(R.ARRAY_BUFFER,d,R.STATIC_DRAW),R.vertexAttribPointer(y.aTexCoord,2,R.FLOAT,!1,0,0),R.bindBuffer(R.ARRAY_BUFFER,Y),R.bufferData(R.ARRAY_BUFFER,ic,R.STATIC_DRAW),R.vertexAttribPointer(y.aRectCoord,2,R.FLOAT,!1,0,0),R.bindBuffer(R.ARRAY_BUFFER,G),R.bufferData(R.ARRAY_BUFFER,e,R.STATIC_DRAW),R.vertexAttribPointer(y.aPosition,2,R.FLOAT,!1,0,0),R.drawArrays(R.TRIANGLE_STRIP,0,e.length/2),R.disableVertexAttribArray(y.aPosition),R.disableVertexAttribArray(y.aTexCoord),R.disableVertexAttribArray(y.aRectCoord)})(h,e.width,e.height,P,Ol(r,g),a,E,g,m,p?new Float32Array(p):dc(e.width,e.height,l,c,s),y,b*s,T)}h&&(h=Math.min(h,M.width,M.height),N(((e,t,o,i,n,r,a,s)=>{const l=[];if(r.every((e=>0===e)))l.push(me(e,t),me(e+o,t),me(e+o,t+i),me(e,t+i));else{const[n,a,s,c]=r,d=e,u=e+o,p=t,h=t+i;l.push(me(d+n,p)),Ql(l,u-a,p+a,a,-1),l.push(me(u,p+a)),Ql(l,u-c,h-c,c,0),l.push(me(u-c,h)),Ql(l,d+s,h-s,s,1),l.push(me(d,h-s)),Ql(l,d+n,p+n,n,2)}return(a||s)&&Fe(l,a,s,e+.5*o,t+.5*i),n&&ze(l,n,e+.5*o,t+.5*i),l})(M.x,M.y,M.width,M.height,t,P,o,i),h*s,Ol(m,g),!0))},drawEllipse:(e,t,o,i,n,r,a,l,c,d,p,h,m,g,y)=>{const b=mt(lt(e.x-t,e.y-o,2*t,2*o),s);if(a||l){const e=et(b);y||(e.x-=.5,e.y-=.5,e.width+=1,e.height+=1);const t=Jl(e,i,n,r);((e,t,o,i,n=I,r,a=ic,l=1,c=!1)=>{const{program:d,locations:p}=q;R.useProgram(d),R.enableVertexAttribArray(p.aPosition),R.enableVertexAttribArray(p.aTexCoord),R.uniformMatrix4fv(p.uMatrix,!1,u),R.uniform2fv(p.uRadius,[.5*t,.5*o]),R.uniform2fv(p.uTextureAdjust,[r.width/(t/s),r.height/(o/s)]),R.uniform1i(p.uInverted,c?1:0),R.uniform4fv(p.uColor,i),R.uniform4f(p.uCanvasColor,v,w,S,k),R.uniform2fv(p.uRepeat,[1,1]),R.uniform1fv(p.uMaskBounds,f),R.uniform1f(p.uMaskOpacity,$),R.uniform1i(p.uTexture,4),R.uniform1f(p.uTextureOpacity,l),R.activeTexture(R.TEXTURE0+4),R.bindTexture(R.TEXTURE_2D,n),R.bindBuffer(R.ARRAY_BUFFER,J),R.bufferData(R.ARRAY_BUFFER,a,R.STATIC_DRAW),R.vertexAttribPointer(p.aTexCoord,2,R.FLOAT,!1,0,0),R.bindBuffer(R.ARRAY_BUFFER,K),R.bufferData(R.ARRAY_BUFFER,e,R.STATIC_DRAW),R.vertexAttribPointer(p.aPosition,2,R.FLOAT,!1,0,0),R.drawArrays(R.TRIANGLE_STRIP,0,e.length/2),R.disableVertexAttribArray(p.aPosition),R.disableVertexAttribArray(p.aTexCoord)})(Kl(t),e.width,e.height,Ol(a,g),l,c||Ne(e.width/s,e.height/s),p?new Float32Array(p):dc(e.width,e.height,c,d,s),g,y)}h&&N(((e,t,o,i,n,r,a)=>{const s=.5*Math.abs(o),l=.5*Math.abs(i),c=Math.abs(o)+Math.abs(i),d=Math.max(20,Math.round(c/6));return Bt(me(e+s,t+l),s,l,n,r,a,d)})(b.x,b.y,b.width,b.height,i,n,r),h*s,Ol(m,g),!0)},drawImage:(e,t,o,n,r,l,c,d,u,p,h=sc,m=1,g,y=1,x=0,v=b,w=cc,S=lc,k=!1,T=!1,I=!0)=>{const E=t.width*s,A=t.height*s,L=-.5*E,F=.5*A,O=.5*E,_=-.5*A,V=new Float32Array([L,_,0,L,F,0,O,_,0,O,F,0]);R.bindBuffer(R.ARRAY_BUFFER,D),R.bufferData(R.ARRAY_BUFFER,V,R.STATIC_DRAW);const N=t.height/2/P*(i.height/t.height)*-1;r*=s,l*=s,o*=s,n*=s;const{program:H,locations:j}=z,U=Bl();((e,t,o,i,n)=>{const r=1/Math.tan(t/2),a=1/(i-n);e[0]=r/o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=r,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(n+i)*a,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*n*i*a,e[15]=0})(U,M,a,1,2*-N),_l(U,r,-l,N),_l(U,o,-n,0),jl(U,-u),Vl(U,p),_l(U,-o,n,0),Hl(U,d),Nl(U,c),R.useProgram(H),R.enableVertexAttribArray(j.aPosition),R.enableVertexAttribArray(j.aTexCoord),R.uniform1i(j.uTexture,3),R.uniform2f(j.uTextureSize,t.width,t.height),R.activeTexture(R.TEXTURE0+3),R.bindTexture(R.TEXTURE_2D,e);const G=T?1:0,Z=C.get(G);R.uniform1i(j.uTextureBlend,G),R.activeTexture(R.TEXTURE0+G),R.bindTexture(R.TEXTURE_2D,Z);const X=k?2:0,Y=C.get(X);R.uniform1i(j.uTextureOverlay,X),R.activeTexture(R.TEXTURE0+X),R.bindTexture(R.TEXTURE_2D,Y),R.bindBuffer(R.ARRAY_BUFFER,D),R.vertexAttribPointer(j.aPosition,3,R.FLOAT,!1,0,0);const q=rc&&ie(e);let K;R.bindBuffer(R.ARRAY_BUFFER,q?W:B),R.vertexAttribPointer(j.aTexCoord,2,R.FLOAT,!1,0,0),R.uniformMatrix4fv(j.uMatrix,!1,U),R.uniform4fv(j.uOverlayColor,S),!g||vs(g,ac)?(g=ac,K=-1):(K=g.reduce(((e,t)=>e+t),0),K=K<=0?1:K),R.uniform1fv(j.uClarityKernel,g),R.uniform1f(j.uClarityKernelWeight,K),R.uniform1f(j.uColorGamma,1/y),R.uniform1f(j.uColorVignette,x),R.uniform1i(j.uAntialias,I?1:0),R.uniform4f(j.uColorOffset,h[4],h[9],h[14],h[19]),R.uniformMatrix4fv(j.uColorMatrix,!1,[h[0],h[1],h[2],h[3],h[5],h[6],h[7],h[8],h[10],h[11],h[12],h[13],h[15],h[16],h[17],h[18]]),R.uniform1f(j.uOpacity,m),R.uniform1f(j.uMaskOpacity,$),R.uniform1fv(j.uMaskBounds,f),R.uniform1fv(j.uMaskCornerRadius,w.map((e=>e*s))),R.uniform1fv(j.uMaskFeather,v.map(((e,t)=>t%2==0?e:e*s))),R.drawArrays(R.TRIANGLE_STRIP,0,4),R.disableVertexAttribArray(j.aPosition),R.disableVertexAttribArray(j.aTexCoord)},textureFilterNearest:R.NEAREST,textureFilterLinear:R.LINEAR,textureClamp:R.CLAMP_TO_EDGE,textureRepeat:R.REPEAT,textureCreate:()=>R.createTexture(),textureUpdate:(e,t,o)=>(Q.set(e,{src:t,options:o,isRotatedVideo:"VIDEO"===t.nodeName&&(t.dataset&&90==t.dataset.rotation||270==t.dataset.rotation)}),Dl(R,e,t,o)),textureGetSize:e=>{const{src:t,options:o}=Q.get(e),i=Be(t);return o.scalar?Xe(i,(e=>e/o.scalar)):i},textureDelete:oe,enablePreviewStencil:()=>{R.stencilOp(R.KEEP,R.KEEP,R.REPLACE),R.stencilFunc(R.ALWAYS,1,255),R.stencilMask(255)},applyPreviewStencil:()=>{R.stencilFunc(R.EQUAL,1,255),R.stencilMask(0)},disablePreviewStencil:T,setCanvasColor(e){v=e[0],w=e[1],S=e[2],k=o?e[3]:1,R.clear(R.COLOR_BUFFER_BIT)},resetCanvasMatrix:()=>{Wl(c,0,i.width,i.height,0,-1,1)},updateCanvasMatrix(e,t,o,n,r){const a=e.width,l=e.height,d=i.width*(.5/s),u=i.height*(.5/s),p={x:d+(o.x+t.x),y:u+(o.y+t.y)},h={x:p.x-t.x,y:p.y-t.y},m=.5*a,g=.5*l;ye(h,r.z,p),Ae(h,n,p);_l(c,(h.x-m)*s,(h.y-g)*s,0),_l(c,m*s,g*s,0),jl(c,r.z);const $=r.x>Math.PI/2;Nl(c,$?Math.PI:0);const f=r.y>Math.PI/2;Hl(c,f?Math.PI:0),Vl(c,n),_l(c,-m*s,-g*s,0)},drawToCanvas(){R.bindFramebuffer(R.FRAMEBUFFER,null),u=c,R.viewport(0,0,R.drawingBufferWidth,R.drawingBufferHeight),R.colorMask(!0,!0,!0,!0),R.clearColor(v,w,S,k),R.clear(R.COLOR_BUFFER_BIT),x=[1,0,1,0,1,i.width,1,i.width]},drawToImageBlendBuffer(e,t){te(1,F,e,t)},drawToImageOverlayBuffer(e,t){te(2,A,e,t)},enableMask(e,t){const o=e.x*s,n=e.y*s,r=e.width*s,a=e.height*s;g=o,h=g+r,p=i.height-n,m=i.height-(n+a),$=1-t,f=[p,h,m,g]},disableMask(){g=0,h=i.width,p=i.height,m=0,$=1,f=[p,h,m,g]},resize:(t,o,r)=>{s=Math.max(1,r),l=1===s?.75:1,n.width=t,n.height=o,i.width=t*s,i.height=o*s,a=X(i.width,i.height),e.width=i.width,e.height=i.height,Wl(c,0,i.width,i.height,0,-1,1),b=[1,0,1,0,1,n.width,1,n.width]},release(){Array.from(Q.keys()).forEach((e=>oe(e,{forceRelease:!0}))),Q.clear(),C.forEach((e=>{R.deleteTexture(e)})),C.clear(),z.destroy(),_.destroy(),H.destroy(),U.destroy(),q.destroy(),e.width=1,e.height=1,e=void 0}}},pc=e=>e%2==0?e:e+1;var hc=(e,t)=>{const{imageData:o,amount:i=1}=e,n=Math.round(2*Math.max(1,i)),r=Math.round(.5*n),a=o.width,s=o.height,l=new Uint8ClampedArray(a*s*4),c=o.data;let d,u,p,h,m,g=0,$=0,f=0;const y=a*s*4-4;for(p=0;p<s;p++)for(d=crypto.getRandomValues(new Uint8ClampedArray(s)),u=0;u<a;u++)h=d[p]/255,$=0,f=0,h<.5&&($=4*(-r+Math.round(Math.random()*n))),h>.5&&(f=(-r+Math.round(Math.random()*n))*(4*a)),m=Math.min(Math.max(0,g+$+f),y),l[g]=c[m],l[g+1]=c[m+1],l[g+2]=c[m+2],l[g+3]=c[m+3],g+=4;t(null,{data:l,width:o.width,height:o.height})};const mc=[.0625,.125,.0625,.125,.25,.125,.0625,.125,.0625];function gc(e){return Math.sqrt(1- --e*e)}function $c(e){return"[object Date]"===Object.prototype.toString.call(e)}function fc(e,t){if(e===t||e!=e)return()=>e;const o=typeof e;if(o!==typeof t||Array.isArray(e)!==Array.isArray(t))throw new Error("Cannot interpolate values of different type");if(Array.isArray(e)){const o=t.map(((t,o)=>fc(e[o],t)));return e=>o.map((t=>t(e)))}if("object"===o){if(!e||!t)throw new Error("Object cannot be null");if($c(e)&&$c(t)){e=e.getTime();const o=(t=t.getTime())-e;return t=>new Date(e+t*o)}const o=Object.keys(t),i={};return o.forEach((o=>{i[o]=fc(e[o],t[o])})),e=>{const t={};return o.forEach((o=>{t[o]=i[o](e)})),t}}if("number"===o){const o=t-e;return t=>e+t*o}throw new Error(`Cannot interpolate ${o} values`)}function yc(e,t={}){const o=Ya(e);let i,n=e;function r(r,a){if(null==e)return o.set(e=r),Promise.resolve();n=r;let s=i,l=!1,{delay:c=0,duration:d=400,easing:u=or,interpolate:p=fc}=ir(ir({},t),a);if(0===d)return s&&(s.abort(),s=null),o.set(e=n),Promise.resolve();const h=kr()+c;let m;return i=Pr((t=>{if(t<h)return!0;l||(m=p(e,r),"function"==typeof d&&(d=d(e,r)),l=!0),s&&(s.abort(),s=null);const i=t-h;return i>d?(o.set(e=r),!1):(o.set(e=m(u(i/d))),!0)})),i.promise}return{set:r,update:(t,o)=>r(t(n,e),o),subscribe:o.subscribe}}function bc(e,t,o,i){if("number"==typeof o){const n=i-o,r=(o-t)/(e.dt||1/60),a=(r+(e.opts.stiffness*n-e.opts.damping*r)*e.inv_mass)*e.dt;return Math.abs(a)<e.opts.precision&&Math.abs(n)<e.opts.precision?i:(e.settled=!1,o+a)}if(_o(o))return o.map(((n,r)=>bc(e,t[r],o[r],i[r])));if("object"==typeof o){const n={};for(const r in o)n[r]=bc(e,t[r],o[r],i[r]);return n}throw new Error(`Cannot spring ${typeof o} values`)}function xc(e,t={}){const o=Ya(e),{stiffness:i=.15,damping:n=.8,precision:r=.01}=t;let a,s,l,c=e,d=e,u=1,p=0,h=!1;function m(t,i={}){d=t;const n=l={};if(null==e||i.hard||g.stiffness>=1&&g.damping>=1)return h=!0,a=null,c=t,o.set(e=d),Promise.resolve();if(i.soft){const e=!0===i.soft?.5:+i.soft;p=1/(60*e),u=0}if(!s){a=null,h=!1;const t={inv_mass:void 0,opts:g,settled:!0,dt:void 0};s=Pr((i=>{if(null===a&&(a=i),h)return h=!1,s=null,!1;u=Math.min(u+p,1),t.inv_mass=u,t.opts=g,t.settled=!0,t.dt=60*(i-a)/1e3;const n=bc(t,c,e,d);return a=i,c=e,o.set(e=n),t.settled&&(s=null),!t.settled}))}return new Promise((e=>{s.promise.then((()=>{n===l&&e()}))}))}const g={set:m,update:(t,o)=>m(t(d,e),o),subscribe:o.subscribe,stiffness:i,damping:n,precision:r};return g}var vc=Xa(!1,(e=>{const t=window.matchMedia("(prefers-reduced-motion:reduce)"),o=()=>e(t.matches);return o(),t.addListener(o),()=>t.removeListener(o)})),wc=()=>"ResizeObserver"in window;const Sc=tt(),kc=(e,t,o,i,n)=>{e.rect||(e.rect=tt());const r=e.rect;ft(Sc,t,o,i,n),gt(r,Sc)||(yt(r,Sc),e.dispatchEvent(new CustomEvent("measure",{detail:r})))},Cc=Math.round,Tc=e=>{const t=e.getBoundingClientRect();Ec&&kc(e,Cc(t.x),Cc(t.y),Cc(t.width),Cc(t.height))},Mc=e=>{Ec&&kc(e,e.offsetLeft,e.offsetTop,e.offsetWidth,e.offsetHeight)},Pc=[];let Rc,Ic,Ec=void 0;function Ac(){Pc.length?(Pc.forEach((e=>e.measure(e))),Ec=requestAnimationFrame(Ac)):Ec=void 0}let Lc=new Map([]),Fc=0,zc=0;var Dc=(e,t={})=>{const{observePosition:o=!1,observeViewRect:i=!1,once:n=!1,disabled:r=!1,isMeasureRoot:a=!1}=t;if(wc()&&a&&(Ic||(Ic=new ResizeObserver((e=>{e.forEach((e=>{Lc.set(e.target,e.contentRect)}));const t=Array.from(Lc.values()).some((({width:e,height:t})=>e>0&&t>0));t?t&&!1===Ec&&Ac():(Ec&&cancelAnimationFrame(Ec),Ec=!1)}))),Ic.observe(e),Fc++),!r)return!wc()||o||i?(e.measure=i?Tc:Mc,Pc.push(e),void 0===Ec&&(Ec=requestAnimationFrame(Ac)),e.measure(e),{destroy(){a&&Ic&&(Lc.delete(e),Ic.unobserve(e),Fc--,0===Fc&&(Ic.disconnect(),Ic=void 0));const t=Pc.indexOf(e);Pc.splice(t,1),delete e.measure}}):(Rc||(Rc=new ResizeObserver((e=>{e.forEach((e=>{Ec&&Mc(e.target)}))}))),Rc.observe(e),Mc(e),n?Rc.unobserve(e):zc++,{destroy(){a&&Ic&&(Lc.delete(e),Ic.unobserve(e),Fc--,0===Fc&&(Ic.disconnect(),Ic=void 0)),n||(Rc.unobserve(e),zc--,0===zc&&(Rc.disconnect(),Rc=void 0))}})},Oc=e=>{let t=void 0;const o={pointerdown:()=>{t=!1},keydown:()=>{t=!0},keyup:()=>{t=!1},focus:e=>{!1!==t&&(e.target.dataset.focusVisible="")},blur:e=>{delete e.target.dataset.focusVisible}};return Object.keys(o).forEach((t=>e.addEventListener(t,o[t],!0))),{destroy(){Object.keys(o).forEach((t=>e.removeEventListener(t,o[t],!0)))}}};const Bc=e=>/^http/.test(e),Wc=e=>new Promise(((t,o)=>"file"===e.kind?t(e.getAsFile()):"string"===e.kind?e.getAsString(t):void o()));var _c=(e,t={})=>{const o=e=>{e.preventDefault()},i=async o=>{o.preventDefault(),o.stopPropagation();try{const i=await(e=>new Promise(((t,o)=>{const{items:i}=e.dataTransfer;if(!i)return t([]);const n=Array.from(i).some((e=>"text/uri-list"===e.type)),r=Array.from(i).filter((e=>("file"===e.kind||"string"===e.kind)&&"text/x-moz-url"!==e.type)).map(Wc);Promise.all(r).then((e=>{if(n)return t([e.find(Bc)].filter(Boolean));const o=e.filter((e=>Go(e)&&oo(e)||Bc(e)));t(o)})).catch(o)})))(o);e.dispatchEvent(new CustomEvent("dropfiles",{detail:{event:o,resources:i},...t}))}catch(e){}};return e.addEventListener("drop",i),e.addEventListener("dragover",o),{destroy(){e.removeEventListener("drop",i),e.removeEventListener("dragover",o)}}};let Vc=null;var Nc=()=>{if(null===Vc)if(d()){const e=$("canvas");Vc=!Gl(e,{failIfMajorPerformanceCaveat:!0}),y(e)}else Vc=!1;return Vc},Hc=e=>e instanceof WebGLTexture,jc=([e,t,o,i])=>[i.x,i.y,e.x,e.y,o.x,o.y,t.x,t.y];function Uc(e){let t,o,i,n;return{c(){t=Fr("div"),o=Fr("canvas"),Nr(t,"class","PinturaCanvas")},m(r,a){Ar(r,t,a),Rr(t,o),e[37](o),i||(n=[Wr(o,"measure",e[38]),wr(Dc.call(null,o))],i=!0)},p:tr,i:tr,o:tr,d(o){o&&Lr(t),e[37](null),i=!1,ar(n)}}}function Gc(e,t,o){let i,n,a,s,l,c,u;const p=[0,0,0,0],h=he(),g=d()&&(e=>{const t=.5*e,o=$("canvas",{"data-retain":!0,width:e,height:e}),i=o.getContext("2d");return i.fillStyle="#f0f",i.fillRect(0,0,t,t),i.fillRect(t,t,t,t),o})(128),f=sa();let x,{isAnimated:v}=t,{isTransparent:w}=t,{maskRect:S}=t,{maskOpacity:k=1}=t,{maskFrameOpacity:C=.95}=t,{maskMarkupOpacity:T=1}=t,{clipAnnotationsToImage:M=!0}=t,{pixelRatio:P=1}=t,{textPixelRatio:R=P}=t,{backgroundColor:I}=t,{willRender:E=Y}=t,{didRender:A=Y}=t,{willRequest:L}=t,{csp:F}=t,{loadImageData:z=Y}=t,{enableGrid:D=!1}=t,{gridColors:B}=t,{gridSize:W}=t,{gridOpacity:_=0}=t,{images:V=[]}=t,{interfaceImages:N=[]}=t,{selectionColor:H}=t,j=null,U=null,G=null;const Z=(e,t)=>e.set(t,{hard:!v}),q={precision:1e-4*.01};let K=0;const J=yc(void 0,{duration:0});hr(e,J,(e=>o(36,u=e)));const Q=xc(1,q);hr(e,Q,(e=>o(35,l=e)));const ee=xc(1,q);hr(e,ee,(e=>o(51,a=e)));const te=Ya();hr(e,te,(e=>o(53,c=e)));const oe=Ya();hr(e,oe,(e=>o(52,s=e)));const ie={},ne=(e,t)=>{let o=ie[e.id];const i=Math.min(1,2048/t.width);let n=o?o.element:$("canvas",{width:t.width*i,height:t.height*i,"data-retain":!0});if(!o||((e,t)=>{if(e.total!==t.length)return!0;const o=e.last,i=t[t.length-1];return o.drawMode!==i.drawMode||!(!Ii(o)||Ii(i)&>(o,i))||!(!Ei(o)||Ei(i)&&o.x===i.x&&o.y===i.y&&o.rx===i.rx&&o.ry===i.ry)||!(!Li(o)||Li(i)&&i.points.length===o.points.length)})(o,e.actions)){n=n.cloneNode(),((e,t,o)=>{const{selectionColor:i=[1,1,1],scalar:n=1}=o||{};let r=!1;for(const o of t){const t="subtract"===o.drawMode;if(t&&!r)continue;e.globalCompositeOperation=t?"destination-out":"source-over",e.save(),e.beginPath();const a=En(o);To(e,n,n),Co(e,o.rotation,a),Xn(e,o.flipX,o.flipY,a),o.width?Nn(e,{...o,backgroundColor:i}):o.points?Zn(e,Object.assign({},o,o.pathClose?{backgroundColor:i,strokeColor:[0,0,0,0]}:{strokeColor:i,strokeJoin:"round",strokeCap:"round"})):o.rx&&Hn(e,{...o,backgroundColor:i,strokeColor:[0,0,0,0],strokeJoin:"round",strokeCap:"round"}),e.restore(),r=!0}})(n.getContext("2d"),e.actions,{selectionColor:[1,0,1],scalar:i});const t=e.actions.length;ie[e.id]={total:t,last:{...e.actions[t-1]},element:n}}return{x:0,y:0,...t,fillColor:e.color||[1,1,1],backgroundImage:n}};let re;const ae=()=>{cancelAnimationFrame(re),re=requestAnimationFrame((()=>{Pe=!0,Ve=0,n()}))},se=new Map([]),le=new Map([]),ce=(e,t)=>({filterParam:"pixelated"===e?j.textureFilterNearest:j.textureFilterLinear,wrapParam:"repeat"===t?j.textureRepeat:j.textureClamp}),de=(e,t,o)=>{if(!se.has(e)){se.set(e,e);const n=ce(t,o);if(!m(i=e)&&($o(i)||b(i)||An(i)||no(i))){const t=j.textureCreate();j.textureUpdate(t,e,n),se.set(e,t)}else z(e).then((t=>{if(!j||!t)return;const o=j.textureCreate();j.textureUpdate(o,t,n),se.set(e,o),ae()})).catch((t=>{se.set(e,t)}))}var i,n;if(no(e)&&((n=e).currentTime>0&&!n.paused&&!n.ended&&n.readyState>2||"true"===e.dataset.redraw)){const i=se.get(e),n=ce(t,o);return j.textureUpdate(i,e,n),e.dataset.redraw=!1,i}return se.get(e)},ue=(e,t={})=>{const o=t.id||e.id;if(e.width&&e.width<1||e.height&&e.height<1||!e.text.length)return void le.delete(o);let{text:i,textAlign:n,fontFamily:r,fontSize:a=16,fontWeight:s,fontVariant:l,fontStyle:c,letterSpacing:d,lineHeight:u=a,width:p,height:h}=e,{outline:m=0,blur:g=0,paddingTop:f=0,paddingRight:y=0,paddingBottom:b=0,paddingLeft:x=0}=t;p=Oo(p)?Math.floor(p):p,h=Oo(h)?Math.floor(h):h;const{textSize:v,signature:w}=((e="",t)=>{let{width:o=0,height:i="auto",fontSize:n,fontFamily:r,lineHeight:a,fontWeight:s,fontStyle:l,fontVariant:c,letterSpacing:d}=t;const u=Yo({text:e,fontFamily:r,fontWeight:s,fontStyle:l,fontVariant:c,fontSize:n,lineHeight:a,letterSpacing:d,width:o,height:i});let p=ii.get(u);if(p)return p;let h=1;n>1e3&&O()&&(h=n/1e3,n=1e3,a*=h);const m=Kt($("pre",{contenteditable:"true",spellcheck:"false",style:`${ri}${ti({fontFamily:r,fontWeight:s,fontStyle:l,fontVariant:c,fontSize:n,letterSpacing:d,lineHeight:a})};${oi(e,t)}"`,innerHTML:e})),g=m.getBoundingClientRect();return p={signature:ni(m).flat().map((e=>e.text)).join("_;_"),textSize:Xe(Be(g),(e=>Math.ceil(e*h)))},ii.set(u,p),m.remove(),p})(i,{...e,width:p,height:void 0}),S=Yo({text:i,textAlign:n,fontFamily:r,fontSize:a,fontWeight:s,fontVariant:l,fontStyle:c,lineHeight:u,letterSpacing:d,outline:m,blur:g,signature:w});if(!se.has(S)){se.set(S,i);const e=Math.ceil(v.width),t=Math.ceil(v.height);if(0===e||0===t)return;const $=tc(),w=Math.min(1,($-(x+y)*R)/(e*R),($-(f+b)*R)/(t*R));bi(i,{fontSize:a,fontFamily:r,fontWeight:s,fontVariant:l,fontStyle:c,letterSpacing:d,textAlign:n,lineHeight:u,width:p,height:h,imageWidth:e,imageHeight:t,paddingLeft:x,paddingTop:f,paddingRight:y,paddingBottom:b,pixelRatio:R*w,willRequest:L,outline:m,blur:g,styleNonce:F.styleNonce,color:[1,0,1]}).then((e=>{if(!j)return;const t=j.textureCreate();j.textureUpdate(t,e,{filterParam:j.textureFilterLinear,wrapParam:j.textureClamp,scalar:w}),se.set(S,t),le.set(o,t),ae()})).catch(console.error)}const k=se.get(S);return Hc(k)?k:le.get(o)},pe=new Map,ge=e=>{let t;return e.backgroundImage?t=de(e.backgroundImage,e.backgroundImageRendering,"repeat"===e.backgroundRepeat?"repeat":void 0):e.bitmap&&e.points&&(t=(e=>{const{id:t,points:o,strokeWidth:i,strokeCap:n,strokeJoin:r,strokeColor:a,strokeDash:s}=e;let l=se.get(t),c=pe.get(t);const d=Yo({points:o.map((e=>`${e.x},${e.y}`)).join(","),strokeWidth:i,strokeCap:n,strokeJoin:r,strokeColor:a,strokeDash:(s||[]).join(",")});if(c){const{hash:e}=c;if(se.has(t)){if(d===e)return se.get(t)}else c=void 0}if(!c){const o=$("canvas",{width:1,height:1});c={canvas:o,hash:void 0},pe.set(e.id,c),l=j.textureCreate(),j.textureUpdate(l,o,{filterParam:j.textureFilterLinear,wrapParam:j.textureClamp}),se.set(t,l)}const{canvas:u}=c,p=Math.ceil(e.strokeWidth),h=rt(o),m=Math.floor(h.x)-.5*p,g=Math.floor(h.y)-.5*p,f=Math.ceil(h.width+p),y=Math.ceil(h.height+p);u.width=Math.max(f,1),u.height=Math.max(y,1);const b=u.getContext("2d");return b.clearRect(0,0,u.width,u.height),f>=1&&y>=1&&(b.translate(-m,-g),Zn(b,e),b.resetTransform()),j.textureUpdate(l,u,{filterParam:j.textureFilterLinear,wrapParam:j.textureClamp}),pe.set(t,{canvas:u,hash:d}),se.get(t)})(e)),t},$e=({texture:e,size:t,origin:o,translation:i,rotation:n,scale:r,colorMatrix:a,opacity:s,convolutionMatrix:l,gamma:c,vignette:d,maskFeather:u,maskCornerRadius:p,overlayColor:h,enableOverlay:m,enableManipulation:g,enableAntialiasing:$})=>{let f=0,y=0;if(1===P){const e=Math.abs(1-r)<Number.EPSILON;f=e&&U%2!=0?.5:0,y=e&&G%2!=0?.5:0}return j.drawImage(e,t,o.x,o.y,i.x+f,i.y+y,n.x,n.y,n.z,r,a,$s(s,0,1),l,c,d,u,p,h,m,g,$),e},fe=(e,t,o)=>{const i=ct(t),n=ct(e),r=i.x-n.x,a=i.y-n.y,s=ye(i,o,n);return{x:s.x-n.x-r,y:s.y-n.y-a}},be=(e,t,o)=>{let i=void 0,n=void 0;const r=X(o.width,o.height);if("repeat"===e.backgroundRepeat&&(i={...o},n={x:0,y:0}),"contain"===e.backgroundSize){const o=St(t,r,t);i=We(o),n=e.backgroundPosition?e.backgroundPosition:me(.5*(t.width-i.width),.5*(t.height-i.height))}else if("cover"===e.backgroundSize){const o=wt(t,r,t);i=We(o),e.backgroundPosition?n=e.backgroundPosition:(n=me(o.x,o.y),n=me(.5*(t.width-i.width),.5*(t.height-i.height)))}else e.backgroundSize?(i=e.backgroundSize,n=e.backgroundPosition||{x:0,y:0}):e.backgroundPosition&&(i={...o},n=e.backgroundPosition);return{backgroundSize:i,backgroundPosition:n}},xe=(e=[],t)=>{e.forEach((e=>{let o=ge(e);const i="complete"!==e.status&&("loading"===e.status||e.backgroundImage&&o===e.backgroundImage);i&&ae();const n="error"===e.status||e.backgroundImage&&o instanceof Error;let r=Hc(o)?o:void 0;const a=e._scale||1,s=e._translate||h,l=e.strokeWidth&&e.strokeWidth*a,c=e.cornerRadius?((e,t)=>[e,e,e,e].map((e=>e*t)))(e.cornerRadius,a):p,d=!!e.width,u=m(e.text),g=_o(e.points),$=Ei(e);if(g){const i=e.points.map((e=>me(e.x*a+s.x,e.y*a+s.y)));if(e.bitmap){o&&t.push(o);const n=rt(i),s=Math.ceil(e.strokeWidth*a);j.drawRect({x:Math.floor(n.x)-.5*s,y:Math.floor(n.y)-.5*s,width:Math.ceil(n.width+s),height:Math.ceil(n.height+s)},e.rotation,e.flipX,e.flipY,[0,0,0,0],void 0,r,void 0,void 0,void 0,void 0,void 0,void 0,e.opacity,void 0,void 0,!1,!1)}else j.drawPath(i,e.rotation,e.flipX,e.flipY,l,e.strokeColor,e.pathClose,e.backgroundColor,e.opacity)}else if($){let c=e.x,d=e.y;c*=a,d*=a,c+=s.x,d+=s.y;const u=at({x:c,y:d,rx:e.rx*a,ry:e.ry*a}),p=me(c,d),h=r&&j.textureGetSize(r);let m,g;if(h&&e.backgroundImage&&(e.backgroundSize||e.backgroundPosition||e.backgroundRepeat)){const t=be(e,u,h);m=t.backgroundSize,g=t.backgroundPosition}if(j.drawEllipse(p,e.rx*a,e.ry*a,e.rotation,e.flipX,e.flipY,e.backgroundColor,r,m,g,e.backgroundCorners&&jc(e.backgroundCorners),l,e.strokeColor,e.opacity,e.inverted),o&&t.push(o),i||n){if(!(e.backgroundColor||e.strokeColor&&e.strokeWidth)){const t=e.opacity||1;j.drawEllipse(p,e.rx*a,e.ry*a,e.rotation,e.flipX,e.flipY,n?[1,.2549,.2118,.25*t]:[0,0,0,.25*t])}n&&Te(p),i&&Ce(p)}}else if(u){const{fontSize:o=16}=e,i=o>1e3&&O()?o/1e3:1,n=Math.max(16,Math.ceil(o/i*.25)),r=Math.abs(e.rotation)>0,d=Oo(e.width)?Math.floor(e.width):e.width,u=Oo(e.height)?Math.floor(e.height):e.height,h=li(e.text,{...e,width:d,height:u}),m=Math.ceil(h.width),g=Math.ceil(h.height),$={x:e.x*a+s.x,y:e.y*a+s.y,width:m*a,height:g*a},f=!!e.height;(e.backgroundColor||e.strokeColor)&&j.drawRect($,e.rotation,e.flipX,e.flipY,c,e.backgroundColor,void 0,void 0,void 0,!1,void 0,l,e.strokeColor,e.opacity,void 0,void 0,void 0,e.inverted);const{textShadowX:y,textShadowY:b,textShadowBlur:x}=e;if(y||b||x){const o=Math.ceil(.5*x),l=Math.max(n,f?0:o),c=ue(e,{id:e.id+"shadow",blur:x,paddingTop:l,paddingRight:l,paddingBottom:l,paddingLeft:l});if(c&&!e._prerender){t.push(c);const o=j.textureGetSize(c),l={x:0,y:0},d={width:o.width/R*a,height:o.height/R*a},u=n*a/i;let p;if(f)p={...$},l.x=y-u,l.y=b-u;else if(p={x:e.x*a+s.x-u,y:e.y*a+s.y-u,width:d.width,height:d.height},r){const t=fe($,p,e.rotation);p.x+=t.x,p.y+=t.y;const o=ye(me(y,b),e.rotation);p.x+=o.x,p.y+=o.y}else p.x+=y,p.y+=b;j.drawRect(p,e.rotation,e.flipX,e.flipY,[0,0,0,0],void 0,c,d,l,!1,void 0,void 0,void 0,e.opacity,void 0,0,e.textShadowColor)}}if(e.textOutlineWidth){const o=Math.ceil(.5*e.textOutlineWidth),l=n+o,c=ue(e,{id:e.id+"outline",outline:e.textOutlineWidth,paddingTop:l,paddingRight:l,paddingBottom:l,paddingLeft:l});if(c&&!e._prerender){t.push(c);const l=j.textureGetSize(c),d={x:0,y:0},u={width:l.width/R*a,height:l.height/R*a},p=(n+o)*a/i,h={x:e.x*a+s.x-p,y:e.y*a+s.y-p,width:u.width,height:e.height?g+p:u.height};if(r){const t=fe($,h,e.rotation);h.x+=t.x,h.y+=t.y}j.drawRect(h,e.rotation,e.flipX,e.flipY,[0,0,0,0],void 0,c,u,d,!1,void 0,void 0,void 0,e.opacity,void 0,0,e.textOutlineColor)}}const v=ue(e,{id:e.id+"text",paddingTop:n,paddingRight:n,paddingBottom:n,paddingLeft:n});if(v&&!e._prerender){t.push(v);const o=j.textureGetSize(v),l={x:0,y:0},c={width:o.width/R*a,height:o.height/R*a},d=n*a/i,u={x:e.x*a+s.x-d,y:e.y*a+s.y-d,width:c.width,height:e.height?g+d:c.height};if(r){const t=fe($,u,e.rotation);u.x+=t.x,u.y+=t.y}const h=e.color||[0,0,0];e._prerender&&(h[3]=0),j.drawRect(u,e.rotation,e.flipX,e.flipY,p,!1,v,c,l,!1,!1,void 0,void 0,e.opacity,void 0,e.feather,h,e.inverted)}}else if(d){o&&t.push(o);const d=nt(e);let u,p;a&&s&&(d.x*=a,d.y*=a,d.x+=s.x,d.y+=s.y,d.width*=a,d.height*=a);const{backgroundRepeat:h="no-repeat"}=e,m=r&&j.textureGetSize(r);if(m&&e.backgroundImage&&(e.backgroundSize||e.backgroundPosition||e.backgroundRepeat)){const t=be(e,d,m);u=t.backgroundSize,p=t.backgroundPosition}if(j.drawRect(d,e.rotation,e.flipX,e.flipY,c,e.backgroundColor||[0,0,0,0],r,u,p,"repeat"===h,e.backgroundCorners&&jc(e.backgroundCorners),l,e.strokeColor,e.opacity,void 0,e.feather,e.fillColor,e.inverted),i||n){if(!(e.backgroundColor&&0!==e.backgroundColor[3]||e.strokeColor&&e.strokeWidth)){const t=e.opacity||1;j.drawRect(d,e.rotation,e.flipX,e.flipY,c,n?[1,.2549,.2118,.25*t]:[0,0,0,.25*t])}const t=ct(d);n&&Te(t),i&&Ce(t)}}else o&&t.push(o)}))};let ve=0;const we=[{x:-5,y:-5},{x:5,y:5}],Se=[{x:5,y:-5},{x:-5,y:5}],ke=Bt({x:0,y:0},10,10,0,!1,!1,16);ke.length=9;const Ce=e=>{ve=Date.now()/50,j.drawEllipse(e,15,15,0,!1,!1,[0,0,0,.5]);const t=ze(ke.map((t=>({x:t.x+e.x,y:t.y+e.y}))),ve,e.x,e.y);j.drawPath(t,0,!1,!1,2,[1,1,1])},Te=e=>{j.drawEllipse(e,13,13,0,!1,!1,[1,.2549,.2118,.75]);const t=we.map((t=>({x:t.x+e.x,y:t.y+e.y}))),o=Se.map((t=>({x:t.x+e.x,y:t.y+e.y})));j.drawPath(t,0,!1,!1,3,[1,1,1]),j.drawPath(o,0,!1,!1,3,[1,1,1])},Me=(e,t,o,i,n,r)=>j.drawRect(t,0,!1,!1,p,p,e,i,o,!0,void 0,0,void 0,r,void 0,void 0,n);let Pe=!1,Re=!0,Ie=!1;const Ee=[],Ae=[],Le=[],Fe=e=>!e.aboveFrame,De=e=>e.aboveFrame,Oe=()=>{Le.length=0;const e=V[0],{manipulationShapes:t,manipulationShapesDirty:o,annotationShapes:i,annotationShapesDirty:n,interfaceShapes:r,decorationShapes:d,frameShapes:h,selectionShapes:m}=E({opacity:e.opacity,rotation:e.rotation,scale:e.scale,images:V,size:Ne(U,G),backgroundColor:[...u],selectionRect:c}),$=[...u],f=c,y=$s(l,0,1),b=s,x=Math.abs(e.rotation.x/Math.PI*2-1),v=Math.abs(e.rotation.y/Math.PI*2-1),k=x<.99||v<.99,C={...e.size},P=e.backgroundColor,I=e.backgroundImage,L=t.length>0,F=i.length>0,z=i.filter(De).length>0,O=d.filter(De).length>0,Z=P[3]>0,X=!!M&&T>=1;if(y<1&&Z){const e=$[0],t=$[1],o=$[2],i=1-y,n=P[0]*i,r=P[1]*i,a=P[2]*i,s=1-i;$[0]=n+e*s,$[1]=r+t*s,$[2]=a+o*s,$[3]=1}j.setCanvasColor(w?p:$);L&&(o||Pe)?(j.disableMask(),j.drawToImageBlendBuffer(C),Ee.length=0,xe(t,Ee)):L||(Ee.length=0),Le.push(...Ee),Re&&(j.drawToImageOverlayBuffer(C,R),Re=!1);if(k){if(F&&(n||Pe)||!Ie){j.disableMask(),j.drawToImageOverlayBuffer(C,R),Ae.length=0;const e=z?i.filter(Fe):i;xe(e,Ae)}else F||(Ae.length=0);Ie=!0}else Ie=!1;if(j.drawToCanvas(),j.enableMask(f,y),D&&W>=1&&2===B.length&&_&&((e,t,o,i,n)=>{const r=Ne(t,t),a=de(g,"pixelated","repeat"),s=me(-e.x%t,-e.y%t),l=me(s.x+.5*r.width,s.y);Me(a,e,s,r,o,n),Me(a,e,l,r,i,n)})(f,W,B[0],B[1],_),Z&&j.drawRect(f,0,!1,!1,p,P),I){j.enableMask(f,1);const e=Math.max(S.width/I.width,S.height/I.height),t=I.width*e,o=I.height*e,i={x:S.x+.5*S.width-.5*t,y:S.y+.5*S.height-.5*o,width:t,height:o};j.drawRect(i,0,!1,!1,p,p,de(I,"linear")),j.enableMask(f,y)}if(X&&j.enablePreviewStencil(),Le.push(...[...V].reverse().map((e=>$e({...e,texture:de(e.data),enableOverlay:k&&F,enableManipulation:L,enableAntialiasing:!0,mask:f,maskOpacity:y,overlayColor:b})))),j.enableMask(f,T),!k){X&&j.applyPreviewStencil(),j.resetCanvasMatrix(),j.updateCanvasMatrix(C,e.origin,e.translation,e.scale,e.rotation),Ae.length=0;const t=z?i.filter(Fe):i;xe(t,Ae),X&&j.disablePreviewStencil()}if(Le.push(...Ae),j.resetCanvasMatrix(),j.enableMask(f,T),xe(O?d.filter(Fe):d,Le),h.length){j.enableMask(f,1);const e=h.filter((e=>!e.expandsCanvas)),t=h.filter((e=>e.expandsCanvas));e.length&&xe(e,Le),t.length&&(j.enableMask({x:f.x+.5,y:f.y+.5,width:f.width-1,height:f.height-1},a),xe(t,Le))}if(z&&(j.resetCanvasMatrix(),j.updateCanvasMatrix(C,e.origin,e.translation,e.scale,e.rotation),xe(i.filter(De),Le),j.resetCanvasMatrix()),O&&(j.resetCanvasMatrix(),xe(d.filter(De),Le),j.resetCanvasMatrix()),H&&m.length&&!k){j.resetCanvasMatrix(),j.updateCanvasMatrix(C,e.origin,e.translation,e.scale,e.rotation);const t=[...H];t[3]=.5;const o=[{id:"selection",color:t,actions:[...m]}].map((e=>ne(e,C)));xe(o,Le),j.resetCanvasMatrix()}j.disableMask(),xe(r,Le),N.forEach((e=>{if(j.enableMask(e.mask,e.maskOpacity),e.backgroundColor){const t=I&&wt({...e.mask},I.width/I.height),o=I&&de(I,"linear");j.drawRect(e.mask,0,!1,!1,e.maskCornerRadius,e.backgroundColor,o,t,t,void 0,void 0,void 0,void 0,e.opacity,e.maskFeather),o&&Le.push(o)}const t=$e({...e,texture:de(e.data),enableAntialiasing:!1,translation:{x:e.translation.x+e.offset.x-.5*U,y:e.translation.y+e.offset.y-.5*G}});Le.push(t)})),j.disableMask(),(e=>{se.forEach(((t,o)=>{!e.find((e=>e===t))&&Hc(t)&&(Array.from(le.values()).includes(t)||(se.delete(o),j.textureDelete(t)))}))})(Le),A(),Pe=!1};let _e,Ve=0;const He=()=>{clearTimeout(_e);const e=Date.now();e-Ve<48?_e=setTimeout(He,48):(Ve=e,Oe())};ra((()=>n())),na((()=>o(31,j=uc(x,{alpha:w})))),aa((()=>{j&&(pe.forEach((({canvas:e})=>y(e))),pe.clear(),j.release(),o(31,j=void 0),o(0,x=void 0))}));return e.$$set=e=>{"isAnimated"in e&&o(9,v=e.isAnimated),"isTransparent"in e&&o(10,w=e.isTransparent),"maskRect"in e&&o(11,S=e.maskRect),"maskOpacity"in e&&o(12,k=e.maskOpacity),"maskFrameOpacity"in e&&o(13,C=e.maskFrameOpacity),"maskMarkupOpacity"in e&&o(14,T=e.maskMarkupOpacity),"clipAnnotationsToImage"in e&&o(15,M=e.clipAnnotationsToImage),"pixelRatio"in e&&o(16,P=e.pixelRatio),"textPixelRatio"in e&&o(17,R=e.textPixelRatio),"backgroundColor"in e&&o(18,I=e.backgroundColor),"willRender"in e&&o(19,E=e.willRender),"didRender"in e&&o(20,A=e.didRender),"willRequest"in e&&o(21,L=e.willRequest),"csp"in e&&o(22,F=e.csp),"loadImageData"in e&&o(23,z=e.loadImageData),"enableGrid"in e&&o(24,D=e.enableGrid),"gridColors"in e&&o(25,B=e.gridColors),"gridSize"in e&&o(26,W=e.gridSize),"gridOpacity"in e&&o(27,_=e.gridOpacity),"images"in e&&o(28,V=e.images),"interfaceImages"in e&&o(29,N=e.interfaceImages),"selectionColor"in e&&o(30,H=e.selectionColor)},e.$$.update=()=>{if(1&e.$$.dirty[0]&&x){const e=getComputedStyle(x).getPropertyValue("--color-transition-duration");o(32,K=(e=>{let t=parseFloat(e);return/^[0-9]+s$/.test(e)?1e3*t:t})(e))}262656&e.$$.dirty[0]|2&e.$$.dirty[1]&&I&&J.set(I,{duration:v?K:0}),4096&e.$$.dirty[0]&&Z(Q,Oo(k)?k:1),8192&e.$$.dirty[0]&&Z(ee,Oo(C)?C:1),2048&e.$$.dirty[0]&&S&&te.set(S),48&e.$$.dirty[1]&&u&&oe.set([u[0],u[1],u[2],$s(l,0,1)]),268435462&e.$$.dirty[0]|1&e.$$.dirty[1]&&o(34,i=!!(j&&U&&G&&V.length)),65542&e.$$.dirty[0]|1&e.$$.dirty[1]&&U&&G&&j&&(Ve=0,j.resize(U,G,P)),8&e.$$.dirty[1]&&o(33,n=i?Nc()?He:Oe:r),12&e.$$.dirty[1]&&i&&n&&n()},[x,U,G,f,J,Q,ee,te,oe,v,w,S,k,C,T,M,P,R,I,E,A,L,F,z,D,B,W,_,V,N,H,j,K,n,i,l,u,function(e){pa[e?"unshift":"push"]((()=>{x=e,o(0,x)}))},e=>{o(1,U=e.detail.width),o(2,G=e.detail.height),f("measure",{width:U,height:G})}]}class Zc extends Ga{constructor(e){super(),Ua(this,e,Gc,Uc,lr,{isAnimated:9,isTransparent:10,maskRect:11,maskOpacity:12,maskFrameOpacity:13,maskMarkupOpacity:14,clipAnnotationsToImage:15,pixelRatio:16,textPixelRatio:17,backgroundColor:18,willRender:19,didRender:20,willRequest:21,csp:22,loadImageData:23,enableGrid:24,gridColors:25,gridSize:26,gridOpacity:27,images:28,interfaceImages:29,selectionColor:30},null,[-1,-1,-1])}}var Xc=(e,t=Boolean,o=" ")=>e.filter(t).join(o);function Yc(e,t,o){const i=e.slice();return i[17]=t[o],i}const qc=e=>({tab:4&e}),Kc=e=>({tab:e[17]});function Jc(e){let t,o,i,n=[],r=new Map,a=e[2];const s=e=>e[17].id;for(let t=0;t<a.length;t+=1){let o=Yc(e,a,t),i=s(o);r.set(i,n[t]=Qc(i,o))}return{c(){t=Fr("div");for(let e=0;e<n.length;e+=1)n[e].c();Nr(t,"class",o=Xc(["PinturaTabList",e[0]])),Nr(t,"role","tablist"),Nr(t,"data-layout",e[1])},m(o,r){Ar(o,t,r);for(let e=0;e<n.length;e+=1)n[e].m(t,null);e[14](t),i=!0},p(e,l){1124&l&&(a=e[2],Ra(),n=Ba(n,l,s,1,e,a,r,t,Oa,Qc,null,Yc),Ia()),(!i||1&l&&o!==(o=Xc(["PinturaTabList",e[0]])))&&Nr(t,"class",o),(!i||2&l)&&Nr(t,"data-layout",e[1])},i(e){if(!i){for(let e=0;e<a.length;e+=1)Ea(n[e]);i=!0}},o(e){for(let e=0;e<n.length;e+=1)Aa(n[e]);i=!1},d(o){o&&Lr(t);for(let e=0;e<n.length;e+=1)n[e].d();e[14](null)}}}function Qc(e,t){let o,i,n,r,a,s,l,c,d;const u=t[11].default,p=mr(u,t,t[10],Kc);function h(...e){return t[12](t[17],...e)}function m(...e){return t[13](t[17],...e)}return{key:e,first:null,c(){o=Fr("button"),p&&p.c(),i=Or(),Nr(o,"role","tab"),Nr(o,"id",n=t[17].tabId),Nr(o,"aria-controls",r=t[17].href.substring(1)),Nr(o,"aria-selected",a=t[17].selected),o.disabled=s=t[17].disabled,Nr(o,"type","button"),this.first=o},m(e,t){Ar(e,o,t),p&&p.m(o,null),Rr(o,i),l=!0,c||(d=[Wr(o,"keydown",h),Wr(o,"click",m)],c=!0)},p(e,i){t=e,p&&p.p&&(!l||1028&i)&&fr(p,u,t,t[10],l?$r(u,t[10],i,qc):yr(t[10]),Kc),(!l||4&i&&n!==(n=t[17].tabId))&&Nr(o,"id",n),(!l||4&i&&r!==(r=t[17].href.substring(1)))&&Nr(o,"aria-controls",r),(!l||4&i&&a!==(a=t[17].selected))&&Nr(o,"aria-selected",a),(!l||4&i&&s!==(s=t[17].disabled))&&(o.disabled=s)},i(e){l||(Ea(p,e),l=!0)},o(e){Aa(p,e),l=!1},d(e){e&&Lr(o),p&&p.d(e),c=!1,ar(d)}}}function ed(e){let t,o,i=e[4]&&Jc(e);return{c(){i&&i.c(),t=Br()},m(e,n){i&&i.m(e,n),Ar(e,t,n),o=!0},p(e,[o]){e[4]?i?(i.p(e,o),16&o&&Ea(i,1)):(i=Jc(e),i.c(),Ea(i,1),i.m(t.parentNode,t)):i&&(Ra(),Aa(i,1,1,(()=>{i=null})),Ia())},i(e){o||(Ea(i),o=!0)},o(e){Aa(i),o=!1},d(e){i&&i.d(e),e&&Lr(t)}}}function td(e,t,o){let i,n,r,{$$slots:a={},$$scope:s}=t,{class:l}=t,{name:c}=t,{selected:d}=t,{tabs:u=[]}=t,{layout:p}=t;const h=sa(),m=e=>{const t=r.querySelectorAll('[role="tab"] button')[e];t&&t.focus()},g=(e,t)=>{e.preventDefault(),e.stopPropagation(),h("select",t)},$=({key:e},t)=>{if(!/arrow/i.test(e))return;const o=u.findIndex((e=>e.id===t));return/right|down/i.test(e)?m(o<u.length-1?o+1:0):/left|up/i.test(e)?m(o>0?o-1:u.length-1):void 0};return e.$$set=e=>{"class"in e&&o(0,l=e.class),"name"in e&&o(7,c=e.name),"selected"in e&&o(8,d=e.selected),"tabs"in e&&o(9,u=e.tabs),"layout"in e&&o(1,p=e.layout),"$$scope"in e&&o(10,s=e.$$scope)},e.$$.update=()=>{896&e.$$.dirty&&o(2,i=u.map((e=>{const t=e.id===d;return{...e,tabId:`tab-${c}-${e.id}`,href:`#panel-${c}-${e.id}`,selected:t}}))),4&e.$$.dirty&&o(4,n=i.length>1)},[l,p,i,r,n,g,$,c,d,u,s,a,(e,t)=>$(t,e.id),(e,t)=>g(t,e.id),function(e){pa[e?"unshift":"push"]((()=>{r=e,o(3,r)}))}]}class od extends Ga{constructor(e){super(),Ua(this,e,td,ed,lr,{class:0,name:7,selected:8,tabs:9,layout:1})}}var id=(e,t)=>{if(!t)return;const o=t=>{g(e,t)};return o(t),{update:o}};const nd=e=>({panel:16&e}),rd=e=>({panel:e[4][0].id,panelIsActive:!0});function ad(e,t,o){const i=e.slice();return i[14]=t[o].id,i[15]=t[o].shouldDraw,i[16]=t[o].panelId,i[17]=t[o].labelledBy,i[18]=t[o].isActive,i[19]=t[o].hidden,i[3]=t[o].visible,i}const sd=e=>({panel:16&e,panelIsActive:16&e}),ld=e=>({panel:e[14],panelIsActive:e[18]});function cd(e){let t,o,i,n,r,a,s;const l=e[11].default,c=mr(l,e,e[10],rd);return{c(){t=Fr("div"),o=Fr("div"),c&&c.c(),Nr(o,"class",i=Xc([e[1]])),Nr(t,"class",e[0])},m(i,l){Ar(i,t,l),Rr(t,o),c&&c.m(o,null),r=!0,a||(s=[wr(n=id.call(null,t,e[2])),Wr(t,"measure",e[13]),wr(Dc.call(null,t))],a=!0)},p(e,a){c&&c.p&&(!r||1040&a)&&fr(c,l,e,e[10],r?$r(l,e[10],a,nd):yr(e[10]),rd),(!r||2&a&&i!==(i=Xc([e[1]])))&&Nr(o,"class",i),(!r||1&a)&&Nr(t,"class",e[0]),n&&sr(n.update)&&4&a&&n.update.call(null,e[2])},i(e){r||(Ea(c,e),r=!0)},o(e){Aa(c,e),r=!1},d(e){e&&Lr(t),c&&c.d(e),a=!1,ar(s)}}}function dd(e){let t,o,i,n,r,a,s=[],l=new Map,c=e[4];const d=e=>e[14];for(let t=0;t<c.length;t+=1){let o=ad(e,c,t),i=d(o);l.set(i,s[t]=pd(i,o))}return{c(){t=Fr("div");for(let e=0;e<s.length;e+=1)s[e].c();Nr(t,"class",o=Xc(["PinturaTabPanels",e[0]]))},m(o,l){Ar(o,t,l);for(let e=0;e<s.length;e+=1)s[e].m(t,null);n=!0,r||(a=[wr(i=id.call(null,t,e[2])),Wr(t,"measure",e[12]),wr(Dc.call(null,t,{observePosition:!0}))],r=!0)},p(e,r){1042&r&&(c=e[4],Ra(),s=Ba(s,r,d,1,e,c,l,t,Oa,pd,null,ad),Ia()),(!n||1&r&&o!==(o=Xc(["PinturaTabPanels",e[0]])))&&Nr(t,"class",o),i&&sr(i.update)&&4&r&&i.update.call(null,e[2])},i(e){if(!n){for(let e=0;e<c.length;e+=1)Ea(s[e]);n=!0}},o(e){for(let e=0;e<s.length;e+=1)Aa(s[e]);n=!1},d(e){e&&Lr(t);for(let e=0;e<s.length;e+=1)s[e].d();r=!1,ar(a)}}}function ud(e){let t;const o=e[11].default,i=mr(o,e,e[10],ld);return{c(){i&&i.c()},m(e,o){i&&i.m(e,o),t=!0},p(e,n){i&&i.p&&(!t||1040&n)&&fr(i,o,e,e[10],t?$r(o,e[10],n,sd):yr(e[10]),ld)},i(e){t||(Ea(i,e),t=!0)},o(e){Aa(i,e),t=!1},d(e){i&&i.d(e)}}}function pd(e,t){let o,i,n,r,a,s,l,c,d=t[15]&&ud(t);return{key:e,first:null,c(){o=Fr("div"),d&&d.c(),i=Or(),Nr(o,"class",n=Xc(["PinturaTabPanel",t[1]])),o.hidden=r=t[19],Nr(o,"id",a=t[16]),Nr(o,"aria-labelledby",s=t[17]),Nr(o,"data-inert",l=!t[3]),Nr(o,"role","tabpanel"),this.first=o},m(e,t){Ar(e,o,t),d&&d.m(o,null),Rr(o,i),c=!0},p(e,u){(t=e)[15]?d?(d.p(t,u),16&u&&Ea(d,1)):(d=ud(t),d.c(),Ea(d,1),d.m(o,i)):d&&(Ra(),Aa(d,1,1,(()=>{d=null})),Ia()),(!c||2&u&&n!==(n=Xc(["PinturaTabPanel",t[1]])))&&Nr(o,"class",n),(!c||16&u&&r!==(r=t[19]))&&(o.hidden=r),(!c||16&u&&a!==(a=t[16]))&&Nr(o,"id",a),(!c||16&u&&s!==(s=t[17]))&&Nr(o,"aria-labelledby",s),(!c||16&u&&l!==(l=!t[3]))&&Nr(o,"data-inert",l)},i(e){c||(Ea(d),c=!0)},o(e){Aa(d),c=!1},d(e){e&&Lr(o),d&&d.d()}}}function hd(e){let t,o,i,n;const r=[dd,cd],a=[];function s(e,t){return e[5]?0:1}return t=s(e),o=a[t]=r[t](e),{c(){o.c(),i=Br()},m(e,o){a[t].m(e,o),Ar(e,i,o),n=!0},p(e,[n]){let l=t;t=s(e),t===l?a[t].p(e,n):(Ra(),Aa(a[l],1,1,(()=>{a[l]=null})),Ia(),o=a[t],o?o.p(e,n):(o=a[t]=r[t](e),o.c()),Ea(o,1),o.m(i.parentNode,i))},i(e){n||(Ea(o),n=!0)},o(e){Aa(o),n=!1},d(e){a[t].d(e),e&&Lr(i)}}}function md(e,t,o){let i,n,{$$slots:r={},$$scope:a}=t,{class:s}=t,{name:l}=t,{selected:c}=t,{panelClass:d}=t,{panels:u=[]}=t,{visible:p}=t,{style:h}=t;const m={};return e.$$set=e=>{"class"in e&&o(0,s=e.class),"name"in e&&o(6,l=e.name),"selected"in e&&o(7,c=e.selected),"panelClass"in e&&o(1,d=e.panelClass),"panels"in e&&o(8,u=e.panels),"visible"in e&&o(3,p=e.visible),"style"in e&&o(2,h=e.style),"$$scope"in e&&o(10,a=e.$$scope)},e.$$.update=()=>{968&e.$$.dirty&&o(4,i=u.map((e=>{const t=e===c;t&&o(9,m[e]=!0,m);const i=p?-1!==p.indexOf(e):t;return{id:e,panelId:`panel-${l}-${e}`,labelledBy:`tab-${l}-${e}`,isActive:t,hidden:!t,visible:i,shouldDraw:t||m[e]}}))),16&e.$$.dirty&&o(5,n=i.length>1)},[s,d,h,p,i,n,l,c,u,m,a,r,function(t){da.call(this,e,t)},function(t){da.call(this,e,t)}]}class gd extends Ga{constructor(e){super(),Ua(this,e,md,hd,lr,{class:0,name:6,selected:7,panelClass:1,panels:8,visible:3,style:2})}}var $d=e=>{const t=Object.getOwnPropertyDescriptors(e.prototype);return Object.keys(t).filter((e=>!!t[e].get))};function fd(e){let t,o,i,n;const r=[e[5],{locale:e[1]}];function a(t){e[22](t)}var s=e[10];function l(e){let t={};for(let e=0;e<r.length;e+=1)t=ir(t,r[e]);return void 0!==e[3]&&(t.name=e[3]),{props:t}}return s&&(t=qr(s,l(e)),pa.push((()=>Va(t,"name",a))),e[23](t),t.$on("measure",e[11])),{c(){t&&Na(t.$$.fragment),i=Br()},m(e,o){t&&Ha(t,e,o),Ar(e,i,o),n=!0},p(e,n){const c=34&n[0]?Wa(r,[32&n[0]&&_a(e[5]),2&n[0]&&{locale:e[1]}]):{};if(!o&&8&n[0]&&(o=!0,c.name=e[3],xa((()=>o=!1))),s!==(s=e[10])){if(t){Ra();const e=t;Aa(e.$$.fragment,1,0,(()=>{ja(e,1)})),Ia()}s?(t=qr(s,l(e)),pa.push((()=>Va(t,"name",a))),e[23](t),t.$on("measure",e[11]),Na(t.$$.fragment),Ea(t.$$.fragment,1),Ha(t,i.parentNode,i)):t=null}else s&&t.$set(c)},i(e){n||(t&&Ea(t.$$.fragment,e),n=!0)},o(e){t&&Aa(t.$$.fragment,e),n=!1},d(o){e[23](null),o&&Lr(i),t&&ja(t,o)}}}function yd(e){let t,o,i,n=e[6]&&fd(e);return{c(){t=Fr("div"),n&&n.c(),Nr(t,"data-util",e[3]),Nr(t,"class",o=Xc(["PinturaUtilPanel",e[2]])),Zr(t,"opacity",e[7])},m(o,r){Ar(o,t,r),n&&n.m(t,null),e[24](t),i=!0},p(e,r){e[6]?n?(n.p(e,r),64&r[0]&&Ea(n,1)):(n=fd(e),n.c(),Ea(n,1),n.m(t,null)):n&&(Ra(),Aa(n,1,1,(()=>{n=null})),Ia()),(!i||8&r[0])&&Nr(t,"data-util",e[3]),(!i||4&r[0]&&o!==(o=Xc(["PinturaUtilPanel",e[2]])))&&Nr(t,"class",o),128&r[0]&&Zr(t,"opacity",e[7])},i(e){i||(Ea(n),i=!0)},o(e){Aa(n),i=!1},d(o){o&&Lr(t),n&&n.d(),e[24](null)}}}function bd(e,t,o){let i,n,r,a,s;const l=sa();let{isActive:c=!0}=t,{stores:d}=t,{view:u}=t,{props:p}=t,{component:h}=t,{locale:m}=t,{class:g}=t;const $=ca("isAnimated");let f;hr(e,$,(e=>o(21,s=e)));const y=xc(0),b=qa(y,(e=>$s(e,0,1)));hr(e,b,(e=>o(20,a=e)));let x=!c;const v=Ya(c),w={isActive:qa(v,(async(e,t)=>{if(!e)return t(e);await ya(),t(e)}),!1),isActiveFraction:qa(b,(e=>e)),isVisible:qa(b,(e=>e>0))},S=u,k=$d(S),C=Object.keys(p||{}).reduce(((e,t)=>k.includes(t)?(e[t]=p[t],e):e),{}),T=Object.keys(w).reduce(((e,t)=>k.includes(t)?(e[t]=w[t],e):e),{});let M,P;const R=e=>{o(17,f={...e.detail}),E&&c&&l("measure",{...f})};la("measurable",Dc);const I=ia().$$.context;let E=!1;return na((()=>{if(o(19,E=!0),r)return;o(0,h=new S({target:P,props:{...n,locale:m},context:I})),o(3,M=h.name);const e=h.$on("measure",R);return()=>{e(),h.$destroy()}})),e.$$set=e=>{"isActive"in e&&o(12,c=e.isActive),"stores"in e&&o(13,d=e.stores),"view"in e&&o(14,u=e.view),"props"in e&&o(15,p=e.props),"component"in e&&o(0,h=e.component),"locale"in e&&o(1,m=e.locale),"class"in e&&o(2,g=e.class)},e.$$.update=()=>{135169&e.$$.dirty[0]&&f&&c&&h&&l("measure",f),2101248&e.$$.dirty[0]&&y.set(c?1:0,{hard:!1===s}),1310720&e.$$.dirty[0]&&(a<=0&&!x?o(18,x=!0):a>0&&x&&o(18,x=!1)),786432&e.$$.dirty[0]&&E&&l(x?"hide":"show"),1048576&e.$$.dirty[0]&&l("fade",a),1048576&e.$$.dirty[0]&&o(7,i=a),4096&e.$$.dirty[0]&&v.set(c),8192&e.$$.dirty[0]&&o(5,n={...C,...T,stores:d})},o(6,r=!k.includes("external")),[h,m,g,M,P,n,r,i,$,b,S,R,c,d,u,p,y,f,x,E,a,s,function(e){M=e,o(3,M)},function(e){pa[e?"unshift":"push"]((()=>{h=e,o(0,h)}))},function(e){pa[e?"unshift":"push"]((()=>{P=e,o(4,P)}))}]}class xd extends Ga{constructor(e){super(),Ua(this,e,bd,yd,lr,{isActive:12,stores:13,view:14,props:15,component:0,locale:1,class:2,opacity:16},null,[-1,-1])}get opacity(){return this.$$.ctx[16]}}function vd(e){let t,o,i,n,r,a;const s=e[5].default,l=mr(s,e,e[4],null);return{c(){t=zr("svg"),l&&l.c(),Nr(t,"class",e[3]),Nr(t,"width",e[0]),Nr(t,"height",e[1]),Nr(t,"viewBox",o="0 0 "+e[0]+"\n "+e[1]),Nr(t,"xmlns","http://www.w3.org/2000/svg"),Nr(t,"aria-hidden","true"),Nr(t,"focusable","false"),Nr(t,"stroke-linecap","round"),Nr(t,"stroke-linejoin","round")},m(o,s){Ar(o,t,s),l&&l.m(t,null),n=!0,r||(a=wr(i=id.call(null,t,e[2])),r=!0)},p(e,[r]){l&&l.p&&(!n||16&r)&&fr(l,s,e,e[4],n?$r(s,e[4],r,null):yr(e[4]),null),(!n||8&r)&&Nr(t,"class",e[3]),(!n||1&r)&&Nr(t,"width",e[0]),(!n||2&r)&&Nr(t,"height",e[1]),(!n||3&r&&o!==(o="0 0 "+e[0]+"\n "+e[1]))&&Nr(t,"viewBox",o),i&&sr(i.update)&&4&r&&i.update.call(null,e[2])},i(e){n||(Ea(l,e),n=!0)},o(e){Aa(l,e),n=!1},d(e){e&&Lr(t),l&&l.d(e),r=!1,a()}}}function wd(e,t,o){let{$$slots:i={},$$scope:n}=t,{width:r=24}=t,{height:a=24}=t,{style:s}=t,{class:l}=t;return e.$$set=e=>{"width"in e&&o(0,r=e.width),"height"in e&&o(1,a=e.height),"style"in e&&o(2,s=e.style),"class"in e&&o(3,l=e.class),"$$scope"in e&&o(4,n=e.$$scope)},[r,a,s,l,n,i]}class Sd extends Ga{constructor(e){super(),Ua(this,e,wd,vd,lr,{width:0,height:1,style:2,class:3})}}var kd=(e,t)=>t===e.target||t.contains(e.target),Cd=(e,t,o)=>{const i=m(t)?t:e;return o?`${i} (${n=o,n.map((e=>"CMD"===e?bo()?"⌘":"Ctrl":e)).join("+")})`:i;var n};const{document:Td}=za;function Md(e){let t,o,i,n;return{c(){t=Or(),o=Fr("button"),Nr(o,"class","PinturaImageButton"),Nr(o,"type","button"),Nr(o,"title",e[1]),o.disabled=e[2]},m(r,a){Ar(r,t,a),Ar(r,o,a),o.innerHTML=e[0],e[11](o),i||(n=[Wr(Td.body,"load",e[5],!0),Wr(Td.body,"error",e[6],!0),Wr(o,"pointerdown",e[4])],i=!0)},p(e,[t]){1&t&&(o.innerHTML=e[0]),2&t&&Nr(o,"title",e[1]),4&t&&(o.disabled=e[2])},i:tr,o:tr,d(r){r&&Lr(t),r&&Lr(o),e[11](null),i=!1,ar(n)}}}function Pd(e,t,o){let i,{html:n}=t,{title:a}=t,{onclick:s}=t,{disabled:l=!1}=t,{ongrab:c=r}=t,{ondrag:d=r}=t,{ondrop:u=r}=t;const p=e=>Ie(h,me(e.pageX,e.pageY))<256;let h;const m=e=>{document.documentElement.removeEventListener("pointermove",g),document.documentElement.removeEventListener("pointerup",m);const t=me(e.pageX,e.pageY);if(Ie(h,t)<32)return s(e);p(e)||u(e)},g=e=>{p(e)||d(e)},$=e=>i&&i.contains(e)&&"IMG"===e.nodeName;return e.$$set=e=>{"html"in e&&o(0,n=e.html),"title"in e&&o(1,a=e.title),"onclick"in e&&o(7,s=e.onclick),"disabled"in e&&o(2,l=e.disabled),"ongrab"in e&&o(8,c=e.ongrab),"ondrag"in e&&o(9,d=e.ondrag),"ondrop"in e&&o(10,u=e.ondrop)},e.$$.update=()=>{8&e.$$.dirty&&i&&i.querySelector("img")&&o(3,i.dataset.loader=!0,i)},[n,a,l,i,e=>{h=me(e.pageX,e.pageY),c(e),document.documentElement.addEventListener("pointermove",g),document.documentElement.addEventListener("pointerup",m)},({target:e})=>{$(e)&&o(3,i.dataset.load=!0,i)},({target:e})=>{$(e)&&o(3,i.dataset.error=!0,i)},s,c,d,u,function(e){pa[e?"unshift":"push"]((()=>{i=e,o(3,i)}))}]}class Rd extends Ga{constructor(e){super(),Ua(this,e,Pd,Md,lr,{html:0,title:1,onclick:7,disabled:2,ongrab:8,ondrag:9,ondrop:10})}}function Id(e,t,o){const i=e.slice();return i[13]=t[o],i}function Ed(e,t){let o,i,n,r,a,s,l;function c(){return t[9](t[13])}function d(...e){return t[10](t[13],...e)}function u(...e){return t[11](t[13],...e)}function p(...e){return t[12](t[13],...e)}return i=new Rd({props:{onclick:c,ongrab:d,ondrag:u,ondrop:p,disabled:t[1]||t[13].disabled,title:t[13].title,html:t[13].thumb}}),{key:e,first:null,c(){o=Fr("li"),Na(i.$$.fragment),n=Or(),Zr(o,"opacity",t[6]),this.first=o},m(e,c){Ar(e,o,c),Ha(i,o,null),Rr(o,n),a=!0,s||(l=wr(r=t[8].call(null,o,t[13])),s=!0)},p(e,n){t=e;const a={};5&n&&(a.onclick=c),9&n&&(a.ongrab=d),17&n&&(a.ondrag=u),33&n&&(a.ondrop=p),3&n&&(a.disabled=t[1]||t[13].disabled),1&n&&(a.title=t[13].title),1&n&&(a.html=t[13].thumb),i.$set(a),r&&sr(r.update)&&1&n&&r.update.call(null,t[13]),64&n&&Zr(o,"opacity",t[6])},i(e){a||(Ea(i.$$.fragment,e),a=!0)},o(e){Aa(i.$$.fragment,e),a=!1},d(e){e&&Lr(o),ja(i),s=!1,l()}}}function Ad(e){let t,o,i=[],n=new Map,r=e[0];const a=e=>e[13].id;for(let t=0;t<r.length;t+=1){let o=Id(e,r,t),s=a(o);n.set(s,i[t]=Ed(s,o))}return{c(){t=Fr("ul");for(let e=0;e<i.length;e+=1)i[e].c();Nr(t,"class","PinturaImageButtonList")},m(e,n){Ar(e,t,n);for(let e=0;e<i.length;e+=1)i[e].m(t,null);o=!0},p(e,[o]){127&o&&(r=e[0],Ra(),i=Ba(i,o,a,1,e,r,n,t,Oa,Ed,null,Id),Ia())},i(e){if(!o){for(let e=0;e<r.length;e+=1)Ea(i[e]);o=!0}},o(e){for(let e=0;e<i.length;e+=1)Aa(i[e]);o=!1},d(e){e&&Lr(t);for(let e=0;e<i.length;e+=1)i[e].d()}}}function Ld(e,t,o){let i,{items:n}=t,{disabled:r}=t,{onclickitem:a}=t,{ongrabitem:s}=t,{ondragitem:l}=t,{ondropitem:c}=t;const d=xc(0,{stiffness:.25,damping:.9});hr(e,d,(e=>o(6,i=e)));na((()=>d.set(1)));return e.$$set=e=>{"items"in e&&o(0,n=e.items),"disabled"in e&&o(1,r=e.disabled),"onclickitem"in e&&o(2,a=e.onclickitem),"ongrabitem"in e&&o(3,s=e.ongrabitem),"ondragitem"in e&&o(4,l=e.ondragitem),"ondropitem"in e&&o(5,c=e.ondropitem)},[n,r,a,s,l,c,i,d,(e,t)=>t.mount&&t.mount(e.firstChild,t),e=>a(e.id),(e,t)=>s&&s(e.id,t),(e,t)=>l&&l(e.id,t),(e,t)=>c&&c(e.id,t)]}class Fd extends Ga{constructor(e){super(),Ua(this,e,Ld,Ad,lr,{items:0,disabled:1,onclickitem:2,ongrabitem:3,ondragitem:4,ondropitem:5})}}var zd=()=>d()&&window.devicePixelRatio||1;let Dd=null;var Od=e=>(null===Dd&&(Dd=1===zd()?Math.round:e=>e),Dd(e)),Bd=(e,t={})=>{if(e){if(t.preventScroll&&Qt()){const t=document.body.scrollTop;return e.focus(),void(document.body.scrollTop=t)}e.focus(t)}},Wd=e=>/date|email|number|search|text|url/.test(e.type),_d=e=>(e=>/textarea/i.test(e.nodeName))(e)||Wd(e)||e.isContentEditable;const Vd=e=>({}),Nd=e=>({}),Hd=e=>({}),jd=e=>({});function Ud(e){let t,o;const i=[e[7]];let n={$$slots:{default:[Zd]},$$scope:{ctx:e}};for(let e=0;e<i.length;e+=1)n=ir(n,i[e]);return t=new wh({props:n}),e[53](t),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const n=128&o[0]?Wa(i,[_a(e[7])]):{};67108864&o[1]&&(n.$$scope={dirty:o,ctx:e}),t.$set(n)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(o){e[53](null),ja(t,o)}}}function Gd(e){let t,o;const i=[e[7]];let n={};for(let e=0;e<i.length;e+=1)n=ir(n,i[e]);return t=new wh({props:n}),e[52](t),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const n=128&o[0]?Wa(i,[_a(e[7])]):{};t.$set(n)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(o){e[52](null),ja(t,o)}}}function Zd(e){let t;const o=e[51].label,i=mr(o,e,e[57],jd);return{c(){i&&i.c()},m(e,o){i&&i.m(e,o),t=!0},p(e,n){i&&i.p&&(!t||67108864&n[1])&&fr(i,o,e,e[57],t?$r(o,e[57],n,Hd):yr(e[57]),jd)},i(e){t||(Ea(i,e),t=!0)},o(e){Aa(i,e),t=!1},d(e){i&&i.d(e)}}}function Xd(e){let t,o,i,n,r,a,s;const l=e[51].details,c=mr(l,e,e[57],Nd);return{c(){t=Fr("div"),c&&c.c(),o=Or(),i=Fr("span"),Nr(i,"class","PinturaPanelTip"),Nr(i,"data-top",e[10]),Zr(i,"opacity",e[14]),Zr(i,"transform",e[13]),Zr(i,"top",e[12]),Zr(i,"left",e[11]),Nr(t,"class",n=Xc(["PinturaPanel","pintura-editor-panel",e[2]])),Nr(t,"tabindex","-1"),Zr(t,"opacity",e[18]),Zr(t,"pointer-events",e[17]),Zr(t,"transform",e[16]),Zr(t,"max-height",e[15])},m(n,l){Ar(n,t,l),c&&c.m(t,null),Rr(t,o),Rr(t,i),e[54](t),r=!0,a||(s=[Wr(t,"close",e[55]),Wr(t,"keydown",e[25]),Wr(t,"measure",e[56]),wr(Dc.call(null,t))],a=!0)},p(e,o){c&&c.p&&(!r||67108864&o[1])&&fr(c,l,e,e[57],r?$r(l,e[57],o,Vd):yr(e[57]),Nd),(!r||1024&o[0])&&Nr(i,"data-top",e[10]),16384&o[0]&&Zr(i,"opacity",e[14]),8192&o[0]&&Zr(i,"transform",e[13]),4096&o[0]&&Zr(i,"top",e[12]),2048&o[0]&&Zr(i,"left",e[11]),(!r||4&o[0]&&n!==(n=Xc(["PinturaPanel","pintura-editor-panel",e[2]])))&&Nr(t,"class",n),262144&o[0]&&Zr(t,"opacity",e[18]),131072&o[0]&&Zr(t,"pointer-events",e[17]),65536&o[0]&&Zr(t,"transform",e[16]),32768&o[0]&&Zr(t,"max-height",e[15])},i(e){r||(Ea(c,e),r=!0)},o(e){Aa(c,e),r=!1},d(o){o&&Lr(t),c&&c.d(o),e[54](null),a=!1,ar(s)}}}function Yd(e){let t,o,i,n,r,a,s,l,c;const d=[Gd,Ud],u=[];function p(e,t){return e[1]?0:1}o=p(e),i=u[o]=d[o](e);let h=e[6]&&Xd(e);return{c(){t=Or(),i.c(),n=Or(),h&&h.c(),r=Or(),a=Br()},m(i,d){Ar(i,t,d),u[o].m(i,d),Ar(i,n,d),h&&h.m(i,d),Ar(i,r,d),Ar(i,a,d),s=!0,l||(c=[Wr(document.body,"pointerdown",(function(){sr(e[9])&&e[9].apply(this,arguments)})),Wr(document.body,"pointerup",(function(){sr(e[8])&&e[8].apply(this,arguments)}))],l=!0)},p(t,a){let s=o;o=p(e=t),o===s?u[o].p(e,a):(Ra(),Aa(u[s],1,1,(()=>{u[s]=null})),Ia(),i=u[o],i?i.p(e,a):(i=u[o]=d[o](e),i.c()),Ea(i,1),i.m(n.parentNode,n)),e[6]?h?(h.p(e,a),64&a[0]&&Ea(h,1)):(h=Xd(e),h.c(),Ea(h,1),h.m(r.parentNode,r)):h&&(Ra(),Aa(h,1,1,(()=>{h=null})),Ia())},i(e){s||(Ea(i),Ea(h),Ea(false),s=!0)},o(e){Aa(i),Aa(h),Aa(false),s=!1},d(e){e&&Lr(t),u[o].d(e),e&&Lr(n),h&&h.d(e),e&&Lr(r),e&&Lr(a),l=!1,ar(c)}}}let qd=12;function Kd(e,t,o){let i,n,a,s,l,c,d,u,p,h,m,g,$,f,y,b,x,v,w,S,k,C,T,M,P,R,{$$slots:I={},$$scope:E}=t,{buttonClass:A}=t,{buttonLabel:L}=t,{buttonLabelClass:F}=t,{buttonHideLabel:z}=t,{buttonIcon:D}=t,{buttonTitle:O}=t,{panelClass:B}=t,{isActive:W=!1}=t,{onshow:_=(({panel:e})=>Bd(e,{preventScroll:!0}))}=t,{onhide:V=r}=t;const N=ca("isAnimated");hr(e,N,(e=>o(50,R=e)));const H=ca("rootPortal");hr(e,H,(e=>o(45,k=e)));const j=ca("rootRect");let U,G,Z;hr(e,j,(e=>o(48,M=e)));const X=()=>o(33,Z=i&&i.getBoundingClientRect());let Y=he(),q=xc(0);hr(e,q,(e=>o(47,T=e)));let K=he();const J=Ya({x:0,y:0});hr(e,J,(e=>o(46,C=e)));const Q=xc(-5,{stiffness:.1,damping:.35,precision:.001});hr(e,Q,(e=>o(49,P=e)));let ee=!0;const te=e=>kd(e,k)||G.isEventTarget(e);let oe,ie,ne=!1;const re=e=>{_d(e.target)||(W||X(),o(38,ie=e),o(0,W=!W))},ae=e=>{/down/i.test(e.key)&&(o(0,W=!0),o(38,ie=e))};aa((()=>{if(!k)return;if(!oe)return;const e=oe;ya().then((()=>{e.parentNode&&e.remove()}))}));return e.$$set=e=>{"buttonClass"in e&&o(26,A=e.buttonClass),"buttonLabel"in e&&o(1,L=e.buttonLabel),"buttonLabelClass"in e&&o(27,F=e.buttonLabelClass),"buttonHideLabel"in e&&o(28,z=e.buttonHideLabel),"buttonIcon"in e&&o(29,D=e.buttonIcon),"buttonTitle"in e&&o(30,O=e.buttonTitle),"panelClass"in e&&o(2,B=e.panelClass),"isActive"in e&&o(0,W=e.isActive),"onshow"in e&&o(31,_=e.onshow),"onhide"in e&&o(32,V=e.onhide),"$$scope"in e&&o(57,E=e.$$scope)},e.$$.update=()=>{if(16&e.$$.dirty[0]&&(i=G&&G.getElement()),1&e.$$.dirty[0]|64&e.$$.dirty[1]&&o(8,w=W?e=>{ne&&(o(37,ne=!1),te(e)||o(0,W=!1))}:void 0),1&e.$$.dirty[0]|524288&e.$$.dirty[1]&&q.set(W?1:0,{hard:!1===R}),1&e.$$.dirty[0]|524288&e.$$.dirty[1]&&Q.set(W?0:-5,{hard:!1===R}),262144&e.$$.dirty[1]&&o(42,n=1-P/-5),1&e.$$.dirty[0]|131072&e.$$.dirty[1]&&M&&W&&X(),9&e.$$.dirty[0]|131076&e.$$.dirty[1]&&M&&U&&Z&&W){o(36,ee=!0);let e=Z.x-M.x+.5*Z.width-.5*U.width,t=Z.y-M.y+Z.height;const i=qd,n=qd,r=M.width-qd,a=M.height-qd,s=e,l=t,c=s+U.width,d=l+U.height;if(s<i&&(o(35,K.x=s-i,K),e=i),c>r&&(o(35,K.x=c-r,K),e=r-U.width),d>a){o(34,Y.y=-1,Y);n<t-U.height-Z.height?(o(35,K.y=0,K),t-=U.height+Z.height):(o(35,K.y=t-(d-a),K),t-=d-a-qd,o(36,ee=!1))}else o(34,Y.y=1,Y);vr(J,C=Se(me(e,t),Od),C)}65536&e.$$.dirty[1]&&o(6,a=T>0),294920&e.$$.dirty[1]&&o(44,s=`translateX(${Math.round(C.x)+Y.x*qd}px) translateY(${Math.round(C.y)+Y.y*qd+Y.y*P}px)`),131072&e.$$.dirty[1]&&o(43,l=`--panel-max-height:${M.height-24}px`),65536&e.$$.dirty[1]&&o(18,c=T),65536&e.$$.dirty[1]&&o(17,d=T<1?"none":"all"),8192&e.$$.dirty[1]&&o(16,u=s),4096&e.$$.dirty[1]&&o(15,p=l),2048&e.$$.dirty[1]&&o(40,h=.5+.5*n),2048&e.$$.dirty[1]&&o(41,m=n),8&e.$$.dirty[0]|32768&e.$$.dirty[1]&&o(39,g=U&&C),1312&e.$$.dirty[1]&&o(14,$=g&&ee?m:0),768&e.$$.dirty[1]&&o(13,f=g?`scaleX(${h})rotate(45deg)`:"none"),8&e.$$.dirty[0]|280&e.$$.dirty[1]&&o(12,y=g?(Y.y<0?K.y+U.height:0)+"px":"0"),8&e.$$.dirty[0]|272&e.$$.dirty[1]&&o(11,b=g?K.x+.5*U.width+"px":"0"),8&e.$$.dirty[1]&&o(10,x=Y.y>=0),1&e.$$.dirty[0]&&o(9,v=W?e=>{te(e)||o(37,ne=!0)}:void 0),96&e.$$.dirty[0]|16384&e.$$.dirty[1]&&a&&k&&oe&&oe.parentNode!==k&&k.append(oe),1&e.$$.dirty[0]&&(W||o(38,ie=void 0)),97&e.$$.dirty[0]|129&e.$$.dirty[1]&&W&&a&&oe&&_({e:ie,panel:oe}),65&e.$$.dirty[0]|2&e.$$.dirty[1]&&a&&!W&&V(),2080374786&e.$$.dirty[0]&&o(7,S={label:L,icon:D,class:Xc(["PinturaPanelButton",A]),onkeydown:ae,onclick:re,hideLabel:z,labelClass:F,title:O})},[W,L,B,U,G,oe,a,S,w,v,x,b,y,f,$,p,u,d,c,N,H,j,q,J,Q,e=>{/esc/i.test(e.key)&&(o(0,W=!1),i.focus())},A,F,z,D,O,_,V,Z,Y,K,ee,ne,ie,g,h,m,n,l,s,k,C,T,M,P,R,I,function(e){pa[e?"unshift":"push"]((()=>{G=e,o(4,G)}))},function(e){pa[e?"unshift":"push"]((()=>{G=e,o(4,G)}))},function(e){pa[e?"unshift":"push"]((()=>{oe=e,o(5,oe)}))},e=>{e.stopPropagation(),o(0,W=!1)},e=>o(3,U=Be(e.detail)),E]}class Jd extends Ga{constructor(e){super(),Ua(this,e,Kd,Yd,lr,{buttonClass:26,buttonLabel:1,buttonLabelClass:27,buttonHideLabel:28,buttonIcon:29,buttonTitle:30,panelClass:2,isActive:0,onshow:31,onhide:32},null,[-1,-1,-1])}}var Qd={Up:38,Down:40,Left:37,Right:39};function eu(e){let t,o,i,n,r,a,s,l;const c=e[15].default,d=mr(c,e,e[14],null);return{c(){t=Fr("li"),o=Fr("input"),i=Or(),n=Fr("label"),d&&d.c(),Nr(o,"type","radio"),Nr(o,"class","implicit"),Nr(o,"id",e[7]),Nr(o,"name",e[0]),o.value=e[3],o.disabled=e[6],o.hidden=e[5],o.checked=e[4],Nr(n,"for",e[7]),Nr(n,"title",e[2]),Nr(t,"class",r=Xc(["PinturaRadioGroupOption",e[1]])),Nr(t,"data-hidden",e[5]),Nr(t,"data-disabled",e[6]),Nr(t,"data-selected",e[4])},m(r,c){Ar(r,t,c),Rr(t,o),Rr(t,i),Rr(t,n),d&&d.m(n,null),a=!0,s||(l=[Wr(o,"change",Vr(e[16])),Wr(o,"keydown",e[9]),Wr(o,"click",e[10])],s=!0)},p(e,[i]){(!a||128&i)&&Nr(o,"id",e[7]),(!a||1&i)&&Nr(o,"name",e[0]),(!a||8&i)&&(o.value=e[3]),(!a||64&i)&&(o.disabled=e[6]),(!a||32&i)&&(o.hidden=e[5]),(!a||16&i)&&(o.checked=e[4]),d&&d.p&&(!a||16384&i)&&fr(d,c,e,e[14],a?$r(c,e[14],i,null):yr(e[14]),null),(!a||128&i)&&Nr(n,"for",e[7]),(!a||4&i)&&Nr(n,"title",e[2]),(!a||2&i&&r!==(r=Xc(["PinturaRadioGroupOption",e[1]])))&&Nr(t,"class",r),(!a||32&i)&&Nr(t,"data-hidden",e[5]),(!a||64&i)&&Nr(t,"data-disabled",e[6]),(!a||16&i)&&Nr(t,"data-selected",e[4])},i(e){a||(Ea(d,e),a=!0)},o(e){Aa(d,e),a=!1},d(e){e&&Lr(t),d&&d.d(e),s=!1,ar(l)}}}function tu(e,t,o){let i,n,{$$slots:r={},$$scope:a}=t,{name:s}=t,{class:l}=t,{label:c}=t,{id:d}=t,{value:u}=t,{checked:p}=t,{onkeydown:h}=t,{onclick:m}=t,{hidden:g=!1}=t,{disabled:$=!1}=t;const f=Object.values(Qd),y=ca("keysPressed");hr(e,y,(e=>o(17,n=e)));return e.$$set=e=>{"name"in e&&o(0,s=e.name),"class"in e&&o(1,l=e.class),"label"in e&&o(2,c=e.label),"id"in e&&o(11,d=e.id),"value"in e&&o(3,u=e.value),"checked"in e&&o(4,p=e.checked),"onkeydown"in e&&o(12,h=e.onkeydown),"onclick"in e&&o(13,m=e.onclick),"hidden"in e&&o(5,g=e.hidden),"disabled"in e&&o(6,$=e.disabled),"$$scope"in e&&o(14,a=e.$$scope)},e.$$.update=()=>{2049&e.$$.dirty&&o(7,i=`${s}-${d}`)},[s,l,c,u,p,g,$,i,y,e=>{h(e)},e=>{n.some((e=>f.includes(e)))||m(e)},d,h,m,a,r,function(t){da.call(this,e,t)}]}class ou extends Ga{constructor(e){super(),Ua(this,e,tu,eu,lr,{name:0,class:1,label:2,id:11,value:3,checked:4,onkeydown:12,onclick:13,hidden:5,disabled:6})}}var iu=(e=[])=>e.reduce(((e,t)=>(_o(t)?_o(t[1]):!!t.options)?e.concat(_o(t)?t[1]:t.options):(e.push(t),e)),[]);const nu=(e,t,o)=>{let i;return _o(e)?i={id:t,value:e[0],label:e[1],...e[2]||{}}:(i=e,i.id=null!=i.id?i.id:t),o?o(i):i};var ru=(e,t,o)=>R(e)?e(t,o):e;const au=(e,t)=>e.map((([e,o,i])=>{if(_o(o))return[ru(e,t),au(o,t)];{const n=[e,ru(o,t)];if(i){let e={...i};i.icon&&(e.icon=ru(i.icon,t)),n.push(e)}return n}}));var su=(e,t)=>au(e,t),lu=(e,t)=>Array.isArray(e)&&Array.isArray(t)?vs(e,t):e===t;function cu(e,t,o){const i=e.slice();return i[27]=t[o],i}const du=e=>({option:1024&e[0]}),uu=e=>({option:e[27]});function pu(e,t,o){const i=e.slice();return i[27]=t[o],i}const hu=e=>({option:1024&e[0]}),mu=e=>({option:e[27]}),gu=e=>({option:1024&e[0]}),$u=e=>({option:e[27]});function fu(e){let t,o,i,n,r,a=[],s=new Map,l=e[1]&&yu(e),c=e[10];const d=e=>e[27].id;for(let t=0;t<c.length;t+=1){let o=cu(e,c,t),i=d(o);s.set(i,a[t]=Iu(i,o))}return{c(){t=Fr("fieldset"),l&&l.c(),o=Or(),i=Fr("ul");for(let e=0;e<a.length;e+=1)a[e].c();Nr(i,"class","PinturaRadioGroupOptions"),Nr(t,"class",n=Xc(["PinturaRadioGroup",e[3]])),Nr(t,"data-layout",e[5]),Nr(t,"title",e[7])},m(e,n){Ar(e,t,n),l&&l.m(t,null),Rr(t,o),Rr(t,i);for(let e=0;e<a.length;e+=1)a[e].m(i,null);r=!0},p(e,u){e[1]?l?l.p(e,u):(l=yu(e),l.c(),l.m(t,o)):l&&(l.d(1),l=null),8419153&u[0]&&(c=e[10],Ra(),a=Ba(a,u,d,1,e,c,s,i,Oa,Iu,null,cu),Ia()),(!r||8&u[0]&&n!==(n=Xc(["PinturaRadioGroup",e[3]])))&&Nr(t,"class",n),(!r||32&u[0])&&Nr(t,"data-layout",e[5]),(!r||128&u[0])&&Nr(t,"title",e[7])},i(e){if(!r){for(let e=0;e<c.length;e+=1)Ea(a[e]);r=!0}},o(e){for(let e=0;e<a.length;e+=1)Aa(a[e]);r=!1},d(e){e&&Lr(t),l&&l.d();for(let e=0;e<a.length;e+=1)a[e].d()}}}function yu(e){let t,o,i;return{c(){t=Fr("legend"),o=Dr(e[1]),Nr(t,"class",i=e[2]&&"implicit")},m(e,i){Ar(e,t,i),Rr(t,o)},p(e,n){2&n[0]&&Ur(o,e[1]),4&n[0]&&i!==(i=e[2]&&"implicit")&&Nr(t,"class",i)},d(e){e&&Lr(t)}}}function bu(e){let t,o;return t=new ou({props:{name:e[4],label:e[27].label,id:e[27].id,value:e[27].value,disabled:e[27].disabled,hidden:e[27].hidden,class:e[8],checked:e[12](e[27])===e[0],onkeydown:e[13](e[27]),onclick:e[14](e[27]),$$slots:{default:[ku]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};16&o[0]&&(i.name=e[4]),1024&o[0]&&(i.label=e[27].label),1024&o[0]&&(i.id=e[27].id),1024&o[0]&&(i.value=e[27].value),1024&o[0]&&(i.disabled=e[27].disabled),1024&o[0]&&(i.hidden=e[27].hidden),256&o[0]&&(i.class=e[8]),1025&o[0]&&(i.checked=e[12](e[27])===e[0]),1024&o[0]&&(i.onkeydown=e[13](e[27])),1024&o[0]&&(i.onclick=e[14](e[27])),8389696&o[0]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function xu(e){let t,o,i,n,r,a,s=[],l=new Map;const c=e[22].group,d=mr(c,e,e[23],$u),u=d||function(e){let t,o,i=e[27].label+"";return{c(){t=Fr("span"),o=Dr(i),Nr(t,"class","PinturaRadioGroupOptionGroupLabel")},m(e,i){Ar(e,t,i),Rr(t,o)},p(e,t){1024&t[0]&&i!==(i=e[27].label+"")&&Ur(o,i)},d(e){e&&Lr(t)}}}(e);let p=e[27].options;const h=e=>e[27].id;for(let t=0;t<p.length;t+=1){let o=pu(e,p,t),i=h(o);l.set(i,s[t]=Ru(i,o))}return{c(){t=Fr("li"),u&&u.c(),o=Or(),i=Fr("ul");for(let e=0;e<s.length;e+=1)s[e].c();n=Or(),Nr(i,"class","PinturaRadioGroupOptions"),Nr(t,"class",r=Xc(["PinturaRadioGroupOptionGroup",e[9]]))},m(e,r){Ar(e,t,r),u&&u.m(t,null),Rr(t,o),Rr(t,i);for(let e=0;e<s.length;e+=1)s[e].m(i,null);Rr(t,n),a=!0},p(e,o){d?d.p&&(!a||8389632&o[0])&&fr(d,c,e,e[23],a?$r(c,e[23],o,gu):yr(e[23]),$u):u&&u.p&&(!a||1024&o[0])&&u.p(e,a?o:[-1,-1]),8418641&o[0]&&(p=e[27].options,Ra(),s=Ba(s,o,h,1,e,p,l,i,Oa,Ru,null,pu),Ia()),(!a||512&o[0]&&r!==(r=Xc(["PinturaRadioGroupOptionGroup",e[9]])))&&Nr(t,"class",r)},i(e){if(!a){Ea(u,e);for(let e=0;e<p.length;e+=1)Ea(s[e]);a=!0}},o(e){Aa(u,e);for(let e=0;e<s.length;e+=1)Aa(s[e]);a=!1},d(e){e&&Lr(t),u&&u.d(e);for(let e=0;e<s.length;e+=1)s[e].d()}}}function vu(e){let t,o;return t=new Sd({props:{$$slots:{default:[wu]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};8389632&o[0]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function wu(e){let t,o=e[27].icon+"";return{c(){t=zr("g")},m(e,i){Ar(e,t,i),t.innerHTML=o},p(e,i){1024&i[0]&&o!==(o=e[27].icon+"")&&(t.innerHTML=o)},d(e){e&&Lr(t)}}}function Su(e){let t,o,i=e[27].label+"";return{c(){t=Fr("span"),o=Dr(i),Nr(t,"class",e[6])},m(e,i){Ar(e,t,i),Rr(t,o)},p(e,n){1024&n[0]&&i!==(i=e[27].label+"")&&Ur(o,i),64&n[0]&&Nr(t,"class",e[6])},d(e){e&&Lr(t)}}}function ku(e){let t;const o=e[22].option,i=mr(o,e,e[23],uu),n=i||function(e){let t,o,i,n=e[27].icon&&vu(e),r=!e[27].hideLabel&&Su(e);return{c(){n&&n.c(),t=Or(),r&&r.c(),o=Or()},m(e,a){n&&n.m(e,a),Ar(e,t,a),r&&r.m(e,a),Ar(e,o,a),i=!0},p(e,i){e[27].icon?n?(n.p(e,i),1024&i[0]&&Ea(n,1)):(n=vu(e),n.c(),Ea(n,1),n.m(t.parentNode,t)):n&&(Ra(),Aa(n,1,1,(()=>{n=null})),Ia()),e[27].hideLabel?r&&(r.d(1),r=null):r?r.p(e,i):(r=Su(e),r.c(),r.m(o.parentNode,o))},i(e){i||(Ea(n),i=!0)},o(e){Aa(n),i=!1},d(e){n&&n.d(e),e&&Lr(t),r&&r.d(e),e&&Lr(o)}}}(e);return{c(){n&&n.c()},m(e,o){n&&n.m(e,o),t=!0},p(e,r){i?i.p&&(!t||8389632&r[0])&&fr(i,o,e,e[23],t?$r(o,e[23],r,du):yr(e[23]),uu):n&&n.p&&(!t||1088&r[0])&&n.p(e,t?r:[-1,-1])},i(e){t||(Ea(n,e),t=!0)},o(e){Aa(n,e),t=!1},d(e){n&&n.d(e)}}}function Cu(e){let t,o;return t=new Sd({props:{$$slots:{default:[Tu]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};8389632&o[0]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Tu(e){let t,o=e[27].icon+"";return{c(){t=zr("g")},m(e,i){Ar(e,t,i),t.innerHTML=o},p(e,i){1024&i[0]&&o!==(o=e[27].icon+"")&&(t.innerHTML=o)},d(e){e&&Lr(t)}}}function Mu(e){let t,o,i=e[27].label+"";return{c(){t=Fr("span"),o=Dr(i),Nr(t,"class",e[6])},m(e,i){Ar(e,t,i),Rr(t,o)},p(e,n){1024&n[0]&&i!==(i=e[27].label+"")&&Ur(o,i),64&n[0]&&Nr(t,"class",e[6])},d(e){e&&Lr(t)}}}function Pu(e){let t;const o=e[22].option,i=mr(o,e,e[23],mu),n=i||function(e){let t,o,i,n=e[27].icon&&Cu(e),r=!e[27].hideLabel&&Mu(e);return{c(){n&&n.c(),t=Or(),r&&r.c(),o=Or()},m(e,a){n&&n.m(e,a),Ar(e,t,a),r&&r.m(e,a),Ar(e,o,a),i=!0},p(e,i){e[27].icon?n?(n.p(e,i),1024&i[0]&&Ea(n,1)):(n=Cu(e),n.c(),Ea(n,1),n.m(t.parentNode,t)):n&&(Ra(),Aa(n,1,1,(()=>{n=null})),Ia()),e[27].hideLabel?r&&(r.d(1),r=null):r?r.p(e,i):(r=Mu(e),r.c(),r.m(o.parentNode,o))},i(e){i||(Ea(n),i=!0)},o(e){Aa(n),i=!1},d(e){n&&n.d(e),e&&Lr(t),r&&r.d(e),e&&Lr(o)}}}(e);return{c(){n&&n.c()},m(e,o){n&&n.m(e,o),t=!0},p(e,r){i?i.p&&(!t||8389632&r[0])&&fr(i,o,e,e[23],t?$r(o,e[23],r,hu):yr(e[23]),mu):n&&n.p&&(!t||1088&r[0])&&n.p(e,t?r:[-1,-1])},i(e){t||(Ea(n,e),t=!0)},o(e){Aa(n,e),t=!1},d(e){n&&n.d(e)}}}function Ru(e,t){let o,i,n;return i=new ou({props:{name:t[4],label:t[27].label,id:t[27].id,value:t[27].value,disabled:t[27].disabled,hidden:t[27].hidden,class:t[8],checked:t[12](t[27])===t[0],onkeydown:t[13](t[27]),onclick:t[14](t[27]),$$slots:{default:[Pu]},$$scope:{ctx:t}}}),{key:e,first:null,c(){o=Br(),Na(i.$$.fragment),this.first=o},m(e,t){Ar(e,o,t),Ha(i,e,t),n=!0},p(e,o){t=e;const n={};16&o[0]&&(n.name=t[4]),1024&o[0]&&(n.label=t[27].label),1024&o[0]&&(n.id=t[27].id),1024&o[0]&&(n.value=t[27].value),1024&o[0]&&(n.disabled=t[27].disabled),1024&o[0]&&(n.hidden=t[27].hidden),256&o[0]&&(n.class=t[8]),1025&o[0]&&(n.checked=t[12](t[27])===t[0]),1024&o[0]&&(n.onkeydown=t[13](t[27])),1024&o[0]&&(n.onclick=t[14](t[27])),8389696&o[0]&&(n.$$scope={dirty:o,ctx:t}),i.$set(n)},i(e){n||(Ea(i.$$.fragment,e),n=!0)},o(e){Aa(i.$$.fragment,e),n=!1},d(e){e&&Lr(o),ja(i,e)}}}function Iu(e,t){let o,i,n,r,a;const s=[xu,bu],l=[];function c(e,t){return e[27].options?0:1}return i=c(t),n=l[i]=s[i](t),{key:e,first:null,c(){o=Br(),n.c(),r=Br(),this.first=o},m(e,t){Ar(e,o,t),l[i].m(e,t),Ar(e,r,t),a=!0},p(e,o){let a=i;i=c(t=e),i===a?l[i].p(t,o):(Ra(),Aa(l[a],1,1,(()=>{l[a]=null})),Ia(),n=l[i],n?n.p(t,o):(n=l[i]=s[i](t),n.c()),Ea(n,1),n.m(r.parentNode,r))},i(e){a||(Ea(n),a=!0)},o(e){Aa(n),a=!1},d(e){e&&Lr(o),l[i].d(e),e&&Lr(r)}}}function Eu(e){let t,o,i,n=e[11].length&&fu(e);return{c(){n&&n.c(),t=Or(),o=Br()},m(e,r){n&&n.m(e,r),Ar(e,t,r),Ar(e,o,r),i=!0},p(e,o){e[11].length?n?(n.p(e,o),2048&o[0]&&Ea(n,1)):(n=fu(e),n.c(),Ea(n,1),n.m(t.parentNode,t)):n&&(Ra(),Aa(n,1,1,(()=>{n=null})),Ia())},i(e){i||(Ea(n),Ea(false),i=!0)},o(e){Aa(n),Aa(false),i=!1},d(e){n&&n.d(e),e&&Lr(t),e&&Lr(o)}}}function Au(e,t,o){let i,n,r,{$$slots:a={},$$scope:s}=t;const l=sa();let{label:c}=t,{hideLabel:d=!0}=t,{class:u}=t,{name:p="radio-group-"+L()}=t,{selectedIndex:h=-1}=t,{options:m=[]}=t,{onchange:g}=t,{layout:$}=t,{optionMapper:f}=t,{optionFilter:y}=t,{value:b}=t,{optionLabelClass:x}=t,{title:v}=t,{locale:w}=t,{optionClass:S}=t,{optionGroupClass:k}=t;const C=e=>r.findIndex((t=>t.id===e.id)),T=(e,t)=>{o(0,h=C(e));const i={index:h,...e};((e,...t)=>{e&&e(...t)})(g,i,t),l("change",i)};return e.$$set=e=>{"label"in e&&o(1,c=e.label),"hideLabel"in e&&o(2,d=e.hideLabel),"class"in e&&o(3,u=e.class),"name"in e&&o(4,p=e.name),"selectedIndex"in e&&o(0,h=e.selectedIndex),"options"in e&&o(15,m=e.options),"onchange"in e&&o(16,g=e.onchange),"layout"in e&&o(5,$=e.layout),"optionMapper"in e&&o(17,f=e.optionMapper),"optionFilter"in e&&o(18,y=e.optionFilter),"value"in e&&o(19,b=e.value),"optionLabelClass"in e&&o(6,x=e.optionLabelClass),"title"in e&&o(7,v=e.title),"locale"in e&&o(20,w=e.locale),"optionClass"in e&&o(8,S=e.optionClass),"optionGroupClass"in e&&o(9,k=e.optionGroupClass),"$$scope"in e&&o(23,s=e.$$scope)},e.$$.update=()=>{1343488&e.$$.dirty[0]&&o(11,i=su(y?m.filter(y):m,w)),133120&e.$$.dirty[0]&&o(10,n=((e=[],t)=>{let o=0;return e.map((e=>(o++,_o(e)?_o(e[1])?{id:o,label:e[0],options:e[1].map((e=>nu(e,++o,t)))}:nu(e,o,t):e.options?{id:e.id||o,label:e.label,options:e.options.map((e=>nu(e,++o,t)))}:nu(e,o,t))))})(i,f)),1024&e.$$.dirty[0]&&o(21,r=iu(n)),2654209&e.$$.dirty[0]&&h<0&&(o(0,h=r.findIndex((e=>lu(e.value,b)))),h<0&&o(0,h=(e=>e.findIndex((e=>void 0===e[0])))(m)))},[h,c,d,u,p,$,x,v,S,k,n,i,C,e=>t=>{var o;(o=t.key,/enter| /i.test(o))&&T(e,t)},e=>t=>{T(e,t)},m,g,f,y,b,w,r,a,s]}class Lu extends Ga{constructor(e){super(),Ua(this,e,Au,Eu,lr,{label:1,hideLabel:2,class:3,name:4,selectedIndex:0,options:15,onchange:16,layout:5,optionMapper:17,optionFilter:18,value:19,optionLabelClass:6,title:7,locale:20,optionClass:8,optionGroupClass:9},null,[-1,-1])}}function Fu(e){let t,o,i,n,r,a,s,l,c,d;return{c(){t=Fr("div"),o=Fr("button"),i=Dr("▲"),r=Or(),a=Fr("button"),s=Dr("▼"),Nr(o,"type","button"),Nr(o,"tabindex","-1"),Nr(o,"aria-label",n="increase "+e[7]),Nr(a,"type","button"),Nr(a,"tabindex","-1"),Nr(a,"aria-label",l="decrease "+e[7]),Nr(t,"class","PinturaInputSpinners")},m(n,l){Ar(n,t,l),Rr(t,o),Rr(o,i),Rr(t,r),Rr(t,a),Rr(a,s),c||(d=[Wr(o,"click",e[18]),Wr(a,"click",e[19])],c=!0)},p(e,t){128&t[0]&&n!==(n="increase "+e[7])&&Nr(o,"aria-label",n),128&t[0]&&l!==(l="decrease "+e[7])&&Nr(a,"aria-label",l)},d(e){e&&Lr(t),c=!1,ar(d)}}}function zu(e){let t,o,i,n,r,a,s=e[14]&&e[9]&&Fu(e);return{c(){t=Fr("div"),o=Fr("input"),n=Or(),s&&s.c(),Nr(o,"class","PinturaInputField"),Nr(o,"title",e[7]),Nr(o,"type",e[1]),Nr(o,"min",e[4]),Nr(o,"max",e[5]),Nr(o,"step",e[6]),Nr(o,"inputmode",e[3]),o.value=i=e[12]?e[15]:e[0],Nr(o,"placeholder",e[8]),Nr(o,"maxlength",e[13]),o.disabled=e[2],Nr(o,"spellcheck","false"),Nr(o,"autocorrect","off"),Nr(o,"autocapitalize","off"),Zr(o,"min-width",e[11]?e[11]+"em":void 0),Nr(t,"class","PinturaInput")},m(i,l){Ar(i,t,l),Rr(t,o),e[30](o),Rr(t,n),s&&s.m(t,null),r||(a=[Wr(o,"input",e[17]),Wr(o,"blur",(function(){sr(e[12]&&e[16])&&(e[12]&&e[16]).apply(this,arguments)})),Wr(o,"keydown",e[20]),Wr(o,"keyup",e[21])],r=!0)},p(n,r){e=n,128&r[0]&&Nr(o,"title",e[7]),2&r[0]&&Nr(o,"type",e[1]),16&r[0]&&Nr(o,"min",e[4]),32&r[0]&&Nr(o,"max",e[5]),64&r[0]&&Nr(o,"step",e[6]),8&r[0]&&Nr(o,"inputmode",e[3]),36865&r[0]&&i!==(i=e[12]?e[15]:e[0])&&o.value!==i&&(o.value=i),256&r[0]&&Nr(o,"placeholder",e[8]),8192&r[0]&&Nr(o,"maxlength",e[13]),4&r[0]&&(o.disabled=e[2]),2048&r[0]&&Zr(o,"min-width",e[11]?e[11]+"em":void 0),e[14]&&e[9]?s?s.p(e,r):(s=Fu(e),s.c(),s.m(t,null)):s&&(s.d(1),s=null)},i:tr,o:tr,d(o){o&&Lr(t),e[30](null),s&&s.d(),r=!1,ar(a)}}}function Du(e,t,o){let i,n,a,s,l,c,d,u,p,{value:h}=t,{type:m="text"}=t,{disabled:g=!1}=t,{inputmode:$}=t,{min:f}=t,{max:y}=t,{step:b}=t,{onchange:x=r}=t,{onkeydown:v=r}=t,{onkeyup:w=r}=t,{title:S}=t,{stepMultiplier:k=10}=t,{placeholder:C}=t,{enableSpinButtons:T=!0}=t,{enableStopPropagation:M=!1}=t;const P=()=>{let e=u.value;return"number"===m&&(e="numeric"===$?parseInt(e,10):parseFloat(e),!Oo(e)||Number.isNaN(e)?e=f||0:n&&(e=$s(e,f,y))),e};let R=h;const I=()=>{const e=$s(P()+(p?b*k:b),f,y);e!==h&&(o(27,R=e),o(0,h=e),x(h))},E=()=>{const e=$s(P()-(p?b*k:b),f,y);e!==h&&(o(27,R=e),o(0,h=e),x(h))};return e.$$set=e=>{"value"in e&&o(0,h=e.value),"type"in e&&o(1,m=e.type),"disabled"in e&&o(2,g=e.disabled),"inputmode"in e&&o(3,$=e.inputmode),"min"in e&&o(4,f=e.min),"max"in e&&o(5,y=e.max),"step"in e&&o(6,b=e.step),"onchange"in e&&o(22,x=e.onchange),"onkeydown"in e&&o(23,v=e.onkeydown),"onkeyup"in e&&o(24,w=e.onkeyup),"title"in e&&o(7,S=e.title),"stepMultiplier"in e&&o(25,k=e.stepMultiplier),"placeholder"in e&&o(8,C=e.placeholder),"enableSpinButtons"in e&&o(9,T=e.enableSpinButtons),"enableStopPropagation"in e&&o(26,M=e.enableStopPropagation)},e.$$.update=()=>{2&e.$$.dirty[0]&&o(29,i="number"===m),48&e.$$.dirty[0]&&o(12,n=Oo(f)&&Oo(y)),64&e.$$.dirty[0]&&o(28,a=Oo(b)),805310464&e.$$.dirty[0]&&o(14,s=i&&n&&a),134218753&e.$$.dirty[0]&&o(15,l=u===document.activeElement?R:h),32&e.$$.dirty[0]&&o(11,c=y?(y+"").length:void 0),2056&e.$$.dirty[0]&&o(13,d="numeric"===$&&c?c:void 0)},[h,m,g,$,f,y,b,S,C,T,u,c,n,d,s,l,()=>{o(27,R=P()),x(h)},()=>{o(27,R=u.value),x(P())},I,E,e=>{if(v(e),!s)return;p=e.shiftKey;const{key:t}=e;M&&e.stopPropagation(),/up|down/i.test(t)&&(/up/i.test(t)&&I(),/down/i.test(t)&&E(),e.preventDefault(),e.stopPropagation())},e=>{if(w(e),!s)return;const{key:t}=e;/up|down/i.test(t)&&(e.preventDefault(),e.stopPropagation())},x,v,w,k,M,R,a,i,function(e){pa[e?"unshift":"push"]((()=>{u=e,o(10,u)}))}]}class Ou extends Ga{constructor(e){super(),Ua(this,e,Du,zu,lr,{value:0,type:1,disabled:2,inputmode:3,min:4,max:5,step:6,onchange:22,onkeydown:23,onkeyup:24,title:7,stepMultiplier:25,placeholder:8,enableSpinButtons:9,enableStopPropagation:26},null,[-1,-1])}}const Bu=e=>({}),Wu=e=>({});function _u(e){let t,o,i,n,r=(e[2]||e[20])+"",a=e[6]&&Nu(e);return{c(){a&&a.c(),t=Or(),o=Fr("span"),Nr(o,"class",i=Xc(["PinturaButtonLabel",e[3],e[5]&&"implicit"]))},m(e,i){a&&a.m(e,i),Ar(e,t,i),Ar(e,o,i),o.innerHTML=r,n=!0},p(e,s){e[6]?a?(a.p(e,s),64&s[0]&&Ea(a,1)):(a=Nu(e),a.c(),Ea(a,1),a.m(t.parentNode,t)):a&&(Ra(),Aa(a,1,1,(()=>{a=null})),Ia()),(!n||1048580&s[0])&&r!==(r=(e[2]||e[20])+"")&&(o.innerHTML=r),(!n||40&s[0]&&i!==(i=Xc(["PinturaButtonLabel",e[3],e[5]&&"implicit"])))&&Nr(o,"class",i)},i(e){n||(Ea(a),n=!0)},o(e){Aa(a),n=!1},d(e){a&&a.d(e),e&&Lr(t),e&&Lr(o)}}}function Vu(e){let t,o;return t=new Ou({props:{value:e[10],onchange:e[16],enableStopPropagation:!0,type:"number",inputmode:"numeric",min:e[8].reduce(Qu,1/0),max:e[8].reduce(ep,-1/0),enableSpinButtons:!1}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};1024&o[0]&&(i.value=e[10]),65536&o[0]&&(i.onchange=e[16]),256&o[0]&&(i.min=e[8].reduce(Qu,1/0)),256&o[0]&&(i.max=e[8].reduce(ep,-1/0)),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Nu(e){let t,o;return t=new Sd({props:{class:"PinturaButtonIcon",$$slots:{default:[Hu]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};536870976&o[0]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Hu(e){let t;return{c(){t=zr("g")},m(o,i){Ar(o,t,i),t.innerHTML=e[6]},p(e,o){64&o[0]&&(t.innerHTML=e[6])},d(e){e&&Lr(t)}}}function ju(e){let t,o,i,n,r;const a=[Vu,_u],s=[];function l(e,t){return e[17]?0:1}return o=l(e),i=s[o]=a[o](e),{c(){t=Fr("span"),i.c(),Nr(t,"slot","label"),Nr(t,"class",n=Xc(["PinturaButtonInner",e[17]&&"PinturaComboBox",e[4]]))},m(e,i){Ar(e,t,i),s[o].m(t,null),r=!0},p(e,c){let d=o;o=l(e),o===d?s[o].p(e,c):(Ra(),Aa(s[d],1,1,(()=>{s[d]=null})),Ia(),i=s[o],i?i.p(e,c):(i=s[o]=a[o](e),i.c()),Ea(i,1),i.m(t,null)),(!r||131088&c[0]&&n!==(n=Xc(["PinturaButtonInner",e[17]&&"PinturaComboBox",e[4]])))&&Nr(t,"class",n)},i(e){r||(Ea(i),r=!0)},o(e){Aa(i),r=!1},d(e){e&&Lr(t),s[o].d()}}}function Uu(e){let t,o,i=e[31].label+"";return{c(){t=Fr("span"),o=Dr(i),Nr(t,"slot","group")},m(e,i){Ar(e,t,i),Rr(t,o)},p(e,t){1&t[1]&&i!==(i=e[31].label+"")&&Ur(o,i)},d(e){e&&Lr(t)}}}function Gu(e){let t,o;return t=new Sd({props:{style:R(e[14])?e[14](e[31].value):e[14],$$slots:{default:[Zu]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};16384&o[0]|1&o[1]&&(i.style=R(e[14])?e[14](e[31].value):e[14]),536870912&o[0]|1&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Zu(e){let t,o=e[31].icon+"";return{c(){t=zr("g")},m(e,i){Ar(e,t,i),t.innerHTML=o},p(e,i){1&i[1]&&o!==(o=e[31].icon+"")&&(t.innerHTML=o)},d(e){e&&Lr(t)}}}function Xu(e){let t,o,i,n,r,a,s,l=e[31].label+"",c=e[31].sublabel&&Yu(e);return{c(){t=Fr("span"),o=new Yr(!1),i=Or(),c&&c.c(),o.a=i,Nr(t,"class",n=Xc(["PinturaDropdownOptionLabel",e[11]]))},m(n,d){Ar(n,t,d),o.m(l,t),Rr(t,i),c&&c.m(t,null),a||(s=wr(r=id.call(null,t,R(e[15])?e[15](e[31].value):e[15])),a=!0)},p(e,i){1&i[1]&&l!==(l=e[31].label+"")&&o.p(l),e[31].sublabel?c?c.p(e,i):(c=Yu(e),c.c(),c.m(t,null)):c&&(c.d(1),c=null),2048&i[0]&&n!==(n=Xc(["PinturaDropdownOptionLabel",e[11]]))&&Nr(t,"class",n),r&&sr(r.update)&&32768&i[0]|1&i[1]&&r.update.call(null,R(e[15])?e[15](e[31].value):e[15])},d(e){e&&Lr(t),c&&c.d(),a=!1,s()}}}function Yu(e){let t,o=e[31].sublabel+"";return{c(){t=Fr("span"),Nr(t,"class","PinturaDropdownOptionSublabel")},m(e,i){Ar(e,t,i),t.innerHTML=o},p(e,i){1&i[1]&&o!==(o=e[31].sublabel+"")&&(t.innerHTML=o)},d(e){e&&Lr(t)}}}function qu(e){let t,o,i,n=e[31].icon&&Gu(e),r=!e[31].hideLabel&&Xu(e);return{c(){t=Fr("span"),n&&n.c(),o=Or(),r&&r.c(),Nr(t,"slot","option")},m(e,a){Ar(e,t,a),n&&n.m(t,null),Rr(t,o),r&&r.m(t,null),i=!0},p(e,i){e[31].icon?n?(n.p(e,i),1&i[1]&&Ea(n,1)):(n=Gu(e),n.c(),Ea(n,1),n.m(t,o)):n&&(Ra(),Aa(n,1,1,(()=>{n=null})),Ia()),e[31].hideLabel?r&&(r.d(1),r=null):r?r.p(e,i):(r=Xu(e),r.c(),r.m(t,null))},i(e){i||(Ea(n),i=!0)},o(e){Aa(n),i=!1},d(e){e&&Lr(t),n&&n.d(),r&&r.d()}}}function Ku(e){let t,o,i,n,r,a;const s=e[27].controls,l=mr(s,e,e[29],Wu);return i=new Lu({props:{class:"PinturaOptionsList PinturaScrollableContent",name:e[7],value:e[10],selectedIndex:e[9],optionFilter:e[12],optionMapper:e[13],optionLabelClass:Xc(["PinturaDropdownOptionLabel",e[11]]),optionGroupClass:"PinturaListOptionGroup",optionClass:"PinturaListOption",options:e[18],onchange:e[21],$$slots:{option:[qu,({option:e})=>({31:e}),({option:e})=>[0,e?1:0]],group:[Uu,({option:e})=>({31:e}),({option:e})=>[0,e?1:0]]},$$scope:{ctx:e}}}),{c(){t=Fr("div"),l&&l.c(),o=Or(),Na(i.$$.fragment),Nr(t,"slot","details"),Nr(t,"class","PinturaOptionsListWrapper")},m(s,c){Ar(s,t,c),l&&l.m(t,null),Rr(t,o),Ha(i,t,null),n=!0,r||(a=Wr(t,"keydown",e[23]),r=!0)},p(e,t){l&&l.p&&(!n||536870912&t[0])&&fr(l,s,e,e[29],n?$r(s,e[29],t,Bu):yr(e[29]),Wu);const o={};128&t[0]&&(o.name=e[7]),1024&t[0]&&(o.value=e[10]),512&t[0]&&(o.selectedIndex=e[9]),4096&t[0]&&(o.optionFilter=e[12]),8192&t[0]&&(o.optionMapper=e[13]),2048&t[0]&&(o.optionLabelClass=Xc(["PinturaDropdownOptionLabel",e[11]])),262144&t[0]&&(o.options=e[18]),536922112&t[0]|1&t[1]&&(o.$$scope={dirty:t,ctx:e}),i.$set(o)},i(e){n||(Ea(l,e),Ea(i.$$.fragment,e),n=!0)},o(e){Aa(l,e),Aa(i.$$.fragment,e),n=!1},d(e){e&&Lr(t),l&&l.d(e),ja(i),r=!1,a()}}}function Ju(e){let t,o,i;function n(t){e[28](t)}let r={onshow:e[22],buttonTitle:Cd(e[2],e[1]),buttonClass:Xc(["PinturaDropdownButton",e[0],e[5]&&"PinturaDropdownIconOnly"]),$$slots:{details:[Ku],label:[ju]},$$scope:{ctx:e}};return void 0!==e[19]&&(r.isActive=e[19]),t=new Jd({props:r}),pa.push((()=>Va(t,"isActive",n))),{c(){Na(t.$$.fragment)},m(e,o){Ha(t,e,o),i=!0},p(e,i){const n={};6&i[0]&&(n.buttonTitle=Cd(e[2],e[1])),33&i[0]&&(n.buttonClass=Xc(["PinturaDropdownButton",e[0],e[5]&&"PinturaDropdownIconOnly"])),538443772&i[0]&&(n.$$scope={dirty:i,ctx:e}),!o&&524288&i[0]&&(o=!0,n.isActive=e[19],xa((()=>o=!1))),t.$set(n)},i(e){i||(Ea(t.$$.fragment,e),i=!0)},o(e){Aa(t.$$.fragment,e),i=!1},d(e){ja(t,e)}}}const Qu=(e,[t])=>t<e?t:e,ep=(e,[t])=>t>e?t:e;function tp(e,t,o){let i,n,{$$slots:a={},$$scope:s}=t,{class:l}=t,{title:c}=t,{label:d}=t,{labelClass:u}=t,{innerClass:p}=t,{hideLabel:h=!1}=t,{icon:m}=t,{name:g}=t,{options:$=[]}=t,{selectedIndex:f=-1}=t,{value:y}=t,{optionLabelClass:b}=t,{optionFilter:x}=t,{optionMapper:v}=t,{optionIconStyle:w}=t,{optionLabelStyle:S}=t,{locale:k}=t,{onchange:C=r}=t,{onload:T=r}=t,{ondestroy:M=r}=t,{enableInput:P=!1}=t;let R;return na((()=>T({options:$}))),aa((()=>M({options:$}))),e.$$set=e=>{"class"in e&&o(0,l=e.class),"title"in e&&o(1,c=e.title),"label"in e&&o(2,d=e.label),"labelClass"in e&&o(3,u=e.labelClass),"innerClass"in e&&o(4,p=e.innerClass),"hideLabel"in e&&o(5,h=e.hideLabel),"icon"in e&&o(6,m=e.icon),"name"in e&&o(7,g=e.name),"options"in e&&o(8,$=e.options),"selectedIndex"in e&&o(9,f=e.selectedIndex),"value"in e&&o(10,y=e.value),"optionLabelClass"in e&&o(11,b=e.optionLabelClass),"optionFilter"in e&&o(12,x=e.optionFilter),"optionMapper"in e&&o(13,v=e.optionMapper),"optionIconStyle"in e&&o(14,w=e.optionIconStyle),"optionLabelStyle"in e&&o(15,S=e.optionLabelStyle),"locale"in e&&o(24,k=e.locale),"onchange"in e&&o(16,C=e.onchange),"onload"in e&&o(25,T=e.onload),"ondestroy"in e&&o(26,M=e.ondestroy),"enableInput"in e&&o(17,P=e.enableInput),"$$scope"in e&&o(29,s=e.$$scope)},e.$$.update=()=>{16777472&e.$$.dirty[0]&&o(18,i=k?su($,k):$),263168&e.$$.dirty[0]&&o(20,n=i.reduce(((e,t)=>{if(e)return e;const o=Array.isArray(t)?t:[t,t],[i,n]=o;return lu(i,y)?n:void 0}),void 0)||(e=>{const t=e.find((e=>void 0===e[0]));if(t)return t[1]})(i)||y)},[l,c,d,u,p,h,m,g,$,f,y,b,x,v,w,S,C,P,i,R,n,e=>{o(20,n=e.value),C(e),o(19,R=!1)},({e:e,panel:t})=>{if(e&&e.key&&/up|down/i.test(e.key))return Bd(t.querySelector("input:not([disabled])"));Bd(t.querySelector("fieldset"))},e=>{/tab/i.test(e.key)&&e.preventDefault()},k,T,M,a,function(e){R=e,o(19,R)},s]}class op extends Ga{constructor(e){super(),Ua(this,e,tp,Ju,lr,{class:0,title:1,label:2,labelClass:3,innerClass:4,hideLabel:5,icon:6,name:7,options:8,selectedIndex:9,value:10,optionLabelClass:11,optionFilter:12,optionMapper:13,optionIconStyle:14,optionLabelStyle:15,locale:24,onchange:16,onload:25,ondestroy:26,enableInput:17},null,[-1,-1])}}function ip(e){let t;return{c(){t=Fr("div"),Nr(t,"slot","details")},m(o,i){Ar(o,t,i),e[14](t)},p:tr,d(o){o&&Lr(t),e[14](null)}}}function np(e){let t,o,i;function n(t){e[15](t)}let r={buttonLabel:e[0],buttonClass:e[1],buttonIcon:e[2],buttonHideLabel:e[3],buttonTitle:e[4],buttonLabelClass:e[5],onshow:e[6],onhide:e[7],$$slots:{details:[ip]},$$scope:{ctx:e}};return void 0!==e[9]&&(r.isActive=e[9]),t=new Jd({props:r}),pa.push((()=>Va(t,"isActive",n))),{c(){Na(t.$$.fragment)},m(e,o){Ha(t,e,o),i=!0},p(e,[i]){const n={};1&i&&(n.buttonLabel=e[0]),2&i&&(n.buttonClass=e[1]),4&i&&(n.buttonIcon=e[2]),8&i&&(n.buttonHideLabel=e[3]),16&i&&(n.buttonTitle=e[4]),32&i&&(n.buttonLabelClass=e[5]),64&i&&(n.onshow=e[6]),128&i&&(n.onhide=e[7]),65792&i&&(n.$$scope={dirty:i,ctx:e}),!o&&512&i&&(o=!0,n.isActive=e[9],xa((()=>o=!1))),t.$set(n)},i(e){i||(Ea(t.$$.fragment,e),i=!0)},o(e){Aa(t.$$.fragment,e),i=!1},d(e){ja(t,e)}}}function rp(e,t,o){let{buttonLabel:i}=t,{buttonClass:n}=t,{buttonIcon:a}=t,{buttonHideLabel:s}=t,{buttonTitle:l}=t,{buttonLabelClass:c}=t,{root:d}=t,{ondestroy:u=r}=t,{onshow:p=r}=t,{onhide:h=r}=t;let m,g=!1;return aa(u),e.$$set=e=>{"buttonLabel"in e&&o(0,i=e.buttonLabel),"buttonClass"in e&&o(1,n=e.buttonClass),"buttonIcon"in e&&o(2,a=e.buttonIcon),"buttonHideLabel"in e&&o(3,s=e.buttonHideLabel),"buttonTitle"in e&&o(4,l=e.buttonTitle),"buttonLabelClass"in e&&o(5,c=e.buttonLabelClass),"root"in e&&o(10,d=e.root),"ondestroy"in e&&o(11,u=e.ondestroy),"onshow"in e&&o(6,p=e.onshow),"onhide"in e&&o(7,h=e.onhide)},e.$$.update=()=>{1280&e.$$.dirty&&m&&d&&m.firstChild!==d&&(m.hasChildNodes()?m.replaceChild(d,m.firstChild):m.append(d))},[i,n,a,s,l,c,p,h,m,g,d,u,()=>o(9,g=!1),()=>o(9,g=!0),function(e){pa[e?"unshift":"push"]((()=>{m=e,o(8,m)}))},function(e){g=e,o(9,g)}]}class ap extends Ga{constructor(e){super(),Ua(this,e,rp,np,lr,{buttonLabel:0,buttonClass:1,buttonIcon:2,buttonHideLabel:3,buttonTitle:4,buttonLabelClass:5,root:10,ondestroy:11,onshow:6,onhide:7,hide:12,show:13})}get hide(){return this.$$.ctx[12]}get show(){return this.$$.ctx[13]}}var sp=(e,t={})=>{const{direction:o,shiftMultiplier:i=10,bubbles:n=!1,preventDefault:r=!1,stopKeydownPropagation:a=!0}=t,s="horizontal"===o,l="vertical"===o,c=t=>{const{key:o}=t,c=t.shiftKey,d=/up|down/i.test(o),u=/left|right/i.test(o);if(!u&&!d)return;if(s&&d)return;if(l&&u)return;const p=c?i:1;a&&t.stopPropagation(),r&&t.preventDefault(),e.dispatchEvent(new CustomEvent("nudge",{bubbles:n,detail:me((/left/i.test(o)?-1:/right/i.test(o)?1:0)*p,(/up/i.test(o)?-1:/down/i.test(o)?1:0)*p)}))};return e.addEventListener("keydown",c),{destroy(){e.removeEventListener("keydown",c)}}},lp=(e,t,o)=>(e-t)/(o-t);const cp=e=>({}),dp=e=>({});function up(e){let t,o,i;return{c(){t=Fr("label"),o=Dr(e[0]),Nr(t,"for",e[17]),Nr(t,"class",i=e[1]?"implicit":void 0)},m(e,i){Ar(e,t,i),Rr(t,o)},p(e,n){1&n[0]&&Ur(o,e[0]),131072&n[0]&&Nr(t,"for",e[17]),2&n[0]&&i!==(i=e[1]?"implicit":void 0)&&Nr(t,"class",i)},d(e){e&&Lr(t)}}}function pp(e){let t,o,i,n,r,a,s,l;return o=new Sd({props:{$$slots:{default:[hp]},$$scope:{ctx:e}}}),r=new Sd({props:{$$slots:{default:[mp]},$$scope:{ctx:e}}}),{c(){t=Fr("button"),Na(o.$$.fragment),i=Or(),n=Fr("button"),Na(r.$$.fragment),Nr(t,"type","button"),Nr(t,"aria-label","Increase"),Nr(n,"type","button"),Nr(n,"aria-label","Decrease")},m(c,d){Ar(c,t,d),Ha(o,t,null),Ar(c,i,d),Ar(c,n,d),Ha(r,n,null),a=!0,s||(l=[Wr(t,"pointerdown",e[20](1)),Wr(n,"pointerdown",e[20](-1))],s=!0)},p(e,t){const i={};256&t[1]&&(i.$$scope={dirty:t,ctx:e}),o.$set(i);const n={};256&t[1]&&(n.$$scope={dirty:t,ctx:e}),r.$set(n)},i(e){a||(Ea(o.$$.fragment,e),Ea(r.$$.fragment,e),a=!0)},o(e){Aa(o.$$.fragment,e),Aa(r.$$.fragment,e),a=!1},d(e){e&&Lr(t),ja(o),e&&Lr(i),e&&Lr(n),ja(r),s=!1,ar(l)}}}function hp(e){let t;return{c(){t=zr("path"),Nr(t,"d","M8 12 h8 M12 8 v8")},m(e,o){Ar(e,t,o)},p:tr,d(e){e&&Lr(t)}}}function mp(e){let t;return{c(){t=zr("path"),Nr(t,"d","M9 12 h6")},m(e,o){Ar(e,t,o)},p:tr,d(e){e&&Lr(t)}}}function gp(e){let t,o,i,n,r,a,s,l,c,d,u,p,h,m,g,$,f=e[0]&&up(e);const y=e[37].default,b=mr(y,e,e[39],null),x=e[37].knob,v=mr(x,e,e[39],dp);let w=e[8]&&pp(e);return{c(){t=Fr("div"),o=Fr("div"),f&&f.c(),i=Or(),n=Fr("input"),r=Or(),a=Fr("div"),b&&b.c(),l=Or(),c=Fr("div"),d=Fr("div"),v&&v.c(),p=Or(),w&&w.c(),Nr(n,"type","range"),Nr(n,"id",e[17]),Nr(n,"min",e[2]),Nr(n,"max",e[3]),Nr(n,"step",e[4]),n.value=e[13],Zr(n,"pointer-events",e[9]?"none":void 0),Nr(a,"class",s=Xc(["PinturaSliderTrack",e[5]])),Nr(d,"class",u=Xc(["PinturaSliderKnob",e[6]])),Nr(c,"class","PinturaSliderKnobController"),Zr(c,"transform",e[16]),Nr(o,"class","PinturaSliderControl"),Zr(o,"--slider-position",Math.round(e[14])),Nr(t,"class",h=Xc(["PinturaSlider",e[11]])),Nr(t,"data-direction",e[7])},m(s,u){Ar(s,t,u),Rr(t,o),f&&f.m(o,null),Rr(o,i),Rr(o,n),e[38](n),Rr(o,r),Rr(o,a),b&&b.m(a,null),Rr(o,l),Rr(o,c),Rr(c,d),v&&v.m(d,null),Rr(t,p),w&&w.m(t,null),m=!0,g||($=[Wr(n,"input",e[18]),Wr(n,"nudge",e[19]),wr(sp.call(null,n)),Wr(o,"pointerdown",(function(){sr(e[10]&&e[12])&&(e[10]&&e[12]).apply(this,arguments)}))],g=!0)},p(r,l){(e=r)[0]?f?f.p(e,l):(f=up(e),f.c(),f.m(o,i)):f&&(f.d(1),f=null),(!m||131072&l[0])&&Nr(n,"id",e[17]),(!m||4&l[0])&&Nr(n,"min",e[2]),(!m||8&l[0])&&Nr(n,"max",e[3]),(!m||16&l[0])&&Nr(n,"step",e[4]),(!m||8192&l[0])&&(n.value=e[13]),512&l[0]&&Zr(n,"pointer-events",e[9]?"none":void 0),b&&b.p&&(!m||256&l[1])&&fr(b,y,e,e[39],m?$r(y,e[39],l,null):yr(e[39]),null),(!m||32&l[0]&&s!==(s=Xc(["PinturaSliderTrack",e[5]])))&&Nr(a,"class",s),v&&v.p&&(!m||256&l[1])&&fr(v,x,e,e[39],m?$r(x,e[39],l,cp):yr(e[39]),dp),(!m||64&l[0]&&u!==(u=Xc(["PinturaSliderKnob",e[6]])))&&Nr(d,"class",u),65536&l[0]&&Zr(c,"transform",e[16]),16384&l[0]&&Zr(o,"--slider-position",Math.round(e[14])),e[8]?w?(w.p(e,l),256&l[0]&&Ea(w,1)):(w=pp(e),w.c(),Ea(w,1),w.m(t,null)):w&&(Ra(),Aa(w,1,1,(()=>{w=null})),Ia()),(!m||2048&l[0]&&h!==(h=Xc(["PinturaSlider",e[11]])))&&Nr(t,"class",h),(!m||128&l[0])&&Nr(t,"data-direction",e[7])},i(e){m||(Ea(b,e),Ea(v,e),Ea(w),m=!0)},o(e){Aa(b,e),Aa(v,e),Aa(w),m=!1},d(o){o&&Lr(t),f&&f.d(),e[38](null),b&&b.d(o),v&&v.d(o),w&&w.d(),g=!1,ar($)}}}function $p(e,t,o){let i,n,a,s,l,c,d,u,p,h,g,$,f,y,b,x,{$$slots:v={},$$scope:w}=t,{id:S}=t,{label:k}=t,{hideLabel:C=!1}=t,{min:T=0}=t,{max:M=100}=t,{step:P=1}=t,{value:R=0}=t,{valueMin:I}=t,{valueMax:E}=t,{trackClass:A}=t,{knobClass:F}=t,{ongrab:z=r}=t,{onchange:D=r}=t,{onrelease:O=r}=t,{onexceed:B=r}=t,{direction:W="x"}=t,{getValue:_=Y}=t,{setValue:V=Y}=t,{enableSpinButtons:N=!0}=t,{enableForceUseKnob:H=!1}=t,{enableStopPropagation:j=!0}=t,{enablePointerdownListener:U=!0}=t,{maxInteractionDistance:G=6}=t,{class:Z}=t;const X=e=>V(((e,t)=>(t=1/t,Math.round(e*t)/t))($s(e,T,M),P),R),q=(e,t,i={})=>{const{grabbed:n=!1,released:r=!1}=i,s=X(T+e/t*a),l=I||T,c=E||M;o(21,R=m(s)?s:$s(s,l,c)),x!==s&&(x=s,!m(s)&&(s<l||s>c)&&B(R,s),R!==b&&(b=R,n&&z(R),D(R),r&&O(R)))};let K;let J;const Q=e=>{const t=e[p]-y;q(f+t,$)},ee=e=>{J=setTimeout((()=>{$=void 0}),50),document.documentElement.removeEventListener("pointermove",Q),document.documentElement.removeEventListener("pointerup",ee),D(R),O(R)},te=()=>{o(21,R=X(n+ie*P)),D(R)};let oe,ie=1,ne=!1;const re=e=>{clearTimeout(oe),ne||te(),O(R),document.removeEventListener("pointerup",re)};return e.$$set=e=>{"id"in e&&o(22,S=e.id),"label"in e&&o(0,k=e.label),"hideLabel"in e&&o(1,C=e.hideLabel),"min"in e&&o(2,T=e.min),"max"in e&&o(3,M=e.max),"step"in e&&o(4,P=e.step),"value"in e&&o(21,R=e.value),"valueMin"in e&&o(23,I=e.valueMin),"valueMax"in e&&o(24,E=e.valueMax),"trackClass"in e&&o(5,A=e.trackClass),"knobClass"in e&&o(6,F=e.knobClass),"ongrab"in e&&o(25,z=e.ongrab),"onchange"in e&&o(26,D=e.onchange),"onrelease"in e&&o(27,O=e.onrelease),"onexceed"in e&&o(28,B=e.onexceed),"direction"in e&&o(7,W=e.direction),"getValue"in e&&o(29,_=e.getValue),"setValue"in e&&o(30,V=e.setValue),"enableSpinButtons"in e&&o(8,N=e.enableSpinButtons),"enableForceUseKnob"in e&&o(9,H=e.enableForceUseKnob),"enableStopPropagation"in e&&o(31,j=e.enableStopPropagation),"enablePointerdownListener"in e&&o(10,U=e.enablePointerdownListener),"maxInteractionDistance"in e&&o(32,G=e.maxInteractionDistance),"class"in e&&o(11,Z=e.class),"$$scope"in e&&o(39,w=e.$$scope)},e.$$.update=()=>{4194305&e.$$.dirty[0]&&o(17,i=S||(k?"PinturaSlider_"+L():void 0)),538968064&e.$$.dirty[0]&&o(13,n=void 0!==R?_(R):0),12&e.$$.dirty[0]&&(a=M-T),8204&e.$$.dirty[0]&&o(34,s=lp(n,T,M)),8&e.$$.dirty[1]&&o(14,l=100*s),128&e.$$.dirty[0]&&o(35,c=W.toUpperCase()),128&e.$$.dirty[0]&&o(36,d="x"===W?"Width":"Height"),32&e.$$.dirty[1]&&(u="offset"+d),16&e.$$.dirty[1]&&(p="page"+c),16384&e.$$.dirty[0]|16&e.$$.dirty[1]&&o(16,h=`translate${c}(${l}%)`)},[k,C,T,M,P,A,F,W,N,H,U,Z,e=>{clearTimeout(J);let t=!1;j&&e.stopPropagation(),clearTimeout(K);const o=g.getBoundingClientRect();if($=g[u],y=e[p],f=y-o[W],H){if(Math.abs(f-s*$)>G)return;t=!0,e.stopPropagation()}return document.activeElement!==g&&g.focus(),q(f,$,{grabbed:!0}),document.documentElement.addEventListener("pointermove",Q),document.documentElement.addEventListener("pointerup",ee),t},n,l,g,h,i,e=>{$||(o(21,R=V(parseFloat(e.target.value))),R!==b&&(b=R,D(R)))},e=>{const t=g[u];q(n/a*t+e.detail[W],t),clearTimeout(K),K=setTimeout((()=>{O(R)}),250)},e=>t=>{clearTimeout(K),ie=e,ne=!1,oe=setInterval((()=>{ne=!0,te()}),100),document.addEventListener("pointercancel",re),document.addEventListener("pointerup",re)},R,S,I,E,z,D,O,B,_,V,j,G,e=>{const t=g.getBoundingClientRect(),o=e[p]-t[W],i=g[u];return Math.abs(o-s*i)},s,c,d,v,function(e){pa[e?"unshift":"push"]((()=>{g=e,o(15,g)}))},w]}class fp extends Ga{constructor(e){super(),Ua(this,e,$p,gp,lr,{id:22,label:0,hideLabel:1,min:2,max:3,step:4,value:21,valueMin:23,valueMax:24,trackClass:5,knobClass:6,ongrab:25,onchange:26,onrelease:27,onexceed:28,direction:7,getValue:29,setValue:30,enableSpinButtons:8,enableForceUseKnob:9,enableStopPropagation:31,enablePointerdownListener:10,maxInteractionDistance:32,class:11,eventDistanceToKnob:33,handlePointerDown:12},null,[-1,-1])}get eventDistanceToKnob(){return this.$$.ctx[33]}get handlePointerDown(){return this.$$.ctx[12]}}function yp(e){let t,o;return t=new Sd({props:{class:"PinturaButtonIcon",$$slots:{default:[bp]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};1048580&o&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function bp(e){let t;return{c(){t=zr("g")},m(o,i){Ar(o,t,i),t.innerHTML=e[2]},p(e,o){4&o&&(t.innerHTML=e[2])},d(e){e&&Lr(t)}}}function xp(e){let t,o,i=ru(e[8],e[6])+"";return{c(){t=Fr("span"),o=Dr(i),Nr(t,"class","PinturaButtonLabelPrefix")},m(e,i){Ar(e,t,i),Rr(t,o)},p(e,t){320&t&&i!==(i=ru(e[8],e[6])+"")&&Ur(o,i)},d(e){e&&Lr(t)}}}function vp(e){let t,o,i,n,r,a,s,l,c,d=e[2]&&yp(e),u=e[8]&&xp(e);return{c(){t=Fr("span"),d&&d.c(),o=Or(),u&&u.c(),i=Or(),n=Fr("span"),r=Dr(e[9]),Nr(n,"class",a=Xc(["PinturaButtonLabel",e[3],e[5]&&"implicit"])),Nr(t,"slot","label"),Nr(t,"title",s=ru(e[1],e[6])),Nr(t,"class",l=Xc(["PinturaButtonInner",e[4]]))},m(e,a){Ar(e,t,a),d&&d.m(t,null),Rr(t,o),u&&u.m(t,null),Rr(t,i),Rr(t,n),Rr(n,r),c=!0},p(e,p){e[2]?d?(d.p(e,p),4&p&&Ea(d,1)):(d=yp(e),d.c(),Ea(d,1),d.m(t,o)):d&&(Ra(),Aa(d,1,1,(()=>{d=null})),Ia()),e[8]?u?u.p(e,p):(u=xp(e),u.c(),u.m(t,i)):u&&(u.d(1),u=null),(!c||512&p)&&Ur(r,e[9]),(!c||40&p&&a!==(a=Xc(["PinturaButtonLabel",e[3],e[5]&&"implicit"])))&&Nr(n,"class",a),(!c||66&p&&s!==(s=ru(e[1],e[6])))&&Nr(t,"title",s),(!c||16&p&&l!==(l=Xc(["PinturaButtonInner",e[4]])))&&Nr(t,"class",l)},i(e){c||(Ea(d),c=!0)},o(e){Aa(d),c=!1},d(e){e&&Lr(t),d&&d.d(),u&&u.d()}}}function wp(e){let t,o,i,n,r;const a=[{label:ru(e[1],e[6])},{hideLabel:!0},e[12],{value:e[7]},{onchange:e[11]}];let s={};for(let e=0;e<a.length;e+=1)s=ir(s,a[e]);return o=new fp({props:s}),{c(){t=Fr("div"),Na(o.$$.fragment),Nr(t,"slot","details")},m(a,s){Ar(a,t,s),Ha(o,t,null),i=!0,n||(r=Wr(t,"keydown",e[10]),n=!0)},p(e,t){const i=6338&t?Wa(a,[66&t&&{label:ru(e[1],e[6])},a[1],4096&t&&_a(e[12]),128&t&&{value:e[7]},2048&t&&{onchange:e[11]}]):{};o.$set(i)},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Lr(t),ja(o),n=!1,r()}}}function Sp(e){let t,o;return t=new Jd({props:{panelClass:"PinturaSliderPanel",buttonClass:Xc(["PinturaSliderButton",e[0],e[5]&&"PinturaSliderIconOnly"]),$$slots:{details:[wp],label:[vp]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,[o]){const i={};33&o&&(i.buttonClass=Xc(["PinturaSliderButton",e[0],e[5]&&"PinturaSliderIconOnly"])),1053694&o&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function kp(e,t,o){const i=["class","title","label","icon","labelClass","innerClass","hideLabel","locale","value","onchange","labelPrefix"];let n=xr(t,i),{class:a}=t,{title:s}=t,{label:l=Math.round}=t,{icon:c}=t,{labelClass:d}=t,{innerClass:u}=t,{hideLabel:p=!1}=t,{locale:h}=t,{value:m}=t,{onchange:g=r}=t,{labelPrefix:$}=t;const{min:f,max:y,getValue:b=Y}=n;let x;const v=e=>o(9,x=(e=>R(l)?l(b(e),f,y,e):l)(e));return e.$$set=e=>{t=ir(ir({},t),br(e)),o(12,n=xr(t,i)),"class"in e&&o(0,a=e.class),"title"in e&&o(1,s=e.title),"label"in e&&o(13,l=e.label),"icon"in e&&o(2,c=e.icon),"labelClass"in e&&o(3,d=e.labelClass),"innerClass"in e&&o(4,u=e.innerClass),"hideLabel"in e&&o(5,p=e.hideLabel),"locale"in e&&o(6,h=e.locale),"value"in e&&o(7,m=e.value),"onchange"in e&&o(14,g=e.onchange),"labelPrefix"in e&&o(8,$=e.labelPrefix)},e.$$.update=()=>{8320&e.$$.dirty&&v(m)},[a,s,c,d,u,p,h,m,$,x,e=>{/tab/i.test(e.key)&&e.preventDefault()},e=>{v(e),g(e)},n,l,g]}class Cp extends Ga{constructor(e){super(),Ua(this,e,kp,Sp,lr,{class:0,title:1,label:13,icon:2,labelClass:3,innerClass:4,hideLabel:5,locale:6,value:7,onchange:14,labelPrefix:8})}}function Tp(e){let t,o,i,n,r,a,s,l;return{c(){t=Fr("span"),o=zr("svg"),i=zr("g"),n=zr("circle"),r=zr("circle"),a=Or(),s=Fr("span"),l=Dr(e[3]),Nr(n,"class","PinturaProgressIndicatorBar"),Nr(n,"r","8.5"),Nr(n,"cx","10"),Nr(n,"cy","10"),Nr(n,"stroke-linecap","round"),Nr(n,"opacity",".25"),Nr(r,"class","PinturaProgressIndicatorFill"),Nr(r,"r","8.5"),Nr(r,"stroke-dasharray",e[2]),Nr(r,"cx","10"),Nr(r,"cy","10"),Nr(r,"transform","rotate(-90) translate(-20)"),Nr(i,"fill","none"),Nr(i,"stroke","currentColor"),Nr(i,"stroke-width","2.5"),Nr(i,"stroke-linecap","round"),Nr(i,"opacity",e[1]),Nr(o,"width","20"),Nr(o,"height","20"),Nr(o,"viewBox","0 0 20 20"),Nr(o,"xmlns","http://www.w3.org/2000/svg"),Nr(o,"aria-hidden","true"),Nr(o,"focusable","false"),Nr(s,"class","implicit"),Nr(t,"class","PinturaProgressIndicator"),Nr(t,"data-status",e[0]),Zr(t,"opacity",e[4])},m(e,c){Ar(e,t,c),Rr(t,o),Rr(o,i),Rr(i,n),Rr(i,r),Rr(t,a),Rr(t,s),Rr(s,l)},p(e,[o]){4&o&&Nr(r,"stroke-dasharray",e[2]),2&o&&Nr(i,"opacity",e[1]),8&o&&Ur(l,e[3]),1&o&&Nr(t,"data-status",e[0]),16&o&&Zr(t,"opacity",e[4])},i:tr,o:tr,d(e){e&&Lr(t)}}}function Mp(e,t,o){let i,n,r,a,s,l,c,d;const u=sa();let{progress:p}=t,{min:h=0}=t,{max:m=100}=t,{labelBusy:g="Busy"}=t,{opacity:$}=t;const f=ca("isAnimated");hr(e,f,(e=>o(14,s=e)));const y=xc($,{precision:.01});hr(e,y,(e=>o(4,d=e)));const b=xc(0,{precision:.01}),x=xc(0,{precision:.01});hr(e,x,(e=>o(15,l=e)));const v=qa([b],(e=>$s(e,h,m)));hr(e,v,(e=>o(16,c=e)));const w=v.subscribe((e=>{1===p&&Math.round(e)>=100&&u("complete")}));return na((()=>{x.set(1,{hard:!s})})),aa((()=>{w()})),e.$$set=e=>{"progress"in e&&o(9,p=e.progress),"min"in e&&o(10,h=e.min),"max"in e&&o(11,m=e.max),"labelBusy"in e&&o(12,g=e.labelBusy),"opacity"in e&&o(13,$=e.opacity)},e.$$.update=()=>{24576&e.$$.dirty&&Oo($)&&y.set($,{hard:!s}),16896&e.$$.dirty&&p&&p!==1/0&&b.set(100*p,{hard:!s}),70144&e.$$.dirty&&o(3,i=p===1/0?g:Math.round(c)+"%"),66048&e.$$.dirty&&o(2,n=p===1/0?"26.5 53":c/100*53+" 53"),32768&e.$$.dirty&&o(1,r=l),512&e.$$.dirty&&o(0,a=p===1/0?"busy":"loading")},[a,r,n,i,d,f,y,x,v,p,h,m,g,$,s,l,c]}class Pp extends Ga{constructor(e){super(),Ua(this,e,Mp,Tp,lr,{progress:9,min:10,max:11,labelBusy:12,opacity:13})}}function Rp(e){let t,o,i=ru(e[0],e[1])+"";return{c(){t=Fr("span"),o=Dr(i),Nr(t,"class",e[3])},m(e,i){Ar(e,t,i),Rr(t,o)},p(e,n){3&n&&i!==(i=ru(e[0],e[1])+"")&&Ur(o,i),8&n&&Nr(t,"class",e[3])},d(e){e&&Lr(t)}}}function Ip(e){let t,o,i,n,r=e[0]&&Rp(e);return i=new gh({props:{items:e[2]}}),{c(){t=Fr("li"),r&&r.c(),o=Or(),Na(i.$$.fragment),Nr(t,"class","PinturaShapeStyle")},m(e,a){Ar(e,t,a),r&&r.m(t,null),Rr(t,o),Ha(i,t,null),n=!0},p(e,[n]){e[0]?r?r.p(e,n):(r=Rp(e),r.c(),r.m(t,o)):r&&(r.d(1),r=null);const a={};4&n&&(a.items=e[2]),i.$set(a)},i(e){n||(Ea(i.$$.fragment,e),n=!0)},o(e){Aa(i.$$.fragment,e),n=!1},d(e){e&&Lr(t),r&&r.d(),ja(i)}}}function Ep(e,t,o){let i,{title:n}=t,{locale:r}=t,{items:a}=t,{hideTitle:s=!1}=t;return e.$$set=e=>{"title"in e&&o(0,n=e.title),"locale"in e&&o(1,r=e.locale),"items"in e&&o(2,a=e.items),"hideTitle"in e&&o(4,s=e.hideTitle)},e.$$.update=()=>{16&e.$$.dirty&&o(3,i="PinturaShapeStyleLabel"+(s?" implicit":""))},[n,r,a,i,s]}class Ap extends Ga{constructor(e){super(),Ua(this,e,Ep,Ip,lr,{title:0,locale:1,items:2,hideTitle:4})}}var Lp=(e,t,o)=>{let i,n,r;const a=Math.floor(6*e),s=6*e-a,l=o*(1-t),c=o*(1-s*t),d=o*(1-(1-s)*t);switch(a%6){case 0:i=o,n=d,r=l;break;case 1:i=c,n=o,r=l;break;case 2:i=l,n=o,r=d;break;case 3:i=l,n=c,r=o;break;case 4:i=d,n=l,r=o;break;case 5:i=o,n=l,r=c}return[i,n,r]};function Fp(e){let t,o;return{c(){t=Fr("div"),o=Fr("span"),Nr(t,"class","PinturaColorPreview"),Nr(t,"title",e[0]),Zr(t,"--color",e[1])},m(e,i){Ar(e,t,i),Rr(t,o)},p(e,[o]){1&o&&Nr(t,"title",e[0]),2&o&&Zr(t,"--color",e[1])},i:tr,o:tr,d(e){e&&Lr(t)}}}function zp(e,t,o){let i,{color:n}=t,{title:r}=t;return e.$$set=e=>{"color"in e&&o(2,n=e.color),"title"in e&&o(0,r=e.title)},e.$$.update=()=>{4&e.$$.dirty&&o(1,i=n?Xo(n):"transparent")},[r,i,n]}class Dp extends Ga{constructor(e){super(),Ua(this,e,zp,Fp,lr,{color:2,title:0})}}var Op=e=>(e=e.trim(),/^rgba/.test(e)?e.substring(5).split(",").map(parseFloat).map(((e,t)=>e/(3===t?1:255))):/^rgb/.test(e)?e.substring(4).split(",").map(parseFloat).map((e=>e/255)):/^#/.test(e)?(e=>{const[,t,o,i,n]=e.split("");e=e.length>=4&&e.length<=5?`#${t}${t}${o}${o}${i}${i}${n?`${n}${n}`:""}`:e;const[r,a,s,l,c]=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i.exec(e)||[];if(r)return[a,s,l,c].filter((e=>void 0!==e)).map((e=>parseInt(e,16)/255))})(e):/[0-9]{1,3}\s?,\s?[0-9]{1,3}\s?,\s?[0-9]{1,3}/.test(e)?e.split(",").map((e=>parseInt(e,10))).map((e=>e/255)):void 0);let Bp=null;function Wp(e){let t,o;return{c(){t=Fr("span"),o=Dr(e[0])},m(e,i){Ar(e,t,i),Rr(t,o)},p(e,t){1&t[0]&&Ur(o,e[0])},d(e){e&&Lr(t)}}}function _p(e){let t,o,i,n;o=new Dp({props:{color:e[4],title:ru(e[8],e[10])}});let r=!e[9]&&Wp(e);return{c(){t=Fr("span"),Na(o.$$.fragment),i=Or(),r&&r.c(),Nr(t,"slot","label"),Nr(t,"class","PinturaButtonLabel")},m(e,a){Ar(e,t,a),Ha(o,t,null),Rr(t,i),r&&r.m(t,null),n=!0},p(e,i){const n={};16&i[0]&&(n.color=e[4]),1280&i[0]&&(n.title=ru(e[8],e[10])),o.$set(n),e[9]?r&&(r.d(1),r=null):r?r.p(e,i):(r=Wp(e),r.c(),r.m(t,null))},i(e){n||(Ea(o.$$.fragment,e),n=!0)},o(e){Aa(o.$$.fragment,e),n=!1},d(e){e&&Lr(t),ja(o),r&&r.d()}}}function Vp(e){let t,o,i,n,r,a,s,l,c,d,u,p;s=new fp({props:{label:"Hue",hideLabel:!0,class:"PinturaHuePicker",onchange:e[27],value:e[16],min:0,max:1,step:.01}});let h=e[11]&&Np(e),m=(e[14]||e[15])&&Hp(e);return{c(){t=Fr("div"),o=Fr("div"),i=Fr("div"),n=Fr("div"),r=Or(),a=Fr("div"),Na(s.$$.fragment),l=Or(),h&&h.c(),c=Or(),m&&m.c(),Nr(n,"role","button"),Nr(n,"aria-label","Saturation slider"),Nr(n,"class","PinturaPickerKnob"),Nr(n,"tabindex","0"),Zr(n,"background-color",e[20]),Nr(i,"class","PinturaPickerKnobController"),Zr(i,"transform",`translate(${e[25]}%,${e[24]}%)`),Nr(o,"class","PinturaSaturationPicker"),Zr(o,"background-color",e[21]),Zr(a,"--knob-background",e[21]),Nr(t,"class","PinturaPicker")},m(g,$){Ar(g,t,$),Rr(t,o),Rr(o,i),Rr(i,n),e[41](o),Rr(t,r),Rr(t,a),Ha(s,a,null),Rr(t,l),h&&h.m(t,null),Rr(t,c),m&&m.m(t,null),d=!0,u||(p=[Wr(n,"nudge",e[30]),wr(sp.call(null,n,{preventDefault:!0})),Wr(o,"pointerdown",e[29])],u=!0)},p(e,r){1048576&r[0]&&Zr(n,"background-color",e[20]),50331648&r[0]&&Zr(i,"transform",`translate(${e[25]}%,${e[24]}%)`),2097152&r[0]&&Zr(o,"background-color",e[21]);const l={};65536&r[0]&&(l.value=e[16]),s.$set(l),2097152&r[0]&&Zr(a,"--knob-background",e[21]),e[11]?h?(h.p(e,r),2048&r[0]&&Ea(h,1)):(h=Np(e),h.c(),Ea(h,1),h.m(t,c)):h&&(Ra(),Aa(h,1,1,(()=>{h=null})),Ia()),e[14]||e[15]?m?(m.p(e,r),49152&r[0]&&Ea(m,1)):(m=Hp(e),m.c(),Ea(m,1),m.m(t,null)):m&&(Ra(),Aa(m,1,1,(()=>{m=null})),Ia())},i(e){d||(Ea(s.$$.fragment,e),Ea(h),Ea(m),d=!0)},o(e){Aa(s.$$.fragment,e),Aa(h),Aa(m),d=!1},d(o){o&&Lr(t),e[41](null),ja(s),h&&h.d(),m&&m.d(),u=!1,ar(p)}}}function Np(e){let t,o,i;return o=new fp({props:{label:"Opacity",hideLabel:!0,class:"PinturaOpacityPicker",onchange:e[28],value:e[17],min:0,max:1,step:.01}}),{c(){t=Fr("div"),Na(o.$$.fragment),Zr(t,"--knob-background",e[18]),Zr(t,"--track-background",`linear-gradient(to right,${e[19]},${e[20]})`)},m(e,n){Ar(e,t,n),Ha(o,t,null),i=!0},p(e,i){const n={};131072&i[0]&&(n.value=e[17]),o.$set(n),262144&i[0]&&Zr(t,"--knob-background",e[18]),1572864&i[0]&&Zr(t,"--track-background",`linear-gradient(to right,${e[19]},${e[20]})`)},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Lr(t),ja(o)}}}function Hp(e){let t,o,i,n,r,a,s,l=e[15]&&jp(e);return{c(){t=Fr("div"),o=Fr("input"),n=Or(),l&&l.c(),Nr(o,"class","PinturaColorPickerInput"),Nr(o,"type","text"),o.disabled=i=!e[14],o.value=e[23],Nr(t,"class","PinturColorPickerInputGroup")},m(i,c){Ar(i,t,c),Rr(t,o),Rr(t,n),l&&l.m(t,null),r=!0,a||(s=[Wr(o,"keydown",e[32]),Wr(o,"input",e[31])],a=!0)},p(e,n){(!r||16384&n[0]&&i!==(i=!e[14]))&&(o.disabled=i),(!r||8388608&n[0]&&o.value!==e[23])&&(o.value=e[23]),e[15]?l?(l.p(e,n),32768&n[0]&&Ea(l,1)):(l=jp(e),l.c(),Ea(l,1),l.m(t,null)):l&&(Ra(),Aa(l,1,1,(()=>{l=null})),Ia())},i(e){r||(Ea(l),r=!0)},o(e){Aa(l),r=!1},d(e){e&&Lr(t),l&&l.d(),a=!1,ar(s)}}}function jp(e){let t,o;return t=new wh({props:{icon:'<path stroke="currentColor" stroke-linecap="square" d="m13 14-7 7a2.704 2.704 0 0 1-3 0 2.704 2.704 0 0 1 0-3l7-7"/><path fill="currentColor" d="M9.475 9.475 14.5 14.5c.263.263.69.265.955.005l.783-.767a4.209 4.209 0 0 0 1.262-3.006V10l4-4c.5-.5.375-2.125-.5-3s-2.5-1-3-.5l-4 4h-.732a4.329 4.329 0 0 0-3.03 1.238l-.758.742a.7.7 0 0 0-.005.995Z"/>',hideLabel:!0,label:"Pick a color",class:"PinturaEyeDropper",onclick:e[33]}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p:tr,i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Up(e){let t,o;return t=new Lu({props:{label:ru(e[10].labelColorPalette,e[10]),class:Xc(["PinturaColorPresets",e[9]?"PinturaColorPresetsGrid":"PinturaColorPresetsList"]),hideLabel:!1,name:e[1],value:e[4],optionGroupClass:"PinturaListOptionGroup",optionClass:"PinturaListOption",options:e[2].map(e[42]),selectedIndex:e[3],optionMapper:e[7],optionLabelClass:e[6],onchange:e[43],$$slots:{option:[Xp,({option:e})=>({59:e}),({option:e})=>[0,e?268435456:0]],group:[Gp,({option:e})=>({59:e}),({option:e})=>[0,e?268435456:0]]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};1024&o[0]&&(i.label=ru(e[10].labelColorPalette,e[10])),512&o[0]&&(i.class=Xc(["PinturaColorPresets",e[9]?"PinturaColorPresetsGrid":"PinturaColorPresetsList"])),2&o[0]&&(i.name=e[1]),16&o[0]&&(i.value=e[4]),1028&o[0]&&(i.options=e[2].map(e[42])),8&o[0]&&(i.selectedIndex=e[3]),128&o[0]&&(i.optionMapper=e[7]),64&o[0]&&(i.optionLabelClass=e[6]),512&o[0]|805306368&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Gp(e){let t,o,i=e[59].label+"";return{c(){t=Fr("span"),o=Dr(i),Nr(t,"slot","group")},m(e,i){Ar(e,t,i),Rr(t,o)},p(e,t){268435456&t[1]&&i!==(i=e[59].label+"")&&Ur(o,i)},d(e){e&&Lr(t)}}}function Zp(e){let t,o,i=e[59].label+"";return{c(){t=Fr("span"),o=Dr(i),Nr(t,"class","PinturaButtonLabel")},m(e,i){Ar(e,t,i),Rr(t,o)},p(e,t){268435456&t[1]&&i!==(i=e[59].label+"")&&Ur(o,i)},d(e){e&&Lr(t)}}}function Xp(e){let t,o,i,n;o=new Dp({props:{title:e[59].label,color:e[59].value}});let r=!e[9]&&Zp(e);return{c(){t=Fr("span"),Na(o.$$.fragment),i=Or(),r&&r.c(),Nr(t,"slot","option")},m(e,a){Ar(e,t,a),Ha(o,t,null),Rr(t,i),r&&r.m(t,null),n=!0},p(e,i){const n={};268435456&i[1]&&(n.title=e[59].label),268435456&i[1]&&(n.color=e[59].value),o.$set(n),e[9]?r&&(r.d(1),r=null):r?r.p(e,i):(r=Zp(e),r.c(),r.m(t,null))},i(e){n||(Ea(o.$$.fragment,e),n=!0)},o(e){Aa(o.$$.fragment,e),n=!1},d(e){e&&Lr(t),ja(o),r&&r.d()}}}function Yp(e){let t,o,i,n=e[13]&&Vp(e),r=e[12]&&Up(e);return{c(){t=Fr("div"),n&&n.c(),o=Or(),r&&r.c(),Nr(t,"slot","details"),Nr(t,"class","PinturaColorPickerPanel")},m(e,a){Ar(e,t,a),n&&n.m(t,null),Rr(t,o),r&&r.m(t,null),i=!0},p(e,i){e[13]?n?(n.p(e,i),8192&i[0]&&Ea(n,1)):(n=Vp(e),n.c(),Ea(n,1),n.m(t,o)):n&&(Ra(),Aa(n,1,1,(()=>{n=null})),Ia()),e[12]?r?(r.p(e,i),4096&i[0]&&Ea(r,1)):(r=Up(e),r.c(),Ea(r,1),r.m(t,null)):r&&(Ra(),Aa(r,1,1,(()=>{r=null})),Ia())},i(e){i||(Ea(n),Ea(r),i=!0)},o(e){Aa(n),Aa(r),i=!1},d(e){e&&Lr(t),n&&n.d(),r&&r.d()}}}function qp(e){let t,o;return t=new Jd({props:{buttonClass:Xc(["PinturaColorPickerButton",e[5]]),$$slots:{details:[Yp],label:[_p]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};32&o[0]&&(i.buttonClass=Xc(["PinturaColorPickerButton",e[5]])),67108831&o[0]|536870912&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Kp(e,t,o){let i,n,r,a,s,l,c,u,p,h,m,g,$,{label:f}=t,{name:y}=t,{options:b=[]}=t,{selectedIndex:x=-1}=t,{value:v}=t,{buttonClass:w}=t,{optionLabelClass:S}=t,{optionMapper:k}=t,{onchange:C}=t,{title:T}=t,{hidePresetLabel:M=!0}=t,{locale:P}=t,{enableOpacity:I=!0}=t,{enablePresets:E=!0}=t,{enablePicker:A=!0}=t,{enableInput:L=!1}=t,{enableEyeDropper:F=!1}=t,z="transparent",D="transparent";const O=(e,t)=>{if(h=[e[0],e[1],e[2]],t){let t=((e,t,o)=>{let i=Math.max(e,t,o),n=i-Math.min(e,t,o),r=n&&(i==e?(t-o)/n:i==t?2+(o-e)/n:4+(e-t)/n);return[60*(r<0?r+6:r)/360,i&&n/i,i]})(...h),i=t[0],n=t[1],r=t[2];Oo(H)&&(i=H),Oo(V)&&(n=V),Oo(N)&&(r=N),o(16,l=i),o(36,c=n),o(37,u=r),o(17,p=Oo(e[3])?e[3]:1)}o(18,m=Xo(e)),o(19,g=Xo([...h,0])),o(20,z=Xo([...h,1])),o(21,D=Xo(Lp(l,1,1)))},B=()=>{const e=[...Lp(l,c,u),p];O(e),C(e)},W=e=>{const t=3===e.length?[...e,1]:e;_(),O(t,!0),C(t)},_=()=>{V=void 0,N=void 0,H=void 0};let V,N,H;const j=(e,t)=>{const i=$s(e.x/t.width,0,1),n=$s(e.y/t.height,0,1);var r,a;a=1-n,o(36,c=r=i),o(37,u=a),V=r,N=a,B()};let U,G,Z,X;const Y=e=>{const t=Ce(ge(e),X);j(ke($e(Z),t),G)},q=e=>{G=void 0,document.documentElement.removeEventListener("pointermove",Y),document.documentElement.removeEventListener("pointerup",q)};let K;return e.$$set=e=>{"label"in e&&o(0,f=e.label),"name"in e&&o(1,y=e.name),"options"in e&&o(2,b=e.options),"selectedIndex"in e&&o(3,x=e.selectedIndex),"value"in e&&o(4,v=e.value),"buttonClass"in e&&o(5,w=e.buttonClass),"optionLabelClass"in e&&o(6,S=e.optionLabelClass),"optionMapper"in e&&o(7,k=e.optionMapper),"onchange"in e&&o(34,C=e.onchange),"title"in e&&o(8,T=e.title),"hidePresetLabel"in e&&o(9,M=e.hidePresetLabel),"locale"in e&&o(10,P=e.locale),"enableOpacity"in e&&o(11,I=e.enableOpacity),"enablePresets"in e&&o(12,E=e.enablePresets),"enablePicker"in e&&o(13,A=e.enablePicker),"enableInput"in e&&o(14,L=e.enableInput),"enableEyeDropper"in e&&o(35,F=e.enableEyeDropper)},e.$$.update=()=>{16&e.$$.dirty[1]&&o(15,i=F&&(null===Bp&&(Bp=d()&&"EyeDropper"in window),Bp)),16&e.$$.dirty[0]|128&e.$$.dirty[1]&&(!v||$&&vs(v,$)||(o(38,$=[...v]),O(v,!0))),32&e.$$.dirty[1]&&o(25,n=100*c),64&e.$$.dirty[1]&&o(24,r=100-100*u),256&e.$$.dirty[1]&&o(40,a=!!K&&(K.length>=4&&K.length<=5)),51216&e.$$.dirty[0]|512&e.$$.dirty[1]&&o(23,s=(L||i)&&v?((e,t,o)=>{let i=e.map((e=>Math.round(255*e).toString(16).toLowerCase().padStart(2,"0")));return(!t&&i.length>3||"ff"===i[3])&&i.pop(),o&&(i=i.map((e=>e.substring(0,1)))),"#"+i.join("")})(v,I,a):void 0)},[f,y,b,x,v,w,S,k,T,M,P,I,E,A,L,i,l,p,m,g,z,D,U,s,r,n,W,e=>{o(16,l=e),H=e,B()},e=>{o(17,p=e),B()},e=>{e.stopPropagation(),G=Ne(U.offsetWidth,U.offsetHeight),Z=(e=>me(e.offsetX,e.offsetY))(e),X=ge(e),j(Z,G),document.documentElement.addEventListener("pointermove",Y),document.documentElement.addEventListener("pointerup",q)},e=>{G=Ne(U.offsetWidth,U.offsetHeight);const t=n/100*G.width,o=r/100*G.height;j({x:t+e.detail.x,y:o+e.detail.y},G)},e=>{const{value:t}=e.target,i=t.length;if(!t.startsWith("#")||i<4||6===i||8===i||i>9)return;if(!I&&i>7)return;const n=Op(t);n&&(o(39,K=t),_(),O(n),C(n))},e=>{e.stopPropagation()},e=>{(new EyeDropper).open().then((({sRGBHex:e})=>{const t=Op(e);t&&(t[3]=1,o(39,K=v),_(),O(t),C(t))})).catch((e=>{}))},C,F,c,u,$,K,a,function(e){pa[e?"unshift":"push"]((()=>{U=e,o(22,U)}))},([e,t])=>[e,R(t)?t(P):t],e=>W(e.value)]}class Jp extends Ga{constructor(e){super(),Ua(this,e,Kp,qp,lr,{label:0,name:1,options:2,selectedIndex:3,value:4,buttonClass:5,optionLabelClass:6,optionMapper:7,onchange:34,title:8,hidePresetLabel:9,locale:10,enableOpacity:11,enablePresets:12,enablePicker:13,enableInput:14,enableEyeDropper:35},null,[-1,-1])}}function Qp(e){let t,o,i;return o=new gh({props:{items:e[0]}}),{c(){t=Fr("div"),Na(o.$$.fragment),Nr(t,"class","PinturaShorthandControl PinturaShapeStyle")},m(e,n){Ar(e,t,n),Ha(o,t,null),i=!0},p(e,[t]){const i={};1&t&&(i.items=e[0]),o.$set(i)},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Lr(t),ja(o)}}}function eh(e,t,o){let i,n,{value:r}=t,{onchange:a}=t,{controls:s=[]}=t;return e.$$set=e=>{o(6,t=ir(ir({},t),br(e))),"value"in e&&o(1,r=e.value),"onchange"in e&&o(2,a=e.onchange),"controls"in e&&o(3,s=e.controls)},e.$$.update=()=>{o(4,i=(e=>{const{controls:t,...o}=e;return o})(t)),30&e.$$.dirty&&o(0,n=s.map(((e,t)=>{const[o,n,s]=e;return[o,n,{...i,...s,value:r[t],onchange:e=>{const o=[...r];o[t]=e,a(o)}}]})))},t=br(t),[n,r,a,s,i]}class th extends Ga{constructor(e){super(),Ua(this,e,eh,Qp,lr,{value:1,onchange:2,controls:3})}}function oh(e){let t,o;return t=new op({props:{label:e[4],options:e[1],title:e[2],selectedIndex:e[5],onchange:e[10]}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,[o]){const i={};16&o&&(i.label=e[4]),2&o&&(i.options=e[1]),4&o&&(i.title=e[2]),32&o&&(i.selectedIndex=e[5]),9&o&&(i.onchange=e[10]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function ih(e,t,o){let i,n,r,a,{options:s}=t,{title:l}=t,{onchange:c}=t,{selectedIndex:d=-1}=t,{value:u}=t,{label:p}=t;return e.$$set=e=>{"options"in e&&o(1,s=e.options),"title"in e&&o(2,l=e.title),"onchange"in e&&o(3,c=e.onchange),"selectedIndex"in e&&o(0,d=e.selectedIndex),"value"in e&&o(6,u=e.value),"label"in e&&o(7,p=e.label)},e.$$.update=()=>{67&e.$$.dirty&&o(9,i=((e,t,o)=>{if(e)return t>-1?e[t]:void 0!==o?e.find((e=>e[0]===o)):e[0]})(s,d,u)),514&e.$$.dirty&&o(5,n=s&&s.findIndex((e=>e===i))),512&e.$$.dirty&&o(8,r=i&&i[1]),384&e.$$.dirty&&o(4,a=p||r)},[d,s,l,c,a,n,u,p,r,i,e=>{o(0,d=e.index),c&&c(e)}]}class nh extends Ga{constructor(e){super(),Ua(this,e,ih,oh,lr,{options:1,title:2,onchange:3,selectedIndex:0,value:6,label:7})}}function rh(e,t,o){const i=e.slice();return i[9]=t[o][0],i[0]=t[o][1],i[10]=t[o][2],i[2]=t[o][3],i}function ah(e){let t,o,i;const n=[e[10]];var r=e[3][e[9]]||e[9];function a(e){let t={};for(let e=0;e<n.length;e+=1)t=ir(t,n[e]);return{props:t}}return r&&(t=qr(r,a())),{c(){t&&Na(t.$$.fragment),o=Br()},m(e,n){t&&Ha(t,e,n),Ar(e,o,n),i=!0},p(e,i){const s=4&i?Wa(n,[_a(e[10])]):{};if(r!==(r=e[3][e[9]]||e[9])){if(t){Ra();const e=t;Aa(e.$$.fragment,1,0,(()=>{ja(e,1)})),Ia()}r?(t=qr(r,a()),Na(t.$$.fragment),Ea(t.$$.fragment,1),Ha(t,o.parentNode,o)):t=null}else r&&t.$set(s)},i(e){i||(t&&Ea(t.$$.fragment,e),i=!0)},o(e){t&&Aa(t.$$.fragment,e),i=!1},d(e){e&&Lr(o),t&&ja(t,e)}}}function sh(e){let t,o=e[9],i=e[9]&&uh(e);return{c(){i&&i.c(),t=Br()},m(e,o){i&&i.m(e,o),Ar(e,t,o)},p(e,n){e[9]?o?lr(o,e[9])?(i.d(1),i=uh(e),i.c(),i.m(t.parentNode,t)):i.p(e,n):(i=uh(e),i.c(),i.m(t.parentNode,t)):o&&(i.d(1),i=null),o=e[9]},i:tr,o(e){Aa(i)},d(e){e&&Lr(t),i&&i.d(e)}}}function lh(e){let t,o,i=e[10].innerHTML+"";return{c(){t=new Yr(!1),o=Br(),t.a=o},m(e,n){t.m(i,e,n),Ar(e,o,n)},p(e,o){4&o&&i!==(i=e[10].innerHTML+"")&&t.p(i)},i:tr,o:tr,d(e){e&&Lr(o),e&&t.d()}}}function ch(e){let t,o=e[10].textContent+"";return{c(){t=Dr(o)},m(e,o){Ar(e,t,o)},p(e,i){4&i&&o!==(o=e[10].textContent+"")&&Ur(t,o)},i:tr,o:tr,d(e){e&&Lr(t)}}}function dh(e){let t,o;return t=new gh({props:{items:e[2],discardEmptyItems:!0}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};4&o&&(i.items=e[2]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function uh(e){let t,o,i,n,r;const a=[dh,ch,lh],s=[];function l(e,t){return e[2]&&e[2].length?0:e[10].textContent?1:e[10].innerHTML?2:-1}~(o=l(e))&&(i=s[o]=a[o](e));let c=[e[4](e[10])],d={};for(let e=0;e<c.length;e+=1)d=ir(d,c[e]);return{c(){t=Fr(e[9]),i&&i.c(),n=Or(),/-/.test(e[9])?jr(t,d):Hr(t,d)},m(e,i){Ar(e,t,i),~o&&s[o].m(t,null),Rr(t,n),r=!0},p(e,r){let u=o;o=l(e),o===u?~o&&s[o].p(e,r):(i&&(Ra(),Aa(s[u],1,1,(()=>{s[u]=null})),Ia()),~o?(i=s[o],i?i.p(e,r):(i=s[o]=a[o](e),i.c()),Ea(i,1),i.m(t,n)):i=null),d=Wa(c,[4&r&&e[4](e[10])]),/-/.test(e[9])?jr(t,d):Hr(t,d)},i(e){r||(Ea(i),r=!0)},o(e){Aa(i),r=!1},d(e){e&&Lr(t),~o&&s[o].d()}}}function ph(e,t){let o,i,n,r,a,s;const l=[sh,ah],c=[];function d(e,t){return 4&t&&(i=null),null==i&&(i=!e[5](e[9])),i?0:1}return n=d(t,-1),r=c[n]=l[n](t),{key:e,first:null,c(){o=Br(),r.c(),a=Br(),this.first=o},m(e,t){Ar(e,o,t),c[n].m(e,t),Ar(e,a,t),s=!0},p(e,o){let i=n;n=d(t=e,o),n===i?c[n].p(t,o):(Ra(),Aa(c[i],1,1,(()=>{c[i]=null})),Ia(),r=c[n],r?r.p(t,o):(r=c[n]=l[n](t),r.c()),Ea(r,1),r.m(a.parentNode,a))},i(e){s||(Ea(r),s=!0)},o(e){Aa(r),s=!1},d(e){e&&Lr(o),c[n].d(e),e&&Lr(a)}}}function hh(e){let t,o,i=[],n=new Map,r=e[2];const a=e=>e[0]+e[1];for(let t=0;t<r.length;t+=1){let o=rh(e,r,t),s=a(o);n.set(s,i[t]=ph(s,o))}return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=Br()},m(e,n){for(let t=0;t<i.length;t+=1)i[t].m(e,n);Ar(e,t,n),o=!0},p(e,[o]){62&o&&(r=e[2],Ra(),i=Ba(i,o,a,1,e,r,n,t.parentNode,Oa,ph,t,rh),Ia())},i(e){if(!o){for(let e=0;e<r.length;e+=1)Ea(i[e]);o=!0}},o(e){for(let e=0;e<i.length;e+=1)Aa(i[e]);o=!1},d(e){for(let t=0;t<i.length;t+=1)i[t].d(e);e&&Lr(t)}}}function mh(e,t,o){let i,n,{items:r}=t,{discardEmptyItems:a=!0}=t,{key:s=""}=t;const l={Button:wh,ImageButton:Rd,ImageButtonList:Fd,Dropdown:op,Select:nh,RadioGroup:Lu,Input:Ou,Panel:ap,ProgressIndicator:Pp,ShapeStyle:Ap,ToggleSlider:Cp,ColorPicker:Jp,ShorthandControl:th},c=e=>!m(e)||!!l[e],d=e=>{if(!e)return!1;const[t,,o,i=[]]=e;return!!c(t)||(i.some(d)||o.textContent||o.innerHTML)};return e.$$set=e=>{"items"in e&&o(6,r=e.items),"discardEmptyItems"in e&&o(7,a=e.discardEmptyItems),"key"in e&&o(0,s=e.key)},e.$$.update=()=>{1&e.$$.dirty&&o(1,i=s),192&e.$$.dirty&&o(2,n=(r&&a?r.filter(d):r)||[])},[s,i,n,l,(e={})=>{const{textContent:t,innerHTML:o,...i}=e;return i},c,r,a]}class gh extends Ga{constructor(e){super(),Ua(this,e,mh,hh,lr,{items:6,discardEmptyItems:7,key:0})}get items(){return this.$$.ctx[6]}set items(e){this.$$set({items:e}),ka()}get discardEmptyItems(){return this.$$.ctx[7]}set discardEmptyItems(e){this.$$set({discardEmptyItems:e}),ka()}get key(){return this.$$.ctx[0]}set key(e){this.$$set({key:e}),ka()}}function $h(e){let t,o;return t=new Sd({props:{class:"PinturaButtonIcon",$$slots:{default:[fh]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};536870920&o&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function fh(e){let t;return{c(){t=zr("g")},m(o,i){Ar(o,t,i),t.innerHTML=e[3]},p(e,o){8&o&&(t.innerHTML=e[3])},d(e){e&&Lr(t)}}}function yh(e){let t;return{c(){t=Fr("span"),Nr(t,"class",e[11])},m(o,i){Ar(o,t,i),t.innerHTML=e[0]},p(e,o){1&o&&(t.innerHTML=e[0]),2048&o&&Nr(t,"class",e[11])},i:tr,o:tr,d(e){e&&Lr(t)}}}function bh(e){let t,o,i;return o=new gh({props:{items:e[0]}}),{c(){t=Fr("span"),Na(o.$$.fragment),Nr(t,"class",e[11])},m(e,n){Ar(e,t,n),Ha(o,t,null),i=!0},p(e,n){const r={};1&n&&(r.items=e[0]),o.$set(r),(!i||2048&n)&&Nr(t,"class",e[11])},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Lr(t),ja(o)}}}function xh(e){let t,o,i,n,r,a;const s=e[27].default,l=mr(s,e,e[29],null),c=l||function(e){let t,o,i,n,r,a,s=e[3]&&$h(e);const l=[bh,yh],c=[];function d(e,t){return 1&t&&(i=null),null==i&&(i=!!_o(e[0])),i?0:1}return n=d(e,-1),r=c[n]=l[n](e),{c(){t=Fr("span"),s&&s.c(),o=Or(),r.c(),Nr(t,"class",e[13])},m(e,i){Ar(e,t,i),s&&s.m(t,null),Rr(t,o),c[n].m(t,null),a=!0},p(e,i){e[3]?s?(s.p(e,i),8&i&&Ea(s,1)):(s=$h(e),s.c(),Ea(s,1),s.m(t,o)):s&&(Ra(),Aa(s,1,1,(()=>{s=null})),Ia());let u=n;n=d(e,i),n===u?c[n].p(e,i):(Ra(),Aa(c[u],1,1,(()=>{c[u]=null})),Ia(),r=c[n],r?r.p(e,i):(r=c[n]=l[n](e),r.c()),Ea(r,1),r.m(t,null)),(!a||8192&i)&&Nr(t,"class",e[13])},i(e){a||(Ea(s),Ea(r),a=!0)},o(e){Aa(s),Aa(r),a=!1},d(e){e&&Lr(t),s&&s.d(),c[n].d()}}}(e);return{c(){t=Fr("button"),c&&c.c(),Nr(t,"type",e[6]),t.disabled=e[5],Nr(t,"class",e[12]),Nr(t,"title",o=Cd(e[0],e[1],e[2]))},m(o,s){Ar(o,t,s),c&&c.m(t,null),e[28](t),n=!0,r||(a=[Wr(t,"keydown",(function(){sr(e[8])&&e[8].apply(this,arguments)})),Wr(t,"click",(function(){sr(e[7])&&e[7].apply(this,arguments)})),Wr(t,"pointerdown",(function(){sr(e[14])&&e[14].apply(this,arguments)})),wr(i=id.call(null,t,e[4])),wr(e[9].call(null,t))],r=!0)},p(r,[a]){e=r,l?l.p&&(!n||536870912&a)&&fr(l,s,e,e[29],n?$r(s,e[29],a,null):yr(e[29]),null):c&&c.p&&(!n||10249&a)&&c.p(e,n?a:-1),(!n||64&a)&&Nr(t,"type",e[6]),(!n||32&a)&&(t.disabled=e[5]),(!n||4096&a)&&Nr(t,"class",e[12]),(!n||7&a&&o!==(o=Cd(e[0],e[1],e[2])))&&Nr(t,"title",o),i&&sr(i.update)&&16&a&&i.update.call(null,e[4])},i(e){n||(Ea(c,e),n=!0)},o(e){Aa(c,e),n=!1},d(o){o&&Lr(t),c&&c.d(o),e[28](null),r=!1,ar(a)}}}function vh(e,t,o){let i,n,a,s,l,c,{$$slots:d={},$$scope:u}=t,{class:p}=t,{label:h}=t,{title:m}=t,{shortcut:g}=t,{labelClass:$}=t,{innerClass:f}=t,{hideLabel:y=!1}=t,{icon:b}=t,{style:x}=t,{disabled:v}=t,{type:w="button"}=t,{onclick:S}=t,{onkeydown:k}=t,{onhold:C}=t,{action:T=(()=>{})}=t,{holdThreshold:M=500}=t,{holdSpeedUpFactor:P=.5}=t,{holdSpeedMin:R=20}=t;const I=e=>{o(25,c=setTimeout((()=>{C(),I(Math.max(e*P,R))}),e))};let E;return e.$$set=e=>{"class"in e&&o(15,p=e.class),"label"in e&&o(0,h=e.label),"title"in e&&o(1,m=e.title),"shortcut"in e&&o(2,g=e.shortcut),"labelClass"in e&&o(16,$=e.labelClass),"innerClass"in e&&o(17,f=e.innerClass),"hideLabel"in e&&o(18,y=e.hideLabel),"icon"in e&&o(3,b=e.icon),"style"in e&&o(4,x=e.style),"disabled"in e&&o(5,v=e.disabled),"type"in e&&o(6,w=e.type),"onclick"in e&&o(7,S=e.onclick),"onkeydown"in e&&o(8,k=e.onkeydown),"onhold"in e&&o(19,C=e.onhold),"action"in e&&o(9,T=e.action),"holdThreshold"in e&&o(20,M=e.holdThreshold),"holdSpeedUpFactor"in e&&o(21,P=e.holdSpeedUpFactor),"holdSpeedMin"in e&&o(22,R=e.holdSpeedMin),"$$scope"in e&&o(29,u=e.$$scope)},e.$$.update=()=>{101187584&e.$$.dirty&&o(26,n=C?()=>{c&&(clearTimeout(c),o(25,c=void 0),document.documentElement.removeEventListener("pointerup",n))}:r),68681728&e.$$.dirty&&o(14,i=C?()=>{document.documentElement.addEventListener("pointerup",n),I(M)}:r),131072&e.$$.dirty&&o(13,a=Xc(["PinturaButtonInner",f])),294912&e.$$.dirty&&o(12,s=Xc(["PinturaButton",y&&"PinturaButtonIconOnly",p])),327680&e.$$.dirty&&o(11,l=Xc([y?"implicit":"PinturaButtonLabel",$]))},[h,m,g,b,x,v,w,S,k,T,E,l,s,a,i,p,$,f,y,C,M,P,R,e=>kd(e,E),()=>E,c,n,d,function(e){pa[e?"unshift":"push"]((()=>{E=e,o(10,E)}))},u]}class wh extends Ga{constructor(e){super(),Ua(this,e,vh,xh,lr,{class:15,label:0,title:1,shortcut:2,labelClass:16,innerClass:17,hideLabel:18,icon:3,style:4,disabled:5,type:6,onclick:7,onkeydown:8,onhold:19,action:9,holdThreshold:20,holdSpeedUpFactor:21,holdSpeedMin:22,isEventTarget:23,getElement:24})}get isEventTarget(){return this.$$.ctx[23]}get getElement(){return this.$$.ctx[24]}}var Sh=(e,t)=>{const o=e.findIndex(t);if(o>=0)return e.splice(o,1)};const kh=80;var Ch=(e,t={})=>{const{inertia:o=!1,inertiaDurationMultiplier:i=kh,shouldStartInteraction:n=(()=>!0),pinch:r=!1,multiTouch:a,getEventPosition:s=(e=>me(e.clientX,e.clientY)),observeKeys:l=!1}=t;function c(t,o){e.dispatchEvent(new CustomEvent(t,{detail:o}))}function d(){w&&w(),w=void 0}const u=[],p=e=>0===e.timeStamp?Date.now():e.timeStamp,h=()=>{const e=$e(u[0].position);if(u[1]){const t=.5*(u[1].position.x-e.x),o=.5*(u[1].position.y-e.y);e.x+=t,e.y+=o}return e},m=e=>{e.origin.x=e.position.x,e.origin.y=e.position.y,e.translation.x=0,e.translation.y=0},g=e=>{const t=(e=>u.findIndex((t=>t.event.pointerId===e.pointerId)))(e);if(!(t<0))return u[t]},$=()=>1===u.length,f=()=>2===u.length,y=e=>{const t=Le(e.map((e=>e.position)));return{center:t,distance:((e,t)=>e.reduce(((e,o)=>e+Ee(t,o.position)),0)/e.length)(e,t),velocity:Le(e.map((e=>e.velocity))),translation:Le(e.map((e=>e.translation)))}};let b,x,v,w,S,k,C,T,M=0,P=void 0;e.addEventListener("pointerdown",L);const R=["Meta","Control","Alt","Shift"];function I(e){if(!R.includes(e.key))return;const{metaKey:t,ctrlKey:o,altKey:i,shiftKey:n}=e;A({metaKey:t,ctrlKey:o,altKey:i,shiftKey:n})}let E=Date.now();const A=e=>{const t=$e(u[0].translation);let o=C;if(r&&f()){o*=Ee(u[0].position,u[1].position)/S,ke(t,u[1].translation)}ke(t,k);const i=Date.now();i-E<16||(E=i,c("interactionupdate",{position:h(),translation:t,scalar:r?o:void 0,isMultiTouching:f(),...e}))};function L(t){if(!f()&&!(e=>Oo(e.button)&&0!==e.button)(t)&&n(t,e))if(d(),(e=>{const t=p(e),o={timeStamp:t,timeStampInitial:t,position:s(e),origin:s(e),velocity:he(),velocityHistory:[],velocityAverage:he(),translation:he(),interactionState:void 0,event:e};u.push(o),o.interactionState=y(u)})(t),l&&(window.addEventListener("keydown",I),window.addEventListener("keyup",I)),$())document.documentElement.addEventListener("pointermove",F),document.documentElement.addEventListener("pointerup",z),document.documentElement.addEventListener("pointercancel",z),document.addEventListener("visibilitychange",O),T=!1,C=1,k=he(),S=void 0,c("interactionstart",{origin:$e(g(t).origin)});else if(r)T=!0,S=Ee(u[0].position,u[1].position),k.x+=u[0].translation.x,k.y+=u[0].translation.y,m(u[0]);else if(!1===a)return u.length=0,W(),c("interactioncancel")}function F(e){e.preventDefault(),(e=>{const t=g(e);if(!t)return;const o=p(e),i=s(e),n=Math.max(1,o-t.timeStamp);t.velocity.x=(i.x-t.position.x)/n,t.velocity.y=(i.y-t.position.y)/n,t.velocityHistory.push($e(t.velocity)),t.velocityHistory=t.velocityHistory.slice(-3),t.velocityAverage=t.velocityHistory.reduce(((e,t,o,i)=>(e.x+=t.x/i.length,e.y+=t.y/i.length,e)),he()),t.translation.x=i.x-t.origin.x,t.translation.y=i.y-t.origin.y,t.timeStamp=o,t.position.x=i.x,t.position.y=i.y,t.event=e})(e);const{metaKey:t=!1,ctrlKey:o=!1,altKey:i=!1,shiftKey:n=!1}=l?e:{};A({metaKey:t,ctrlKey:o,altKey:i,shiftKey:n})}function z(e){if(!g(e))return;const t=h(),n=(e=>{const t=Sh(u,(t=>t.event.pointerId===e.pointerId));if(t)return t[0]})(e);if(r&&$()){const e=Ee(u[0].position,n.position);C*=e/S,k.x+=u[0].translation.x+n.translation.x,k.y+=u[0].translation.y+n.translation.y,m(u[0])}let a=!1,s=!1;if(!T&&n){const e=performance.now(),t=e-n.timeStampInitial,o=Ie(n.translation);a=o<64&&t<300,s=!!(P&&a&&e-M<700&&Ie(P,n.position)<128),a&&(P=$e(n.position),M=e)}if(u.length>0)return;W();const l=$e(n.translation),d=$e(n.velocityAverage);let p=!1;c("interactionrelease",{isTap:a,isDoubleTap:s,position:t,translation:l,scalar:C,preventInertia:()=>p=!0});const f=Ee(d);if(p||!o||f<.25)return B(l,{isTap:a,isDoubleTap:s});x=$e(t),v=$e(l),b=yc($e(l),{easing:gc,duration:f*i}),b.set({x:l.x+50*d.x,y:l.y+50*d.y}).then((()=>{w&&B(pr(b),{isTap:a,isDoubleTap:s})})),w=b.subscribe(D)}function D(e){e&&c("interactionupdate",{position:me(x.x+(e.x-v.x),x.y+(e.y-v.y)),translation:e,scalar:r?C:void 0})}function O(e){if("visible"===document.visibilityState||!u.length)return;const t=y(u);d(),c("interactionend",{...t}),u.length=0,W()}function B(e,t){d(),c("interactionend",{...t,translation:e,scalar:r?C:void 0})}function W(){l&&window.removeEventListener("keydown",I),l&&window.removeEventListener("keyup",I),document.documentElement.removeEventListener("pointermove",F),document.documentElement.removeEventListener("pointerup",z),document.documentElement.removeEventListener("pointercancel",z),document.removeEventListener("visibilitychange",O)}return{destroy(){d(),e.removeEventListener("pointerdown",L)}}};function Th(e,t){return t?t*Math.sign(e)*Math.log10(1+Math.abs(e)/t):e}const Mh=(e,t,o)=>{if(!t||!o)return{...e};const i=e.x+Th(t.x-e.x,o),n=e.x+e.width+Th(t.x+t.width-(e.x+e.width),o),r=e.y+Th(t.y-e.y,o);return{x:i,y:r,width:n-i,height:e.y+e.height+Th(t.y+t.height-(e.y+e.height),o)-r}},Ph=(e,t,o)=>t&&o?me(e.x+Th(t.x-e.x,o),e.y+Th(t.y-e.y,o)):{...e};var Rh=(e,t)=>{if(e)return/em/.test(e)?16*parseInt(e,10):/px/.test(e)?parseInt(e,10):void 0},Ih=(e,t)=>{let o=e.detail||0;const{deltaX:i,deltaY:n,wheelDelta:r,wheelDeltaX:a,wheelDeltaY:s}=e,{fixScrollDirection:l=!1}=t||{};return Oo(a)&&Math.abs(a)>Math.abs(s)?o=a/-120:Oo(i)&&Math.abs(i)>Math.abs(n)?o=i/20:(r||s)&&(o=(r||s)/-120),o||(o=n/20),(O()||Qt())&&(o*=2),l&&bo()&&(o*=-1),o};function Eh(e){let t,o,i,n,r,a,s;const l=e[38].default,c=mr(l,e,e[37],null);return{c(){t=Fr("div"),o=Fr("div"),c&&c.c(),Zr(o,"transform",e[6]),Nr(t,"class",i=Xc(["PinturaScrollable",e[0]])),Nr(t,"data-direction",e[1]),Nr(t,"data-state",e[7]),Zr(t,"--scrollable-feather-start-opacity",e[4]),Zr(t,"--scrollable-feather-end-opacity",e[5])},m(i,l){Ar(i,t,l),Rr(t,o),c&&c.m(o,null),e[40](t),r=!0,a||(s=[Wr(o,"interactionstart",e[10]),Wr(o,"interactionupdate",e[12]),Wr(o,"interactionend",e[13]),Wr(o,"interactionrelease",e[11]),wr(Ch.call(null,o,{inertia:!0})),Wr(o,"measure",e[39]),wr(Dc.call(null,o)),Wr(t,"wheel",e[15],{passive:!1}),Wr(t,"scroll",e[17]),Wr(t,"focusin",e[16]),Wr(t,"nudge",e[18]),Wr(t,"measure",e[14]),wr(Dc.call(null,t,{observePosition:!0})),wr(n=sp.call(null,t,{direction:"x"===e[1]?"horizontal":"vertical",stopKeydownPropagation:!1}))],a=!0)},p(e,a){c&&c.p&&(!r||64&a[1])&&fr(c,l,e,e[37],r?$r(l,e[37],a,null):yr(e[37]),null),64&a[0]&&Zr(o,"transform",e[6]),(!r||1&a[0]&&i!==(i=Xc(["PinturaScrollable",e[0]])))&&Nr(t,"class",i),(!r||2&a[0])&&Nr(t,"data-direction",e[1]),(!r||128&a[0])&&Nr(t,"data-state",e[7]),n&&sr(n.update)&&2&a[0]&&n.update.call(null,{direction:"x"===e[1]?"horizontal":"vertical",stopKeydownPropagation:!1}),16&a[0]&&Zr(t,"--scrollable-feather-start-opacity",e[4]),32&a[0]&&Zr(t,"--scrollable-feather-end-opacity",e[5])},i(e){r||(Ea(c,e),r=!0)},o(e){Aa(c,e),r=!1},d(o){o&&Lr(t),c&&c.d(o),e[40](null),a=!1,ar(s)}}}function Ah(e,t,o){let i,n,a,s,l,c,d,u,p,{$$slots:h={},$$scope:m}=t;const g=sa();let $,f,y,b,x="idle",v=xc(0);hr(e,v,(e=>o(36,u=e)));let{class:w}=t,{scrollBlockInteractionDist:S=5}=t,{scrollStep:k=10}=t,{scrollFocusMargin:C=64}=t,{scrollDirection:T="x"}=t,{scrollAutoCancel:M=!1}=t,{elasticity:P=0}=t,{onscroll:R=r}=t,{maskFeatherSize:I}=t,{maskFeatherStartOpacity:E}=t,{maskFeatherEndOpacity:A}=t,{scroll:L}=t;const F=ca("fixScrollDirection");let z;hr(e,F,(e=>o(47,p=e)));let D=void 0,O=void 0,B=!0;const W=v.subscribe((e=>{const t=he();t[T]=e,R(t)})),_=e=>Math.max(Math.min(0,e),y[i]-f[i]);let V,N,H;const j=(e,t={})=>{const{elastic:i=!1,animate:n=!1,preventScrollState:r=!1}=t;Math.abs(e-$)>S&&"idle"===x&&!b&&!r&&o(29,x="scrolling");const a=_(e),s=i&&P&&!b?a+Th(e-a,P):a;let l=!0;n?l=!1:B||(l=!b),B=!1,v.set(s,{hard:l}).then((e=>{b&&(B=!0)}))};aa((()=>{W()}));return e.$$set=e=>{"class"in e&&o(0,w=e.class),"scrollBlockInteractionDist"in e&&o(22,S=e.scrollBlockInteractionDist),"scrollStep"in e&&o(23,k=e.scrollStep),"scrollFocusMargin"in e&&o(24,C=e.scrollFocusMargin),"scrollDirection"in e&&o(1,T=e.scrollDirection),"scrollAutoCancel"in e&&o(25,M=e.scrollAutoCancel),"elasticity"in e&&o(26,P=e.elasticity),"onscroll"in e&&o(27,R=e.onscroll),"maskFeatherSize"in e&&o(21,I=e.maskFeatherSize),"maskFeatherStartOpacity"in e&&o(19,E=e.maskFeatherStartOpacity),"maskFeatherEndOpacity"in e&&o(20,A=e.maskFeatherEndOpacity),"scroll"in e&&o(28,L=e.scroll),"$$scope"in e&&o(37,m=e.$$scope)},e.$$.update=()=>{if(2&e.$$.dirty[0]&&o(33,i="x"===T?"width":"height"),2&e.$$.dirty[0]&&o(31,n=T.toUpperCase()),8&e.$$.dirty[0]&&o(35,a=z&&getComputedStyle(z)),8&e.$$.dirty[0]|16&e.$$.dirty[1]&&o(34,s=a&&Rh(a.getPropertyValue("--scrollable-feather-size"))),1075314692&e.$$.dirty[0]|44&e.$$.dirty[1]&&null!=u&&y&&null!=s&&f){const e=-1*u/s,t=-(y[i]-f[i]-u)/s;o(19,E=$s(1-e,0,1)),o(20,A=$s(1-t,0,1)),o(21,I=s),o(4,D=E),o(5,O=A)}268435464&e.$$.dirty[0]&&z&&void 0!==L&&(Oo(L)?j(L):j(L.scrollOffset,L)),1073741828&e.$$.dirty[0]|4&e.$$.dirty[1]&&o(32,l=y&&f?f[i]>y[i]:void 0),536870912&e.$$.dirty[0]|2&e.$$.dirty[1]&&o(7,c=Xc([x,l?"overflows":void 0])),35&e.$$.dirty[1]&&o(6,d=l?`translate${n}(${u}px)`:"none")},[w,T,f,z,D,O,d,c,v,F,()=>{l&&(N=!1,V=!0,H=me(0,0),b=!1,o(29,x="idle"),$=pr(v))},({detail:e})=>{l&&(b=!0,o(29,x="idle"))},({detail:e})=>{l&&(N||V&&(V=!1,Ie(e.translation)<.1)||(!M||"x"!==T||(e=>{const t=Se(me(e.x-H.x,e.y-H.y),Math.abs);H=$e(e);const o=Ie(t),i=t.x-t.y;return!(o>1&&i<-.5)})(e.translation)?j($+e.translation[T],{elastic:!0}):N=!0))},({detail:e})=>{if(!l)return;if(N)return;const t=$+e.translation[T],o=_(t);B=!1,v.set(o).then((e=>{b&&(B=!0)}))},({detail:e})=>{o(30,y=e),g("measure",{x:e.x,y:e.y,width:e.width,height:e.height})},e=>{if(!l)return;e.preventDefault(),e.stopPropagation();const t=e.shiftKey,o=Ih(e,{fixScrollDirection:p})*(t?-1:1),i=pr(v);j(i+o*k,{animate:!0})},e=>{if(!l)return;if(!b)return;let t=e.target;e.target.classList.contains("implicit")&&(t=t.parentNode);const o=t["x"===T?"offsetLeft":"offsetTop"],n=o+t["x"===T?"offsetWidth":"offsetHeight"],r=pr(v),a=C+I;r+o<a?j(-o+a):r+n>y[i]-a&&j(y[i]-n-a,{animate:!0})},()=>{o(3,z["x"===T?"scrollLeft":"scrollTop"]=0,z)},({detail:e})=>{if(z.querySelector("[data-focus-visible]"))return;const t=-2*e[T],o=pr(v);j(o+t*k,{animate:!0,preventScrollState:!0})},E,A,I,S,k,C,M,P,R,L,x,y,n,l,i,s,a,u,m,h,e=>o(2,f=e.detail),function(e){pa[e?"unshift":"push"]((()=>{z=e,o(3,z)}))}]}class Lh extends Ga{constructor(e){super(),Ua(this,e,Ah,Eh,lr,{class:0,scrollBlockInteractionDist:22,scrollStep:23,scrollFocusMargin:24,scrollDirection:1,scrollAutoCancel:25,elasticity:26,onscroll:27,maskFeatherSize:21,maskFeatherStartOpacity:19,maskFeatherEndOpacity:20,scroll:28},null,[-1,-1])}}function Fh(e){let t,o,i,n,r;return{c(){t=Fr("span"),Nr(t,"class","PinturaStatusMessage")},m(o,a){Ar(o,t,a),t.innerHTML=e[0],i=!0,n||(r=[Wr(t,"measure",(function(){sr(e[1])&&e[1].apply(this,arguments)})),wr(Dc.call(null,t))],n=!0)},p(o,[n]){e=o,(!i||1&n)&&(t.innerHTML=e[0])},i(n){i||(ba((()=>{o||(o=Fa(t,e[4],{duration:e[2]},!0)),o.run(1)})),i=!0)},o(n){o||(o=Fa(t,e[4],{duration:e[2]},!1)),o.run(0),i=!1},d(e){e&&Lr(t),e&&o&&o.end(),n=!1,ar(r)}}}function zh(e,t,o){let i,n,{text:a}=t,{onmeasure:s=r}=t;const l=ca("isAnimated");return hr(e,l,(e=>o(5,n=e))),e.$$set=e=>{"text"in e&&o(0,a=e.text),"onmeasure"in e&&o(1,s=e.onmeasure)},e.$$.update=()=>{32&e.$$.dirty&&o(2,i=n?500:0)},[a,s,i,l,function(e,{duration:t}){return{duration:t,tick:t=>{e.style.opacity=t}}},n]}class Dh extends Ga{constructor(e){super(),Ua(this,e,zh,Fh,lr,{text:0,onmeasure:1})}}function Oh(e){let t,o,i;const n=e[5].default,r=mr(n,e,e[4],null);return{c(){t=Fr("span"),r&&r.c(),Nr(t,"class",o="PinturaStatusAside "+e[1]),Zr(t,"transform",e[2]),Zr(t,"opacity",e[0])},m(e,o){Ar(e,t,o),r&&r.m(t,null),i=!0},p(e,[a]){r&&r.p&&(!i||16&a)&&fr(r,n,e,e[4],i?$r(n,e[4],a,null):yr(e[4]),null),(!i||2&a&&o!==(o="PinturaStatusAside "+e[1]))&&Nr(t,"class",o),4&a&&Zr(t,"transform",e[2]),1&a&&Zr(t,"opacity",e[0])},i(e){i||(Ea(r,e),i=!0)},o(e){Aa(r,e),i=!1},d(e){e&&Lr(t),r&&r.d(e)}}}function Bh(e,t,o){let i,{$$slots:n={},$$scope:r}=t,{offset:a=0}=t,{opacity:s=0}=t,{class:l}=t;return e.$$set=e=>{"offset"in e&&o(3,a=e.offset),"opacity"in e&&o(0,s=e.opacity),"class"in e&&o(1,l=e.class),"$$scope"in e&&o(4,r=e.$$scope)},e.$$.update=()=>{8&e.$$.dirty&&o(2,i=`translateX(${a}px)`)},[s,l,i,a,r,n]}class Wh extends Ga{constructor(e){super(),Ua(this,e,Bh,Oh,lr,{offset:3,opacity:0,class:1})}}let _h=null;var Vh=e=>{if(null===_h&&(_h=d()&&"visualViewport"in window),!_h)return!1;const t=visualViewport.height,o=()=>{e(visualViewport.height<t?"visible":"hidden")};return visualViewport.addEventListener("resize",o),()=>visualViewport.removeEventListener("resize",o)};function Nh(e){let t,o;const i=[{onclick:e[1]},e[3]];let n={};for(let e=0;e<i.length;e+=1)n=ir(n,i[e]);return t=new wh({props:n}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const n=10&o[0]?Wa(i,[2&o[0]&&{onclick:e[1]},8&o[0]&&_a(e[3])]):{};t.$set(n)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Hh(e){let t,o;const i=[{onclick:e[0]},{class:"PinturaInputFormButtonConfirm"},e[2]];let n={};for(let e=0;e<i.length;e+=1)n=ir(n,i[e]);return t=new wh({props:n}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const n=5&o[0]?Wa(i,[1&o[0]&&{onclick:e[0]},i[1],4&o[0]&&_a(e[2])]):{};t.$set(n)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function jh(e){let t,o,i,n,r,a,s,l,c=e[3]&&Nh(e);const d=e[29].default,u=mr(d,e,e[28],null);let p=e[2]&&Hh(e);return{c(){t=Fr("div"),o=Fr("div"),c&&c.c(),i=Or(),n=Fr("div"),u&&u.c(),r=Or(),p&&p.c(),Nr(n,"class","PinturaInputFormFields"),Nr(o,"class","PinturaInputFormInner"),Nr(t,"class","PinturaInputForm"),Nr(t,"data-layout",e[4]),Zr(t,"opacity",e[6]),Zr(t,"left",e[7]),Zr(t,"top",e[8]),Zr(t,"right",e[9]),Zr(t,"bottom",e[10])},m(d,h){Ar(d,t,h),Rr(t,o),c&&c.m(o,null),Rr(o,i),Rr(o,n),u&&u.m(n,null),Rr(o,r),p&&p.m(o,null),e[30](t),a=!0,s||(l=[Wr(n,"keydown",e[14]),Wr(t,"focusin",e[11]),Wr(t,"focusout",e[12]),Wr(t,"measure",e[13]),wr(Dc.call(null,t))],s=!0)},p(e,n){e[3]?c?(c.p(e,n),8&n[0]&&Ea(c,1)):(c=Nh(e),c.c(),Ea(c,1),c.m(o,i)):c&&(Ra(),Aa(c,1,1,(()=>{c=null})),Ia()),u&&u.p&&(!a||268435456&n[0])&&fr(u,d,e,e[28],a?$r(d,e[28],n,null):yr(e[28]),null),e[2]?p?(p.p(e,n),4&n[0]&&Ea(p,1)):(p=Hh(e),p.c(),Ea(p,1),p.m(o,null)):p&&(Ra(),Aa(p,1,1,(()=>{p=null})),Ia()),(!a||16&n[0])&&Nr(t,"data-layout",e[4]),64&n[0]&&Zr(t,"opacity",e[6]),128&n[0]&&Zr(t,"left",e[7]),256&n[0]&&Zr(t,"top",e[8]),512&n[0]&&Zr(t,"right",e[9]),1024&n[0]&&Zr(t,"bottom",e[10])},i(e){a||(Ea(c),Ea(u,e),Ea(p),a=!0)},o(e){Aa(c),Aa(u,e),Aa(p),a=!1},d(o){o&&Lr(t),c&&c.d(),u&&u.d(o),p&&p.d(),e[30](null),s=!1,ar(l)}}}function Uh(e,t,o){let i,n,r,a,s,{$$slots:l={},$$scope:c}=t,{onconfirm:d}=t,{oncancel:u}=t,{autoFocus:p=!0}=t,{autoPositionCursor:h=!0}=t,{buttonConfirm:m}=t,{buttonCancel:g}=t,{layout:$="stack"}=t,{parentRect:f}=t,{align:y}=t,{justify:b}=t,{parentMargin:x=16}=t,{panelOffset:v=he()}=t,{willHandleKeydown:S=(()=>!0)}=t,k=!1,C=void 0,T=void 0,M={top:void 0,bottom:void 0},P=0,R=void 0,I=void 0,E=void 0,A=void 0;const L=()=>{const e=s.querySelector("input, textarea");e.focus(),P>=1||e.select()},F=()=>{k=!0,D||!vo()&&!w()||o(24,M={top:"1em",bottom:"auto"}),vo()&&(e=>{let t;const o=e=>t=e.touches[0].screenY,i=e=>{const o=e.touches[0].screenY,i=e.target;/textarea/i.test(i.nodeName)?(o>t?0==i.scrollTop&&e.preventDefault():o<t?i.scrollTop+i.offsetHeight==i.scrollHeight&&e.preventDefault():e.preventDefault(),t=o):e.preventDefault()};e.addEventListener("touchstart",o),e.addEventListener("touchmove",i)})(s),o(6,P=1)};let z;const D=Vh((e=>{a?"hidden"!==e||k?(clearTimeout(T),T=void 0,o(24,M={top:visualViewport.height-C.height-v.y+"px"}),"visible"===e?(o(5,s.dataset.stick=!0,s),L(),F()):(k=!1,o(6,P=0))):L():o(24,M={top:"4.5em",bottom:"auto"})}));return na((()=>{p&&L()})),aa((()=>{D&&D()})),e.$$set=e=>{"onconfirm"in e&&o(0,d=e.onconfirm),"oncancel"in e&&o(1,u=e.oncancel),"autoFocus"in e&&o(15,p=e.autoFocus),"autoPositionCursor"in e&&o(16,h=e.autoPositionCursor),"buttonConfirm"in e&&o(2,m=e.buttonConfirm),"buttonCancel"in e&&o(3,g=e.buttonCancel),"layout"in e&&o(4,$=e.layout),"parentRect"in e&&o(17,f=e.parentRect),"align"in e&&o(18,y=e.align),"justify"in e&&o(19,b=e.justify),"parentMargin"in e&&o(20,x=e.parentMargin),"panelOffset"in e&&o(21,v=e.panelOffset),"willHandleKeydown"in e&&o(22,S=e.willHandleKeydown),"$$scope"in e&&o(28,c=e.$$scope)},e.$$.update=()=>{8519680&e.$$.dirty[0]&&o(27,i=f&&C),144572416&e.$$.dirty[0]&&o(26,n=i?((e,t,o,i,n)=>{let r,a;return r="center"===i?e.x+.5*e.width-.5*t.width:"right"===i?e.x+e.width-t.width-n:e.x+n,a="center"===o?e.y+.5*e.height-.5*t.height:"bottom"===o?e.y+e.height-t.height-n:e.y+n,{top:a+"px",right:"auto",bottom:"auto",left:r+"px"}})(f,C,y,b,x):void 0),201326592&e.$$.dirty[0]&&o(7,R=i?n.left:void 0),218103808&e.$$.dirty[0]&&o(8,I=i?n.top:M.top),201326592&e.$$.dirty[0]&&o(9,E=i?n.right:void 0),218103808&e.$$.dirty[0]&&o(10,A=i?n.bottom:M.bottom),32&e.$$.dirty[0]&&o(25,r=s&&getComputedStyle(s)),33554432&e.$$.dirty[0]&&(a=r&&"1"===r.getPropertyValue("--editor-modal"))},[d,u,m,g,$,s,P,R,I,E,A,e=>{var t;((e=>/textarea/i.test(e))(e.target)||Wd(e.target))&&(z=Date.now(),h&&((t=e.target).selectionStart=t.selectionEnd=t.value.length),clearTimeout(T),T=setTimeout(F,200))},e=>{Date.now()-z>50||(e.stopPropagation(),L())},({detail:e})=>{o(23,C={width:e.width,height:e.height})},e=>{if(S(e))return"Enter"===e.key?d():"Escape"===e.key?u():void 0},p,h,f,y,b,x,v,S,C,M,r,n,i,c,l,function(e){pa[e?"unshift":"push"]((()=>{s=e,o(5,s)}))}]}class Gh extends Ga{constructor(e){super(),Ua(this,e,Uh,jh,lr,{onconfirm:0,oncancel:1,autoFocus:15,autoPositionCursor:16,buttonConfirm:2,buttonCancel:3,layout:4,parentRect:17,align:18,justify:19,parentMargin:20,panelOffset:21,willHandleKeydown:22},null,[-1,-1])}}var Zh=(e,t)=>{e.fastSeek&&e.fastSeek(t),e.currentTime=t};const Xh=["aspectRatio","isRotatedSideways","flip","cropSize"],Yh=Ts.map((([e])=>e)).filter((e=>!Xh.includes(e)));var qh=(e,t)=>new CustomEvent("ping",{detail:{type:e,data:t},cancelable:!0,bubbles:!0}),Kh=(e,t)=>(t?Il(e,t):e).replace(/([a-z])([A-Z])/g,"$1-$2").replace(/\s+/g,"-").toLowerCase(),Jh=(e,t=Y)=>{const{subscribe:o,set:i}=Ya(void 0);return{subscribe:o,destroy:((e,t)=>{const o=matchMedia(e);return o.addListener(t),t(o),{get matches(){return o.matches},destroy:()=>o.removeListener(t)}})(e,(({matches:e})=>i(t(e)))).destroy}},Qh=(e,t,o)=>new Promise(((i,n)=>{(async()=>{Zs(e)&&i(await Gs(e));const r=await t.read(e),a=e=>W(e,o).then((e=>t.apply(e,r))).then(i).catch(n);if(A(e)||!E()||Qt()||vo())return a(e);let s;try{s=await z(((e,t)=>createImageBitmap(e).then((e=>t(null,e))).catch(t)),[e])}catch(e){}s&&s.width?await p()?oc()&&r>1?i(await(async e=>h(await k(e)))(s)):i(s):i(t.apply(s,r)):a(e)})()})),em=(e,t)=>new Promise((async o=>{if(e.width<t.width&&e.height<t.height)return o(e);const i=Math.min(t.width/e.width,t.height/e.height),n=i*e.width,r=i*e.height,a=$("canvas",{width:n,height:r}),s=a.getContext("2d",{willReadFrequently:!0}),l=b(e)?await k(e):e;s.drawImage(l,0,0,n,r),o(h(a))}));let tm=null;var om=()=>{if(null===tm){let e=$("canvas");tm=!!Gl(e),y(e),e=void 0}return tm};const im=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],nm={precision:1e-4},rm={precision:.01*nm.precision};var am=()=>{const e=[],t=[],o=[],i=()=>{t.forEach((e=>e(o)))},n=t=>{t.unsub=t.subscribe((n=>((t,n)=>{const r=e.indexOf(t);r<0||(o[r]=n,i())})(t,n))),i()};return{get length(){return e.length},clear:()=>{e.forEach((e=>e.unsub())),e.length=0,o.length=0},unshift:t=>{e.unshift(t),n(t)},get:t=>e[t],push:t=>{e.push(t),n(t)},remove:t=>{t.unsub();const i=e.indexOf(t);e.splice(i,1),o.splice(i,1)},forEach:t=>e.forEach(t),filter:t=>e.filter(t),subscribe:e=>(t.push(e),e(o),()=>{t.splice(t.indexOf(e),1)})}},sm=e=>e[0]<.25&&e[1]<.25&&e[2]<.25,lm=(e={})=>new Promise((t=>{const{accept:o="image/*"}=e,i=$("input",{style:"position:absolute;visibility:hidden;width:0;height:0;",type:"file",accept:o}),n=()=>{const[e]=i.files;i.parentNode&&i.remove(),i.removeEventListener("change",n),t(e)};i.addEventListener("change",n),vo()&&document.body.append(i),i.click()})),cm=e=>{try{return e()}catch(e){console.error(e)}},dm=([e,t])=>e+.5*(t-e),um=e=>Math.round(100*e),pm=e=>me(e.clientX,e.clientY),hm=(e,t,o)=>{const i=pm(e);return Ce(Ce(i,t),o)};function mm(e,t,o){let i,n,r,a,s,l,c,d,u,p,h,m,g,$,f,y,b,x,v,w,S,{root:k}=t,{locale:C}=t,{stores:T}=t,{allowPan:M=!0}=t,{allowZoom:P=!0}=t,{enablePan:R=!0}=t,{enableZoom:I=!0}=t,{enableZoomControls:E=I}=t,{enableZoomInput:A=!0}=t,{enablePanInput:L=!0}=t,{enablePanLimit:F=!0}=t,{panLimitGutterScalar:z=0}=t,{zoomOptions:D=[.25,.5,1,1.25,1.5,2,3,4,6,8,16]}=t,{zoomAdjustStep:O=.25}=t,{zoomAdjustFactor:B=.1}=t,{zoomAdjustWheelFactor:W=1}=t,{elasticity:_=5}=t,{imageSelectionRectCentered:V}=t,{imageSelectionRectScalar:N}=t,{zoomLevel:H=null}=t,{zoomControls:j}=t,{zoomMultiTouching:U=!1}=t;const{isAnimated:G,isInteracting:Z,rootRect:X,stageRect:Y,stageScalar:q,imageSelectionPan:K,imageSelectionZoom:J,imageSelectionStageFitScalar:Q,imageSelectionRect:ee,imageSelectionStoredState:te,imagePreviewUpscale:oe}=T;hr(e,G,(e=>o(70,w=e))),hr(e,Z,(e=>o(69,x=e))),hr(e,X,(e=>o(66,f=e))),hr(e,Y,(e=>o(65,$=e))),hr(e,q,(e=>o(46,v=e))),hr(e,K,(e=>o(64,h=e))),hr(e,J,(e=>o(43,p=e))),hr(e,Q,(e=>o(44,m=e))),hr(e,ee,(e=>o(67,y=e))),hr(e,te,(e=>o(71,S=e))),hr(e,oe,(e=>o(45,g=e)));const ie=ca("fixScrollDirection");hr(e,ie,(e=>o(68,b=e)));let ne=!1,re=void 0,ae=void 0,se=void 0,le=void 0;const ce=e=>{const t=k.querySelector(".PinturaMain > .PinturaUtilMain")||k.querySelector('div[tabindex="0"] .PinturaUtilMain');return!!t&&(!!t.contains(e.target)&&!_d(e.target))},de=(e={})=>{const{pan:t=h,zoom:o=p}=e;vr(te,S={translation:t,zoom:o},S)},ue=()=>h&&0===h.x&&0===h.y,pe=()=>{vr(J,p=void 0,p),ue()||vr(K,h=he(),h),fe.set(void 0,{hard:!0})},ge=()=>{pe(),de()},fe=xc(void 0,{precision:.01});fe.subscribe((e=>{if(void 0===e)return vr(J,p=void 0,p),void(ue()||vr(K,h=he(),h));const t=p;e<=1?ue()||vr(K,h=he(),h):e<=t&&vr(K,h=Me(h,.8),h),vr(J,p=e,p)}));const ye=e=>{fe.update((t=>{const o=e(t||m);return de({zoom:o}),o}))},xe=e=>{e?fe.set(e,{hard:!1===w}):(e=void 0,fe.set(void 0,{hard:!0})),vr(J,p=e,p),de({zoom:e})},ve=(e,t)=>{const o=N*t,i={...V},n=1-$s(z,0,1);ut(i,o<n?o:n);const r={...V};ut(r,o),dt(r,e);const a={...r};return r.x>i.x&&(a.x=i.x),r.y>i.y&&(a.y=i.y),r.x+r.width<i.x+i.width&&(a.x=i.x+i.width-r.width),r.y+r.height<i.y+i.height&&(a.y=i.y+i.height-r.height),Ce(ct(a),ct(i))},we=({translation:e,zoom:t=1,elastify:o=!0})=>{if(!re)return;let i=e;const n=me(re.x+i.x,re.y+i.y);if(!F)return n;const r=ve(n,t);return o?Ph(r,n,_):r};let Se,ke;const Pe=()=>{ke=void 0,vr(Z,x=!0,x),o(34,ne=L),Se=!1,se=!1,re={...h},ae=g?p||m:r?p||1:p||m},Re=e=>{const{scalar:t,translation:n,isMultiTouching:r}=e.detail;if(!re||!r&&!L)return;r&&Me(n,.5),(L||r)&&(Se=!0),U||o(13,U=r);const a=i?$s(ae*t,s,l):1,c=we({translation:n,zoom:a,elastify:!0}),d=be(c);le=be(h),se=d<le,i&&J.set(a),K.set(c),ke=U&&{translation:e.detail.translation,scalar:t}},Ie=e=>{vr(Z,x=!1,x),o(34,ne=!1),o(13,U=!1),se&&le<50&&(re=void 0,ae=void 0,K.set(he()))},Ee=e=>{vr(Z,x=!1,x),o(34,ne=!1),o(13,U=!1),Promise.resolve().then((()=>{if(Se&&re){const t=ke||e.detail,o=i?$s(ae*t.scalar,s,l):1,n=we({elastify:!1,translation:t.translation,zoom:o});K.set(n)}re=void 0,ae=void 0,L&&e.detail.isDoubleTap&&ge(),de()}))};let Ae,Le=Date.now(),Fe=0,ze=!1,De=!1;const Oe=e=>{if(!ce(e))return;if(e.preventDefault(),e.stopPropagation(),De)return;clearTimeout(Ae);const t=Ih(e,{fixScrollDirection:b}),o=Date.now(),i=o-Le;Le=o;const n=Math.abs(t/i)>.2;Fe=n?Fe+1:0;const r=1+-1*t*W/(n?50:100),a=hm(e,f,$);Be(a,r,{isZoomingFast:n})},Be=(e,t,{isZoomingFast:o})=>{const i=g?p||m:r?p||1:p||m,n=i*t,a=he(),c=h,d=g?m:r?1:m,u=Math.abs(n-d),$=n<i,f=i>d&&$||i<d&&n>i,b=Fe>=5;if(o||(ze=!1),Fe>0&&!ze&&(ze=f),b&&ze)return ge(),De=!0,void setTimeout((()=>{De=!1}),100);if(b)return;!o&&f&&u<=.05&&(Ae=setTimeout((()=>{ge()}),250)),vr(J,p=$s(n,s,l),p);const x=et(y);ut(x,i),dt(x,c);const v=ct(x),w=et(x);ut(w,p-i+1,e);const S=ct(w),k=Te(Ce(S,v),i);((e,t,o)=>{e.x=t,e.y=o})(a,c.x+k.x,c.y+k.y),vr(K,h=$&&o?Me($e(h),.85):ve(a,i),h),de()},We=e=>(e?"add":"remove")+"EventListener";let _e,Ve,Ne,He;const je=e=>{e.preventDefault(),Ve={...h},He=et(y),Ne=hm(e,f,$),_e=g?p||m:r?p||1:p||m},Ue=e=>{e.preventDefault(),vr(J,p=$s(e.scale*_e,s,l),p);const t=et(He);ut(t,_e),dt(t,Ve);const o=ct(t),i=et(t);ut(i,p-_e+1,Ne);const n=ct(i),r=Te(Ce(n,o),_e),a={x:Ve.x+r.x,y:Ve.y+r.y};vr(K,h=ve(a,p),h)},Ge=e=>{e.preventDefault()},Ze=e=>{k[We(e)]("wheel",Oe),vo()||(k[We(e)]("gesturestart",je),k[We(e)]("gesturechange",Ue),k[We(e)]("gestureend",Ge))},Xe=e=>{const t=We(e);k[t]("interactionstart",Pe),k[t]("interactionupdate",Re),k[t]("interactionrelease",Ie),k[t]("interactionend",Ee)};let Ye;return na((()=>{Ye=Ch(k,{drag:!0,pinch:!0,inertia:!0,inertiaDurationMultiplier:10,shouldStartInteraction:ce})})),aa((()=>{Ze(!1),Xe(!1),Ye.destroy(),Ye=void 0})),e.$$set=e=>{"root"in e&&o(14,k=e.root),"locale"in e&&o(15,C=e.locale),"stores"in e&&o(16,T=e.stores),"allowPan"in e&&o(17,M=e.allowPan),"allowZoom"in e&&o(18,P=e.allowZoom),"enablePan"in e&&o(19,R=e.enablePan),"enableZoom"in e&&o(20,I=e.enableZoom),"enableZoomControls"in e&&o(21,E=e.enableZoomControls),"enableZoomInput"in e&&o(22,A=e.enableZoomInput),"enablePanInput"in e&&o(23,L=e.enablePanInput),"enablePanLimit"in e&&o(24,F=e.enablePanLimit),"panLimitGutterScalar"in e&&o(25,z=e.panLimitGutterScalar),"zoomOptions"in e&&o(26,D=e.zoomOptions),"zoomAdjustStep"in e&&o(27,O=e.zoomAdjustStep),"zoomAdjustFactor"in e&&o(28,B=e.zoomAdjustFactor),"zoomAdjustWheelFactor"in e&&o(29,W=e.zoomAdjustWheelFactor),"elasticity"in e&&o(30,_=e.elasticity),"imageSelectionRectCentered"in e&&o(31,V=e.imageSelectionRectCentered),"imageSelectionRectScalar"in e&&o(32,N=e.imageSelectionRectScalar),"zoomLevel"in e&&o(33,H=e.zoomLevel),"zoomControls"in e&&o(12,j=e.zoomControls),"zoomMultiTouching"in e&&o(13,U=e.zoomMultiTouching)},e.$$.update=()=>{var t,$;5505024&e.$$.dirty[0]&&o(36,i=P&&I&&A),655360&e.$$.dirty[0]&&o(35,n=M&&R),393216&e.$$.dirty[0]&&(M||P?(vr(J,p=I?S.zoom:void 0,p),vr(K,h=R?$e(S.translation):ue()?h:he(),h),fe.set(p)):pe()),32768&e.$$.dirty[1]&&(r=v>=1),67141632&e.$$.dirty[0]|57344&e.$$.dirty[1]&&o(40,a=[(g||v<1)&&[m,um(m)+"%",{sublabel:C.labelZoomFit}],...D.map((e=>[e,um(e)+"%"]))].filter(Boolean).map((e=>(1===e[0]&&(e[2]={sublabel:C.labelZoomActual}),e))).sort(((e,t)=>{const o=e[0]||m,i=t[0]||m;return o<i?-1:i<o?1:0}))),8704&e.$$.dirty[1]&&o(38,s=Math.min(a.reduce(((e,[t])=>t<e?t:e),Number.MAX_SAFE_INTEGER),m)),512&e.$$.dirty[1]&&o(37,l=a.reduce(((e,[t])=>t>e?t:e),Number.MIN_SAFE_INTEGER)),4&e.$$.dirty[1]&&null!==H&&xe(H),61440&e.$$.dirty[1]&&o(42,d=p||(g||v<1?m:1)),2560&e.$$.dirty[1]&&o(39,(t=a.map((([e])=>e)),$=d,c=t.findIndex((e=>e===$)))),2048&e.$$.dirty[1]&&o(41,u=um(d)+"%"),405045248&e.$$.dirty[0]|6080&e.$$.dirty[1]&&o(12,j=(P||P)&&E?[["Button","zoom-out",{hideLabel:!0,label:C.labelZoomOut,icon:C.iconZoomOut,disabled:p===s,onclick:()=>ye((e=>Math.max(s,e-O))),onhold:()=>ye((e=>Math.max(s,e*(1-B))))}],["Dropdown","zoom-level",{label:u,title:C.labelZoom,labelClass:"PinturaFixedWidthCharacters",options:a,selectedIndex:c,onchange:e=>xe(e.value)}],["Button","zoom-in",{hideLabel:!0,label:C.labelZoomIn,icon:C.iconZoomIn,disabled:p===l,onclick:()=>ye((e=>Math.min(l,e+O))),onhold:()=>ye((e=>Math.min(l,e*(1+B))))}]]:[]),16384&e.$$.dirty[0]|32&e.$$.dirty[1]&&k&&Ze(i),16384&e.$$.dirty[0]|16&e.$$.dirty[1]&&k&&Xe(n),8404992&e.$$.dirty[0]|24&e.$$.dirty[1]&&k&&k.style.setProperty("--cursor",n&&L?ne?"grabbing":"grab":"")},[G,Z,X,Y,q,K,J,Q,ee,te,oe,ie,j,U,k,C,T,M,P,R,I,E,A,L,F,z,D,O,B,W,_,V,N,H,ne,n,i,l,s,c,a,u,d,p,m,g,v]}class gm extends Ga{constructor(e){super(),Ua(this,e,mm,null,lr,{root:14,locale:15,stores:16,allowPan:17,allowZoom:18,enablePan:19,enableZoom:20,enableZoomControls:21,enableZoomInput:22,enablePanInput:23,enablePanLimit:24,panLimitGutterScalar:25,zoomOptions:26,zoomAdjustStep:27,zoomAdjustFactor:28,zoomAdjustWheelFactor:29,elasticity:30,imageSelectionRectCentered:31,imageSelectionRectScalar:32,zoomLevel:33,zoomControls:12,zoomMultiTouching:13},null,[-1,-1,-1,-1])}}const{window:$m}=za;function fm(e){let t,o,i,n=e[41]&&ym(e),r=e[38]&&Mm(e);return{c(){n&&n.c(),t=Or(),r&&r.c(),o=Br()},m(e,a){n&&n.m(e,a),Ar(e,t,a),r&&r.m(e,a),Ar(e,o,a),i=!0},p(e,i){e[41]?n?(n.p(e,i),1024&i[1]&&Ea(n,1)):(n=ym(e),n.c(),Ea(n,1),n.m(t.parentNode,t)):n&&(Ra(),Aa(n,1,1,(()=>{n=null})),Ia()),e[38]?r?(r.p(e,i),128&i[1]&&Ea(r,1)):(r=Mm(e),r.c(),Ea(r,1),r.m(o.parentNode,o)):r&&(Ra(),Aa(r,1,1,(()=>{r=null})),Ia())},i(e){i||(Ea(n),Ea(r),i=!0)},o(e){Aa(n),Aa(r),i=!1},d(e){n&&n.d(e),e&&Lr(t),r&&r.d(e),e&&Lr(o)}}}function ym(e){let t,o,i,n,r;const a=[xm,bm],s=[];function l(e,t){return e[39]?0:e[35]?1:-1}return~(i=l(e))&&(n=s[i]=a[i](e)),{c(){t=Fr("div"),o=Fr("p"),n&&n.c(),Zr(o,"transform",e[72]),Nr(t,"class","PinturaStatus"),Zr(t,"opacity",e[54])},m(e,n){Ar(e,t,n),Rr(t,o),~i&&s[i].m(o,null),r=!0},p(e,r){let c=i;i=l(e),i===c?~i&&s[i].p(e,r):(n&&(Ra(),Aa(s[c],1,1,(()=>{s[c]=null})),Ia()),~i?(n=s[i],n?n.p(e,r):(n=s[i]=a[i](e),n.c()),Ea(n,1),n.m(o,null)):n=null),1024&r[2]&&Zr(o,"transform",e[72]),8388608&r[1]&&Zr(t,"opacity",e[54])},i(e){r||(Ea(n),r=!0)},o(e){Aa(n),r=!1},d(e){e&&Lr(t),~i&&s[i].d()}}}function bm(e){let t,o,i,n;t=new Dh({props:{text:e[35].text||"",onmeasure:e[221]}});let r=e[35].aside&&vm(e);return{c(){Na(t.$$.fragment),o=Or(),r&&r.c(),i=Br()},m(e,a){Ha(t,e,a),Ar(e,o,a),r&&r.m(e,a),Ar(e,i,a),n=!0},p(e,o){const n={};16&o[1]&&(n.text=e[35].text||""),t.$set(n),e[35].aside?r?(r.p(e,o),16&o[1]&&Ea(r,1)):(r=vm(e),r.c(),Ea(r,1),r.m(i.parentNode,i)):r&&(Ra(),Aa(r,1,1,(()=>{r=null})),Ia())},i(e){n||(Ea(t.$$.fragment,e),Ea(r),n=!0)},o(e){Aa(t.$$.fragment,e),Aa(r),n=!1},d(e){ja(t,e),e&&Lr(o),r&&r.d(e),e&&Lr(i)}}}function xm(e){let t,o,i,n;return t=new Dh({props:{text:e[39],onmeasure:e[221]}}),i=new Wh({props:{class:"PinturaStatusIcon",offset:e[82],opacity:e[83],$$slots:{default:[Tm]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment),o=Or(),Na(i.$$.fragment)},m(e,r){Ha(t,e,r),Ar(e,o,r),Ha(i,e,r),n=!0},p(e,o){const n={};256&o[1]&&(n.text=e[39]),t.$set(n);const r={};1048576&o[2]&&(r.offset=e[82]),2097152&o[2]&&(r.opacity=e[83]),8&o[0]|134217728&o[19]&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(e){n||(Ea(t.$$.fragment,e),Ea(i.$$.fragment,e),n=!0)},o(e){Aa(t.$$.fragment,e),Aa(i.$$.fragment,e),n=!1},d(e){ja(t,e),e&&Lr(o),ja(i,e)}}}function vm(e){let t,o;return t=new Wh({props:{class:"PinturaStatusButton",offset:e[82],opacity:e[83],$$slots:{default:[km]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};1048576&o[2]&&(i.offset=e[82]),2097152&o[2]&&(i.opacity=e[83]),16&o[1]|134217728&o[19]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function wm(e){let t,o;return t=new Pp({props:{progress:e[35].progressIndicator.progress}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};16&o[1]&&(i.progress=e[35].progressIndicator.progress),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Sm(e){let t,o;const i=[e[35].closeButton,{hideLabel:!0}];let n={};for(let e=0;e<i.length;e+=1)n=ir(n,i[e]);return t=new wh({props:n}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const n=16&o[1]?Wa(i,[_a(e[35].closeButton),i[1]]):{};t.$set(n)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function km(e){let t,o,i,n=e[35].progressIndicator.visible&&wm(e),r=e[35].closeButton&&e[35].text&&Sm(e);return{c(){n&&n.c(),t=Or(),r&&r.c(),o=Br()},m(e,a){n&&n.m(e,a),Ar(e,t,a),r&&r.m(e,a),Ar(e,o,a),i=!0},p(e,i){e[35].progressIndicator.visible?n?(n.p(e,i),16&i[1]&&Ea(n,1)):(n=wm(e),n.c(),Ea(n,1),n.m(t.parentNode,t)):n&&(Ra(),Aa(n,1,1,(()=>{n=null})),Ia()),e[35].closeButton&&e[35].text?r?(r.p(e,i),16&i[1]&&Ea(r,1)):(r=Sm(e),r.c(),Ea(r,1),r.m(o.parentNode,o)):r&&(Ra(),Aa(r,1,1,(()=>{r=null})),Ia())},i(e){i||(Ea(n),Ea(r),i=!0)},o(e){Aa(n),Aa(r),i=!1},d(e){n&&n.d(e),e&&Lr(t),r&&r.d(e),e&&Lr(o)}}}function Cm(e){let t,o=e[3].iconSupportError+"";return{c(){t=zr("g")},m(e,i){Ar(e,t,i),t.innerHTML=o},p(e,i){8&i[0]&&o!==(o=e[3].iconSupportError+"")&&(t.innerHTML=o)},d(e){e&&Lr(t)}}}function Tm(e){let t,o;return t=new Sd({props:{$$slots:{default:[Cm]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};8&o[0]|134217728&o[19]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Mm(e){let t,o,i,n,r,a,s,l,c,d,u,p,h,m,g=e[10]&&Pm(e),$=e[46]&&e[45]&&Rm(e);const f=[Dm,zm],y=[];function b(e,t){return e[46]?0:1}function x(t){e[444](t)}function v(t){e[445](t)}function w(t){e[446](t)}i=b(e),n=y[i]=f[i](e),a=new Zc({props:{isAnimated:e[53],isTransparent:e[20],pixelRatio:e[57],textPixelRatio:e[6],backgroundColor:e[56],maskRect:e[58],maskOpacity:e[73]?e[73].maskOpacity:1,maskMarkupOpacity:e[7],maskFrameOpacity:e[5],clipAnnotationsToImage:e[85],images:e[55],interfaceImages:e[86],loadImageData:e[28],enableGrid:e[11],gridSize:e[87],gridColors:[e[88],e[89]],gridOpacity:e[90],selectionColor:e[91],csp:e[92]||{},willRequest:e[81]||e[93],willRender:e[441],didRender:e[442]}});let S={root:e[2],locale:e[3],stores:e[202],allowPan:e[95],enablePan:e[17],enablePanLimit:e[21],panLimitGutterScalar:e[22],enablePanInput:e[96],allowZoom:e[97],enableZoom:e[18],enableZoomInput:void 0!==e[19]?e[19]:e[98],enableZoomControls:e[99],zoomOptions:e[13]||e[23],zoomAdjustStep:e[14]||e[24],zoomAdjustFactor:e[15]||e[25],zoomAdjustWheelFactor:e[16]||e[26],imageSelectionRectCentered:e[100],imageSelectionRectScalar:e[101],elasticity:Nm*e[8]};return void 0!==e[0]&&(S.zoomLevel=e[0]),void 0!==e[33]&&(S.zoomControls=e[33]),void 0!==e[34]&&(S.zoomMultiTouching=e[34]),d=new gm({props:S}),pa.push((()=>Va(d,"zoomLevel",x))),pa.push((()=>Va(d,"zoomControls",v))),pa.push((()=>Va(d,"zoomMultiTouching",w))),{c(){g&&g.c(),t=Or(),$&&$.c(),o=Or(),n.c(),r=Or(),Na(a.$$.fragment),s=Or(),l=Fr("div"),c=Or(),Na(d.$$.fragment),Nr(l,"class","PinturaRootPortal")},m(n,u){g&&g.m(n,u),Ar(n,t,u),$&&$.m(n,u),Ar(n,o,u),y[i].m(n,u),Ar(n,r,u),Ha(a,n,u),Ar(n,s,u),Ar(n,l,u),e[443](l),Ar(n,c,u),Ha(d,n,u),m=!0},p(e,s){e[10]?g?(g.p(e,s),1024&s[0]&&Ea(g,1)):(g=Pm(e),g.c(),Ea(g,1),g.m(t.parentNode,t)):g&&(Ra(),Aa(g,1,1,(()=>{g=null})),Ia()),e[46]&&e[45]?$?($.p(e,s),49152&s[1]&&Ea($,1)):($=Rm(e),$.c(),Ea($,1),$.m(o.parentNode,o)):$&&(Ra(),Aa($,1,1,(()=>{$=null})),Ia());let l=i;i=b(e),i===l?y[i].p(e,s):(Ra(),Aa(y[l],1,1,(()=>{y[l]=null})),Ia(),n=y[i],n?n.p(e,s):(n=y[i]=f[i](e),n.c()),Ea(n,1),n.m(r.parentNode,r));const c={};4194304&s[1]&&(c.isAnimated=e[53]),1048576&s[0]&&(c.isTransparent=e[20]),67108864&s[1]&&(c.pixelRatio=e[57]),64&s[0]&&(c.textPixelRatio=e[6]),33554432&s[1]&&(c.backgroundColor=e[56]),134217728&s[1]&&(c.maskRect=e[58]),2048&s[2]&&(c.maskOpacity=e[73]?e[73].maskOpacity:1),128&s[0]&&(c.maskMarkupOpacity=e[7]),32&s[0]&&(c.maskFrameOpacity=e[5]),8388608&s[2]&&(c.clipAnnotationsToImage=e[85]),16777216&s[1]&&(c.images=e[55]),16777216&s[2]&&(c.interfaceImages=e[86]),268435456&s[0]&&(c.loadImageData=e[28]),2048&s[0]&&(c.enableGrid=e[11]),33554432&s[2]&&(c.gridSize=e[87]),201326592&s[2]&&(c.gridColors=[e[88],e[89]]),268435456&s[2]&&(c.gridOpacity=e[90]),536870912&s[2]&&(c.selectionColor=e[91]),1073741824&s[2]&&(c.csp=e[92]||{}),524288&s[2]|1&s[3]&&(c.willRequest=e[81]||e[93]),512&s[0]|270991424&s[1]|2&s[3]&&(c.willRender=e[441]),62&s[2]&&(c.didRender=e[442]),a.$set(c);const m={};4&s[0]&&(m.root=e[2]),8&s[0]&&(m.locale=e[3]),4&s[3]&&(m.allowPan=e[95]),131072&s[0]&&(m.enablePan=e[17]),2097152&s[0]&&(m.enablePanLimit=e[21]),4194304&s[0]&&(m.panLimitGutterScalar=e[22]),8&s[3]&&(m.enablePanInput=e[96]),16&s[3]&&(m.allowZoom=e[97]),262144&s[0]&&(m.enableZoom=e[18]),524288&s[0]|32&s[3]&&(m.enableZoomInput=void 0!==e[19]?e[19]:e[98]),64&s[3]&&(m.enableZoomControls=e[99]),8396800&s[0]&&(m.zoomOptions=e[13]||e[23]),16793600&s[0]&&(m.zoomAdjustStep=e[14]||e[24]),33587200&s[0]&&(m.zoomAdjustFactor=e[15]||e[25]),67174400&s[0]&&(m.zoomAdjustWheelFactor=e[16]||e[26]),128&s[3]&&(m.imageSelectionRectCentered=e[100]),256&s[3]&&(m.imageSelectionRectScalar=e[101]),256&s[0]&&(m.elasticity=Nm*e[8]),!u&&1&s[0]&&(u=!0,m.zoomLevel=e[0],xa((()=>u=!1))),!p&&4&s[1]&&(p=!0,m.zoomControls=e[33],xa((()=>p=!1))),!h&&8&s[1]&&(h=!0,m.zoomMultiTouching=e[34],xa((()=>h=!1))),d.$set(m)},i(e){m||(Ea(g),Ea($),Ea(n),Ea(a.$$.fragment,e),Ea(d.$$.fragment,e),m=!0)},o(e){Aa(g),Aa($),Aa(n),Aa(a.$$.fragment,e),Aa(d.$$.fragment,e),m=!1},d(n){g&&g.d(n),n&&Lr(t),$&&$.d(n),n&&Lr(o),y[i].d(n),n&&Lr(r),ja(a,n),n&&Lr(s),n&&Lr(l),e[443](null),n&&Lr(c),ja(d,n)}}}function Pm(e){let t,o,i,n,r;return o=new gh({props:{items:e[69]}}),{c(){t=Fr("div"),Na(o.$$.fragment),Nr(t,"class","PinturaNav PinturaNavTools")},m(a,s){Ar(a,t,s),Ha(o,t,null),i=!0,n||(r=[Wr(t,"measure",e[430]),wr(Dc.call(null,t))],n=!0)},p(e,t){const i={};128&t[2]&&(i.items=e[69]),o.$set(i)},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Lr(t),ja(o),n=!1,ar(r)}}}function Rm(e){let t,o,i;return o=new Lh({props:{elasticity:e[8]*jm,scrollDirection:e[76]?"y":"x",$$slots:{default:[Fm]},$$scope:{ctx:e}}}),{c(){t=Fr("div"),Na(o.$$.fragment),Nr(t,"class","PinturaNav PinturaNavMain")},m(e,n){Ar(e,t,n),Ha(o,t,null),i=!0},p(e,t){const i={};256&t[0]&&(i.elasticity=e[8]*jm),16384&t[2]&&(i.scrollDirection=e[76]?"y":"x"),12288&t[1]|135168&t[2]|134217728&t[19]&&(i.$$scope={dirty:t,ctx:e}),o.$set(i)},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Lr(t),ja(o)}}}function Im(e){let t,o;const i=[e[79],{tabs:e[44]}];let n={$$slots:{default:[Lm,({tab:e})=>({615:e}),({tab:e})=>[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,e?67108864:0]]},$$scope:{ctx:e}};for(let e=0;e<i.length;e+=1)n=ir(n,i[e]);return t=new od({props:n}),t.$on("select",e[431]),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const n=8192&o[1]|131072&o[2]?Wa(i,[131072&o[2]&&_a(e[79]),8192&o[1]&&{tabs:e[44]}]):{};201326592&o[19]&&(n.$$scope={dirty:o,ctx:e}),t.$set(n)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Em(e){let t,o;return t=new gh({props:{items:e[44]}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};8192&o[1]&&(i.items=e[44]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Am(e){let t,o=e[615].icon+"";return{c(){t=zr("g")},m(e,i){Ar(e,t,i),t.innerHTML=o},p(e,i){67108864&i[19]&&o!==(o=e[615].icon+"")&&(t.innerHTML=o)},d(e){e&&Lr(t)}}}function Lm(e){let t,o,i,n,r,a=e[615].label+"";return t=new Sd({props:{$$slots:{default:[Am]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment),o=Or(),i=Fr("span"),n=Dr(a)},m(e,a){Ha(t,e,a),Ar(e,o,a),Ar(e,i,a),Rr(i,n),r=!0},p(e,o){const i={};201326592&o[19]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i),(!r||67108864&o[19])&&a!==(a=e[615].label+"")&&Ur(n,a)},i(e){r||(Ea(t.$$.fragment,e),r=!0)},o(e){Aa(t.$$.fragment,e),r=!1},d(e){ja(t,e),e&&Lr(o),e&&Lr(i)}}}function Fm(e){let t,o,i,n;const r=[Em,Im],a=[];function s(e,t){return e[74]?0:1}return t=s(e),o=a[t]=r[t](e),{c(){o.c(),i=Br()},m(e,o){a[t].m(e,o),Ar(e,i,o),n=!0},p(e,n){let l=t;t=s(e),t===l?a[t].p(e,n):(Ra(),Aa(a[l],1,1,(()=>{a[l]=null})),Ia(),o=a[t],o?o.p(e,n):(o=a[t]=r[t](e),o.c()),Ea(o,1),o.m(i.parentNode,i))},i(e){n||(Ea(o),n=!0)},o(e){Aa(o),n=!1},d(e){a[t].d(e),e&&Lr(i)}}}function zm(e){let t,o,i;function n(t){e[437](t)}let r={locale:e[3],class:"PinturaMain",view:e[207](e[43]),props:e[206](e[43],e[27]),stores:e[202]};return void 0!==e[1][e[43]]&&(r.component=e[1][e[43]]),t=new xd({props:r}),pa.push((()=>Va(t,"component",n))),t.$on("measure",e[233]),t.$on("show",e[438]),t.$on("hide",e[439]),t.$on("fade",e[440]),{c(){Na(t.$$.fragment)},m(e,o){Ha(t,e,o),i=!0},p(e,i){const n={};8&i[0]&&(n.locale=e[3]),4096&i[1]&&(n.view=e[207](e[43])),134217728&i[0]|4096&i[1]&&(n.props=e[206](e[43],e[27])),!o&&2&i[0]|4096&i[1]&&(o=!0,n.component=e[1][e[43]],xa((()=>o=!1))),t.$set(n)},i(e){i||(Ea(t.$$.fragment,e),i=!0)},o(e){Aa(t.$$.fragment,e),i=!1},d(e){ja(t,e)}}}function Dm(e){let t,o;const i=[{class:"PinturaMain"},{visible:e[62]},e[79],{panels:e[78]}];let n={$$slots:{default:[Om,({panel:e,panelIsActive:t})=>({613:e,614:t}),({panel:e,panelIsActive:t})=>[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(e?16777216:0)|(t?33554432:0)]]},$$scope:{ctx:e}};for(let e=0;e<i.length;e+=1)n=ir(n,i[e]);return t=new gd({props:n}),t.$on("measure",e[436]),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const n=196609&o[2]?Wa(i,[i[0],1&o[2]&&{visible:e[62]},131072&o[2]&&_a(e[79]),65536&o[2]&&{panels:e[78]}]):{};134217738&o[0]|184549376&o[19]&&(n.$$scope={dirty:o,ctx:e}),t.$set(n)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Om(e){let t,o,i;function n(t){e[432](t,e[613])}let r={locale:e[3],view:e[207](e[613]),props:e[206](e[613],e[27]),isActive:e[614],stores:e[202]};return void 0!==e[1][e[613]]&&(r.component=e[1][e[613]]),t=new xd({props:r}),pa.push((()=>Va(t,"component",n))),t.$on("measure",e[233]),t.$on("show",(function(){return e[433](e[613])})),t.$on("hide",(function(){return e[434](e[613])})),t.$on("fade",(function(...t){return e[435](e[613],...t)})),{c(){Na(t.$$.fragment)},m(e,o){Ha(t,e,o),i=!0},p(i,n){e=i;const r={};8&n[0]&&(r.locale=e[3]),16777216&n[19]&&(r.view=e[207](e[613])),134217728&n[0]|16777216&n[19]&&(r.props=e[206](e[613],e[27])),33554432&n[19]&&(r.isActive=e[614]),!o&&2&n[0]|16777216&n[19]&&(o=!0,r.component=e[1][e[613]],xa((()=>o=!1))),t.$set(r)},i(e){i||(Ea(t.$$.fragment,e),i=!0)},o(e){Aa(t.$$.fragment,e),i=!1},d(e){ja(t,e)}}}function Bm(e){let t;return{c(){t=Fr("span"),Nr(t,"class","PinturaEditorOverlay"),Zr(t,"opacity",e[102])},m(e,o){Ar(e,t,o)},p(e,o){512&o[3]&&Zr(t,"opacity",e[102])},d(e){e&&Lr(t)}}}function Wm(e){let t,o;const i=[{layout:"row"},{parentRect:e[50]},e[60]];let n={$$slots:{default:[_m]},$$scope:{ctx:e}};for(let e=0;e<i.length;e+=1)n=ir(n,i[e]);return t=new Gh({props:n}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const n=537395200&o[1]?Wa(i,[i[0],524288&o[1]&&{parentRect:e[50]},536870912&o[1]&&_a(e[60])]):{};1610612736&o[1]|134217728&o[19]&&(n.$$scope={dirty:o,ctx:e}),t.$set(n)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function _m(e){let t,o,i;return{c(){t=Fr("input"),t.value=o=e[60].text,Nr(t,"placeholder",i=e[60].placeholder),Nr(t,"type","text"),Nr(t,"spellcheck","false"),Nr(t,"autocorrect","off"),Nr(t,"autocapitalize","off")},m(o,i){Ar(o,t,i),e[447](t)},p(e,n){536870912&n[1]&&o!==(o=e[60].text)&&t.value!==o&&(t.value=o),536870912&n[1]&&i!==(i=e[60].placeholder)&&Nr(t,"placeholder",i)},d(o){o&&Lr(t),e[447](null)}}}function Vm(e){let t,o,i,n,a,s;ba(e[429]);let l=e[40]&&fm(e),c=e[102]>0&&Bm(e),d=e[60]&&Wm(e);return{c(){t=Fr("div"),l&&l.c(),o=Or(),c&&c.c(),i=Or(),d&&d.c(),Nr(t,"id",e[4]),Nr(t,"class",e[77]),Nr(t,"data-env",e[75]),Nr(t,"dir",e[12])},m(u,p){Ar(u,t,p),l&&l.m(t,null),Rr(t,o),c&&c.m(t,null),Rr(t,i),d&&d.m(t,null),e[448](t),n=!0,a||(s=[Wr($m,"keydown",e[224]),Wr($m,"keyup",e[225]),Wr($m,"blur",e[226]),Wr($m,"paste",e[230]),Wr($m,"resize",e[429]),Wr(t,"ping",(function(){sr(e[68])&&e[68].apply(this,arguments)})),Wr(t,"contextmenu",e[227]),Wr(t,"touchstart",e[222],{passive:!1}),Wr(t,"touchmove",(function(){sr(e[71])&&e[71].apply(this,arguments)})),Wr(t,"pointermove",(function(){sr(e[70])&&e[70].apply(this,arguments)})),Wr(t,"transitionend",e[212]),Wr(t,"dropfiles",e[228]),Wr(t,"measure",e[449]),Wr(t,"click",(function(){sr(e[42]?e[229]:r)&&(e[42]?e[229]:r).apply(this,arguments)})),wr(Dc.call(null,t,{observeViewRect:!0,isMeasureRoot:!0})),wr(Oc.call(null,t)),wr(_c.call(null,t))],a=!0)},p(r,a){(e=r)[40]?l?(l.p(e,a),512&a[1]&&Ea(l,1)):(l=fm(e),l.c(),Ea(l,1),l.m(t,o)):l&&(Ra(),Aa(l,1,1,(()=>{l=null})),Ia()),e[102]>0?c?c.p(e,a):(c=Bm(e),c.c(),c.m(t,i)):c&&(c.d(1),c=null),e[60]?d?(d.p(e,a),536870912&a[1]&&Ea(d,1)):(d=Wm(e),d.c(),Ea(d,1),d.m(t,null)):d&&(Ra(),Aa(d,1,1,(()=>{d=null})),Ia()),(!n||16&a[0])&&Nr(t,"id",e[4]),(!n||32768&a[2])&&Nr(t,"class",e[77]),(!n||8192&a[2])&&Nr(t,"data-env",e[75]),(!n||4096&a[0])&&Nr(t,"dir",e[12])},i(e){n||(Ea(l),Ea(d),n=!0)},o(e){Aa(l),Aa(d),n=!1},d(o){o&&Lr(t),l&&l.d(),c&&c.d(),d&&d.d(),e[448](null),a=!1,ar(s)}}}const Nm=1,Hm="stage-overlay",jm=10;function Um(e,t,o){let i,n,a,s,l,c,u,p,g,$,f,b,x,v,k,C,T,M,P,I,E,A,F,z,D,B,W,_,V,N,H,j,U,G,Z,X,q,K,J,Q,ee,te,oe,ie,ne,re,ae,se,le,ce,ue,pe,ge,$e,fe,ye,be,xe,ve,we,ke,Ce,Te,Me,Pe,Re,Ie,Ee,Ae,Le,Fe,ze,De,Oe,Be,We,_e,Ve,He,je,Ue,Ge,Ze,Xe,Ye,qe,Ke,Je,Qe,it,nt,at,st,ct,pt,ht,ft,yt,vt,wt,Ct,Mt,Rt,It,Et,At,Lt,Ft,zt,Dt,Ot,Bt,Wt,_t,Vt,Nt,Ht,Gt,Zt,Xt,Yt,qt,Kt,Jt,eo,to,oo,io,no,ro,ao,so,lo,co,uo,po,ho,mo,$o,fo,yo,bo,xo,wo,So,ko,Co,To,Mo,Po,Ro,Io,Eo,Ao,Lo,Fo,zo,Do,Bo,Wo,_o,Vo,No,Ho,jo,Uo,Zo,Xo,Yo,qo,Ko,Jo,ei,ti,oi,ii,ni,ri,ai,si,li,ci,di,ui,pi,hi,mi,gi,$i,fi,yi,bi,vi,wi,Si,ki,Ci,Ti,Ri,Ii,Ei,Li,Fi,Di,Oi,Wi,_i,Vi,Ni,Hi,ji,Ui,Gi,Zi,Xi,Yi=tr,qi=tr;hr(e,vc,(e=>o(417,ii=e))),e.$$.on_destroy.push((()=>Yi())),e.$$.on_destroy.push((()=>qi()));const Ki=Qo(),Ji=sa();let{class:Qi}=t,{layout:en}=t,{stores:tn}=t,{locale:on}=t,{id:nn}=t,{util:rn}=t,{utils:an}=t,{animations:sn="auto"}=t,{disabled:ln=!1}=t,{previewUpscale:cn=!1}=t,{previewPad:dn=!1}=t,{previewMaskOpacity:un=.95}=t,{previewImageDataMaxSize:pn}=t,{previewImageTextPixelRatio:hn}=t,{markupMaskOpacity:mn=1}=t,{zoomMaskOpacity:gn=.85}=t,{elasticityMultiplier:$n=10}=t,{willRevert:fn=(()=>Promise.resolve(!0))}=t,{willProcessImage:yn=(()=>Promise.resolve(!0))}=t,{willRenderCanvas:bn=Y}=t,{willRenderToolbar:xn=Y}=t,{willRenderUtilTabs:vn=Y}=t,{willSetHistoryInitialState:Sn=Y}=t,{enableButtonExport:kn=!0}=t,{enableButtonRevert:Cn=!0}=t,{enableNavigateHistory:Tn=!0}=t,{enableToolbar:Rn=!0}=t,{enableUtils:In=!0}=t,{enableButtonClose:En=!1}=t,{enableDropImage:Ln=!1}=t,{enablePasteImage:Fn=!1}=t,{enableBrowseImage:zn=!1}=t,{enableTransparencyGrid:Dn=!1}=t,{layoutDirectionPreference:On="auto"}=t,{layoutHorizontalUtilsPreference:Bn="left"}=t,{layoutVerticalUtilsPreference:Wn="bottom"}=t,{layoutVerticalToolbarPreference:_n="top"}=t,{layoutVerticalControlGroupsPreference:Vn="bottom"}=t,{layoutVerticalControlTabsPreference:Nn="bottom"}=t,{status:Hn}=t,{formatStatusImageLoading:jn=function(e,t){const{state:o}=e;if(!o||!o.task)return t.statusImageLoadNone;if(o.error){if("IMAGE_TOO_SMALL"===o.error.code)return t.statusImageLoadMinSize;if("VIDEO_TOO_SHORT"===o.error.code){const e=Array.isArray(t.unitSeconds)?1===o.error.metadata.minDuration?t.unitSeconds[0]:t.unitSeconds[1]:t.unitSeconds;return Il(t.statusImageLoadMinDuration,{seconds:e},"{","}")}return t.statusImageLoadError}return"blob-to-bitmap"===o.task?t.statusImageLoadPrepare:t.statusImageLoadBusy}}=t,{formatStatusImageProcessing:Un=function(e,t){const{state:o}=e;if(o&&o.task)return"store"===o.task?o.error?t.statusImageUploadError:t.statusImageUploadBusy:o.error?t.statusImageProcessError:t.statusImageProcessBusy}}=t,{formatStatusSupportError:Gn=function(e,t){const{features:o}=e;return{features:o.join(", ")}}}=t,{textDirection:Zn}=t,{markupEditorZoomLevel:Xn=null}=t,{markupEditorZoomLevels:Yn}=t,{markupEditorZoomAdjustStep:qn}=t,{markupEditorZoomAdjustFactor:Kn}=t,{markupEditorZoomAdjustWheelFactor:Jn}=t,{markupEditorInteractionMode:or=!1}=t,{muteAudio:ir=!0}=t,{willSetMediaInitialTimeOffset:nr=((e,t)=>e*dm(t[0]))}=t,{enablePan:rr=!0}=t,{enableZoom:ar=!0}=t,{enableZoomControls:sr=!0}=t,{enableZoomInput:lr}=t,{enablePanInput:cr}=t,{enableCanvasAlpha:dr=!1}=t,{enablePanLimit:mr}=t,{panLimitGutterScalar:gr}=t,{pan:$r=null}=t,{zoomPresetOptions:fr=[.25,.5,1,1.25,1.5,2,3,4,6,8,16]}=t,{zoomAdjustStep:yr=.25}=t,{zoomAdjustFactor:br=.1}=t,{zoomAdjustWheelFactor:xr=1}=t,{zoomLevel:wr=null}=t,{fixScrollDirection:Sr=!1}=t;const kr=Ya(Sr);la("fixScrollDirection",kr);const Cr=d()&&"visualViewport"in window,Tr=Ya("hidden");function Mr(e){const{height:t,scale:o}=e.target,i=t*o/window.screen.height<.75?"visible":"hidden";Tr.set(i)}let Pr,Rr;la("softKeyboardState",Tr),Cr&&window.visualViewport.addEventListener("resize",Mr);let{imagePreviewSrc:Ir}=t,{imageOrienter:Er={read:()=>1,apply:e=>e}}=t,{pluginComponents:Ar}=t,{pluginOptions:Lr={}}=t;const Fr=Ki.sub,zr={};let{root:Dr}=t;const Or=()=>{Rt.setAttribute("data-redraw","true"),ra.set({})},Br=Ya(!0);hr(e,Br,(e=>o(483,qt=e)));const Wr=Ya(void 0);hr(e,Wr,(e=>o(427,vi=e)));const _r=Ya(0);hr(e,_r,(e=>o(424,fi=e)));const Vr=Ya(!1),Nr=e=>{Vr.set("play"===e.type),Ki.pub(e.type)};let Hr,jr;let Ur,Gr,Zr=!1;const Xr=()=>{if(!a||!qr())return;Gr=g,vr(Wr,vi=void 0,vi);const e=Rt;Zr=!1;const t=1/24,o=oa();(Math.abs(u*o-fi*o)<=t||o-o*fi<=t)&&vr(_r,fi=c,fi),na(fi*oa()),e.play().catch((()=>{}));let i=ia();const n=()=>{if(qr())return;Ur=requestAnimationFrame(n);let e=ia();e-i<=0&&(e=i+.01),i=e,vr(_r,fi=e/oa(),fi),Gr>=0&&fi>=u&&(vr(_r,fi=u,fi),Yr()),g>-1&&(Zr=!0),Zr&&-1===g&&$>0&&(vr(_r,fi=l[$][0],fi),na(fi*oa())),vr(wa,hi=fi*oa(),hi),Or()};n()},Yr=()=>{a&&!qr()&&(vr(Wr,vi=void 0,vi),Gr=void 0,Rt.pause(),cancelAnimationFrame(Ur),Or())},qr=()=>Rt&&Rt.paused,Kr=()=>{if(a)return qr()?Xr():Yr()},Jr=()=>{if(!a)return;Rt.muted=!0},Qr=()=>{if(!a)return;Rt.muted=!1},ea=()=>{a&&vr(ta,bi=!bi,bi)},ta=Ya(ir);hr(e,ta,(e=>o(426,bi=e)));const oa=()=>{if(a)return Rt.duration},ia=()=>{if(!a)return;return Rt.currentTime},na=e=>{a&&(Zh(Rt,e),vr(_r,fi=e/yi,fi))},ra=Ya({});hr(e,ra,(e=>o(52,eo=e))),la("redrawTrigger",ra);const ca=Ya($n);hr(e,ca,(e=>o(500,gi=e))),la("elasticityMultiplier",ca);let da=[];const ua=xc();hr(e,ua,(e=>o(102,Xi=e)));const ha=tc()||1024,ma=Ne(ha,ha),ga=Os(),$a=e=>Promise.resolve(mi&&mi(e,{resourceType:"image"})).then((t=>{if(!1===t)return;const{headers:o,credentials:i}=t||{};return fetch(e,{headers:o,credentials:i}).then((e=>{if(200!==e.status)throw`${e.status} (${e.statusText})`;return e.blob()})).then((e=>Qh(e,Er,ga))).then((e=>em(e,x)))}));let{imageSourceToImageData:fa=(e=>m(e)?$a(e):jt(e)?new Promise((t=>t(h(e)))):go(e)||Ut(e)?Qh(e,Er,ga).then((e=>em(e,x))):void 0)}=t;const ya=(()=>{let e,t;const o=Yh.reduce(((e,o)=>(e[o]=function(e,t,o){let i=[];return{set:t,update:o,publish:e=>{i.forEach((t=>t(e)))},subscribe:t=>(i.push(t),e(t),()=>{i=i.filter((e=>e!==t))})}}((e=>{if(!t)return e();t.stores[o].subscribe(e)()}),(e=>{t&&t.stores[o].set(e)}),(e=>{t&&t.stores[o].update(e)})),e)),{});return{update:i=>{if(t=i,e&&(e.forEach((e=>e())),e=void 0),!i)return o.file.publish(void 0),void o.loadState.publish(void 0);e=Yh.map((e=>i.stores[e].subscribe((t=>{o[e].publish(t)}))))},stores:o,destroy:()=>{e&&e.forEach((e=>e()))}}})(),{file:ba,size:xa,duration:va,currentTime:wa,trim:Sa,volume:ka,minDuration:Ca,maxDuration:Ta,loadState:Ma,processState:Pa,cropAspectRatio:Ra,cropLimitToImage:Ia,crop:Ea,cropMinSize:Aa,cropMaxSize:La,cropRange:Fa,cropOrigin:za,cropRectAspectRatio:Da,rotation:Oa,rotationRange:Ba,targetSize:Wa,flipX:_a,flipY:Va,backgroundColor:Na,backgroundImage:Ha,colorMatrix:ja,convolutionMatrix:Ua,gamma:Ga,vignette:Za,noise:Ka,decoration:Ja,annotation:Qa,manipulation:es,redaction:ts,frame:os,selection:is,state:ns}=ya.stores;hr(e,ba,(e=>o(401,So=e))),hr(e,xa,(e=>o(375,At=e))),hr(e,va,(e=>o(425,yi=e))),hr(e,wa,(e=>o(499,hi=e))),hr(e,Sa,(e=>o(422,pi=e))),hr(e,ka,(e=>o(423,$i=e))),hr(e,Ta,(e=>o(428,wi=e))),hr(e,Ma,(e=>o(393,uo=e))),hr(e,Pa,(e=>o(392,co=e))),hr(e,Ra,(e=>o(496,ri=e))),hr(e,Ia,(e=>o(85,Ti=e))),hr(e,Ea,(e=>o(412,No=e))),hr(e,Oa,(e=>o(378,zt=e))),hr(e,_a,(e=>o(377,Ft=e))),hr(e,Va,(e=>o(376,Lt=e))),hr(e,Na,(e=>o(383,Zt=e))),hr(e,Ja,(e=>o(48,Et=e))),hr(e,Qa,(e=>o(49,Dt=e))),hr(e,es,(e=>o(380,Nt=e))),hr(e,ts,(e=>o(381,Ht=e))),hr(e,os,(e=>o(47,It=e))),hr(e,is,(e=>o(59,ci=e))),hr(e,ns,(e=>o(485,To=e))),la("components",{DynamicComponentTree:gh}),la("previewcontrols",{play:Xr,pause:Yr,togglePlayPause:Kr,mute:Jr,unmute:Qr,toggleMute:ea,setCurrentTime:na,getCurrentTime:ia,getDuration:oa,frameOffset:_r,framePeekOffset:Wr,isPlaying:Vr,isMuted:ta});const rs=(e,t,o=0)=>new Promise(((i,n)=>{if(Zs(e))return void js(e).then((e=>{const t=Oo(hi)?hi:nr(e.duration,pi||[[0,1]]);Us(e,t).then(i)}));let r,a=!1;t.cancel=()=>a=!0;const s=Date.now();fa(e).then((e=>{const t=Date.now()-s;clearTimeout(r),r=setTimeout((()=>{a||i(e)}),Math.max(0,o-t))})).catch(n)})),{images:as,shapePreprocessor:ss,imageScrambler:ls,imageRedactionRendering:cs,willRequest:ds,willRequestResource:us,csp:ps}=tn;let hs;hr(e,as,(e=>o(421,ui=e))),hr(e,ss,(e=>o(420,di=e))),hr(e,ls,(e=>o(384,Xt=e))),hr(e,cs,(e=>o(382,Gt=e))),hr(e,ds,(e=>o(81,mi=e))),hr(e,us,(e=>o(93,Wi=e))),hr(e,ps,(e=>o(92,Oi=e)));const ms=qa(Ha,((e,t)=>{if(!e)return t(void 0);hs&&(hs.cancel(),hs=void 0),hs={cancel:r},rs(e,hs).then(t).catch((e=>{}))})),gs=ns.subscribe((e=>Ki.pub("update",e))),fs=Ya();la("ui",Ya({})),la("selection",is);const ys=Ya(!0);hr(e,ys,(e=>o(95,Vi=e)));const bs=Ya(!0);hr(e,bs,(e=>o(97,Hi=e)));const xs=Ya(!0);hr(e,xs,(e=>o(419,li=e)));const ws=Ya(!0);hr(e,ws,(e=>o(497,ai=e)));const Ss=Ya(!0);hr(e,Ss,(e=>o(98,ji=e)));const ks=Ya();hr(e,ks,(e=>o(99,Ui=e)));const Cs=Ya();hr(e,Cs,(e=>o(498,si=e)));const Ts=qa([Cs,ws],(()=>void 0!==si?si:ai));hr(e,Ts,(e=>o(96,Ni=e)));const Ms=Ya([0,0,0]);hr(e,Ms,(e=>o(56,Eo=e)));const Rs=Ya([1,1,1]);hr(e,Rs,(e=>o(481,Vt=e)));const Is=xc([1,1,1]);hr(e,Is,(e=>o(480,_t=e)));const Es=Ya();hr(e,Es,(e=>o(91,Di=e)));const As=Ya(),Ls=Ya();hr(e,Ls,(e=>o(51,Kt=e)));const Fs=Ya();hr(e,Fs,(e=>o(373,Ct=e)));const zs=Ya(tt());hr(e,zs,(e=>o(80,Mo=e)));const Ds=Ya(0);hr(e,Ds,(e=>o(418,ni=e)));const Bs=Ya(tt());hr(e,Bs,(e=>o(84,Ci=e)));const Ws=Ya();hr(e,Ws,(e=>o(478,Mt=e)));const _s=Jh("(pointer: fine)",(e=>e?"pointer-fine":"pointer-coarse"));hr(e,_s,(e=>o(399,xo=e)));const Vs=Jh("(hover: hover)",(e=>e?"pointer-hover":"pointer-no-hover"));hr(e,Vs,(e=>o(398,bo=e)));const Ns=Ya(!1),Hs=Ya(!1);hr(e,Hs,(e=>o(379,Wt=e)));const Gs=Xa(void 0,(e=>{const t=xc(0),o=[Hs.subscribe((e=>{t.set(e?1:0,{hard:!oo})})),t.subscribe(e)];return()=>o.forEach((e=>e()))}));hr(e,Gs,(e=>o(479,Bt=e)));const Xs=Ya();hr(e,Xs,(e=>o(484,$o=e)));const Ys=Ya();let qs;hr(e,Ys,(e=>o(53,oo=e))),la("isAnimated",Ys);const Ks=Ya(cn);hr(e,Ks,(e=>o(402,ko=e)));const Js=Ya(!1);hr(e,Js,(e=>o(490,Uo=e))),la("imageIsStatic",Js);const Qs=Ya();hr(e,Qs,(e=>o(491,Zo=e)));const el=Ya();hr(e,el,(e=>o(488,Ho=e)));const tl=Xa(void 0,(e=>{const t=Ya(void 0),o=[Ea.subscribe((()=>{if(!No)return;if(Uo)return t.set(et(No));const e=Mh(No,Ho,5*$n);t.set(e)})),t.subscribe(e)];return()=>o.forEach((e=>e()))})),ol=Ya();hr(e,ol,(e=>o(487,Vo=e)));const il=Ya();hr(e,il,(e=>o(489,jo=e)));const nl=Ya(void 0);hr(e,nl,(e=>o(494,ei=e)));const rl=Ya(he());hr(e,rl,(e=>o(495,ti=e)));const al=(e,t)=>{if(!t||!e)return{top:0,right:0,bottom:0,left:0};const o=Pn(t,e,v),i=Mn(o,e);return{top:Math.abs(i.top),right:Math.abs(i.right),bottom:Math.abs(i.bottom),left:Math.abs(i.left)}},sl=Ya({}),ll=qa([Ws,zs,Bs,sl],(([e,t,o,i],n)=>{if(!e)return n(void 0);let r=0;1!==N.length||f||"bottom"===_n||(r=o.y+o.height),n(lt(e.x+t.x,e.y+t.y+r,e.width,e.height))}));let cl={left:0,right:0,top:0,bottom:0};const dl=Ya(!1),ul=qa([dl,os,ll,Hs],(([e,t,o,i],n)=>{if(!o)return n({left:0,right:0,top:0,bottom:0});if(!e)return;const r=Math.min(o.width,o.height),a=al({width:r,height:r},t);de(cl.top,4)===de(a.top,4)&&de(cl.bottom,4)===de(a.bottom,4)&&de(cl.right,4)===de(a.right,4)&&de(cl.left,4)===de(a.left,4)||(cl=a,n(a))}));hr(e,ul,(e=>o(410,Bo=e)));const pl=qa([dl,ul],(([e,t],o)=>{if(!e)return o(!1);o(Object.values(t).some((e=>e>0)))}));hr(e,pl,(e=>o(411,Wo=e)));const hl=qa([dl,Ws,pl,ul],(([e,t,o,i],n)=>{if(t)return e&&o?void n(lt(t.x+i.left,t.y+i.top,t.width-i.left-i.right,t.height-i.top-i.bottom)):n({...t})})),ml=qa([ll,pl,ul],(([e,t,o],i)=>e?t?void i(lt(e.x+o.left,e.y+o.top,e.width-o.left-o.right,e.height-o.top-o.bottom)):i(e):i(void 0)));hr(e,ml,(e=>o(50,Ot=e)));const gl=qa([Js,xa,Oa],(([e,t,o],i)=>{if(!e||!t)return i(void 0);const n=ot(t);i(bt(n,o))})),$l=qa([gl],(([e],t)=>{if(!e)return t(void 0);const o=rt(e);t(Pt(o))}));hr(e,$l,(e=>o(414,qo=e)));const fl=qa([ml,Ea,$l,Ks],(([e,t,o,i],n)=>{if(!e||!t||!(!Zo&&!Ho))return;const{width:r,height:a}=o||t,s=Math.min(e.width/r,e.height/a);n(i?s:Math.min(1,s))}));hr(e,fl,(e=>o(413,Yo=e)));la("imageStaticVisualCorners",qa([Js,xa,Oa,ml,Ws,fl],(([e,t,o,i,n,r],a)=>{if(!(e&&i&&n&&t))return a(void 0);const s=ot(t),l=Pt(ut(s,r)),c=xt(i,l);l.x=c.x,l.y=c.y;a(bt(l,o))})));const yl=Ya(void 0);hr(e,yl,(e=>o(416,oi=e)));const bl=qa([Ea,ml],(([e,t])=>{if(t&&e)return Math.min(t.width/e.width,t.height/e.height)})),xl=qa([Ea,ol],(([e,t])=>e&&t?Math.min(e.width/t.width,e.height/t.height):1));hr(e,xl,(e=>o(101,Zi=e)));const vl=qa([yl,xl],(([e,t])=>e&&t?t*e:1));hr(e,vl,(e=>o(493,Ko=e)));const wl=Ya(he());hr(e,wl,(e=>o(415,Jo=e)));const Sl=Ya({scalar:Ko,translation:Jo}),kl=()=>{Sl.set({scalar:void 0,translation:he()})},Cl=Xa(void 0,(e=>{const t=xc(void 0,{precision:1e-4}),o=1===zd()?e=>Tt(e,Math.round):Y,i=()=>{if(!Vo)return;const e=Wt||!$o;if(Uo){const o=et(Vo);return dt(o,ti),dt(o,Ot),t.set(o,{hard:e})}const i=Mh(Vo,ei,Nm*$n);i.width<0&&(i.width=0,i.x=Vo.x),i.height<0&&(i.height=0,i.y=Vo.y),dt(i,Ot),dt(i,Jo),ut(i,Ko),!e&&o(i),t.set(i,{hard:e})},n=[ml.subscribe(i),ol.subscribe(i),vl.subscribe(i),wl.subscribe(i),os.subscribe(i),t.subscribe(e)];return()=>n.forEach((e=>e()))}));hr(e,Cl,(e=>o(58,Do=e)));const Ml=Ya(1);hr(e,Ml,(e=>o(486,_o=e)));const Pl=()=>{if(!No||!Ot)return;let e=mt(et(No),Yo||1);const t=xt(Ot,mt(et(qo),Yo));dt(e,t);const o=Mt.width/e.width,i=Mt.height/e.height,n=Math.min(1,o,i);Ml.set(n),ut(e,n),((e,t)=>{const[o,i,n,r]=kt(e);o<t.y&&(e.y=Math.max(t.y,e.y)),i>t.width&&(e.x=t.width-e.width),n>t.height&&(e.y=t.height-e.height),r<t.x&&(e.x=Math.max(t.x,e.x))})(e,{...Mt,x:0,y:0}),ol.set(e)},Rl=qa([ml,fl,Ea,xa],(([e,t,o,i],n)=>{e&&(o||i)&&n(El(e,t||1,o||i))}));hr(e,Rl,(e=>o(100,Gi=e)));const El=(e,t,o)=>o.width<=e.width&&o.height<=e.height?xt(e,mt(et(o),t)):St(e,$t(o));let Al,Ll;const Fl=e=>{if(f&&Al&>(Al,e)&&Ll===Yo)return;if(Uo)return Pl();Al=e,Ll=Yo;const t=El(e,Yo,No||At);ol.set(t)};let zl=!1;const Dl=fl.subscribe((e=>{!zl&&void 0!==e&&No&&(Fl(Ot),zl=!0)})),Ol=ml.subscribe((e=>{e&&void 0!==Yo&&No&&Fl(e)})),Bl=Js.subscribe((e=>{!e&&Ot&&Fl(Ot)}));let Wl;const _l=il.subscribe((e=>{if(!e)return Wl=void 0,void vr(Qs,Zo=void 0,Zo);Wl=Xo;const t=et(No);Qs.set(t)})),Vl=ol.subscribe((e=>{if(!e||!jo)return;const t=(o=et(e),i=jo,o.x-=i.x,o.y-=i.y,o.width-=i.width,o.height-=i.height,o);var o,i;((e,t)=>{e.x/=t,e.y/=t,e.width/=t,e.height/=t})(t,Wl);const n=((e,t)=>(e.x+=t.x,e.y+=t.y,e.width+=t.width,e.height+=t.height,e))(et(Zo),t);Ea.set(n)})),Nl=Ea.subscribe((e=>{if(!e||!Vo)return;if(Uo)return void(jo||Pl());if(Wt||jo||Ho)return;const t=$t(Vo),o=$t(e);if(de(t,6)===de(o,6))return;const{width:i,height:n}=No,r=Math.min(Ot.width/i,Ot.height/n),a=Ne(e.width*r,e.height*r),s=.5*(Vo.width-a.width),l=.5*(Vo.height-a.height),c=lt(Math.max(0,Math.min(Ot.width-a.width,Vo.x+s)),Math.max(0,Math.min(Ot.height-a.height,Vo.y+l)),a.width,a.height);ol.set(c)})),Hl=qa([fl,Ea,ol,Js],(([e,t,o,i],n)=>{if(!e||!t||!o)return;if(i)return n(_o);const r=o.width/t.width,a=o.height/t.height;n(Math.max(r,a)/e)})),jl=qa([fl,Hl],(([e,t],o)=>{if(!t)return;o(e*t)}));hr(e,jl,(e=>o(492,Xo=e)));let Ul={left:0,right:0,top:0,bottom:0};const Gl=qa([os,ol],(([e,t],o)=>{if(!t)return o(Ul);const i=al(t,e);de(Ul.top,4)===de(i.top,4)&&de(Ul.bottom,4)===de(i.bottom,4)&&de(Ul.right,4)===de(i.right,4)&&de(Ul.left,4)===de(i.left,4)||(Ul=i,o(i))})),Zl=qa([Gl],(([e],t)=>{t(Object.values(e).some((e=>e>0)))})),Xl=xc(.075,{stiffness:.03,damping:.4,precision:.001}),Yl=qa([Is,Ms,Xl,Cl,vl,os,Zl,Gl,pl],(([e,t,o,i,n,r,a,s,l],c)=>{if(!i||f)return c([]);let{x:d,y:u,width:p,height:h}=i;d+=.5,u+=.5,p-=.5,h-=.5;const m=[];if(r){if(a){let{left:e,right:o,top:i,bottom:r}=s;e*=n,o*=n,i*=n,r*=n;const a=sm(t)?[1,1,1,.125]:[0,0,0,.075];m.push({x:d-e-.5,y:u-i-.5,width:p+e+o+1,height:h+i+r+1,strokeWidth:1,strokeColor:a,opacity:l?1:.5})}const i=sm(e);r&&r.frameColor&&sm(r.frameColor)||i||(m.push({x:d-1,y:u-1,width:p+2,height:h+2,strokeWidth:2,strokeColor:[0,0,0,.1],opacity:o}),m.push({x:d+1,y:u+1,width:p-2,height:h-2,strokeWidth:2,strokeColor:[0,0,0,.1],opacity:o}))}c([...m,{x:d,y:u,width:p,height:h,strokeWidth:1,strokeColor:e,opacity:o}])})),ql=Ya([]);hr(e,ql,(e=>o(404,Po=e)));const Kl=qa([Yl,ql],(([e,t],o)=>{o([...e,...t])}));hr(e,Kl,(e=>o(94,_i=e)));const Jl=xc(0,{precision:.001});hr(e,Jl,(e=>o(406,Io=e)));const Ql=xc();hr(e,Ql,(e=>o(409,Fo=e)));const ec=xc();hr(e,ec,(e=>o(408,Lo=e)));const ic=xc();hr(e,ic,(e=>o(407,Ao=e)));const nc=xc();hr(e,nc,(e=>o(405,Ro=e)));const rc=Ya(!1);hr(e,rc,(e=>o(391,lo=e)));const ac=Ya();let sc;hr(e,ac,(e=>o(394,po=e)));const lc=qa([rc,ac],(([e,t],i)=>{if(!e||!t)return void i(void 0);if(sc&&(sc.cancel(),o(295,sc=void 0)),An(t))return i(S(t));const n=Lc.length?0:oo?250:0;o(295,sc={cancel:r}),rs(t,sc,n).then(i).catch((e=>{vr(Ma,uo.error=e,uo)})).finally((()=>{o(295,sc=void 0)}))}));Yi(),Yi=ur(lc,(e=>o(374,Rt=e)));let{imagePreviewCurrent:cc}=t;const dc=Ya({});hr(e,dc,(e=>o(396,fo=e)));const uc=Ya([]);hr(e,uc,(e=>o(86,Ri=e)));const pc=qa([ml,Fs,xa,tl,ol,jl,Oa,_a,Va,vl,wl,Ns],(([e,t,o,i,n,r,a,s,l,c,d,u],p)=>{if(!e||!n)return;const h=Tl(e,t,o,i,n,c,d,r,a,s,l);!u&&B(h),p(h)}));hr(e,pc,(e=>o(397,yo=e)));const hc=qa([ja,Ua,Ga,Za,Ka],(([e,t,o,i,n],r)=>{const a=e&&Object.keys(e).map((t=>e[t])).filter(Boolean);r({gamma:o||void 0,vignette:i||void 0,noise:n||void 0,convolutionMatrix:t||void 0,colorMatrix:a&&a.length&&Qn(a)})}));let mc,gc;const $c=(()=>{if(!vo())return!1;const e=navigator.userAgent.match(/OS (\d+)_(\d+)_?(\d+)?/i)||[],[,t,o]=e.map((e=>parseInt(e,10)||0));return t>13||13===t&&o>=4})(),fc=Ya({});hr(e,fc,(e=>o(385,Jt=e))),la("env",fc);const bc=zd(),wc=Xa(bc,(e=>{const t=()=>e(zd()),o=matchMedia(`(resolution: ${bc}dppx)`);return o.addListener(t),()=>o.removeListener(t)}));hr(e,wc,(e=>o(57,zo=e)));const Sc=((e,t,o)=>{const{sub:i,pub:n}=Qo(),{willUndo:r=(()=>!0)}=o||{},a=[],s=Ya(0),l=[],c=()=>l.forEach((e=>e({index:pr(s),length:a.length}))),d={get index(){return pr(s)},set index(e){e=Number.isInteger(e)?e:0,e=$s(e,0,a.length-1),s.set(e),t(a[d.index]),c()},get state(){return a[a.length-1]},length:()=>a.length,undo(){if(!1===r())return;const e=d.index--;return n("undo",e),e},redo(){const e=d.index++;return n("redo",d.index),e},revert(){a.length=1,d.index=0,n("revert")},write(o){o&&t({...e(),...o});const i=e(),r=a[a.length-1];JSON.stringify(i)!==JSON.stringify(r)&&(a.length=d.index+1,a.push(i),s.set(a.length-1),c(),n("writehistory"))},set(e={}){a.length=0,d.index=0;const t=Array.isArray(e)?e:[e];a.push(...t),d.index=a.length-1},get:()=>[...a],subscribe:e=>(l.push(e),e({index:d.index,length:a.length}),()=>l.splice(l.indexOf(e),1)),on:i};return d})((()=>To),(e=>{vr(ns,To=e,To),zs.set(Mo)}),{willUndo:()=>!Rc()||(Pc(),!1)});qi(),qi=ur(Sc,(e=>o(403,Co=e)));const kc=()=>{const e={x:0,y:0,...At},t=Tt(St(e,To.cropAspectRatio),Math.round),o=Sn({...To,rotation:0,crop:t},To),i=[o];JSON.stringify(o)!==JSON.stringify(To)&&i.push({...To}),Sc.set(i)},Cc=Ma.subscribe((e=>{e&&e.complete&&kc()})),Tc=()=>fn().then((e=>e&&Sc.revert())),Mc=[Qa,Ja,ts,es],Pc=()=>{Mc.forEach((e=>{e.update((e=>e.length&&Bi(e[e.length-1])?e.slice(0,-1):e))}))},Rc=()=>V.filter((e=>e.length)).some((e=>Bi(e[e.length-1]))),Ic=Ya(!1);hr(e,Ic,(e=>o(386,to=e)));const Ec=()=>{vr(Ic,to=!0,to),yn().then((e=>{if(!e)return void vr(Ic,to=!1,to);let t;t=cd.subscribe((e=>{1===e&&(t&&t(),Ji("processImage"))}))}))},Ac=Pa.subscribe((e=>{if(!e)return void vr(Ic,to=!1,to);vr(Ic,to=!0,to);const{complete:t,abort:o}=e;(t||o)&&vr(Ic,to=!1,to)})),Lc=am();hr(e,Lc,(e=>o(55,ho=e)));const Fc=qa([Lc],(([e],t)=>{if(!e.length)return t();const{origin:o,translation:i,rotation:n,scale:r}=e[0];t({origin:o,translation:i,rotation:n,scale:r})})),zc=Ya();hr(e,zc,(e=>o(400,wo=e)));let Dc,Oc=[];const Bc=Ya(),Wc=Ya(),_c=qa([yl,Wc,fl,bl],(([e,t,o,i])=>e||(t||o<1?i:1))),Vc={...tn,imageFile:ba,imageSize:xa,mediaDuration:va,mediaMinDuration:Ca,mediaMaxDuration:Ta,mediaTrim:Sa,imageBackgroundColor:Na,imageBackgroundImage:Ha,imageCropAspectRatio:Ra,imageCropMinSize:Aa,imageCropMaxSize:La,imageCropLimitToImage:Ia,imageCropRect:Ea,imageCropRectOrigin:za,imageCropRectSnapshot:Qs,imageCropRectAspectRatio:Da,imageCropRange:Fa,imageRotation:Oa,imageRotationRange:Ba,imageFlipX:_a,imageFlipY:Va,imageOutputSize:Wa,imageColorMatrix:ja,imageConvolutionMatrix:Ua,imageGamma:Ga,imageVignette:Za,imageNoise:Ka,imageManipulation:es,imageDecoration:Ja,imageAnnotation:Qa,imageRedaction:ts,imageFrame:os,imagePreview:lc,imagePreviewSource:ac,imageTransforms:pc,imagePreviewModifiers:dc,history:Sc,animation:Xs,pixelRatio:wc,elasticityMultiplier:$n,scrollElasticity:jm,rangeInputElasticity:5,redrawTrigger:ra,pointerAccuracy:_s,pointerHoverable:Vs,env:fc,rootRect:Fs,stageRect:ml,stageRectBase:ll,stageRecenter:sl,stageScalar:fl,stagePadding:ul,stagePadded:pl,presentationScalar:jl,imagePreviewUpscale:Wc,utilRect:Ws,utilRectPadded:hl,allowPlayPause:Br,allowPan:ys,allowZoom:bs,allowZoomControls:xs,enableZoomInput:Ss,enablePanInput:ws,enablePanInputStatus:Ts,imageSelectionMultiTouching:Bc,rootBackgroundColor:Ms,rootForegroundColor:Rs,rootLineColor:Is,rootColorSecondary:As,imageOutlineOpacity:Xl,utilTools:zc,imageSelectionPan:wl,imageSelectionZoom:yl,imageSelectionZoomCurrent:_c,imageSelectionStageFitScalar:bl,imageSelectionStoredState:Sl,imageOverlayMarkup:ql,interfaceImages:uc,isInteracting:Hs,isTransformingImage:Ns,isInteractingFraction:Gs,imageCropRectIntent:el,imageCropRectPresentation:tl,imageSelectionRect:ol,imageSelectionRectIntent:nl,imageSelectionRectPresentation:Cl,imageSelectionRectSnapshot:il,imageScalar:Hl,imageTransformsInterpolated:Fc,imageEffects:hc};delete Vc.image;const Hc="util-"+L();let jc=[];const Uc=e=>H.find((([t])=>e===t));let Gc=[];const Zc=e=>{o(62,Gc=Gc.concat(e))},Yc=e=>{o(62,Gc=Gc.filter((t=>t!==e)))},qc=(e,t)=>{o(304,Z[e]=t,Z)};let Kc=vo();const Jc=(e,t,o)=>{let i=ke.getPropertyValue(e);i=o?o(i):/^[0-9]+$/.test(i)?parseFloat(i):void 0,t.set(i,{hard:!oo})},Qc=(e,t,o=!1)=>{const i=(e=>{const t=ke.getPropertyValue(e);return Op(t)})(e);i&&0!==i[3]&&(o||(i.length=3),t.set(i,{hard:!oo}))},ed=Ya();hr(e,ed,(e=>o(87,Ii=e)));const td=Ya();hr(e,td,(e=>o(88,Ei=e)));const od=Ya();hr(e,od,(e=>o(89,Li=e)));const id=xc(0,{damping:.9});hr(e,id,(e=>o(90,Fi=e)));const nd=()=>{Qc("color",Rs),Qc(dr?"--color-background":"background-color",Ms),Qc("outline-color",Is),Qc("--color-primary",Es),Qc("--color-secondary",As),Qc("--grid-color-even",td,!0),Qc("--grid-color-odd",od,!0),Jc("--grid-size",ed),Jc("--editor-inset-top",Ds,(e=>parseInt(e,10)))},rd=qa([pc,hc,Na,ms],(([e,t,o,i])=>e&&{...e,...t,backgroundColor:o,backgroundImage:i}));hr(e,rd,(e=>o(395,mo=e)));const ad=()=>{const e=Lc.length?void 0:{resize:1.05},t=((e,t,o={})=>{const{resize:i=1,opacity:n=0}=o,r={opacity:[xc(n,{...nm,stiffness:.1}),Y],resize:[xc(i,{...nm,stiffness:.1}),Y],translation:[xc(void 0,nm),Y],rotation:[xc(void 0,rm),Y],origin:[xc(void 0,nm),Y],scale:[xc(void 0,rm),Y],gamma:[xc(void 0,rm),e=>e||1],vignette:[xc(void 0,rm),e=>e||0],colorMatrix:[xc([...im],nm),e=>e||[...im]],convolutionMatrix:[Ya(void 0),e=>e&&e.clarity||void 0],backgroundColor:[xc(void 0,nm),(e,t,o)=>{if(Array.isArray(e)){if(Array.isArray(t)){const i=[...e];0===t[3]?(i[3]=0,o(i)):0===i[3]&&((e=[...t])[3]=0)}return e}}],backgroundImage:[Ya(void 0),Y]},a=Object.entries(r).map((([e,t])=>[e,t[0]])),s=a.map((([,e])=>e)),l=Object.entries(r).reduce(((e,[t,o])=>{const[i,n]=o;return e[t]=(e,o)=>i.set(n(e,c[t],(e=>{i.set(e,{hard:!0})})),o),e}),{});let c;const d=qa(s,(o=>(c=o.reduce(((e,t,o)=>(e[a[o][0]]=t,e)),{}),c.data=e,c.size=t,c.scale*=o[1],c)));return d.get=()=>c,d.set=(e,t)=>{const o={hard:!t};Object.entries(e).forEach((([e,t])=>{l[e]&&l[e](t,o)}))},d})(Rt,At,e);Lc.unshift(t),sd(mo)},sd=e=>{Lc.forEach(((t,o)=>{const i=0===o?1:0;t.set({...e,opacity:i,resize:1},$o)}))};let ld;const cd=yc(void 0,{duration:500});let dd;hr(e,cd,(e=>o(54,ao=e)));const ud=Ya(!1);let pd;hr(e,ud,(e=>o(390,so=e)));const hd=xc(void 0,{stiffness:.1,damping:.7,precision:.25});hr(e,hd,(e=>o(82,Si=e)));const md=xc(0,{stiffness:.1,precision:.05});hr(e,md,(e=>o(83,ki=e)));const gd=xc(0,{stiffness:.02,damping:.5,precision:.25});hr(e,gd,(e=>o(388,no=e)));const $d=xc(void 0,{stiffness:.02,damping:.5,precision:.25});hr(e,$d,(e=>o(389,ro=e)));const fd=xc(void 0,{stiffness:.02,damping:.5,precision:.25});let yd;hr(e,fd,(e=>o(387,io=e)));const bd=()=>{Ji("abortLoadImage")},xd=()=>{Ji("abortProcessImage"),vr(Ic,to=!1,to)},vd=e=>{e.target&&"true"===e.target.dataset.touchScroll||e.preventDefault()},wd=$c?e=>{const t=e.touches?e.touches[0]:e;t.pageX>20&&t.pageX<window.innerWidth-20||vd(e)}:r,Sd=Ya([]);hr(e,Sd,(e=>o(482,Yt=e))),la("keysPressed",Sd);const kd=e=>{!e||Go(e)&&!(e=>/^image/.test(e.type)&&!/svg/.test(e.type))(e)||!Go(e)&&!/^http/.test(e)||Ji("loadImage",e)},Cd=e=>{e&&kd(e)};let Td=void 0,Md=void 0;let Pd,Rd=[];const Id=Ya();la("rootPortal",Id),la("rootRect",Fs);const Ed=()=>({foregroundColor:[...Vt],lineColor:[..._t],utilVisibility:{...Z},isInteracting:Wt,isInteractingFraction:Bt,rootRect:et(Ct),stageRect:et(Ot),manipulationShapesDirty:qd,annotationShapesDirty:Gd,decorationShapesDirty:Xd,frameShapesDirty:Yd}),Ad=(e,t,o)=>wn(e,Ne(Math.round(t.width/o),Math.round(t.height/o))),Ld=(e,t,o)=>{var i;return e._translate=me((i=t).x,i.y),e._scale=o,e},Fd=e=>{const t=[];return e.forEach((e=>t.push(Dd(e)))),t.filter(Boolean)},Dd=e=>Ai(e)?(e.points=[me(e.x1,e.y1),me(e.x2,e.y2)],e):(!(e=>Mi(e)&&!e.text.length)(e)||e.backgroundColor&&0!==e.backgroundColor[3]||(Pi(e)&&(e.width=5,e.height=e.lineHeight),e.strokeWidth=1,e.strokeColor=[1,1,1,.5],e.backgroundColor=[0,0,0,.1]),e);let Od,Bd=[],Wd=[],Vd=[],Nd=[],Hd=[],jd={};const Ud=(e,t,o,i,n,r,a)=>{const{manipulationShapesDirty:s,annotationShapesDirty:l,decorationShapesDirty:c,frameShapesDirty:d,selectionRect:u,scale:p}=e,h=Od!==p,m=h||!gt(jd,u);m&&(Od=p,jd=u),s&&(Vd=t.filter(zi).map(xi).map((e=>wn(e,At)))),(l||o!==Dt)&&(Bd=o.filter(zi).map(xi).sort(((e,t)=>e.alwaysOnTop?1:t.alwaysOnTop?-1:0)).map((e=>wn(e,At)))),(h||Zd||l||o!==Dt)&&(Wd=Fd(Bd.map((e=>v(e,{flipX:Ft,flipY:Lt,rotation:zt,scale:p,context:ot(At)}))).flat())),(c||i!==Et||m)&&(Nd=Fd(i.filter(zi).map(xi).sort(((e,t)=>e.alwaysOnTop?1:t.alwaysOnTop?-1:0)).map((e=>Ad(e,u,p))).map((e=>v(e,{context:u}))).flat().map((e=>Ld(e,u,p))))),(d||r!==It||m)&&(Hd=r?Fd([r].map(xi).map((e=>Ad(e,u,p))).map(v).flat().map((e=>Ld(e,u,p)))):[]);let g=Fd(n.filter(zi));return"undefined"!=typeof window&&(e=>{if(e&&e._v94ofot)return;const[t]=[[85,110,108,105,99,101,110,115,101,100,32,80,105,110,116,117,114,97,32,105,110,115,116,97,110,99,101]].map((e=>e.map((e=>String.fromCharCode(e))).join("")));g=[...g,{x:u.x+.5*u.width-82,y:u.y+u.height-16-12,width:164,height:16,text:t,fontWeight:900,fontSize:12,color:[1,1,1,.25]}]})(window),{manipulationShapesDirty:s,manipulationShapes:Vd,annotationShapesDirty:l,annotationShapes:Wd,decorationShapesDirty:c,decorationShapes:Nd,frameShapesDirty:d,frameShapes:Hd,interfaceShapes:g,selectionShapes:a.map(xi).map((e=>wn(e,At)))}};let Gd=!0;let Zd=!0;let Xd=!0;let Yd=!0;let qd=!0;aa((()=>{Yr(),Rt&&m(Rt.src)&&/^blob:/.test(Rt.src)&&URL.revokeObjectURL(Rt.src),gs(),Ol(),Dl(),Bl(),_l(),Vl(),Nl(),Cc(),Ac(),_s.destroy(),Vs.destroy(),ya.destroy(),Lc.clear(),Bd.length=0,Wd.length=0,Vd.length=0,Nd.length=0,Hd.length=0,Td&&y(Td),Cr&&window.visualViewport.removeEventListener("resize",Mr);try{o(235,cc=void 0),o(296,ld=void 0)}catch(e){}}));let Kd;return e.$$set=e=>{"class"in e&&o(236,Qi=e.class),"layout"in e&&o(237,en=e.layout),"stores"in e&&o(238,tn=e.stores),"locale"in e&&o(3,on=e.locale),"id"in e&&o(4,nn=e.id),"util"in e&&o(239,rn=e.util),"utils"in e&&o(240,an=e.utils),"animations"in e&&o(241,sn=e.animations),"disabled"in e&&o(242,ln=e.disabled),"previewUpscale"in e&&o(243,cn=e.previewUpscale),"previewPad"in e&&o(244,dn=e.previewPad),"previewMaskOpacity"in e&&o(5,un=e.previewMaskOpacity),"previewImageDataMaxSize"in e&&o(245,pn=e.previewImageDataMaxSize),"previewImageTextPixelRatio"in e&&o(6,hn=e.previewImageTextPixelRatio),"markupMaskOpacity"in e&&o(7,mn=e.markupMaskOpacity),"zoomMaskOpacity"in e&&o(246,gn=e.zoomMaskOpacity),"elasticityMultiplier"in e&&o(8,$n=e.elasticityMultiplier),"willRevert"in e&&o(247,fn=e.willRevert),"willProcessImage"in e&&o(248,yn=e.willProcessImage),"willRenderCanvas"in e&&o(9,bn=e.willRenderCanvas),"willRenderToolbar"in e&&o(249,xn=e.willRenderToolbar),"willRenderUtilTabs"in e&&o(250,vn=e.willRenderUtilTabs),"willSetHistoryInitialState"in e&&o(251,Sn=e.willSetHistoryInitialState),"enableButtonExport"in e&&o(252,kn=e.enableButtonExport),"enableButtonRevert"in e&&o(253,Cn=e.enableButtonRevert),"enableNavigateHistory"in e&&o(254,Tn=e.enableNavigateHistory),"enableToolbar"in e&&o(10,Rn=e.enableToolbar),"enableUtils"in e&&o(255,In=e.enableUtils),"enableButtonClose"in e&&o(256,En=e.enableButtonClose),"enableDropImage"in e&&o(257,Ln=e.enableDropImage),"enablePasteImage"in e&&o(258,Fn=e.enablePasteImage),"enableBrowseImage"in e&&o(259,zn=e.enableBrowseImage),"enableTransparencyGrid"in e&&o(11,Dn=e.enableTransparencyGrid),"layoutDirectionPreference"in e&&o(260,On=e.layoutDirectionPreference),"layoutHorizontalUtilsPreference"in e&&o(261,Bn=e.layoutHorizontalUtilsPreference),"layoutVerticalUtilsPreference"in e&&o(262,Wn=e.layoutVerticalUtilsPreference),"layoutVerticalToolbarPreference"in e&&o(263,_n=e.layoutVerticalToolbarPreference),"layoutVerticalControlGroupsPreference"in e&&o(264,Vn=e.layoutVerticalControlGroupsPreference),"layoutVerticalControlTabsPreference"in e&&o(265,Nn=e.layoutVerticalControlTabsPreference),"status"in e&&o(234,Hn=e.status),"formatStatusImageLoading"in e&&o(266,jn=e.formatStatusImageLoading),"formatStatusImageProcessing"in e&&o(267,Un=e.formatStatusImageProcessing),"formatStatusSupportError"in e&&o(268,Gn=e.formatStatusSupportError),"textDirection"in e&&o(12,Zn=e.textDirection),"markupEditorZoomLevel"in e&&o(269,Xn=e.markupEditorZoomLevel),"markupEditorZoomLevels"in e&&o(13,Yn=e.markupEditorZoomLevels),"markupEditorZoomAdjustStep"in e&&o(14,qn=e.markupEditorZoomAdjustStep),"markupEditorZoomAdjustFactor"in e&&o(15,Kn=e.markupEditorZoomAdjustFactor),"markupEditorZoomAdjustWheelFactor"in e&&o(16,Jn=e.markupEditorZoomAdjustWheelFactor),"markupEditorInteractionMode"in e&&o(270,or=e.markupEditorInteractionMode),"muteAudio"in e&&o(271,ir=e.muteAudio),"willSetMediaInitialTimeOffset"in e&&o(272,nr=e.willSetMediaInitialTimeOffset),"enablePan"in e&&o(17,rr=e.enablePan),"enableZoom"in e&&o(18,ar=e.enableZoom),"enableZoomControls"in e&&o(273,sr=e.enableZoomControls),"enableZoomInput"in e&&o(19,lr=e.enableZoomInput),"enablePanInput"in e&&o(274,cr=e.enablePanInput),"enableCanvasAlpha"in e&&o(20,dr=e.enableCanvasAlpha),"enablePanLimit"in e&&o(21,mr=e.enablePanLimit),"panLimitGutterScalar"in e&&o(22,gr=e.panLimitGutterScalar),"pan"in e&&o(275,$r=e.pan),"zoomPresetOptions"in e&&o(23,fr=e.zoomPresetOptions),"zoomAdjustStep"in e&&o(24,yr=e.zoomAdjustStep),"zoomAdjustFactor"in e&&o(25,br=e.zoomAdjustFactor),"zoomAdjustWheelFactor"in e&&o(26,xr=e.zoomAdjustWheelFactor),"zoomLevel"in e&&o(0,wr=e.zoomLevel),"fixScrollDirection"in e&&o(276,Sr=e.fixScrollDirection),"imagePreviewSrc"in e&&o(279,Ir=e.imagePreviewSrc),"imageOrienter"in e&&o(280,Er=e.imageOrienter),"pluginComponents"in e&&o(281,Ar=e.pluginComponents),"pluginOptions"in e&&o(27,Lr=e.pluginOptions),"root"in e&&o(2,Dr=e.root),"imageSourceToImageData"in e&&o(28,fa=e.imageSourceToImageData),"imagePreviewCurrent"in e&&o(235,cc=e.imagePreviewCurrent)},e.$$.update=()=>{if(268435456&e.$$.dirty[8]&&kr.set(Sr),8&e.$$.dirty[0]&&o(302,i=!!on),1&e.$$.dirty[0]|2097152&e.$$.dirty[8]&&o(0,wr=null===wr?Xn:wr),2&e.$$.dirty[0]|4&e.$$.dirty[9]){let e=!1;Ar.forEach((([t])=>{zr[t]||(o(1,zr[t]={},zr),e=!0)})),e&&o(293,da=[...Ar])}var t,d,h,w;if(8388608&e.$$.dirty[7]|8404992&e.$$.dirty[9]&&o(354,N=i&&da.length?an||da.map((([e])=>e)):[]),134217728&e.$$.dirty[0]|16384&e.$$.dirty[9]|8192&e.$$.dirty[11]|536870912&e.$$.dirty[12]&&o(355,H=((e,t,o,i)=>{const n=t.filter((([t])=>e.includes(t))).filter((([e,{isSupported:t}])=>t({...i,...o[e]}))).map((([e,t])=>[e,t.Component]));return vs(n,jc,((e,t)=>e[0]===t[0]&&e[1]===t[1]))?jc:(jc=n,n)})(N,da,Lr,{src:So})),16384&e.$$.dirty[11]&&o(308,j=H.length),8&e.$$.dirty[0]|536870912&e.$$.dirty[9]|8192&e.$$.dirty[11]&&o(353,U=j&&N.map((e=>{const t=Uc(e);if(t)return{id:e,view:t[1],tabIcon:on[e+"Icon"],tabLabel:on[e+"Label"]}})).filter(Boolean)||[]),4096&e.$$.dirty[11]&&o(372,n=!!U.find((e=>"trim"===e.id))),5&e.$$.dirty[12]|4194304&e.$$.dirty[13]&&o(307,a=!!(yi&&Rt&&n)),4194304&e.$$.dirty[7]|536870912&e.$$.dirty[9]&&o(43,G=j&&rn&&"string"==typeof rn&&Uc(rn)?rn:j>0?H[0][0]:void 0),4096&e.$$.dirty[1]|268435456&e.$$.dirty[9]&&a&&G&&Yr(),268435456&e.$$.dirty[9]|4&e.$$.dirty[12]&&(a?(Rt.addEventListener("play",Nr),Rt.addEventListener("pause",Nr)):Rt&&"video"===Rt.nodeName&&(Rt.removeEventListener("play",Nr),Rt.removeEventListener("pause",Nr))),268435456&e.$$.dirty[9]&&a&&_r.set(ia()/oa()),18874368&e.$$.dirty[13]&&(e=>{if(!qr())return;const t=Date.now();if(jr&&t-jr<16)return;jr=t;const o=yi*e;if(o.toFixed(1)===Hr)return;Hr=o.toFixed(1);const i=Rt,n=()=>{i.removeEventListener("seeked",n),Or()};i.addEventListener("seeked",n),Zh(i,o)})(vi||fi),2097152&e.$$.dirty[13]&&o(370,s=fi&&de(fi,6)),38273024&e.$$.dirty[13]&&o(368,l=pi||[[0,Math.min(yi,wi)/yi]]),134217728&e.$$.dirty[11]&&(c=l[0][0]),134217728&e.$$.dirty[11]&&(u=l[l.length-1][1]),134217728&e.$$.dirty[11]&&o(371,p=l.map((([e,t])=>[de(e,6),de(t,6)]))),1610612736&e.$$.dirty[11]&&o(369,g=p.findIndex((([e,t])=>s>=e&&s<=t))),1879048192&e.$$.dirty[11]&&($=-1===g&&p.findIndex(((e,t,o)=>{const i=o[t-1];return i?s<=e[0]&&s>=i[1]:s<=e[0]}))),8388608&e.$$.dirty[8]&&ta.set(ir),4&e.$$.dirty[12]|8388608&e.$$.dirty[13]&&(Rt&&bi?Jr():Qr()),268435456&e.$$.dirty[9]|2097152&e.$$.dirty[13]&&a&&wa.set(oa()*fi),4&e.$$.dirty[12]|1048576&e.$$.dirty[13]&&Rt&&(e=>{if(!a)return;Rt.volume=Math.min(1,e)})($i),256&e.$$.dirty[0]&&vr(ca,gi=$n,gi),1048576&e.$$.dirty[7]&&o(364,f="overlay"===en),128&e.$$.dirty[8]|8388608&e.$$.dirty[11]&&o(45,b=In&&!f),134217730&e.$$.dirty[0]&&Lr&&Object.entries(Lr).forEach((([e,t])=>{Object.entries(t).forEach((([t,i])=>{zr[e]&&o(1,zr[e][t]=i,zr)}))})),16384&e.$$.dirty[13]&&o(365,T=!ii),16777216&e.$$.dirty[7]|50331648&e.$$.dirty[11]&&vr(Ys,oo="always"===sn?k:"never"!==sn&&(k&&T),oo),4194304&e.$$.dirty[1]|33554432&e.$$.dirty[7]&&ua.set(ln?1:0,{hard:!oo}),268435456&e.$$.dirty[7]&&(x=pn?(t=pn,d=ma,Ne(Math.min(t.width,d.width),Math.min(t.height,d.height))):ma),262144&e.$$.dirty[13]&&ya.update(ui[0]),131072&e.$$.dirty[13]&&(v=di?(e,t)=>di(e,{flipX:void 0,flipY:void 0,rotation:void 0,...t,isPreview:!0}):Y),268435456&e.$$.dirty[1]&&Array.isArray(ci)&&Ji("selectionchange",[...ci]),33554432&e.$$.dirty[8]|65536&e.$$.dirty[13]&&ks.set(li&&sr),71303168&e.$$.dirty[8]&&Cs.set("pan"===or||cr),1048576&e.$$.dirty[1]&&Kt&&Fs.set(lt(Kt.x,Kt.y,Kt.width,Kt.height)),8388608&e.$$.dirty[11]|2097154&e.$$.dirty[12]&&Ct&&f&&uo&&uo.complete&&(()=>{const e=ri,t=$t(Ct);e&&e===t||(Ra.set($t(Ct)),kc())})(),8192&e.$$.dirty[11]&&o(46,J=N.length>1),32768&e.$$.dirty[1]&&(J||zs.set(tt())),1024&e.$$.dirty[0]|32768&e.$$.dirty[13]&&(Rn||Bs.set(lt(0,ni,0,0))),33554432&e.$$.dirty[11]|128&e.$$.dirty[12]&&o(367,C=!Wt&&k),1048576&e.$$.dirty[1]&&o(309,st=Kt&&Kt.width>0&&Kt.height>0),8&e.$$.dirty[0]|1610612736&e.$$.dirty[9]&&o(40,ct=st&&on&&!!j),512&e.$$.dirty[1]&&setTimeout((()=>o(294,qs=ct)),1),16777216&e.$$.dirty[7]|32768&e.$$.dirty[9]|83886080&e.$$.dirty[11]&&vr(Xs,$o="always"===sn?C:"never"!==sn&&(C&&qs&&T),$o),67108864&e.$$.dirty[7]|8388608&e.$$.dirty[11]&&Ks.set(cn||f),134217728&e.$$.dirty[7]&&dl.set(dn),134217728&e.$$.dirty[8]&&$r&&wl.set($r),4&e.$$.dirty[0]|9216&e.$$.dirty[13]&&Dr&&(Dr.dispatchEvent(qh("markupzoom",oi)),Dr.dispatchEvent(qh("zoom",Oo(oi)?oi:Yo))),4&e.$$.dirty[0]|4096&e.$$.dirty[13]&&Dr&&(Dr.dispatchEvent(qh("markuppan",Jo)),Dr.dispatchEvent(qh("pan",Jo))),512&e.$$.dirty[13]&&No&&kl(),2048&e.$$.dirty[13]&&qo&&Pl(),4198400&e.$$.dirty[1]&&G&&Xl.set(.075,{hard:!oo}),536870912&e.$$.dirty[7]&&o(362,M=gn),384&e.$$.dirty[13]&&o(363,P=Wo?-Math.max(...Object.values(Bo)):0),138936320&e.$$.dirty[1]|6291456&e.$$.dirty[11]&&Do){let e=Do.x-Ot.x,t=Ot.x+Ot.width-(Do.x+Do.width),o=Do.y-Ot.y,i=Ot.y+Ot.height-(Do.y+Do.height),n=Math.min(e,o,t,i);Jl.set(n>P?0:Math.min(M,Math.abs(n/64)),{hard:!oo})}if(67108864&e.$$.dirty[1]&&o(361,I=.55/zo),4718592&e.$$.dirty[1]|1048576&e.$$.dirty[11]&&Ot&&Ql.set({x:0,y:Ot.y,width:Ot.x<64?0:Ot.x,height:Ot.height+I},{hard:!oo}),4718592&e.$$.dirty[1]|1048576&e.$$.dirty[11]|2&e.$$.dirty[12]&&Ot&&ec.set({x:0,y:0,width:Ct.width,height:Ot.y+I},{hard:!oo}),4718592&e.$$.dirty[1]|1048576&e.$$.dirty[11]|2&e.$$.dirty[12]&&Ot){let e=Ot.x+Ot.width,t=Ct.width-(Ot.x+Ot.width);t<64&&(e+=t,t=0),ic.set({x:e,y:Ot.y,width:t,height:Ot.height+I},{hard:!oo})}if(4718592&e.$$.dirty[1]|2&e.$$.dirty[12]&&Ot&&nc.set({x:0,y:Ot.y+Ot.height,width:Ct.width,height:Ct.height-(Ot.y+Ot.height)},{hard:!oo}),33554432&e.$$.dirty[1]|72&e.$$.dirty[13]&&o(357,E=Fo&&{id:Hm,backgroundColor:Eo,opacity:Io,...Fo}),33554432&e.$$.dirty[1]|40&e.$$.dirty[13]&&o(360,A=Lo&&{id:Hm,backgroundColor:Eo,opacity:Io,...Lo}),33554432&e.$$.dirty[1]|24&e.$$.dirty[13]&&o(359,F=Ao&&{id:Hm,backgroundColor:Eo,opacity:Io,...Ao}),33554432&e.$$.dirty[1]|12&e.$$.dirty[13]&&o(358,z=Ro&&{id:Hm,backgroundColor:Eo,opacity:Io,...Ro}),983040&e.$$.dirty[11]&&o(356,D=[A,F,z,E].filter(Boolean)),32768&e.$$.dirty[11]|2&e.$$.dirty[13]&&D&&Po&&ql.update((e=>[...e.filter((e=>e.id!==Hm)),...D])),1&e.$$.dirty[9]|536870912&e.$$.dirty[12]&&ac.set(Ir||(So||void 0)),4&e.$$.dirty[0]|262144&e.$$.dirty[7]|4&e.$$.dirty[12]&&(o(235,cc=Rt),Rt&&Dr.dispatchEvent(qh("loadpreview",cc))),4194304&e.$$.dirty[12]&&po&&(wl.set(he()),yl.set(void 0),kl(),uc.set([])),1&e.$$.dirty[13]&&o(313,W=Co.index>0),1&e.$$.dirty[13]&&o(312,_=Co.index<Co.length-1),393216&e.$$.dirty[1]|768&e.$$.dirty[12]&&(V=[Dt,Et,Ht,Nt]),8&e.$$.dirty[1]&&Bc.set(Dc),1073741824&e.$$.dirty[12]&&Wc.set(ko),4096&e.$$.dirty[1]&&fs.set(G),33554432&e.$$.dirty[9]|4096&e.$$.dirty[11]&&o(304,Z=U.reduce(((e,t)=>(e[t.id]=Z&&Z[t.id]||0,e)),{})),4096&e.$$.dirty[1]&&o(79,X={name:Hc,selected:G}),4096&e.$$.dirty[11]&&o(335,q=U.map((e=>({id:e.id,icon:e.tabIcon,label:e.tabLabel})))),4096&e.$$.dirty[11]&&o(78,K=U.map((e=>e.id))),524288&e.$$.dirty[7]&&o(77,Q=Xc(["PinturaRoot","PinturaRootComponent",Qi])),2&e.$$.dirty[12]&&o(349,ee=Ct&&(Ct.width>1e3?"wide":Ct.width<600?"narrow":void 0)),2&e.$$.dirty[12]&&o(336,te=Ct&&(Ct.width<=320||Ct.height<=460)),2&e.$$.dirty[12]&&o(348,oe=Ct&&(Ct.height>1e3?"tall":Ct.height<600?"short":void 0)),4&e.$$.dirty[0]&&o(315,ie=Dr&&Dr.parentNode&&Dr.parentNode.classList.contains("PinturaModal")),1&e.$$.dirty[1]|32&e.$$.dirty[10]|2&e.$$.dirty[12]&&o(341,ne=ie&&Ct&&mc>Ct.width),2&e.$$.dirty[1]|32&e.$$.dirty[10]|2&e.$$.dirty[12]&&o(340,re=ie&&Ct&&gc>Ct.height),1073741824&e.$$.dirty[10]|1&e.$$.dirty[11]&&o(342,ae=ne&&re),1048576&e.$$.dirty[0]&&o(339,se=dr),256&e.$$.dirty[11]&&o(310,le="narrow"===ee),4096&e.$$.dirty[8]|2&e.$$.dirty[12]&&o(350,(h=Ct,w=On,ce=Ct?"auto"===w?h.width>h.height?"landscape":"portrait":"horizontal"===w?h.width<500?"portrait":"landscape":"vertical"===w?h.height<400?"landscape":"portrait":void 0:"landscape")),512&e.$$.dirty[11]&&o(76,ue="landscape"===ce),1&e.$$.dirty[10]|128&e.$$.dirty[11]&&o(338,pe=le||"short"===oe),1&e.$$.dirty[1]|2&e.$$.dirty[12]&&o(337,ge=Kc&&Ct&&mc===Ct.width&&!$c),4&e.$$.dirty[1]|268435456&e.$$.dirty[12]&&o(311,$e=[...wo||[],...Oc].filter(Boolean)),8192&e.$$.dirty[8]&&o(347,fe="has-navigation-preference-"+Bn),16384&e.$$.dirty[8]&&o(346,ye="has-navigation-preference-"+Wn),32768&e.$$.dirty[8]&&o(343,be="has-toolbar-preference-"+_n),65536&e.$$.dirty[8]&&o(345,xe="has-controlgroups-preference-"+Vn),131072&e.$$.dirty[8]&&o(344,ve="has-controltabs-preference-"+Nn),2&e.$$.dirty[12]&&o(352,we=void 0!==Ct&&Ct.width>0&&Ct.height>0),4&e.$$.dirty[0]|2048&e.$$.dirty[11]&&o(351,ke=we&&Dr&&getComputedStyle(Dr)),1024&e.$$.dirty[11]&&ke&&nd(),1024&e.$$.dirty[0]|4243456&e.$$.dirty[1]|34603008&e.$$.dirty[7]|2080374816&e.$$.dirty[10]|1023&e.$$.dirty[11]|201334784&e.$$.dirty[12]&&fc.set({...Jt,layoutMode:en,orientation:ce,horizontalSpace:ee,verticalSpace:oe,navigationHorizontalPreference:fe,navigationVerticalPreference:ye,controlGroupsVerticalPreference:xe,controlTabsVerticalpreference:ve,toolbarVerticalPreference:be,isModal:ie,isDisabled:ln,isCentered:ae,isCenteredHorizontally:ne,isCenteredVertically:re,isAnimated:oo,isTransparent:se,pointerAccuracy:xo,pointerHoverable:bo,isCompact:pe,hasSwipeNavigation:ge,hasLimitedSpace:te,hasToolbar:Rn,hasNavigation:J&&b,isIOS:Kc,browserVersion:oc()?"chrome-"+(navigator.userAgent.match(/Chrome\/([0-9]+)/)||[])[1]:void 0}),8192&e.$$.dirty[12]&&o(75,Ce=Object.entries(Jt).map((([e,t])=>/^is|has/.test(e)?t?Kh(e):void 0:t)).filter(Boolean).join(" ")),4096&e.$$.dirty[1]&&G&&zc.set([]),4096&e.$$.dirty[1]|4&e.$$.dirty[8]|33554432&e.$$.dirty[10]|8192&e.$$.dirty[12]&&o(44,Te=vn(q.map((e=>({...e,selected:G===e.id}))),{...Jt},(()=>ra.set({})))),8192&e.$$.dirty[1]&&o(74,Me=!!Te.find((e=>Array.isArray(e)))),50331648&e.$$.dirty[12]&&o(73,Pe=yo&&Object.entries(fo).filter((([,e])=>null!=e)).reduce(((e,[,t])=>e={...e,...t}),{})),2097152&e.$$.dirty[12]&&o(332,Ae=uo&&"any-to-file"===uo.task),4194304&e.$$.dirty[10]&&Ae&&Lc&&Lc.clear(),8388608&e.$$.dirty[12]&&o(334,Re=!!mo&&!!mo.translation),131072&e.$$.dirty[9]|16777216&e.$$.dirty[10]|4&e.$$.dirty[12]&&Re&&Rt&&Rt!==ld&&(o(296,ld=Rt),ad()),16777216&e.$$.dirty[10]|8388608&e.$$.dirty[12]&&Re&&sd(mo),16777216&e.$$.dirty[1]&&ho&&ho.length>1){let e=[];Lc.forEach(((t,o)=>{0!==o&&t.get().opacity<=0&&e.push(t)})),e.forEach((e=>Lc.remove(e)))}if(8&e.$$.dirty[0]|8388608&e.$$.dirty[10]&&o(39,Ee=on&&Ie.length&&function(e,t){if(R(t.labelSupportError))return t.labelSupportError(e);const o=Gn({features:e},t);return Il(t.labelSupportError,o,"{","}")}(Ie,on)),2097152&e.$$.dirty[12]&&o(324,Le=uo&&!!uo.error),2097152&e.$$.dirty[12]&&o(42,Fe=!uo||!uo.complete&&void 0===uo.task),2097152&e.$$.dirty[12]&&o(325,ze=uo&&(uo.taskLengthComputable?uo.taskProgress:1/0)),4194304&e.$$.dirty[10]&&Ae&&vr(rc,lo=!1,lo),4194304&e.$$.dirty[1]|262144&e.$$.dirty[9]|2097152&e.$$.dirty[12]&&uo&&uo.complete){const e=oo?250:0;clearTimeout(dd),o(297,dd=setTimeout((()=>{vr(rc,lo=!0,lo)}),e))}if(2048&e.$$.dirty[1]|16384&e.$$.dirty[10]|2621440&e.$$.dirty[12]&&o(329,De=uo&&!Le&&!Fe&&!lo),65536&e.$$.dirty[9]|4194308&e.$$.dirty[12]&&o(328,Oe=!(!po||Rt&&!sc)),4194304&e.$$.dirty[1]|524288&e.$$.dirty[12])if(lo){setTimeout((()=>id.set(1,{hard:!oo})),oo?500:0)}else id.set(0,{hard:!oo});if(1064960&e.$$.dirty[12]&&o(323,Be=!!(to||co&&void 0!==co.progress&&!co.complete)),8192&e.$$.dirty[10]&&Be&&Yr(),2048&e.$$.dirty[1]|2097152&e.$$.dirty[12]&&o(326,We=uo&&!(uo.error||Fe)),8&e.$$.dirty[0]|2097152&e.$$.dirty[12]&&o(327,_e=on&&function(e,t){const o=e?!e.complete||e.error?e:{task:"blob-to-bitmap",progress:1/0}:void 0;let i=R(t.statusLabelLoadImage)?t.statusLabelLoadImage(o):jn({state:o},t);return e&&e.error&&e.error.metadata&&(i=Il(i,e.error.metadata,"{","}")),i}(uo,on)),8&e.$$.dirty[0]|1048576&e.$$.dirty[12]&&o(322,Ve=co&&on&&function(e,t){return R(t.statusLabelProcessImage)?t.statusLabelProcessImage(e):Un({state:e},t)}(co,on)),1048576&e.$$.dirty[12]&&o(320,He=co&&(co.taskLengthComputable?co.taskProgress:1/0)),1048576&e.$$.dirty[12]&&o(321,je=co&&!co.error),1048576&e.$$.dirty[12]&&o(319,Ue=!(!co||!co.error)),8&e.$$.dirty[0]|2048&e.$$.dirty[1]|131072&e.$$.dirty[7]|1048064&e.$$.dirty[10])if(Hn){let e,t,i,n,r;m(Hn)&&(e=Hn),Oo(Hn)?t=Hn:Array.isArray(Hn)&&([e,t,r]=Hn,!1===t&&(n=!0),Oo(t)&&(i=!0)),o(35,pd=(e||t)&&{text:e,aside:n||i,progressIndicator:{visible:i,progress:t},closeButton:n&&{label:on.statusLabelButtonClose,icon:on.statusIconButtonClose,onclick:r||(()=>o(234,Hn=void 0))}})}else o(35,pd=on&&Fe||Le||De||Oe?{text:_e,aside:Le||We,progressIndicator:{visible:We,progress:ze},closeButton:Le&&{label:on.statusLabelButtonClose,icon:on.statusIconButtonClose,onclick:bd}}:on&&Be&&Ve?{text:Ve,aside:Ue||je,progressIndicator:{visible:je,progress:He},closeButton:Ue&&{label:on.statusLabelButtonClose,icon:on.statusIconButtonClose,onclick:xd}}:void 0);if(131072&e.$$.dirty[7]&&o(331,Ge=void 0!==Hn),4194304&e.$$.dirty[1]|32&e.$$.dirty[10]|1048576&e.$$.dirty[12]&&ie&&co&&co.complete&&(ud.set(!0),setTimeout((()=>ud.set(!1)),oo?100:0)),4&e.$$.dirty[0]|4096&e.$$.dirty[1]|524288&e.$$.dirty[12]&&lo&&Dr&&Dr.dispatchEvent(qh("selectutil",G)),2304&e.$$.dirty[1]|2908160&e.$$.dirty[10]|262144&e.$$.dirty[12]&&o(330,Ze=so||Ee||Fe||Le||De||Oe||Be||Ge),1048576&e.$$.dirty[10]&&vr(cd,ao=Ze?1:0,ao),4194304&e.$$.dirty[1]|1048576&e.$$.dirty[10]&&cd.set(Ze?1:0,{duration:oo?500:1}),8388608&e.$$.dirty[1]&&o(41,Xe=ao>0),16&e.$$.dirty[1]&&o(318,Ye=!(!pd||!pd.aside)),4195344&e.$$.dirty[1]|524288&e.$$.dirty[9]|256&e.$$.dirty[10]|131072&e.$$.dirty[12]&&Xe&&pd){clearTimeout(yd);const e={hard:!1===oo};if(Ye){const t=!!pd.error||!oo;md.set(1,e),hd.set(ro,{hard:t}),o(298,yd=setTimeout((()=>{gd.set(16,e)}),1))}else md.set(0,e),o(298,yd=setTimeout((()=>{gd.set(0,e)}),1))}if(1024&e.$$.dirty[1]&&(Xe||(fd.set(void 0,{hard:!0}),hd.set(void 0,{hard:!0}),gd.set(0,{hard:!0}))),65536&e.$$.dirty[12]&&o(317,qe=.5*no),128&e.$$.dirty[10]|32768&e.$$.dirty[12]&&o(72,Ke=`translateX(${io-qe}px)`),256&e.$$.dirty[1]|12&e.$$.dirty[12]&&o(38,vt=Rt&&At&&!Ee),128&e.$$.dirty[1]|96&e.$$.dirty[10]&&o(314,Qe=Je&&(vt||ie)?vd:r),16&e.$$.dirty[10]&&o(71,it=Qe),16&e.$$.dirty[10]&&o(70,nt=Qe),8&e.$$.dirty[0]|2097152&e.$$.dirty[1]|370&e.$$.dirty[8]|15&e.$$.dirty[10]|8192&e.$$.dirty[12]&&o(69,at=on&&eo&&cm((()=>xn([["div","alpha",{class:"PinturaNavGroup"},[["div","alpha-set",{class:"PinturaNavSet"},[En&&["Button","close",{label:on.labelClose,icon:on.iconButtonClose,onclick:()=>Ji("close"),hideLabel:!0}],Cn&&["Button","revert",{label:on.labelButtonRevert,icon:on.iconButtonRevert,disabled:!W,onclick:Tc,hideLabel:!0}]]]]],["div","beta",{class:"PinturaNavGroup PinturaNavGroupFloat"},[Tn&&["div","history",{class:"PinturaNavSet"},[["Button","undo",{label:on.labelButtonUndo,icon:on.iconButtonUndo,disabled:!W,onclick:Sc.undo,hideLabel:!0}],["Button","redo",{label:on.labelButtonRedo,icon:on.iconButtonRedo,disabled:!_,onclick:Sc.redo,hideLabel:!0}]]],$e.length&&["div","plugin-tools",{class:"PinturaNavSet"},$e.filter(Boolean).map((([e,t,o])=>[e,t,{...o}]))]]],["div","gamma",{class:"PinturaNavGroup"},[kn&&["Button","export",{label:on.labelButtonExport,icon:le&&on.iconButtonExport,class:"PinturaButtonExport",onclick:Ec,hideLabel:le}]]]],{...Jt},(()=>ra.set({})))))),512&e.$$.dirty[12]&&o(306,pt=Ht&&!!Ht.length),134217728&e.$$.dirty[9]|520&e.$$.dirty[12]&&o(305,ht=pt&&er(At,Ht)),201326592&e.$$.dirty[9]|6148&e.$$.dirty[12]&&pt&&((e,t,i,n)=>{if(!t||!e||Md===t)return;Md=t;const r={dataSizeScalar:i};n&&n[3]>0&&(r.backgroundColor=[...n]),t(e,r).then((e=>{Td&&y(Td),e.setAttribute("data-retain",!0),o(299,Td=e)}))})(Rt,Xt,ht,Zt),1048576&e.$$.dirty[9]|1544&e.$$.dirty[12]&&Ht&&Td&&At){const{width:e,height:t}=At,i=Qt()?"pixelated":"auto"===Gt?"auto":"pixelated";o(300,Rd=Ht.map((o=>{const n=lt(o.x,o.y,o.width,o.height),r=bt(et(n),o.rotation).map((o=>me(o.x/e,o.y/t)));return{...o,id:"redaction",flipX:!1,flipY:!1,cornerRadius:0,strokeWidth:0,strokeColor:void 0,backgroundColor:[0,0,0,0],backgroundImage:Td,backgroundImageRendering:i,backgroundCorners:r}})))}2097152&e.$$.dirty[9]|256&e.$$.dirty[12]&&o(37,ft=[...Rd,...Nt||[]]),32&e.$$.dirty[1]&&Pd&&Id.set(Pd),4&e.$$.dirty[0]|128&e.$$.dirty[1]&&vt&&Dr&&Dr.dispatchEvent(qh("ready")),262144&e.$$.dirty[1]&&o(63,Gd=!0),120&e.$$.dirty[12]&&o(64,Zd=!0),131072&e.$$.dirty[1]&&o(65,Xd=!0),65536&e.$$.dirty[1]&&o(66,Yd=!0),64&e.$$.dirty[1]&&o(67,qd=!0),2&e.$$.dirty[12]&&o(303,wt=!!Ct&&Ct.height>0),29360128&e.$$.dirty[9]&&!i&&wt&&(clearTimeout(Kd),o(301,Kd=setTimeout((()=>{i||Ps("locale")}),32)))},o(366,k=!Nc()),B=1===zd()?e=>{e&&(Se(e.origin,Math.round),Se(e.translation,Math.round))}:Y,o(333,Ie=[!om()&&"WebGL"].filter(Boolean)),o(316,Je=vo()||w()&&O()),o(68,yt=((e,t=!0)=>o=>{"ping"===o.type&&(t&&o.stopPropagation(),e(o.detail.type,o.detail.data))})(Ki.pub)),[wr,zr,Dr,on,nn,un,hn,mn,$n,bn,Rn,Dn,Zn,Yn,qn,Kn,Jn,rr,ar,lr,dr,mr,gr,fr,yr,br,xr,Lr,fa,lc,Sc,mc,gc,Oc,Dc,pd,Pd,ft,vt,Ee,ct,Xe,Fe,G,Te,b,J,It,Et,Dt,Ot,Kt,eo,oo,ao,ho,Eo,zo,Do,ci,Pr,Rr,Gc,Gd,Zd,Xd,Yd,qd,yt,at,nt,it,Ke,Pe,Me,Ce,ue,Q,K,X,Mo,mi,Si,ki,Ci,Ti,Ri,Ii,Ei,Li,Fi,Di,Oi,Wi,_i,Vi,Ni,Hi,ji,Ui,Gi,Zi,Xi,Br,Wr,_r,ta,ra,ca,ua,ba,xa,va,wa,Sa,ka,Ta,Ma,Pa,Ra,Ia,Ea,Oa,_a,Va,Na,Ja,Qa,es,ts,os,is,ns,as,ss,ls,cs,ds,us,ps,ys,bs,xs,ws,Ss,ks,Cs,Ts,Ms,Rs,Is,Es,Ls,Fs,zs,Ds,Bs,Ws,_s,Vs,Hs,Gs,Xs,Ys,Ks,Js,Qs,el,ol,il,nl,rl,ul,pl,ml,$l,fl,yl,xl,vl,wl,Cl,Ml,Rl,jl,ql,Kl,Jl,Ql,ec,ic,nc,rc,ac,dc,uc,pc,fc,wc,Ic,Lc,zc,Vc,Zc,Yc,qc,(e,t)=>t[e],e=>U.find((t=>t.id===e)).view,ed,td,od,id,({target:e,propertyName:t})=>{e===Dr&&/background|outline/.test(t)&&ke&&nd()},rd,cd,ud,hd,md,gd,$d,fd,e=>{const t=!(!pd||!pd.closeButton)||!oo;$d.set(e.detail.width,{hard:t}),fd.set(Math.round(.5*-e.detail.width),{hard:t})},wd,Sd,e=>{const{keyCode:t,metaKey:o,ctrlKey:i,shiftKey:n}=e;if(9===t&&ln)return void e.preventDefault();if(e.target&&32===t&&Dr.contains(e.target)&&!_d(e.target)&&(qt&&a&&Kr(),e.preventDefault()),90===t&&(o||i))return void(n&&o?Sc.redo():Sc.undo());if(89===t&&i)return void Sc.redo();if(229===t)return;const r=new Set([...Yt,t]);Sd.set(Array.from(r))},({key:e,keyCode:t})=>{if("Meta"===e)return Sd.set([]);Sd.set(Yt.filter((e=>e!==t)))},()=>{Sd.set([])},e=>{_d(e.target)||e.preventDefault()},e=>{Ln&&kd(e.detail.resources[0])},()=>{zn&&lm().then(Cd)},e=>{if(!Fn)return;const t=$s((window.innerWidth-Math.abs(Ct.x))/Ct.width,0,1),o=$s((window.innerHeight-Math.abs(Ct.y))/Ct.height,0,1);t<.75&&o<.75||kd((e.clipboardData||window.clipboardData).files[0])},Ed,Ud,e=>{Mt&>(e.detail,Mt)||vr(Ws,Mt=e.detail,Mt)},Hn,cc,Qi,en,tn,rn,an,sn,ln,cn,dn,pn,gn,fn,yn,xn,vn,Sn,kn,Cn,Tn,In,En,Ln,Fn,zn,On,Bn,Wn,_n,Vn,Nn,jn,Un,Gn,Xn,or,ir,nr,sr,cr,$r,Sr,()=>o(60,Pr=void 0),(e,t,i)=>{const{text:n="",placeholder:r="",autoClose:a=!0,align:s="top",justify:l="center",buttonConfirm:c,buttonCancel:d}=i;o(60,Pr={align:s,justify:l,text:n,placeholder:r,buttonConfirm:c,buttonCancel:d,onconfirm:()=>{e(Rr.value),a&&o(60,Pr=void 0)},oncancel:()=>{t(void 0),o(60,Pr=void 0)}})},Ir,Er,Ar,Fr,Xr,Yr,qr,Kr,Jr,Qr,ea,oa,ia,na,da,qs,sc,ld,dd,yd,Td,Rd,Kd,i,wt,Z,ht,pt,a,j,st,le,$e,_,W,Qe,ie,Je,qe,Ye,Ue,He,je,Ve,Be,Le,ze,We,_e,Oe,De,Ze,Ge,Ae,Ie,Re,q,te,ge,pe,se,re,ne,ae,be,ve,xe,ye,fe,oe,ee,ce,ke,we,U,N,H,D,E,z,F,A,I,M,P,f,T,k,C,l,g,s,p,n,Ct,Rt,At,Lt,Ft,zt,Wt,Nt,Ht,Gt,Zt,Xt,Jt,to,io,no,ro,so,lo,co,uo,po,mo,fo,yo,bo,xo,wo,So,ko,Co,Po,Ro,Io,Ao,Lo,Fo,Bo,Wo,No,Yo,qo,Jo,oi,ii,ni,li,di,ui,pi,$i,fi,yi,bi,vi,wi,function(){o(31,mc=$m.innerWidth),o(32,gc=$m.innerHeight)},e=>vr(Bs,Ci=e.detail,Ci),({detail:e})=>o(43,G=e),function(t,i){e.$$.not_equal(zr[i],t)&&(zr[i]=t,o(1,zr),o(281,Ar),o(27,Lr))},e=>Zc(e),e=>Yc(e),(e,{detail:t})=>qc(e,t),e=>vr(zs,Mo=e.detail,Mo),function(t){e.$$.not_equal(zr[G],t)&&(zr[G]=t,o(1,zr),o(281,Ar),o(27,Lr))},()=>Zc(G),()=>Yc(G),({detail:e})=>qc(G,e),e=>{const t={...e,...Ed()},{annotationShapes:o,decorationShapes:i,interfaceShapes:n,frameShapes:r,selectionShapes:a}=bn({annotationShapes:Dt,decorationShapes:Et,interfaceShapes:_i,frameShapes:It,selectionShapes:ci},t);return Ud(t,ft,o,i,n,r,a)},()=>{o(63,Gd=!1),o(64,Zd=!1),o(65,Xd=!1),o(66,Yd=!1),o(67,qd=!1)},function(e){pa[e?"unshift":"push"]((()=>{Pd=e,o(36,Pd)}))},function(e){wr=e,o(0,wr),o(269,Xn)},function(e){Oc=e,o(33,Oc)},function(e){Dc=e,o(34,Dc)},function(e){pa[e?"unshift":"push"]((()=>{Rr=e,o(61,Rr)}))},function(e){pa[e?"unshift":"push"]((()=>{Dr=e,o(2,Dr)}))},e=>vr(Ls,Kt=e.detail,Kt)]}class Gm extends Ga{constructor(e){super(),Ua(this,e,Um,Vm,lr,{class:236,layout:237,stores:238,locale:3,id:4,util:239,utils:240,animations:241,disabled:242,previewUpscale:243,previewPad:244,previewMaskOpacity:5,previewImageDataMaxSize:245,previewImageTextPixelRatio:6,markupMaskOpacity:7,zoomMaskOpacity:246,elasticityMultiplier:8,willRevert:247,willProcessImage:248,willRenderCanvas:9,willRenderToolbar:249,willRenderUtilTabs:250,willSetHistoryInitialState:251,enableButtonExport:252,enableButtonRevert:253,enableNavigateHistory:254,enableToolbar:10,enableUtils:255,enableButtonClose:256,enableDropImage:257,enablePasteImage:258,enableBrowseImage:259,enableTransparencyGrid:11,layoutDirectionPreference:260,layoutHorizontalUtilsPreference:261,layoutVerticalUtilsPreference:262,layoutVerticalToolbarPreference:263,layoutVerticalControlGroupsPreference:264,layoutVerticalControlTabsPreference:265,status:234,formatStatusImageLoading:266,formatStatusImageProcessing:267,formatStatusSupportError:268,textDirection:12,markupEditorZoomLevel:269,markupEditorZoomLevels:13,markupEditorZoomAdjustStep:14,markupEditorZoomAdjustFactor:15,markupEditorZoomAdjustWheelFactor:16,markupEditorInteractionMode:270,muteAudio:271,willSetMediaInitialTimeOffset:272,enablePan:17,enableZoom:18,enableZoomControls:273,enableZoomInput:19,enablePanInput:274,enableCanvasAlpha:20,enablePanLimit:21,panLimitGutterScalar:22,pan:275,zoomPresetOptions:23,zoomAdjustStep:24,zoomAdjustFactor:25,zoomAdjustWheelFactor:26,zoomLevel:0,fixScrollDirection:276,hideTextInput:277,showTextInput:278,imagePreviewSrc:279,imageOrienter:280,pluginComponents:281,pluginOptions:27,sub:282,pluginInterface:1,root:2,play:283,pause:284,isPaused:285,togglePlayPause:286,mute:287,unmute:288,toggleMute:289,getDuration:290,getCurrentTime:291,setCurrentTime:292,imageSourceToImageData:28,imagePreview:29,imagePreviewCurrent:235,history:30},null,[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1])}get class(){return this.$$.ctx[236]}set class(e){this.$$set({class:e}),ka()}get layout(){return this.$$.ctx[237]}set layout(e){this.$$set({layout:e}),ka()}get stores(){return this.$$.ctx[238]}set stores(e){this.$$set({stores:e}),ka()}get locale(){return this.$$.ctx[3]}set locale(e){this.$$set({locale:e}),ka()}get id(){return this.$$.ctx[4]}set id(e){this.$$set({id:e}),ka()}get util(){return this.$$.ctx[239]}set util(e){this.$$set({util:e}),ka()}get utils(){return this.$$.ctx[240]}set utils(e){this.$$set({utils:e}),ka()}get animations(){return this.$$.ctx[241]}set animations(e){this.$$set({animations:e}),ka()}get disabled(){return this.$$.ctx[242]}set disabled(e){this.$$set({disabled:e}),ka()}get previewUpscale(){return this.$$.ctx[243]}set previewUpscale(e){this.$$set({previewUpscale:e}),ka()}get previewPad(){return this.$$.ctx[244]}set previewPad(e){this.$$set({previewPad:e}),ka()}get previewMaskOpacity(){return this.$$.ctx[5]}set previewMaskOpacity(e){this.$$set({previewMaskOpacity:e}),ka()}get previewImageDataMaxSize(){return this.$$.ctx[245]}set previewImageDataMaxSize(e){this.$$set({previewImageDataMaxSize:e}),ka()}get previewImageTextPixelRatio(){return this.$$.ctx[6]}set previewImageTextPixelRatio(e){this.$$set({previewImageTextPixelRatio:e}),ka()}get markupMaskOpacity(){return this.$$.ctx[7]}set markupMaskOpacity(e){this.$$set({markupMaskOpacity:e}),ka()}get zoomMaskOpacity(){return this.$$.ctx[246]}set zoomMaskOpacity(e){this.$$set({zoomMaskOpacity:e}),ka()}get elasticityMultiplier(){return this.$$.ctx[8]}set elasticityMultiplier(e){this.$$set({elasticityMultiplier:e}),ka()}get willRevert(){return this.$$.ctx[247]}set willRevert(e){this.$$set({willRevert:e}),ka()}get willProcessImage(){return this.$$.ctx[248]}set willProcessImage(e){this.$$set({willProcessImage:e}),ka()}get willRenderCanvas(){return this.$$.ctx[9]}set willRenderCanvas(e){this.$$set({willRenderCanvas:e}),ka()}get willRenderToolbar(){return this.$$.ctx[249]}set willRenderToolbar(e){this.$$set({willRenderToolbar:e}),ka()}get willRenderUtilTabs(){return this.$$.ctx[250]}set willRenderUtilTabs(e){this.$$set({willRenderUtilTabs:e}),ka()}get willSetHistoryInitialState(){return this.$$.ctx[251]}set willSetHistoryInitialState(e){this.$$set({willSetHistoryInitialState:e}),ka()}get enableButtonExport(){return this.$$.ctx[252]}set enableButtonExport(e){this.$$set({enableButtonExport:e}),ka()}get enableButtonRevert(){return this.$$.ctx[253]}set enableButtonRevert(e){this.$$set({enableButtonRevert:e}),ka()}get enableNavigateHistory(){return this.$$.ctx[254]}set enableNavigateHistory(e){this.$$set({enableNavigateHistory:e}),ka()}get enableToolbar(){return this.$$.ctx[10]}set enableToolbar(e){this.$$set({enableToolbar:e}),ka()}get enableUtils(){return this.$$.ctx[255]}set enableUtils(e){this.$$set({enableUtils:e}),ka()}get enableButtonClose(){return this.$$.ctx[256]}set enableButtonClose(e){this.$$set({enableButtonClose:e}),ka()}get enableDropImage(){return this.$$.ctx[257]}set enableDropImage(e){this.$$set({enableDropImage:e}),ka()}get enablePasteImage(){return this.$$.ctx[258]}set enablePasteImage(e){this.$$set({enablePasteImage:e}),ka()}get enableBrowseImage(){return this.$$.ctx[259]}set enableBrowseImage(e){this.$$set({enableBrowseImage:e}),ka()}get enableTransparencyGrid(){return this.$$.ctx[11]}set enableTransparencyGrid(e){this.$$set({enableTransparencyGrid:e}),ka()}get layoutDirectionPreference(){return this.$$.ctx[260]}set layoutDirectionPreference(e){this.$$set({layoutDirectionPreference:e}),ka()}get layoutHorizontalUtilsPreference(){return this.$$.ctx[261]}set layoutHorizontalUtilsPreference(e){this.$$set({layoutHorizontalUtilsPreference:e}),ka()}get layoutVerticalUtilsPreference(){return this.$$.ctx[262]}set layoutVerticalUtilsPreference(e){this.$$set({layoutVerticalUtilsPreference:e}),ka()}get layoutVerticalToolbarPreference(){return this.$$.ctx[263]}set layoutVerticalToolbarPreference(e){this.$$set({layoutVerticalToolbarPreference:e}),ka()}get layoutVerticalControlGroupsPreference(){return this.$$.ctx[264]}set layoutVerticalControlGroupsPreference(e){this.$$set({layoutVerticalControlGroupsPreference:e}),ka()}get layoutVerticalControlTabsPreference(){return this.$$.ctx[265]}set layoutVerticalControlTabsPreference(e){this.$$set({layoutVerticalControlTabsPreference:e}),ka()}get status(){return this.$$.ctx[234]}set status(e){this.$$set({status:e}),ka()}get formatStatusImageLoading(){return this.$$.ctx[266]}set formatStatusImageLoading(e){this.$$set({formatStatusImageLoading:e}),ka()}get formatStatusImageProcessing(){return this.$$.ctx[267]}set formatStatusImageProcessing(e){this.$$set({formatStatusImageProcessing:e}),ka()}get formatStatusSupportError(){return this.$$.ctx[268]}set formatStatusSupportError(e){this.$$set({formatStatusSupportError:e}),ka()}get textDirection(){return this.$$.ctx[12]}set textDirection(e){this.$$set({textDirection:e}),ka()}get markupEditorZoomLevel(){return this.$$.ctx[269]}set markupEditorZoomLevel(e){this.$$set({markupEditorZoomLevel:e}),ka()}get markupEditorZoomLevels(){return this.$$.ctx[13]}set markupEditorZoomLevels(e){this.$$set({markupEditorZoomLevels:e}),ka()}get markupEditorZoomAdjustStep(){return this.$$.ctx[14]}set markupEditorZoomAdjustStep(e){this.$$set({markupEditorZoomAdjustStep:e}),ka()}get markupEditorZoomAdjustFactor(){return this.$$.ctx[15]}set markupEditorZoomAdjustFactor(e){this.$$set({markupEditorZoomAdjustFactor:e}),ka()}get markupEditorZoomAdjustWheelFactor(){return this.$$.ctx[16]}set markupEditorZoomAdjustWheelFactor(e){this.$$set({markupEditorZoomAdjustWheelFactor:e}),ka()}get markupEditorInteractionMode(){return this.$$.ctx[270]}set markupEditorInteractionMode(e){this.$$set({markupEditorInteractionMode:e}),ka()}get muteAudio(){return this.$$.ctx[271]}set muteAudio(e){this.$$set({muteAudio:e}),ka()}get willSetMediaInitialTimeOffset(){return this.$$.ctx[272]}set willSetMediaInitialTimeOffset(e){this.$$set({willSetMediaInitialTimeOffset:e}),ka()}get enablePan(){return this.$$.ctx[17]}set enablePan(e){this.$$set({enablePan:e}),ka()}get enableZoom(){return this.$$.ctx[18]}set enableZoom(e){this.$$set({enableZoom:e}),ka()}get enableZoomControls(){return this.$$.ctx[273]}set enableZoomControls(e){this.$$set({enableZoomControls:e}),ka()}get enableZoomInput(){return this.$$.ctx[19]}set enableZoomInput(e){this.$$set({enableZoomInput:e}),ka()}get enablePanInput(){return this.$$.ctx[274]}set enablePanInput(e){this.$$set({enablePanInput:e}),ka()}get enableCanvasAlpha(){return this.$$.ctx[20]}set enableCanvasAlpha(e){this.$$set({enableCanvasAlpha:e}),ka()}get enablePanLimit(){return this.$$.ctx[21]}set enablePanLimit(e){this.$$set({enablePanLimit:e}),ka()}get panLimitGutterScalar(){return this.$$.ctx[22]}set panLimitGutterScalar(e){this.$$set({panLimitGutterScalar:e}),ka()}get pan(){return this.$$.ctx[275]}set pan(e){this.$$set({pan:e}),ka()}get zoomPresetOptions(){return this.$$.ctx[23]}set zoomPresetOptions(e){this.$$set({zoomPresetOptions:e}),ka()}get zoomAdjustStep(){return this.$$.ctx[24]}set zoomAdjustStep(e){this.$$set({zoomAdjustStep:e}),ka()}get zoomAdjustFactor(){return this.$$.ctx[25]}set zoomAdjustFactor(e){this.$$set({zoomAdjustFactor:e}),ka()}get zoomAdjustWheelFactor(){return this.$$.ctx[26]}set zoomAdjustWheelFactor(e){this.$$set({zoomAdjustWheelFactor:e}),ka()}get zoomLevel(){return this.$$.ctx[0]}set zoomLevel(e){this.$$set({zoomLevel:e}),ka()}get fixScrollDirection(){return this.$$.ctx[276]}set fixScrollDirection(e){this.$$set({fixScrollDirection:e}),ka()}get hideTextInput(){return this.$$.ctx[277]}get showTextInput(){return this.$$.ctx[278]}get imagePreviewSrc(){return this.$$.ctx[279]}set imagePreviewSrc(e){this.$$set({imagePreviewSrc:e}),ka()}get imageOrienter(){return this.$$.ctx[280]}set imageOrienter(e){this.$$set({imageOrienter:e}),ka()}get pluginComponents(){return this.$$.ctx[281]}set pluginComponents(e){this.$$set({pluginComponents:e}),ka()}get pluginOptions(){return this.$$.ctx[27]}set pluginOptions(e){this.$$set({pluginOptions:e}),ka()}get sub(){return this.$$.ctx[282]}get pluginInterface(){return this.$$.ctx[1]}get root(){return this.$$.ctx[2]}set root(e){this.$$set({root:e}),ka()}get play(){return this.$$.ctx[283]}get pause(){return this.$$.ctx[284]}get isPaused(){return this.$$.ctx[285]}get togglePlayPause(){return this.$$.ctx[286]}get mute(){return this.$$.ctx[287]}get unmute(){return this.$$.ctx[288]}get toggleMute(){return this.$$.ctx[289]}get getDuration(){return this.$$.ctx[290]}get getCurrentTime(){return this.$$.ctx[291]}get setCurrentTime(){return this.$$.ctx[292]}get imageSourceToImageData(){return this.$$.ctx[28]}set imageSourceToImageData(e){this.$$set({imageSourceToImageData:e}),ka()}get imagePreview(){return this.$$.ctx[29]}get imagePreviewCurrent(){return this.$$.ctx[235]}set imagePreviewCurrent(e){this.$$set({imagePreviewCurrent:e}),ka()}get history(){return this.$$.ctx[30]}}"undefined"!=typeof window&&(e=>{if(e&&e._v94ofot)return;const[t,o,i]=[[99,111,110,115,111,108,101],[108,111,103],[84,104,105,115,32,118,101,114,115,105,111,110,32,111,102,32,80,105,110,116,117,114,97,32,105,115,32,102,111,114,32,116,101,115,116,105,110,103,32,112,117,114,112,111,115,101,115,32,111,110,108,121,46,32,86,105,115,105,116,32,104,116,116,112,115,58,47,47,112,113,105,110,97,46,110,108,47,112,105,110,116,117,114,97,32,116,111,32,112,117,114,99,104,97,115,101,32,97,32,108,105,99,101,110,115,101,46,32,86,105,115,105,116,32,104,116,116,112,115,58,47,47,112,113,105,110,97,46,110,108,47,112,105,110,116,117,114,97,47,99,104,97,116,32,105,102,32,121,111,117,32,104,97,118,101,32,97,110,121,32,113,117,101,115,116,105,111,110,115,46]].map((e=>e.map((e=>String.fromCharCode(e))).join("")));e&&e[t]&&e[t][o](i)})(window);const Zm=["klass","stores","isVisible","isActive","isActiveFraction","locale"],Xm=["history","klass","stores","navButtons","pluginComponents","pluginInterface","pluginOptions","sub","imagePreviewSrc","imagePreview","imagePreviewCurrent"],Ym=["locale"];let qm;const Km=new Set([]),Jm={},Qm=new Map,eg=(...e)=>{e.filter((e=>!!e.util)).forEach((e=>{const[t,o,i=(()=>!0)]=e.util;Qm.has(t)||(Qm.set(t,{Component:o,isSupported:i}),$d(o).filter((e=>!Zm.includes(e))).forEach((e=>{Km.add(e),Jm[e]?Jm[e].push(t):Jm[e]=[t]})))}))};var tg=[...Rs,"init","update","undo","redo","revert","writehistory","destroy","show","hide","close","ready","zoom","pan","loadpreview","selectshape","blurshape","updateshape","addshape","removeshape","selectstyle","markuptap","markupzoom","markuppan","selectutil","selectcontrol","selectiondown","selectionup","selectionchange"];var og=(e,t,o={})=>{const{prefix:i="pintura:"}=o;return tg.map((o=>e.on(o,(e=>jt(t)?((e,t,o)=>e.dispatchEvent(new CustomEvent(t,{detail:o,bubbles:!0,cancelable:!0})))(t,`${i}${o}`,e):t(o,e)))))};const ig=e=>m(e[0]),ng=e=>!ig(e),rg=e=>e[1],ag=e=>e[3]||[];const sg=(e,t,o,i=(e=>e))=>{const n=dg(t,o),r=n.findIndex((e=>rg(e)===t));var a,s,l;a=n,s=i(r),l=e,a.splice(s,0,l)},lg=(e,t)=>{const o=dg(e,t);return Sh(o,(t=>rg(t)===e)),o},cg=(e,t)=>{if(t&&t.length){if(ig(t)){if(rg(t)===e)return t;const o=cg(e,ag(t));if(o)return o}if(ng(t))for(const o of t){const t=cg(e,o);if(t)return t}}},dg=(e,t)=>{if(ng(t)){if(t.find((t=>rg(t)===e)))return t;const o=t.find((t=>dg(e,ag(t))));return o&&o[3]}return dg(e,ag(t))},ug=()=>[.75,.25,.25,0,0,.25,.75,.25,0,0,.25,.25,.75,0,0,0,0,0,1,0],pg=()=>[1.398,-.316,.065,-.273,.201,-.051,1.278,-.08,-.273,.201,-.051,.119,1.151,-.29,.215,0,0,0,1,0],hg=()=>[1.073,-.015,.092,-.115,-.017,.107,.859,.184,-.115,-.017,.015,.077,1.104,-.115,-.017,0,0,0,1,0],mg=()=>[1.06,0,0,0,0,0,1.01,0,0,0,0,0,.93,0,0,0,0,0,1,0],gg=()=>[1.1,0,0,0,-.1,0,1.1,0,0,-.1,0,0,1.2,0,-.1,0,0,0,1,0],$g=()=>[.212,.715,.114,0,0,.212,.715,.114,0,0,.212,.715,.114,0,0,0,0,0,1,0],fg=()=>[.15,1.3,-.25,.1,-.2,.15,1.3,-.25,.1,-.2,.15,1.3,-.25,.1,-.2,0,0,0,1,0],yg=()=>[.163,.518,.084,-.01,.208,.163,.529,.082,-.02,.21,.171,.529,.084,0,.214,0,0,0,1,0],bg=()=>[.338,.991,.117,.093,-.196,.302,1.049,.096,.078,-.196,.286,1.016,.146,.101,-.196,0,0,0,1,0],xg=()=>[.393,.768,.188,0,0,.349,.685,.167,0,0,.272,.533,.13,0,0,0,0,0,1,0],vg=()=>[.289,.62,.185,0,.077,.257,.566,.163,0,.115,.2,.43,.128,0,.188,0,0,0,1,0],wg=()=>[.269,.764,.172,.05,.1,.239,.527,.152,0,.176,.186,.4,.119,0,.159,0,0,0,1,0],Sg=()=>[.547,.764,.134,0,-.147,.281,.925,.12,0,-.135,.225,.558,.33,0,-.113,0,0,0,1,0],kg={chrome:pg,fade:hg,pastel:ug,cold:gg,warm:mg,monoDefault:$g,monoWash:yg,monoNoir:fg,monoStark:bg,sepiaDefault:xg,sepiaRust:wg,sepiaBlues:vg,sepiaColor:Sg};var Cg={filterFunctions:kg,filterOptions:[["Default",[[void 0,e=>e.labelDefault]]],["Classic",[["chrome",e=>e.filterLabelChrome],["fade",e=>e.filterLabelFade],["cold",e=>e.filterLabelCold],["warm",e=>e.filterLabelWarm],["pastel",e=>e.filterLabelPastel]]],["Monochrome",[["monoDefault",e=>e.filterLabelMonoDefault],["monoNoir",e=>e.filterLabelMonoNoir],["monoStark",e=>e.filterLabelMonoStark],["monoWash",e=>e.filterLabelMonoWash]]],["Sepia",[["sepiaDefault",e=>e.filterLabelSepiaDefault],["sepiaRust",e=>e.filterLabelSepiaRust],["sepiaBlues",e=>e.filterLabelSepiaBlues],["sepiaColor",e=>e.filterLabelSepiaColor]]]]};const Tg={borderColor:"strokeColor",borderWidth:"strokeWidth",lineWidth:"strokeWidth",fontColor:"color",lineColor:"strokeColor",src:"backgroundImage",fit:"backgroundSize"},Mg=e=>0===e||"0%"===e||"0px"===e?0:/px$/.test(e)?parseInt(e,10):/\%$/.test(e)?e:e<=1?100*e+"%":void 0,Pg=(e,t)=>{let o,i;return/%$/.test(e)?(o=parseFloat(e),i=parseFloat(t),o+i+"%"):/px$/.test(e)?(o=parseInt(e,10),i=parseInt(t,10),o+i+"px"):void 0},Rg=(e,t)=>{const o=e,i=t,n=1.5707963267948966-t,r=Math.sin(1.5707963267948966),a=Math.sin(i),s=Math.sin(n),l=Math.cos(n),c=o/r;return me(l*(c*a),l*(c*s))},Ig=(e,{flip:t,aspectRatio:o,rotation:i,center:n,zoom:r,scaleToFit:a})=>{const s={flipX:!1,flipY:!1},l=!n||n&&.5===n.x&&.5===n.y;t&&t.horizontal&&(s.flipX=t.horizontal),t&&t.vertical&&(s.flipY=t.vertical);const c=((e,t)=>null!=t?1/t:e.width/e.height)(e,o),d=!(!1===a),u=((e,t,o=1)=>{const i=e.height/e.width,n=t;let r=1,a=i;a>n&&(a=n,r=a/i);const s=Math.max(1/r,n/a),l=e.width/(o*s*r);return{width:l,height:l*t}})(e,o,r),p=l?e:((e,t)=>{const o=t.x>.5?1-t.x:t.x,i=t.y>.5?1-t.y:t.y;return Ne(2*o*e.width,2*i*e.height)})(e,d?n:{x:.5,y:.5}),h=((e,t)=>{let o=e.width,i=o*t;i>e.height&&(i=e.height,o=i/t);const n=.5*(e.width-o),r=.5*(e.height-i);return lt(n,r,o,i)})(e,o);if((o||!l||r)&&(s.crop=St(ot(p),c)),"number"==typeof i&&null!==i&&0!==i){null!=i&&(s.rotation=i);const t=((e,t)=>{const o=e.width,i=e.height,n=Rg(o,t),r=Rg(i,t),a=me(e.x+Math.abs(n.x),e.y-Math.abs(n.y)),s=me(e.x+e.width+Math.abs(r.y),e.y+Math.abs(r.x)),l=me(e.x-Math.abs(r.y),e.y+e.height-Math.abs(r.x));return{width:Ee(a,s),height:Ee(a,l)}})(h,i),o=Math.max(t.width/p.width,t.height/p.height),r=me(n.x*e.width,n.y*e.height),a=Ht(e,i),l=Ue(a),c=me(.5*(a.width-e.width),.5*(a.height-e.height)),d=bt({x:c.x+r.x-u.width/o*.5,y:c.y+r.y-u.height/o*.5,width:u.width/o,height:u.height/o},i),m=ze(d.map($e),i,l.x,l.y),g=ct(rt(m)),$=ze(m.map($e),-2*i,g.x,g.y);s.crop=rt($)}else null!=r&&ut(s.crop,1/r);return d||(s.cropLimitToImage=!1),s};let Eg=null;const Ag={base:0,min:-.25,max:.25,getLabel:e=>um(e/.25),getStore:({imageColorMatrix:e})=>e,getValue:e=>{if(e.brightness)return e.brightness[4]},setValue:(e,t)=>e.update((e=>({...e,brightness:[1,0,0,0,t,0,1,0,0,t,0,0,1,0,t,0,0,0,1,0]})))},Lg={base:1,min:.5,max:1.5,getLabel:e=>um(2*(e-.5)-1),getStore:({imageColorMatrix:e})=>e,getValue:e=>{if(e.contrast)return e.contrast[0]},setValue:(e,t)=>e.update((e=>({...e,contrast:[t,0,0,0,.5*(1-t),0,t,0,0,.5*(1-t),0,0,t,0,.5*(1-t),0,0,0,1,0]})))},Fg={base:1,min:0,max:2,getLabel:e=>um(e-1),getStore:({imageColorMatrix:e})=>e,getValue:e=>{if(e.saturation)return(e.saturation[0]-.213)/.787},setValue:(e,t)=>e.update((e=>({...e,saturation:[.213+.787*t,.715-.715*t,.072-.072*t,0,0,.213-.213*t,.715+.285*t,.072-.072*t,0,0,.213-.213*t,.715-.715*t,.072+.928*t,0,0,0,0,0,1,0]})))},zg={base:1,min:.5,max:1.5,getLabel:e=>um(2*(e-.5)-1),getStore:({imageColorMatrix:e})=>e,getValue:e=>{if(e.exposure)return e.exposure[0]},setValue:(e,t)=>e.update((e=>({...e,exposure:[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0]})))},Dg={base:1,min:.15,max:4,getLabel:e=>um(e<1?(e-.15)/.85-1:(e-1)/3),getStore:({imageGamma:e})=>e},Og={base:0,min:-1,max:1,getStore:({imageVignette:e})=>e},Bg={base:0,min:-1,max:1,getStore:({imageConvolutionMatrix:e})=>e,getValue:e=>{if(e.clarity)return 0===e.clarity[0]?e.clarity[1]/-1:e.clarity[1]/-2},setValue:(e,t)=>{e.update((e=>({...e,clarity:t>=0?[0,-1*t,0,-1*t,1+4*t,-1*t,0,-1*t,0]:[-1*t,-2*t,-1*t,-2*t,1+-3*t,-2*t,-1*t,-2*t,-1*t]})))}},Wg={base:0,min:-1,max:1,getStore:({imageColorMatrix:e})=>e,getValue:e=>{if(!e.temperature)return;const t=e.temperature[0];return t>=1?(t-1)/.1:(1-t)/-.15},setValue:(e,t)=>e.update((e=>({...e,temperature:t>0?[1+.1*t,0,0,0,0,0,1,0,0,0,0,0,1+.1*-t,0,0,0,0,0,1,0]:[1+.15*t,0,0,0,0,0,1+.05*t,0,0,0,0,0,1+.15*-t,0,0,0,0,0,1,0]})))};var _g={finetuneControlConfiguration:{gamma:Dg,brightness:Ag,contrast:Lg,saturation:Fg,exposure:zg,temperature:Wg,clarity:Bg,vignette:Og},finetuneOptions:[["brightness",e=>e.finetuneLabelBrightness],["contrast",e=>e.finetuneLabelContrast],["saturation",e=>e.finetuneLabelSaturation],["exposure",e=>e.finetuneLabelExposure],["temperature",e=>e.finetuneLabelTemperature],["gamma",e=>e.finetuneLabelGamma],!Nc()&&["clarity",e=>e.finetuneLabelClarity],["vignette",e=>e.finetuneLabelVignette]].filter(Boolean)};const Vg=(e,t="thumb")=>["div",t,{style:e,textContent:" "}],Ng={shape:{frameColor:[1,1,1],frameStyle:"solid",frameSize:"2.5%"},thumb:'<rect stroke-width="5" x="0" y="0" width="100%" height="100%"/>'},Hg={shape:{frameColor:[1,1,1],frameStyle:"solid",frameSize:"2.5%",frameRound:!0},thumb:'<rect stroke-width="5" x="0" y="0" width="100%" height="100%" rx="12%"/>'},jg={shape:{frameColor:[1,1,1],frameStyle:"line",frameInset:"2.5%",frameSize:".3125%",frameRadius:0},thumb:[Vg("top:.5em;left:.5em;right:.5em;bottom:.5em;box-shadow:inset 0 0 0 1px currentColor")]},Ug={shape:{frameColor:[1,1,1],frameStyle:"line",frameAmount:2,frameInset:"2.5%",frameSize:".3125%",frameOffset:"1.25%",frameRadius:0},thumb:[Vg("top:.75em;left:.75em;right:.75em;bottom:.75em; outline: 3px double")]},Gg={shape:{frameColor:[1,1,1],frameStyle:"edge",frameInset:"2.5%",frameOffset:"5%",frameSize:".3125%"},thumb:[Vg("top:.75em;left:.5em;bottom:.75em;border-left:1px solid","a"),Vg("top:.75em;right:.5em;bottom:.75em;border-right:1px solid","b"),Vg("top:.5em;left:.75em;right:.75em;border-top:1px solid","c"),Vg("bottom:.5em;left:.75em;right:.75em;border-bottom:1px solid","d")]},Zg={shape:{frameColor:[1,1,1],frameStyle:"edge",frameInset:"2.5%",frameSize:".3125%"},thumb:[Vg("top:-.5em;left:.5em;right:.5em;bottom:-.5em; box-shadow: inset 0 0 0 1px currentColor","a"),Vg("top:.5em;left:-.5em;right:-.5em;bottom:.5em;box-shadow:inset 0 0 0 1px currentColor","b")]},Xg={shape:{frameColor:[1,1,1],frameStyle:"edge",frameOffset:"1.5%",frameSize:".3125%"},thumb:[Vg("top:.3125em;left:.5em;bottom:.3125em;border-left:1px solid","a"),Vg("top:.3125em;right:.5em;bottom:.3125em;border-right:1px solid","b"),Vg("top:.5em;left:.3125em;right:.3125em;border-top:1px solid","c"),Vg("bottom:.5em;left:.3125em;right:.3125em;border-bottom:1px solid","d")]},Yg={shape:{frameColor:[1,1,1],frameStyle:"hook",frameInset:"2.5%",frameSize:".3125%",frameLength:"5%"},thumb:[Vg("top:.5em;left:.5em;width:.75em;height:.75em; border-left: 1px solid;border-top: 1px solid","a"),Vg("top:.5em;right:.5em;width:.75em;height:.75em; border-right: 1px solid;border-top: 1px solid","b"),Vg("bottom:.5em;left:.5em;width:.75em;height:.75em; border-left: 1px solid;border-bottom: 1px solid","c"),Vg("bottom:.5em;right:.5em;width:.75em;height:.75em; border-right: 1px solid;border-bottom: 1px solid","d")]},qg={shape:{frameColor:[1,1,1],frameStyle:"polaroid"},thumb:'<rect stroke-width="20%" x="-5%" y="-5%" width="110%" height="96%"/>'};var Kg={frameStyles:{solidSharp:Ng,solidRound:Hg,lineSingle:jg,lineMultiple:Ug,edgeSeparate:Gg,edgeCross:Zg,edgeOverlap:Xg,hook:Yg,polaroid:qg},frameOptions:[[void 0,e=>e.labelNone],["solidSharp",e=>e.frameLabelMatSharp],["solidRound",e=>e.frameLabelMatRound],["lineSingle",e=>e.frameLabelLineSingle],["lineMultiple",e=>e.frameLabelLineMultiple],["edgeCross",e=>e.frameLabelEdgeCross],["edgeSeparate",e=>e.frameLabelEdgeSeparate],["edgeOverlap",e=>e.frameLabelEdgeOverlap],["hook",e=>e.frameLabelCornerHooks],["polaroid",e=>e.frameLabelPolaroid]]},Jg=e=>e.charAt(0).toUpperCase()+e.slice(1);let Qg=null;var e$=()=>{if(null===Qg)if(d())try{Qg=!1===document.fonts.check("16px TestNonExistingFont")}catch(e){Qg=!1}else Qg=!1;return Qg};const t$=(e,t)=>o=>o[t?`${t}${Jg(e)}`:e],o$=e=>[e,""+e],i$=(e,t)=>o=>[e[o],t$(o,t)],n$=e=>Array.isArray(e)&&e.every(Oo)?e.map(o$):e,r$=[1,.2549,.2118],a$="0.5%",s$=[1,1,1,0],l$={brush:["path",{bitmap:!0,drawMode:"add",strokeWidth:"5%",cursorStyle:"ellipse",cursorSize:"strokeWidth",disableStyle:["strokeColor"],settings:{strokeWidth:{control:"brushSize"}}}],lassoo:["path",{drawMode:"add",disableStyle:["strokeWidth","strokeColor"],pathClose:!0}],rectangle:["rectangle",{disableStyle:["backgroundColor","strokeWidth","strokeColor","cornerRadius"],drawMode:"add"}],ellipse:["ellipse",{disableStyle:["backgroundColor","strokeWidth","strokeColor"],drawMode:"add"}]},c$=["brush","lassoo","rectangle","ellipse"],d$=e=>{const{hideLabel:t=!0}=e||{};return G$(["new","add","subtract"].map((e=>[e,t$(e,"shapeLabelSelectionMode"),{icon:t$(e,"shapeIconSelectionMode"),hideLabel:t}])),{title:e=>e.shapeTitleSelectionMode,layout:"radio"})},u$=e=>U$(e,{title:e=>e.shapeTitleBrushSize,layout:"radio",optionHideLabel:!0,optionIcon:(e,t)=>`<circle fill="currentColor" stroke-width=".05em" stroke="currentColor" fill-opacity=".25" cx="12" cy="12" r="${2+8*t}"/>`}),p$={eraser:()=>({eraseRadius:8,cursorStyle:"ellipse",cursorSize:"eraseRadius"}),path:()=>({points:[],disableAddPoints:!1}),line:()=>({x1:0,y1:0,x2:0,y2:0,disableErase:!1}),rectangle:()=>({x:0,y:0,width:0,height:0}),ellipse:()=>({x:0,y:0,rx:0,ry:0}),text:()=>({x:0,y:0,text:"Text",disableTextScale:!0})},h$=(e,t={},o)=>{if(!p$[e])return;const{position:i="relative",inputMode:n="drag",isSelection:r=!1,interpolateInput:a=!1}=o||{};return[{...p$[e](),...t},{position:i,inputMode:n,isSelection:r,interpolateInput:a}]},m$=e=>{const t={sharpie:h$("path",{bitmap:!0,strokeJoin:"round",strokeCap:"round",strokeWidth:a$,strokeColor:[...r$],cursorStyle:"ellipse",cursorSize:"strokeWidth",disableErase:!1,disableResize:!0,disableMove:!0},{interpolateInput:!0}),eraser:h$("eraser"),path:h$("path",{pathClose:void 0,strokeWidth:a$,strokeColor:[...r$],backgroundColor:[0,0,0,0]},{inputMode:"step"}),line:h$("line",{strokeColor:[...r$],strokeWidth:a$}),arrow:h$("line",{lineStart:"none",lineEnd:"arrow-solid",strokeColor:[...r$],strokeWidth:a$}),rectangle:h$("rectangle",{strokeColor:[...s$],backgroundColor:[...r$]}),ellipse:h$("ellipse",{strokeColor:[...s$],backgroundColor:[...r$]}),text:h$("text",{color:[...r$],fontSize:"2%"})};return e&&Object.entries(e).forEach((([e,o])=>{Array.isArray(o)?t[e]=o:T(o)&&t[e]&&(t[e]=[{...t[e][0],...o},t[e][1]])})),t},g$=(e,t,o)=>[e,t||t$(e,"shapeLabelTool"),{icon:t$(e,"shapeIconTool"),...o}],$$=(e=["move","view","sharpie","eraser","path","line","arrow","rectangle","ellipse","text","preset"])=>e.map((e=>m(e)?g$(e):Array.isArray(e)?T(e[1])?g$(e[0],void 0,e[1]):g$(e[0],e[1],e[2]):void 0)).filter(Boolean),f$=()=>({transparent:[1,1,1,0],white:[1,1,1],silver:[.8667,.8667,.8667],gray:[.6667,.6667,.6667],black:[0,0,0],navy:[0,.1216,.2471],blue:[0,.4549,.851],aqua:[.498,.8588,1],teal:[.2235,.8,.8],olive:[.2392,.6,.4392],green:[.1804,.8,.251],yellow:[1,.8627,0],orange:[1,.5216,.1059],red:[1,.2549,.2118],maroon:[.5216,.0784,.2941],fuchsia:[.9412,.0706,.7451],purple:[.6941,.051,.7882]}),y$=()=>[16,18,20,24,30,36,48,64,72,96,128,144],b$=y$,x$=()=>({extraSmall:"2%",small:"4%",mediumSmall:"8%",medium:"10%",mediumLarge:"15%",large:"20%",extraLarge:"25%"}),v$=()=>({extraSmall:"40%",small:"60%",mediumSmall:"100%",medium:"120%",mediumLarge:"140%",large:"180%",extraLarge:"220%"}),w$=()=>({extraSmall:"0.25%",small:"0.5%",mediumSmall:"1%",medium:"1.75%",mediumLarge:"2.5%",large:"3.5%",extraLarge:"5%"}),S$=()=>["bar","arrow","arrowSolid","circle","circleSolid","square","squareSolid"],k$=()=>[["Helvetica, Arial, Verdana, 'Droid Sans', sans-serif","Sans Serif"],["'Arial Black', 'Avenir-Black', 'Arial Bold'","Black"],["'Arial Narrow', 'Futura-CondensedMedium'","Narrow"],["'Trebuchet MS'","Humanist"],["Georgia, 'Avenir-Black', 'Times New Roman', 'Droid Serif', serif","Serif"],["Palatino","Old-Style"],["'Times New Roman', 'TimesNewRomanPSMT'","Transitional"],["Menlo, Monaco, 'Lucida Console', monospace","Monospaced"],["'Courier New', monospace","Slab Serif"]],C$=()=>["left","center","right"],T$=()=>[["normal","bold"],["italic","normal"],["italic","bold"]],M$=e=>Object.keys(e).map(i$(e,"shapeTitleColor")),P$=e=>Object.keys(e).map(i$(e,"labelSize")),R$=e=>Object.keys(e).map(i$(e,"labelSize")),I$=e=>Object.keys(e).map(i$(e,"labelSize")),E$=e=>[...e],A$=e=>e.map((e=>[e,t=>t["shapeLabelFontStyle"+e.filter((e=>"normal"!==e)).map(Jg).join("")]])),L$=e=>e.map((e=>[Kh(e),t=>t["shapeTitleLineDecoration"+Jg(e)],{icon:t=>t["shapeIconLineDecoration"+Jg(e)]}])),F$=(e,t)=>{const{defaultKey:o,defaultValue:i,defaultOptions:n}=t||{},r=[];return o&&(r[0]=[i,e=>e[o],{...n}]),[...r,...e]},z$=e=>e.split(",").map((e=>e.trim())).some((e=>document.fonts.check("16px "+e))),D$=(e={})=>["ToggleSlider",{...e}],O$="PinturaFontTest",B$=(e,t={defaultKey:"labelDefault"})=>["Dropdown",{title:e=>e.shapeTitleFontFamily,onload:({options:e=[]})=>{e$()&&e.map((([e])=>e)).filter(Boolean).filter((e=>!z$(e))).forEach((e=>{const t="PinturaFontTest-"+e.replace(/[^a-zA-Z0-9]+/g,"").toLowerCase();document.getElementById(t)||document.body.append($("span",{textContent:" ",id:t,class:O$,style:`font-family:${e};font-size:0;color:transparent;`}))}))},ondestroy:()=>{if(!e$())return;document.querySelectorAll(".PinturaFontTest").forEach((e=>e.remove()))},optionLabelStyle:e=>"font-family: "+e,options:F$(e,t),optionFilter:e=>{if(!e$())return!0;const[t]=e;if(!t)return!0;return z$(t)}}],W$=(e,t={})=>["ColorPicker",{options:F$(e),...t}],_$=(e,t={})=>W$(e,{title:e=>e.labelColor,...t}),V$=e=>(t,o={})=>W$(t,{title:t=>t[e],...o}),N$=V$("shapeTitleBackgroundColor"),H$=V$("shapeTitleTextColor"),j$=(e,t={})=>W$(e,{title:e=>e.shapeTitleStrokeColor,options:F$(e),buttonClass:"PinturaColorPickerButtonStroke",onchange:(e,o)=>{const i=o.strokeWidth;(Oo(i)||m(i)?parseFloat(i):0)>0||(o.strokeWidth=t&&t.defaultStrokeWidth||"0.5%")},...t}),U$=(e,t)=>{const{title:o,optionHideLabel:i=!1,layout:n,optionIcon:r=!1}=t||{},a=n$(e),s=e.map((([e])=>m(e)?parseFloat(e):e)),l=Math.max(...s),c=Math.min(...s),d=l-c;return["radio"===n?"RadioGroup":"Dropdown",{title:!1===o?void 0:o||(e=>e.shapeTitleStrokeWidth),options:e=>{const o=t?a.map((e=>{const[t,o,n={}]=e,a=m(t)?parseFloat(t):t,s=(a-c)/d;let l=void 0;return"line"===r?l=`<path stroke="currentColor" stroke-linecap="square" stroke-width="${.1+.875*s}em" d="M3,12 H20"/>`:"dot"===r?l=`<circle fill="currentColor" cx="12" cy="12" r="${2+8*s}"/>`:m(r)?l=r:R(r)&&(l=r(a,s)),[t,o,{icon:l,hideLabel:i,...n}]})):a;return Wo(e,"backgroundColor")?F$(o,{defaultKey:"shapeLabelStrokeNone"}):F$(o)},onchange:(e,t)=>{if(!e)return;const o=t.strokeColor||[];if(o[3])return;const i=[...o];i[3]=1,t.strokeColor=i}}]},G$=(e,t)=>{const{title:o,layout:i}=t||{};return["radio"===i?"RadioGroup":"Dropdown",{title:o,options:F$(e)}]},Z$=(e,t,o)=>["Dropdown",{title:e=>e[t],options:F$(e,{defaultKey:"labelNone",defaultOptions:{icon:'<g stroke="currentColor" stroke-linecap="round" stroke-width=".125em"><path d="M5,12 H14"/></g>'}}),optionIconStyle:o}],X$=e=>Z$(e,"shapeTitleLineStart","transform: scaleX(-1)"),Y$=e=>Z$(e,"shapeTitleLineEnd"),q$=e=>["Dropdown",{title:e=>e.shapeTitleFontStyle,optionLabelStyle:e=>e&&`font-style:${e[0]};font-weight:${e[1]}`,options:F$(e,{defaultKey:"shapeLabelFontStyleNormal"})}],K$=e=>["ShorthandControl",e],J$=(e,t,o,i)=>{i||e.find((([e])=>e===o))||(i={defaultKey:"labelAuto",defaultValue:o});const n=n$(e);return["Dropdown",{title:t,options:F$(n,i),formatValue:e=>Oo(e)?Math.floor(e):Math.floor(parseFloat(e))+"%",...i}]},Q$=(e,t)=>J$(e,(e=>e.shapeTitleFontSize),"4%",t),ef=(e,t)=>J$(e,(e=>e.shapeTitleLineHeight),"120%",t),tf=e=>["RadioGroup",{title:e=>e.shapeTitleTextAlign,options:F$(e)}],of={colorOptions:()=>M$({transparent:[1,1,1,0],white:[1,1,1],silver:[.8667,.8667,.8667],gray:[.6667,.6667,.6667],black:[0,0,0],navy:[0,.1216,.2471],blue:[0,.4549,.851],aqua:[.498,.8588,1],teal:[.2235,.8,.8],olive:[.2392,.6,.4392],green:[.1804,.8,.251],yellow:[1,.8627,0],orange:[1,.5216,.1059],red:[1,.2549,.2118],maroon:[.5216,.0784,.2941],fuchsia:[.9412,.0706,.7451],purple:[.6941,.051,.7882]}),lineEndStyleOptions:()=>L$(["bar","arrow","arrowSolid","circle","circleSolid","square","squareSolid"]),fontFamilyOptions:()=>E$([["Helvetica, Arial, Verdana, 'Droid Sans', sans-serif","Sans Serif"],["'Arial Black', 'Avenir-Black', 'Arial Bold'","Black"],["'Arial Narrow', 'Futura-CondensedMedium'","Narrow"],["'Trebuchet MS'","Humanist"],["Georgia, 'Avenir-Black', 'Times New Roman', 'Droid Serif', serif","Serif"],["Palatino","Old-Style"],["'Times New Roman', 'TimesNewRomanPSMT'","Transitional"],["Menlo, Monaco, 'Lucida Console', monospace","Monospaced"],["'Courier New', monospace","Slab Serif"]]),fontStyleOptions:()=>A$([["normal","bold"],["italic","normal"],["italic","bold"]]),textAlignOptions:()=>["left","center","right"].map((e=>[e,t=>t["shapeTitleTextAlign"+Jg(e)],{hideLabel:!0,icon:t=>t["shapeIconTextAlign"+Jg(e)]}])),strokeWidthOptions:()=>I$({extraSmall:"0.25%",small:"0.5%",mediumSmall:"1%",medium:"1.75%",mediumLarge:"2.5%",large:"3.5%",extraLarge:"5%"}),brushSizeOptions:()=>I$(Object.entries({extraSmall:"0.25%",small:"0.5%",mediumSmall:"1%",medium:"1.75%",mediumLarge:"2.5%",large:"3.5%",extraLarge:"5%"}).reduce(((e,[t,o])=>(e[t]=2*parseFloat(o)+"%",e)),{})),fontSizeOptions:()=>P$({extraSmall:"2%",small:"4%",mediumSmall:"8%",medium:"10%",mediumLarge:"15%",large:"20%",extraLarge:"25%"}),lineHeightOptions:()=>R$({extraSmall:"40%",small:"60%",mediumSmall:"100%",medium:"120%",mediumLarge:"140%",large:"180%",extraLarge:"220%"})},nf=new Intl.NumberFormat("default",{minimumFractionDigits:1,maximumFractionDigits:1}),rf=(e,t)=>m(t)?e+"%":e,af=(e,t,o,i)=>m(i)?Math.round(e/o*100)+"%":""+nf.format(e),sf={getValue:e=>parseFloat(e),setValue:rf,label:af,step:.05,labelClass:"PinturaPercentageLabel"},lf={factory:K$,options:{title:"Text shadow",controls:[["ToggleSlider","x",{...sf,min:-100,max:100,labelPrefix:"X"}],["ToggleSlider","y",{...sf,min:-100,max:100,labelPrefix:"Y"}],["ToggleSlider","blur",{...sf,min:0,max:25,labelPrefix:e=>e.shapeTitleTextShadowBlur}],["ColorPicker","color",{enablePresets:!1}]]}},cf={defaultColor:{factory:_$,items:"colorOptions"},defaultNumber:{factory:D$},defaultPercentage:{factory:D$,options:{getValue:e=>parseFloat(e),setValue:e=>e+"%",step:.05,label:(e,t,o)=>Math.round(e/o*100)+"%",labelClass:"PinturaPercentageLabel"}},backgroundColor:{items:"colorOptions",factory:N$},strokeColor:{items:"colorOptions",factory:j$},strokeWidth:{items:"strokeWidthOptions",factory:U$},brushSize:{items:"brushSizeOptions",factory:u$},drawMode:{factory:d$},lineStart:{items:"lineEndStyleOptions",factory:X$},lineEnd:{items:"lineEndStyleOptions",factory:Y$},color:{items:"colorOptions",factory:H$},fontFamily:{items:"fontFamilyOptions",factory:B$},fontStyle_fontWeight:{items:"fontStyleOptions",factory:q$},fontSize:{items:"fontSizeOptions",factory:Q$},lineHeight:{items:"lineHeightOptions",factory:ef},textAlign:{items:"textAlignOptions",factory:tf},textShadowX_textShadowY_textShadowBlur_textShadowColor:lf,textOutlineWidth_textOutlineColor:{factory:K$,options:{title:"Text outline",controls:[["ToggleSlider","width",{getValue:e=>parseFloat(e),setValue:rf,label:af,min:0,max:15,step:.05,labelClass:"PinturaPercentageLabel",labelPrefix:e=>e.shapeTitleTextOutlineWidth}],["ColorPicker","color",{enablePresets:!1}]]}},cornerRadius:{factory:"defaultPercentage",options:{min:0,max:50,title:e=>e.shapeTitleCornerRadius}},frameColor:{factory:"defaultColor"},frameSize:{factory:"defaultPercentage",options:{min:.2,max:10,title:e=>e.labelSize}},frameInset:{factory:"defaultPercentage",options:{min:.5,max:10,title:e=>e.labelOffset}},frameOffset:{factory:"defaultPercentage",options:{min:.5,max:10,title:e=>e.labelOffset}},frameRadius:{factory:"defaultPercentage",options:{min:.5,max:10,title:e=>e.labelRadius}},frameAmount:{factory:"defaultNumber",options:{min:1,max:5,step:1,title:e=>e.labelAmount}}},df=(e={})=>{const t={...cf,...e},o={};return Object.entries(t).forEach((([e,i])=>{if(!/Options$/.test(e))if(cf[e]&&T(i)&&!_o(i)){const{component:i,factory:n,items:r,options:a={}}=t[e];if(m(n))o[e]=[n,a];else{const s=cf[e].items;let l=m(s)?t[s]||of[s]():void 0;m(r)&&of[r]?l=t[r]?t[r].every((e=>!Array.isArray(e)))?t[r].map((e=>[e,e])):t[r]:of[r]():(r||a.items)&&(l=r||a.items);let c=n||cf[e].factory;R(c)?o[e]=l?c(l,a):c(a):i&&(o[e]=[i,{...a,items:r}])}}else o[e]=i})),o};function uf(e){let t,o,i,n,r;const a=e[7].default,s=mr(a,e,e[6],null);return{c(){t=Fr("div"),o=Fr("div"),s&&s.c(),Nr(o,"class","PinturaToolbarInner"),Nr(t,"class","PinturaToolbar"),Nr(t,"data-layout",e[1]),Nr(t,"data-overflow",e[0])},m(a,l){Ar(a,t,l),Rr(t,o),s&&s.m(o,null),i=!0,n||(r=[Wr(o,"measure",e[3]),wr(Dc.call(null,o)),Wr(t,"measure",e[2]),wr(Dc.call(null,t))],n=!0)},p(e,[o]){s&&s.p&&(!i||64&o)&&fr(s,a,e,e[6],i?$r(a,e[6],o,null):yr(e[6]),null),(!i||2&o)&&Nr(t,"data-layout",e[1]),(!i||1&o)&&Nr(t,"data-overflow",e[0])},i(e){i||(Ea(s,e),i=!0)},o(e){Aa(s,e),i=!1},d(e){e&&Lr(t),s&&s.d(e),n=!1,ar(r)}}}function pf(e,t,o){let i,n,{$$slots:r={},$$scope:a}=t,s=0,l=0,c=0;const d=()=>{o(0,n="compact"===i&&s>c?"overflow":void 0)};return e.$$set=e=>{"$$scope"in e&&o(6,a=e.$$scope)},e.$$.update=()=>{48&e.$$.dirty&&o(1,i=l>c?"compact":"default")},[n,i,({detail:e})=>{const{width:t}=e;o(5,c=t),d()},({detail:e})=>{const{width:t}=e;t>l&&o(4,l=t),s=t,n||d()},l,c,a,r]}class hf extends Ga{constructor(e){super(),Ua(this,e,pf,uf,lr,{})}}function mf(e){let t,o,i,n;const r=e[5].default,a=mr(r,e,e[4],null);return{c(){t=Fr("div"),a&&a.c(),Nr(t,"class",e[0])},m(r,s){Ar(r,t,s),a&&a.m(t,null),o=!0,i||(n=[Wr(t,"measure",(function(){sr(e[1]&&e[3])&&(e[1]&&e[3]).apply(this,arguments)})),wr(e[2].call(null,t))],i=!0)},p(i,[n]){e=i,a&&a.p&&(!o||16&n)&&fr(a,r,e,e[4],o?$r(r,e[4],n,null):yr(e[4]),null),(!o||1&n)&&Nr(t,"class",e[0])},i(e){o||(Ea(a,e),o=!0)},o(e){Aa(a,e),o=!1},d(e){e&&Lr(t),a&&a.d(e),i=!1,ar(n)}}}function gf(e,t,o){let{$$slots:i={},$$scope:n}=t;const r=sa();let{class:a=null}=t;const s=ca("measurable");let l=!1;return na((()=>o(1,l=!0))),e.$$set=e=>{"class"in e&&o(0,a=e.class),"$$scope"in e&&o(4,n=e.$$scope)},[a,l,s,({detail:e})=>r("measure",e),n,i]}class $f extends Ga{constructor(e){super(),Ua(this,e,gf,mf,lr,{class:0})}}const ff=e=>({}),yf=e=>({}),bf=e=>({}),xf=e=>({}),vf=e=>({}),wf=e=>({});function Sf(e){let t,o;const i=e[4].header,n=mr(i,e,e[3],wf);return{c(){t=Fr("div"),n&&n.c(),Nr(t,"class","PinturaUtilHeader")},m(e,i){Ar(e,t,i),n&&n.m(t,null),o=!0},p(e,t){n&&n.p&&(!o||8&t)&&fr(n,i,e,e[3],o?$r(i,e[3],t,vf):yr(e[3]),wf)},i(e){o||(Ea(n,e),o=!0)},o(e){Aa(n,e),o=!1},d(e){e&&Lr(t),n&&n.d(e)}}}function kf(e){let t,o;const i=e[4].footer,n=mr(i,e,e[3],yf);return{c(){t=Fr("div"),n&&n.c(),Nr(t,"class","PinturaUtilFooter")},m(e,i){Ar(e,t,i),n&&n.m(t,null),o=!0},p(e,t){n&&n.p&&(!o||8&t)&&fr(n,i,e,e[3],o?$r(i,e[3],t,ff):yr(e[3]),yf)},i(e){o||(Ea(n,e),o=!0)},o(e){Aa(n,e),o=!1},d(e){e&&Lr(t),n&&n.d(e)}}}function Cf(e){let t,o,i,n,r,a,s=e[1]&&Sf(e);const l=e[4].main,c=mr(l,e,e[3],xf),d=c||function(e){let t,o;return t=new $f({props:{class:"PinturaStage"}}),t.$on("measure",e[5]),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p:tr,i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}(e);let u=e[2]&&kf(e);return{c(){s&&s.c(),t=Or(),o=Fr("div"),d&&d.c(),i=Or(),u&&u.c(),n=Or(),r=Br(),Nr(o,"class","PinturaUtilMain")},m(l,c){s&&s.m(l,c),Ar(l,t,c),Ar(l,o,c),d&&d.m(o,null),e[6](o),Ar(l,i,c),u&&u.m(l,c),Ar(l,n,c),Ar(l,r,c),a=!0},p(e,[o]){e[1]?s?(s.p(e,o),2&o&&Ea(s,1)):(s=Sf(e),s.c(),Ea(s,1),s.m(t.parentNode,t)):s&&(Ra(),Aa(s,1,1,(()=>{s=null})),Ia()),c&&c.p&&(!a||8&o)&&fr(c,l,e,e[3],a?$r(l,e[3],o,bf):yr(e[3]),xf),e[2]?u?(u.p(e,o),4&o&&Ea(u,1)):(u=kf(e),u.c(),Ea(u,1),u.m(n.parentNode,n)):u&&(Ra(),Aa(u,1,1,(()=>{u=null})),Ia())},i(e){a||(Ea(s),Ea(d,e),Ea(u),Ea(false),a=!0)},o(e){Aa(s),Aa(d,e),Aa(u),Aa(false),a=!1},d(a){s&&s.d(a),a&&Lr(t),a&&Lr(o),d&&d.d(a),e[6](null),a&&Lr(i),u&&u.d(a),a&&Lr(n),a&&Lr(r)}}}function Tf(e,t,o){let{$$slots:i={},$$scope:n}=t,{hasHeader:r=!!t.$$slots.header}=t,{hasFooter:a=!!t.$$slots.footer}=t,{root:s}=t;return e.$$set=e=>{o(7,t=ir(ir({},t),br(e))),"hasHeader"in e&&o(1,r=e.hasHeader),"hasFooter"in e&&o(2,a=e.hasFooter),"root"in e&&o(0,s=e.root),"$$scope"in e&&o(3,n=e.$$scope)},t=br(t),[s,r,a,n,i,function(t){da.call(this,e,t)},function(e){pa[e?"unshift":"push"]((()=>{s=e,o(0,s)}))}]}class Mf extends Ga{constructor(e){super(),Ua(this,e,Tf,Cf,lr,{hasHeader:1,hasFooter:2,root:0})}}function Pf(e){let t;return{c(){t=Fr("div"),Nr(t,"class","PinturaRangeInputMeter"),Zr(t,"transform",`translateX(${e[10].x-e[13].x}px) translateY(${e[10].y-e[13].y}px)`)},m(o,i){Ar(o,t,i),t.innerHTML=e[7]},p(e,o){128&o[0]&&(t.innerHTML=e[7]),1024&o[0]&&Zr(t,"transform",`translateX(${e[10].x-e[13].x}px) translateY(${e[10].y-e[13].y}px)`)},d(e){e&&Lr(t)}}}function Rf(e){let t,o,i,n,r,a,s,l,c,d,u,p=e[10]&&Pf(e);return{c(){t=Fr("div"),o=Fr("span"),i=Or(),n=Fr("button"),r=Dr(e[1]),s=Or(),l=Fr("div"),p&&p.c(),Nr(o,"class","PinturaRangeInputValue"),Nr(n,"class","PinturaRangeInputReset"),Nr(n,"type","button"),n.disabled=a=e[0]===e[2],Nr(l,"class","PinturaRangeInputInner"),Nr(l,"data-value-limited",e[5]),Zr(l,"--range-mask-from",e[9]),Zr(l,"--range-mask-to",e[8]),Nr(t,"class","PinturaRangeInput"),Nr(t,"tabindex","0")},m(a,h){Ar(a,t,h),Rr(t,o),o.innerHTML=e[3],Rr(t,i),Rr(t,n),Rr(n,r),Rr(t,s),Rr(t,l),p&&p.m(l,null),d||(u=[Wr(n,"click",e[18]),Wr(l,"interactionstart",e[14]),Wr(l,"interactionupdate",e[16]),Wr(l,"interactionend",e[17]),Wr(l,"interactionrelease",e[15]),wr(c=Ch.call(null,l,{inertia:e[6]})),Wr(l,"measure",e[39]),wr(Dc.call(null,l)),Wr(t,"wheel",e[20],{passive:!1}),Wr(t,"nudge",e[21]),wr(sp.call(null,t,{direction:"horizontal",preventDefault:!0}))],d=!0)},p(e,t){8&t[0]&&(o.innerHTML=e[3]),2&t[0]&&Ur(r,e[1]),5&t[0]&&a!==(a=e[0]===e[2])&&(n.disabled=a),e[10]?p?p.p(e,t):(p=Pf(e),p.c(),p.m(l,null)):p&&(p.d(1),p=null),32&t[0]&&Nr(l,"data-value-limited",e[5]),c&&sr(c.update)&&64&t[0]&&c.update.call(null,{inertia:e[6]}),512&t[0]&&Zr(l,"--range-mask-from",e[9]),256&t[0]&&Zr(l,"--range-mask-to",e[8])},i:tr,o:tr,d(e){e&&Lr(t),p&&p.d(),d=!1,ar(u)}}}function If(e,t,o){let i,n,a,s,l,c,d,u,p,h,m,g,{labelReset:$="Reset"}=t,{direction:f="x"}=t,{min:y=0}=t,{max:b=1}=t,{base:x=y}=t,{value:v=0}=t,{valueLabel:w=0}=t,{valueMin:S}=t,{valueMax:k}=t,{oninputstart:C=r}=t,{oninputmove:T=r}=t,{oninputend:M=r}=t,{elasticity:P=0}=t,{nudgeMultiplier:R}=t,{step:I=8}=t;const E=ca("isAnimated");hr(e,E,(e=>o(6,h=e)));const A=ca("fixScrollDirection");hr(e,A,(e=>o(45,m=e)));const L=(e,t,o)=>Math.ceil((e-o)/t)*t+o;let F,z,D;const O={x:2,y:0},B=(e,t,o)=>`M ${e-o} ${t} a ${o} ${o} 0 1 0 0 -1`;let W,_=void 0,V=!1,N={snap:!1,elastic:!1};const H=(e,t,o)=>{const i=e[f]+t[f],n=$s(i,W[1][f],W[0][f]),r=P?n+Th(i-n,P):n,a=o.elastic?r:n,s=me(0,0);return s[f]=a,j.set(s,{hard:o.snap}),$s(G(s,f),y,b)},j=xc();hr(e,j,(e=>o(10,g=e)));const U=(e,t)=>{const o=.5*(F[t]-s[t])-(lp(e,y,b)*s[t]-.5*s[t]);return{x:"x"===t?o:0,y:"y"===t?o:0}},G=(e,t)=>{const o=-(e[t]-.5*F[t])/s[t];return y+o*i},Z=j.subscribe((e=>{e&&_&&T($s(G(e,f),y,b))})),X=e=>{const t=[U(null!=S?S:y,f),U(null!=k?k:b,f)],o={x:"x"===f?g.x+e:0,y:"y"===f?g.y+e:0},i=$s(o[f],t[1][f],t[0][f]),n={...g,[f]:i};vr(j,g=n,g);const r=$s(G(n,f),y,b);C(),T(r),M(r)};aa((()=>{Z()}));return e.$$set=e=>{"labelReset"in e&&o(1,$=e.labelReset),"direction"in e&&o(22,f=e.direction),"min"in e&&o(23,y=e.min),"max"in e&&o(24,b=e.max),"base"in e&&o(2,x=e.base),"value"in e&&o(0,v=e.value),"valueLabel"in e&&o(3,w=e.valueLabel),"valueMin"in e&&o(25,S=e.valueMin),"valueMax"in e&&o(26,k=e.valueMax),"oninputstart"in e&&o(27,C=e.oninputstart),"oninputmove"in e&&o(28,T=e.oninputmove),"oninputend"in e&&o(29,M=e.oninputend),"elasticity"in e&&o(30,P=e.elasticity),"nudgeMultiplier"in e&&o(31,R=e.nudgeMultiplier),"step"in e&&o(32,I=e.step)},e.$$.update=()=>{if(25165824&e.$$.dirty[0]&&o(34,i=b-y),41943040&e.$$.dirty[0]&&o(36,n=null!=S?Math.max(S,y):y),83886080&e.$$.dirty[0]&&o(35,a=null!=k?Math.min(k,b):b),25165828&e.$$.dirty[0]&&o(38,l=lp(x,y,b)),16&e.$$.dirty[0]|128&e.$$.dirty[1]&&F){const e=.5*F.y;let t,i=40*l,n="",r=F.y,a="";for(let o=0;o<=40;o++){const r=O.x+10*o,s=e;n+=B(r,s,o%5==0?2:.75)+" ",t=r+O.x,o===i&&(a=`<path d="M${r} ${s-4} l2 3 l-2 -1 l-2 1 z"/>`)}o(7,z=`<svg width="${t}" height="${r}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${t} ${r}" aria-hidden="true" focusable="false">\n ${a}\n <rect rx="4" ry="4" y="${e-4}"" height="8"/>\n <path fill-rule="evenodd" d="${n.trim()}"/></svg>`),o(33,D={x:t-2*O.x,y:r})}16&e.$$.dirty[0]|4&e.$$.dirty[1]&&(s=F&&D),25165824&e.$$.dirty[0]|48&e.$$.dirty[1]&&o(5,c=n!==y||a!==b),32&e.$$.dirty[0]|48&e.$$.dirty[1]&&o(37,d=c?function(e,t){const o=1/40,i=lp(e,y,b),n=lp(t,y,b);return[100*de(L(i,o,0)-.0125)+"%",100*de(L(n,o,0)-.0125)+"%"]}(n,a):void 0),64&e.$$.dirty[1]&&o(9,u=d?d[0]:""),64&e.$$.dirty[1]&&o(8,p=d?d[1]:""),4194385&e.$$.dirty[0]|8&e.$$.dirty[1]&&i&&F&&F.x&&F.y&&j.set(U(v,f),{hard:!1===h})},[v,$,x,w,F,c,h,z,p,u,g,E,A,O,()=>{V=!1,_=pr(j),W=[U(null!=S?S:y,f),U(null!=k?k:b,f)],C()},()=>{V=!0},({detail:e})=>{N.snap=!V,N.elastic=!V,H(_,e.translation,N)},({detail:e})=>{N.snap=!1,N.elastic=!1;const t=H(_,e.translation,N);if(_=void 0,W=void 0,Math.abs(t-x)<.01)return M(x);M(t)},()=>{o(0,v=$s(x,n,a)),C(),M(v)},j,e=>{e.preventDefault(),e.stopPropagation();const t=Ih(e,{fixScrollDirection:m})*I;X(t)},({detail:e})=>{X(e[f]*Math.abs(R||8))},f,y,b,S,k,C,T,M,P,R,I,D,i,a,n,d,l,e=>o(4,F=(e=>me(e.width,e.height))(e.detail))]}class Ef extends Ga{constructor(e){super(),Ua(this,e,If,Rf,lr,{labelReset:1,direction:22,min:23,max:24,base:2,value:0,valueLabel:3,valueMin:25,valueMax:26,oninputstart:27,oninputmove:28,oninputend:29,elasticity:30,nudgeMultiplier:31,step:32},null,[-1,-1])}}var Af={[te]:e=>({x:e.x,y:e.y}),[ae]:e=>({x:e.x+e.width,y:e.y}),[oe]:e=>({x:e.x+e.width,y:e.y}),[se]:e=>({x:e.x+e.width,y:e.y+e.height}),[ie]:e=>({x:e.x,y:e.y+e.height}),[le]:e=>({x:e.x,y:e.y+e.height}),[ne]:e=>({x:e.x,y:e.y}),[re]:e=>({x:e.x,y:e.y})};const Lf={t:"top",r:"right",b:"bottom",l:"left"},Ff="horizontal",zf="vertical",Df={t:zf,b:zf,r:Ff,l:Ff};function Of(e,t,o){const i=e.slice();return i[15]=t[o].key,i[16]=t[o].translate,i[17]=t[o].scale,i[18]=t[o].type,i[19]=t[o].opacity,i[20]=t[o].role,i[21]=t[o].tabindex,i[22]=t[o].label,i[23]=t[o].orientation,i[24]=t[o].valuemin,i[25]=t[o].valuemax,i[26]=t[o].valuenow,i}function Bf(e,t){let o,i,n,r,a,s,l,c,d,u,p,h;return{key:e,first:null,c(){o=Fr("div"),Nr(o,"role",i=t[20]),Nr(o,"tabindex",n=t[21]),Nr(o,"aria-label",r=t[22]),Nr(o,"aria-orientation",a=t[23]),Nr(o,"aria-valuemin",s=t[24]),Nr(o,"aria-valuemax",l=t[25]),Nr(o,"aria-valuenow",c=t[26]),Nr(o,"class","PinturaRectManipulator"),Nr(o,"data-direction",d=t[15]),Nr(o,"data-shape",u=""+("edge"===t[18]?"edge":""+t[0])),Zr(o,"--tx",t[16].x),Zr(o,"--ty",t[16].y),Zr(o,"--sx",t[17].x),Zr(o,"--sy",t[17].y),Zr(o,"opacity",t[19]),this.first=o},m(e,i){Ar(e,o,i),p||(h=[Wr(o,"nudge",(function(){sr(t[6](t[15]))&&t[6](t[15]).apply(this,arguments)})),wr(sp.call(null,o,{preventDefault:!0})),Wr(o,"interactionstart",(function(){sr(t[5]("resizestart",t[15]))&&t[5]("resizestart",t[15]).apply(this,arguments)})),Wr(o,"interactionupdate",(function(){sr(t[5]("resizemove",t[15]))&&t[5]("resizemove",t[15]).apply(this,arguments)})),Wr(o,"interactionend",(function(){sr(t[5]("resizeend",t[15]))&&t[5]("resizeend",t[15]).apply(this,arguments)})),wr(Ch.call(null,o))],p=!0)},p(e,p){t=e,2&p&&i!==(i=t[20])&&Nr(o,"role",i),2&p&&n!==(n=t[21])&&Nr(o,"tabindex",n),2&p&&r!==(r=t[22])&&Nr(o,"aria-label",r),2&p&&a!==(a=t[23])&&Nr(o,"aria-orientation",a),2&p&&s!==(s=t[24])&&Nr(o,"aria-valuemin",s),2&p&&l!==(l=t[25])&&Nr(o,"aria-valuemax",l),2&p&&c!==(c=t[26])&&Nr(o,"aria-valuenow",c),2&p&&d!==(d=t[15])&&Nr(o,"data-direction",d),3&p&&u!==(u=""+("edge"===t[18]?"edge":""+t[0]))&&Nr(o,"data-shape",u),2&p&&Zr(o,"--tx",t[16].x),2&p&&Zr(o,"--ty",t[16].y),2&p&&Zr(o,"--sx",t[17].x),2&p&&Zr(o,"--sy",t[17].y),2&p&&Zr(o,"opacity",t[19])},d(e){e&&Lr(o),p=!1,ar(h)}}}function Wf(e){let t,o=[],i=new Map,n=e[1];const r=e=>e[15];for(let t=0;t<n.length;t+=1){let a=Of(e,n,t),s=r(a);i.set(s,o[t]=Bf(s,a))}return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=Br()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);Ar(e,t,i)},p(e,[a]){99&a&&(n=e[1],o=Ba(o,a,r,1,e,n,i,t.parentNode,Da,Bf,t,Of))},i:tr,o:tr,d(e){for(let t=0;t<o.length;t+=1)o[t].d(e);e&&Lr(t)}}}function _f(e,t,o){let i,n,r,a,{rect:s=null}=t,{bounds:l=null}=t,{visible:c=!1}=t,{cornerStyle:d}=t;const u=ca("isAnimated");hr(e,u,(e=>o(12,a=e)));const p=xc(void 0,{precision:1e-4,stiffness:.2,damping:.4});hr(e,p,(e=>o(11,r=e)));const h=xc(0,{precision:.001});let m;hr(e,h,(e=>o(10,n=e)));const g=sa();return e.$$set=e=>{"rect"in e&&o(7,s=e.rect),"bounds"in e&&o(8,l=e.bounds),"visible"in e&&o(9,c=e.visible),"cornerStyle"in e&&o(0,d=e.cornerStyle)},e.$$.update=()=>{4608&e.$$.dirty&&p.set(c?1:.5,{hard:!1===a}),4608&e.$$.dirty&&h.set(c?1:0,{hard:!1===a}),3456&e.$$.dirty&&o(1,i=Object.keys(ee).map(((e,t)=>{const o=ee[e],i=Af[o](s),a=1===o.length?"edge":"corner",c="corner"===a;let d;if("edge"===a&&l){let e,t,i;"l"===o&&(e=l.x,t=Math.min(l.width,s.x+s.width),i=s.x),"t"===o&&(e=l.y,t=Math.min(l.height,s.y+s.height),i=s.y),"r"===o&&(e=s.x,t=l.width,i=s.x+s.width),"b"===o&&(e=s.y,t=l.height,i=s.y+s.height),d={role:"slider",tabindex:0,label:"Drag "+Lf[o],orientation:""+Df[o],valuemin:Math.round(e),valuemax:Math.round(t),valuenow:Math.round(i)}}return{key:o,type:a,scale:{x:/^(t|b)$/.test(o)?s.width:c?$s(r,.5,1.25):1,y:/^(r|l)$/.test(o)?s.height:c?$s(r,.5,1.25):1},translate:{x:i.x,y:i.y},opacity:n,...d}})))},[d,i,u,p,h,(e,t)=>({detail:o})=>{m&&t!==m||"resizestart"!==e&&void 0===m||("resizestart"===e&&(m=t),"resizeend"===e&&(m=void 0),g(e,{direction:t,translation:o&&o.translation}))},e=>({detail:t})=>{g("resizestart",{direction:e,translation:{x:0,y:0}}),g("resizemove",{direction:e,translation:t}),g("resizeend",{direction:e,translation:{x:0,y:0}})},s,l,c,n,r,a]}class Vf extends Ga{constructor(e){super(),Ua(this,e,_f,Wf,lr,{rect:7,bounds:8,visible:9,cornerStyle:0})}}var Nf=e=>{function t(t,o){e.dispatchEvent(new CustomEvent(t,{detail:o}))}const o=o=>{o.preventDefault(),e.addEventListener("gesturechange",i),e.addEventListener("gestureend",n),t("gesturedown")},i=e=>{e.preventDefault(),t("gestureupdate",e.scale)},n=e=>{t("gestureup",e.scale),e.preventDefault(),r()},r=()=>{e.removeEventListener("gesturechange",i),e.removeEventListener("gestureend",n)};return e.addEventListener("gesturestart",o),{destroy:()=>{r(),e.removeEventListener("gesturestart",o)}}},Hf={[te]:ie,[oe]:ne,[ie]:te,[ne]:oe,[re]:se,[ae]:le,[se]:re,[le]:ae},jf=e=>{const t=e===ne||e===oe,o=e===te||e===ie;return[e===oe||e===ae||e===se,e===ne||e===le||e===re,e===te||e===ae||e===re,e===ie||e===se||e===le,t,o,t||o]},Uf=(e,t,o,i={})=>{const{target:n,translate:r}=t,{aspectRatio:a,minSize:s,maxSize:l}=i,c=ce[Hf[n]],d=ke(me(e.x,e.y),me(c[0]*e.width,c[1]*e.height)),u=ce[n],p=ke(et(e),me(u[0]*e.width,u[1]*e.height)),[h,m,g,$,f,y,b]=jf(n);let x=r.x,v=r.y;f?v=0:y&&(x=0);const{inner:w,outer:S}=Gf(d,n,o,{aspectRatio:a,minSize:s,maxSize:l});let[k,C,T,M]=kt(e);if(h?M=d.x:m&&(C=d.x),$?k=d.y:g&&(T=d.y),h){const e=w.x+w.width,t=S.x+S.width;C=$s(p.x+x,e,t)}else if(m){const e=S.x,t=w.x;M=$s(p.x+x,e,t)}if($){const e=w.y+w.height,t=S.y+S.height;T=$s(p.y+v,e,t)}else if(g){const e=S.y,t=w.y;k=$s(p.y+v,e,t)}if(M>w.x&&(M=w.x),C<w.x+w.width&&(C=w.x+w.width),k>w.y&&(k=w.y),T<w.y+w.height&&(T=w.y+w.height),M<S.x){const e=S.x-M;M=S.x,C+=e}if(C>S.x+S.width){const e=C-(S.x+S.width);C=S.x+S.width,M-=e}if(k<S.y){const e=S.y-k;k=S.y,T+=e}if(T>S.y+S.height){const e=T-(S.y+S.height);T=S.y+S.height,k-=e}if(a)if(b){let e=C-M,t=T-k;f?(t=e/a,k=d.y-.5*t,T=d.y+.5*t):y&&(e=t*a,M=d.x-.5*e,C=d.x+.5*e)}else{const e=me(p.x+x-d.x,p.y+v-d.y);n===ae?(e.x=Math.max(0,e.x),e.y=Math.min(0,e.y)):n===se?(e.x=Math.max(0,e.x),e.y=Math.max(0,e.y)):n===le?(e.x=Math.min(0,e.x),e.y=Math.max(0,e.y)):n===re&&(e.x=Math.min(0,e.x),e.y=Math.min(0,e.y));const t=be(e),o=be(me(w.width,w.height)),i=be(me(S.width,S.height)),r=$s(t,o,i),s=me(a,1),l=Me(xe(s),r);n===ae?(C=d.x+l.x,k=d.y-l.y):n===se?(C=d.x+l.x,T=d.y+l.y):n===le?(M=d.x-l.x,T=d.y+l.y):n===re&&(M=d.x-l.x,k=d.y-l.y)}return lt(M,k,C-M,T-k)};const Gf=(e,t,o,i)=>{const{aspectRatio:n,minSize:r,maxSize:a}=i,s=t===oe||t===ae||t===se,l=t===ne||t===le||t===re,c=t===te||t===ae||t===re,d=t===ie||t===se||t===le,u=t===ne||t===oe,p=t===te||t===ie,h=et(o);s?(h.x=e.x,h.width-=e.x):l&&(h.width=e.x),d?(h.y=e.y,h.height-=e.y):c&&(h.height=e.y);const m=((e,t)=>Qe(0,0,e,t))(Math.min(h.width,a.width),Math.min(h.height,a.height));if(n)if(u){const t=Math.min(e.y,o.height-e.y);m.height=Math.min(2*t,m.height)}else if(p){const t=Math.min(e.x,o.width-e.x);m.width=Math.min(2*t,m.width)}const g=n?We(wt(ot(r),n)):r,$=n?We(St(m,n)):m;let f,y,b,x;s?f=e.x:l&&(y=e.x),d?b=e.y:c&&(x=e.y),s?y=f+g.width:l&&(f=y-g.width),d?x=b+g.height:c&&(b=x-g.height),u?(b=e.y-.5*g.height,x=e.y+.5*g.height):p&&(f=e.x-.5*g.width,y=e.x+.5*g.width);const v=rt([me(f,b),me(y,x)]);s?y=f+$.width:l&&(f=y-$.width),d?x=b+$.height:c&&(b=x-$.height),u?(b=e.y-.5*$.height,x=e.y+.5*$.height):p&&(f=e.x-.5*$.width,y=e.x+.5*$.width),f=Math.max(o.x,f),y=Math.min(o.x+o.width,y),b=Math.max(o.y,b),x=Math.min(o.y+o.height,x);return{inner:v,outer:rt([me(f,b),me(y,x)])}};var Zf=e=>180*e/Math.PI;function Xf(e){let t,o,i;return o=new Ef({props:{elasticity:e[5],min:e[9],max:e[10],value:e[11],valueMin:Math.max(e[9],e[0]),valueMax:Math.min(e[10],e[1]),labelReset:e[6],base:e[12],valueLabel:Math.round(Zf(e[11]))+"°",oninputstart:e[2],oninputmove:e[17],oninputend:e[18]}}),{c(){t=Fr("div"),Na(o.$$.fragment),Nr(t,"class","PinturaImageRotator")},m(e,n){Ar(e,t,n),Ha(o,t,null),i=!0},p(e,[t]){const i={};32&t&&(i.elasticity=e[5]),512&t&&(i.min=e[9]),1024&t&&(i.max=e[10]),2048&t&&(i.value=e[11]),513&t&&(i.valueMin=Math.max(e[9],e[0])),1026&t&&(i.valueMax=Math.min(e[10],e[1])),64&t&&(i.labelReset=e[6]),4096&t&&(i.base=e[12]),2048&t&&(i.valueLabel=Math.round(Zf(e[11]))+"°"),4&t&&(i.oninputstart=e[2]),392&t&&(i.oninputmove=e[17]),400&t&&(i.oninputend=e[18]),o.$set(i)},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Lr(t),ja(o)}}}function Yf(e,t,o){let i,n,a,s,l,c,d,{rotation:u}=t,{valueMin:p}=t,{valueMax:h}=t,{oninputstart:m=r}=t,{oninputmove:g=r}=t,{oninputend:$=r}=t,{elasticity:f=0}=t,{labelReset:y}=t,{rotationMin:b}=t,{rotationMax:x}=t;return e.$$set=e=>{"rotation"in e&&o(13,u=e.rotation),"valueMin"in e&&o(0,p=e.valueMin),"valueMax"in e&&o(1,h=e.valueMax),"oninputstart"in e&&o(2,m=e.oninputstart),"oninputmove"in e&&o(3,g=e.oninputmove),"oninputend"in e&&o(4,$=e.oninputend),"elasticity"in e&&o(5,f=e.elasticity),"labelReset"in e&&o(6,y=e.labelReset),"rotationMin"in e&&o(14,b=e.rotationMin),"rotationMax"in e&&o(15,x=e.rotationMax)},e.$$.update=()=>{16384&e.$$.dirty&&o(9,i=b+1e-9),32768&e.$$.dirty&&o(10,n=x-1e-9),1536&e.$$.dirty&&o(12,a=i+.5*(n-i)),32768&e.$$.dirty&&o(16,s=2*x),8192&e.$$.dirty&&o(8,l=Math.sign(u)),73728&e.$$.dirty&&o(7,c=Math.round(Math.abs(u)/s)*s),8576&e.$$.dirty&&o(11,d=u-l*c)},[p,h,m,g,$,f,y,c,l,i,n,d,a,u,b,x,s,e=>g(l*c+e),e=>$(l*c+e)]}class qf extends Ga{constructor(e){super(),Ua(this,e,Yf,Xf,lr,{rotation:13,valueMin:0,valueMax:1,oninputstart:2,oninputmove:3,oninputend:4,elasticity:5,labelReset:6,rotationMin:14,rotationMax:15})}}function Kf(e){let t,o;return t=new Lu({props:{class:"PinturaPresetListFilter",layout:"row",options:e[8],selectedIndex:e[7],onchange:e[10]}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};256&o&&(i.options=e[8]),128&o&&(i.selectedIndex=e[7]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Jf(e){let t,o;return t=new op({props:{icon:e[0],label:e[1],labelClass:e[2],hideLabel:e[3],options:e[9],selectedIndex:e[4],onchange:e[5],optionMapper:e[6],$$slots:{controls:[Kf]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,[o]){const i={};1&o&&(i.icon=e[0]),2&o&&(i.label=e[1]),4&o&&(i.labelClass=e[2]),8&o&&(i.hideLabel=e[3]),512&o&&(i.options=e[9]),16&o&&(i.selectedIndex=e[4]),32&o&&(i.onchange=e[5]),64&o&&(i.optionMapper=e[6]),262528&o&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}const Qf='fill="none" stroke="currentColor"';function ey(e,t,o){let i,n,a,{icon:s}=t,{label:l}=t,{labelClass:c}=t,{hideLabel:d}=t,{options:u}=t,{selectedIndex:p}=t,{onchange:h}=t,{optionMapper:g}=t,{filter:$="landscape"}=t,{onfilterchange:f=r}=t;const y=(e,t,o,i,n)=>`\n <rect ${Qf} x="${e}" y="${t}" width="${o}" height="${i}" rx="${n}"/>`,b=(e,t)=>`<path ${Qf} d="M${e} ${t} l2 2 l3 -4"/>`;return e.$$set=e=>{"icon"in e&&o(0,s=e.icon),"label"in e&&o(1,l=e.label),"labelClass"in e&&o(2,c=e.labelClass),"hideLabel"in e&&o(3,d=e.hideLabel),"options"in e&&o(12,u=e.options),"selectedIndex"in e&&o(4,p=e.selectedIndex),"onchange"in e&&o(5,h=e.onchange),"optionMapper"in e&&o(6,g=e.optionMapper),"filter"in e&&o(11,$=e.filter),"onfilterchange"in e&&o(13,f=e.onfilterchange)},e.$$.update=()=>{6144&e.$$.dirty&&o(9,i=((e,t)=>(e||[]).map((e=>m(e[0])?(e[1]=e[1].map(t),e):t(e))))(u,(e=>t=>{const[o,i,n={}]=t;return Oo(o)&&(n.hidden="landscape"===e?o<1:o>1),[o,i,n]})($))),2048&e.$$.dirty&&o(7,n="landscape"===$?0:1),128&e.$$.dirty&&o(8,a=[["landscape","Landscape",{hideLabel:!0,icon:y(2,6,19,12,2)+(0===n?b(9,12):"")}],["portrait","Portrait",{hideLabel:!0,icon:y(5,3,13,18,2)+(1===n?b(9,12):"")}]])},[s,l,c,d,p,h,g,n,a,i,e=>{o(11,$=e.value),f(e.value)},$,u,f]}class ty extends Ga{constructor(e){super(),Ua(this,e,ey,Jf,lr,{icon:0,label:1,labelClass:2,hideLabel:3,options:12,selectedIndex:4,onchange:5,optionMapper:6,filter:11,onfilterchange:13})}}const oy=e=>Se(e,(e=>de(e,6))),iy=e=>Tt(e,(e=>de(e,6))),ny=(e,t,o=1e-4)=>Math.abs(e-t)<o;var ry=(e,t,o,i,n={})=>{const{aspectRatio:r}=n;e=iy(e),i=i.map(oy);const a=ht(e,Hf[o.target]),s=Se(a,(e=>de(e,6))),l=r?wt(n.minSize,r):n.minSize,c=r?St(n.maxSize,r):n.maxSize,d=ht(t,o.target);if(Ee(d,a)<1){t=et(e);const o=Math.min(l.width/e.width,l.height/e.height);ut(t,o,a)}t=pt(et(t),l,c,a);let u=et(t);t=iy(t);const p=Ot(i,1),h=Ct(e),m=Ct(t),g=h.findIndex((e=>we(Se(e,(e=>de(e,6))),s))),$=e=>p.map((t=>It(t,e))).filter(Boolean).pop();if(r){const t=m.map(((e,t)=>{if(t===g)return;const o=me(a.x-e.x,a.y-e.y);xe(o),Me(o,.5);const i=me(a.x-o.x,a.y-o.y),n=Ye(i,oy(e)),r=$(n);if(!r)return;const s=h[t];return{intersection:r,cornerDist:Ee(a,s),intersectionDist:Ee(a,r)}})).filter(Boolean);if(t.length){const o=t.reduce(((e,t)=>{const o=t.intersectionDist/t.cornerDist;return o<e?o:e}),Number.MAX_SAFE_INTEGER);u=et(e),ut(u,o,a)}}else{const e=1===o.target.length,n=!(i[0].y===i[1].y||i[0].x===i[1].x),r=h.map(((t,o)=>{if(o===g)return;const i=m[o],r=!ny(i.x,s.x)&&!ny(i.y,s.y);if(!e&&!n&&r)return;if(e&&(ny(i.x,s.x)||ny(i.y,s.y)))return;const l=$e(e?t:a),c=Ce($e(l),i);xe(c),Me(c,.5),e?ke(l,c):Ce(l,c);const d=Ye(l,i),u=$(d);return u||void 0})).filter(Boolean);if(r.length){const[e,i,n,l]=jf(o.target);let[c,d,p,h]=kt(t);r.forEach((({x:t,y:o})=>{const r=de(t,6),a=de(o,6);n&&!ny(a,s.y)&&(c=Math.max(c,o)),e&&!ny(r,s.x)&&(d=Math.min(d,t)),l&&!ny(a,s.y)&&(p=Math.min(p,o)),i&&!ny(r,s.x)&&(h=Math.max(h,t))})),u=it([c,d,p,h]),ut(u,.9999,a)}}return pt(u,l,c,a),u};function ay(e){let t,o;return t=new gh({props:{items:e[12]}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};4096&o[0]&&(i.items=e[12]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function sy(e){let t,o,i;return o=new hf({props:{$$slots:{default:[ay]},$$scope:{ctx:e}}}),{c(){t=Fr("div"),Na(o.$$.fragment),Nr(t,"slot","header")},m(e,n){Ar(e,t,n),Ha(o,t,null),i=!0},p(e,t){const i={};4096&t[0]|1024&t[7]&&(i.$$scope={dirty:t,ctx:e}),o.$set(i)},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Lr(t),ja(o)}}}function ly(e){let t,o;return t=new wh({props:{onclick:e[90],label:e[4].cropLabelButtonRecenter,icon:e[4].cropIconButtonRecenter,disabled:!e[9],hideLabel:!0,class:"PinturaButtonCenter",style:`opacity:${e[31]};transform:translate3d(${e[32].x}px, ${e[32].y}px,0)`}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};16&o[0]&&(i.label=e[4].cropLabelButtonRecenter),16&o[0]&&(i.icon=e[4].cropIconButtonRecenter),512&o[0]&&(i.disabled=!e[9]),3&o[1]&&(i.style=`opacity:${e[31]};transform:translate3d(${e[32].x}px, ${e[32].y}px,0)`),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function cy(e){let t,o;return t=new Vf({props:{rect:e[8],bounds:e[14],visible:e[13],cornerStyle:e[1]}}),t.$on("resizestart",e[70]),t.$on("resizemove",e[71]),t.$on("resizeend",e[72]),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};256&o[0]&&(i.rect=e[8]),16384&o[0]&&(i.bounds=e[14]),8192&o[0]&&(i.visible=e[13]),2&o[0]&&(i.cornerStyle=e[1]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function dy(e){let t,o;return{c(){t=Fr("div"),o=Fr("p"),Nr(t,"class","PinturaImageInfo"),Nr(t,"data-custom",e[24])},m(i,n){Ar(i,t,n),Rr(t,o),o.innerHTML=e[23]},p(e,i){8388608&i[0]&&(o.innerHTML=e[23]),16777216&i[0]&&Nr(t,"data-custom",e[24])},d(e){e&&Lr(t)}}}function uy(e){let t,o,i,n,r,a,s,l,c=e[22]&&e[10]&&ly(e),d=e[22]&&cy(e),u=e[11]&&dy(e);return{c(){t=Fr("div"),o=Fr("div"),c&&c.c(),i=Or(),d&&d.c(),r=Or(),u&&u.c(),Nr(o,"class","PinturaStage"),Nr(t,"slot","main")},m(p,h){Ar(p,t,h),Rr(t,o),c&&c.m(o,null),Rr(o,i),d&&d.m(o,null),e[168](o),Rr(t,r),u&&u.m(t,null),a=!0,s||(l=[wr(Dc.call(null,o)),Wr(o,"measure",e[166]),Wr(o,"wheel",(function(){sr(e[2]&&e[89])&&(e[2]&&e[89]).apply(this,arguments)}),{passive:!1}),Wr(o,"interactionstart",e[76]),Wr(o,"interactionupdate",e[77]),Wr(o,"interactionrelease",e[79]),Wr(o,"interactionend",e[78]),wr(n=Ch.call(null,o,{drag:!0,inertia:!0,pinch:e[2],shouldStartInteraction:vy,getEventPosition:e[169]})),Wr(o,"gesturedown",e[86]),Wr(o,"gestureupdate",e[87]),Wr(o,"gestureup",e[88]),wr(Nf.call(null,o))],s=!0)},p(r,a){(e=r)[22]&&e[10]?c?(c.p(e,a),4195328&a[0]&&Ea(c,1)):(c=ly(e),c.c(),Ea(c,1),c.m(o,i)):c&&(Ra(),Aa(c,1,1,(()=>{c=null})),Ia()),e[22]?d?(d.p(e,a),4194304&a[0]&&Ea(d,1)):(d=cy(e),d.c(),Ea(d,1),d.m(o,null)):d&&(Ra(),Aa(d,1,1,(()=>{d=null})),Ia()),n&&sr(n.update)&&67108868&a[0]&&n.update.call(null,{drag:!0,inertia:!0,pinch:e[2],shouldStartInteraction:vy,getEventPosition:e[169]}),e[11]?u?u.p(e,a):(u=dy(e),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},i(e){a||(Ea(c),Ea(d),a=!0)},o(e){Aa(c),Aa(d),a=!1},d(o){o&&Lr(t),c&&c.d(),d&&d.d(),e[168](null),u&&u.d(),s=!1,ar(l)}}}function py(e){let t,o,i,n;const r=[{class:"PinturaControlList"},{tabs:e[7]},e[19]];let a={$$slots:{default:[hy,({tab:e})=>({226:e}),({tab:e})=>[0,0,0,0,0,0,0,e?512:0]]},$$scope:{ctx:e}};for(let e=0;e<r.length;e+=1)a=ir(a,r[e]);t=new od({props:a}),t.$on("select",e[167]);const s=[{class:"PinturaControlPanels"},{panelClass:"PinturaControlPanel"},{panels:e[18]},e[19]];let l={$$slots:{default:[$y,({panel:e})=>({225:e}),({panel:e})=>[0,0,0,0,0,0,0,e?256:0]]},$$scope:{ctx:e}};for(let e=0;e<s.length;e+=1)l=ir(l,s[e]);return i=new gd({props:l}),{c(){Na(t.$$.fragment),o=Or(),Na(i.$$.fragment)},m(e,r){Ha(t,e,r),Ar(e,o,r),Ha(i,e,r),n=!0},p(e,o){const n=524416&o[0]?Wa(r,[r[0],128&o[0]&&{tabs:e[7]},524288&o[0]&&_a(e[19])]):{};1536&o[7]&&(n.$$scope={dirty:o,ctx:e}),t.$set(n);const a=786432&o[0]?Wa(s,[s[0],s[1],262144&o[0]&&{panels:e[18]},524288&o[0]&&_a(e[19])]):{};2046853144&o[0]|1280&o[7]&&(a.$$scope={dirty:o,ctx:e}),i.$set(a)},i(e){n||(Ea(t.$$.fragment,e),Ea(i.$$.fragment,e),n=!0)},o(e){Aa(t.$$.fragment,e),Aa(i.$$.fragment,e),n=!1},d(e){ja(t,e),e&&Lr(o),ja(i,e)}}}function hy(e){let t,o,i=e[226].label+"";return{c(){t=Fr("span"),o=Dr(i)},m(e,i){Ar(e,t,i),Rr(t,o)},p(e,t){512&t[7]&&i!==(i=e[226].label+"")&&Ur(o,i)},d(e){e&&Lr(t)}}}function my(e){let t,o;return t=new Ef({props:{elasticity:e[27]*e[46],base:xy,min:e[25],max:by,valueMin:e[29][0],valueMax:e[29][1],value:e[30],labelReset:e[4].labelReset,valueLabel:Math.round(100*e[30])+"%",oninputstart:e[83],oninputmove:e[84],oninputend:e[85]}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};134217728&o[0]&&(i.elasticity=e[27]*e[46]),33554432&o[0]&&(i.min=e[25]),536870912&o[0]&&(i.valueMin=e[29][0]),536870912&o[0]&&(i.valueMax=e[29][1]),1073741824&o[0]&&(i.value=e[30]),16&o[0]&&(i.labelReset=e[4].labelReset),1073741824&o[0]&&(i.valueLabel=Math.round(100*e[30])+"%"),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function gy(e){let t,o;return t=new qf({props:{elasticity:e[27]*e[46],rotation:e[15],labelReset:e[4].labelReset,valueMin:e[28][0],valueMax:e[28][1],rotationMin:-e[3],rotationMax:e[3],oninputstart:e[73],oninputmove:e[74],oninputend:e[75]}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};134217728&o[0]&&(i.elasticity=e[27]*e[46]),32768&o[0]&&(i.rotation=e[15]),16&o[0]&&(i.labelReset=e[4].labelReset),268435456&o[0]&&(i.valueMin=e[28][0]),268435456&o[0]&&(i.valueMax=e[28][1]),8&o[0]&&(i.rotationMin=-e[3]),8&o[0]&&(i.rotationMax=e[3]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function $y(e){let t,o,i,n;const r=[gy,my],a=[];function s(e,t){return e[225]===e[95]+"-rotation"?0:e[225]===e[95]+"-zoom"?1:-1}return~(t=s(e))&&(o=a[t]=r[t](e)),{c(){o&&o.c(),i=Br()},m(e,o){~t&&a[t].m(e,o),Ar(e,i,o),n=!0},p(e,n){let l=t;t=s(e),t===l?~t&&a[t].p(e,n):(o&&(Ra(),Aa(a[l],1,1,(()=>{a[l]=null})),Ia()),~t?(o=a[t],o?o.p(e,n):(o=a[t]=r[t](e),o.c()),Ea(o,1),o.m(i.parentNode,i)):o=null)},i(e){n||(Ea(o),n=!0)},o(e){Aa(o),n=!1},d(e){~t&&a[t].d(e),e&&Lr(i)}}}function fy(e){let t,o,i=e[20]&&py(e);return{c(){t=Fr("div"),i&&i.c(),Nr(t,"slot","footer"),Zr(t,"transform",e[17])},m(e,n){Ar(e,t,n),i&&i.m(t,null),o=!0},p(e,o){e[20]?i?(i.p(e,o),1048576&o[0]&&Ea(i,1)):(i=py(e),i.c(),Ea(i,1),i.m(t,null)):i&&(Ra(),Aa(i,1,1,(()=>{i=null})),Ia()),131072&o[0]&&Zr(t,"transform",e[17])},i(e){o||(Ea(i),o=!0)},o(e){Aa(i),o=!1},d(e){e&&Lr(t),i&&i.d()}}}function yy(e){let t,o,i;function n(t){e[170](t)}let r={hasHeader:e[21],$$slots:{footer:[fy],main:[uy],header:[sy]},$$scope:{ctx:e}};return void 0!==e[16]&&(r.root=e[16]),t=new Mf({props:r}),pa.push((()=>Va(t,"root",n))),t.$on("measure",e[171]),{c(){Na(t.$$.fragment)},m(e,o){Ha(t,e,o),i=!0},p(e,i){const n={};2097152&i[0]&&(n.hasHeader=e[21]),2145320958&i[0]|3&i[1]|1024&i[7]&&(n.$$scope={dirty:i,ctx:e}),!o&&65536&i[0]&&(o=!0,n.root=e[16],xa((()=>o=!1))),t.$set(n)},i(e){i||(Ea(t.$$.fragment,e),i=!0)},o(e){Aa(t.$$.fragment,e),i=!1},d(e){ja(t,e)}}}const by=1,xy=0,vy=(e,t)=>e.target===t;function wy(e,t,o){let i,n,r,a,s,l,c,d,u,p,h,m,g,$,f,y,b,x,v,w,S,k,C,T,M,P,I,E,A,F,z,D,O,B,W,_,V,N,H,j,U,G,Z,q,K,ee,te,oe,ie,ne,ue,pe,he,ge,ye,ve,Se,Te,Pe,Re,Ie,Ee,Ae,Le,Fe,ze,De,Be,Ve,He,Ye,qe,Ke,Je,Qe=tr,tt=()=>(Qe(),Qe=ur(it,(e=>o(13,z=e))),it);e.$$.on_destroy.push((()=>Qe()));let{isActive:it}=t;tt();let{stores:nt}=t,{cropImageSelectionCornerStyle:rt="circle"}=t,{cropWillRenderImageSelectionGuides:at=((e,t)=>{const o="rotate"==e;return{rows:o?5:3,cols:o?5:3,opacity:.25*t}})}=t,{cropAutoCenterImageSelectionTimeout:pt}=t,{cropEnableZoomMatchImageAspectRatio:ht=!0}=t,{cropEnableRotateMatchImageAspectRatio:ft="never"}=t,{cropEnableRotationInput:yt=!0}=t,{cropEnableZoom:bt=!0}=t,{cropEnableZoomInput:Ct=!0}=t,{cropEnableZoomAutoHide:Mt=!0}=t,{cropEnableImageSelection:Pt=!0}=t,{cropEnableInfoIndicator:Rt=!1}=t,{cropEnableZoomTowardsWheelPosition:It=!0}=t,{cropEnableLimitWheelInputToCropSelection:Et=!0}=t,{cropEnableCenterImageSelection:At=!0}=t,{cropEnableButtonRotateLeft:Lt=!0}=t,{cropEnableButtonRotateRight:Ft=!1}=t,{cropEnableButtonFlipHorizontal:zt=!0}=t,{cropEnableButtonFlipVertical:Dt=!1}=t,{cropSelectPresetOptions:Ot}=t,{cropEnableSelectPreset:Bt=!0}=t,{cropEnableFilterMatchAspectRatio:Wt=!0}=t,{cropSelectPresetFilter:_t=!1}=t,{cropEnableButtonToggleCropLimit:Vt=!1}=t,{cropWillRenderTools:Nt=Y}=t,{cropWillRenderInfoIndicator:Ht}=t,{cropActiveTransformTool:jt="rotation"}=t,{cropMinimizeToolbar:Ut="auto"}=t,{cropInteractionFocus:Gt="image"}=t,{cropRotationRange:Zt=J}=t,{cropMaskOpacity:Xt=.85}=t,{locale:Yt={}}=t,{cropFormatIconSelectPreset:qt=function(e){const{aspectRatio:t}=e,[o,i,n]=t?[t<1?1:.3,1===t?.85:.5,t>1?1:.3]:[.2,.3,.4];return{a:o,b:i,c:n}}}=t,{cropFormatIconCropBoundary:Kt=function(e){const{isBoundToImage:t}=e,[o,i,n,r]=t?[.3,1,0,0]:[0,0,.3,1];return{a:o,b:i,c:n,d:r}}}=t;const Jt=ca("isAnimated");hr(e,Jt,(e=>o(144,D=e)));const Qt=ca("elasticityMultiplier");hr(e,Qt,(e=>o(27,Ve=e)));const eo=ca("redrawTrigger");hr(e,eo,(e=>o(165,Be=e)));const to=ca("imageIsStatic");hr(e,to,(e=>o(150,H=e)));const oo=ca("imageStaticVisualCorners");hr(e,oo,(e=>o(187,Ie=e)));const io=ca("fixScrollDirection");hr(e,io,(e=>o(181,ge=e)));let no="idle";const ro=Ya();hr(e,ro,(e=>o(162,Fe=e)));const ao=()=>void 0===Pe,so=e=>1/e,lo=e=>{Wt&&_t!==e&&(o(97,_t=e),Pe&&1!==Pe&&co()&&vr(Xo,Pe=so(Pe),Pe))},co=()=>{if(1===Pe||!i)return!1;const e=so(Pe);return!!iu(Fe).find((([t])=>t===e))},uo=(e,t,o)=>Q(o)?t.width===Math.round(e.height)||t.height===Math.round(e.width):t.width===Math.round(e.width)||t.height===Math.round(e.height),po=()=>(ao()||"always"===ft&&co())&&((e,t,o)=>{const i=Xe(Ge(Oe(t),o),(e=>Math.abs(Math.round(e)))),n=Ue(i),r=ct(e);return we(n,r)})(U,ne,ue)&&uo(U,ne,ue),ho=e=>{if("never"!==ft&&po()){vr(Fo,ue+=e,ue);const t=Q(ue),o=t?ne.height:ne.width,i=t?ne.width:ne.height;vr(jo,U=lt(0,0,o,i),U),ao()||vr(Xo,Pe=X(o,i),Pe)}else vr(Fo,ue+=e,ue)},{history:mo,env:go,isInteracting:$o,isInteractingFraction:fo,isTransformingImage:yo,rootRect:bo,stageRect:xo,utilRect:vo,utilRectPadded:wo,rootLineColor:So,allowPan:ko,allowZoom:Co,allowPlayPause:To,rangeInputElasticity:Mo,presentationScalar:Po,utilTools:Ro,imagePreviewModifiers:Io,imageOutlineOpacity:Eo,imageFlipX:Ao,imageFlipY:Lo,imageRotation:Fo,imageRotationRange:zo,imageOutputSize:Do,imageSelectionRect:Oo,imageSelectionRectSnapshot:Bo,imageSelectionRectIntent:Wo,imageSelectionRectPresentation:Vo,imageCropRectIntent:No,imageCropRectOrigin:Ho,imageCropRect:jo,imageCropMinSize:Uo,imageCropMaxSize:Go,imageCropRange:Zo,imageCropAspectRatio:Xo,imageCropLimitToImage:Yo,imageSize:qo,imageScalar:Ko,imageOverlayMarkup:Jo,stagePadded:Qo,stageRecenter:ei}=nt;function ti(e,t){return R(e.cropIconSelectPreset)?ru(e.cropIconSelectPreset,e,t):Il(e.cropIconSelectPreset,qt({aspectRatio:t}),"{","}")}function oi(e,t){return R(e.cropIconCropBoundary)?ru(e.cropIconCropBoundary,e,t):Il(e.cropIconCropBoundary,Kt({isBoundToImage:t}),"{","}")}let ii;hr(e,go,(e=>o(145,O=e))),hr(e,$o,(e=>o(149,N=e))),hr(e,yo,(e=>o(179,oe=e))),hr(e,bo,(e=>o(26,ye=e))),hr(e,xo,(e=>o(157,te=e))),hr(e,wo,(e=>o(14,q=e))),hr(e,Po,(e=>o(154,Z=e))),hr(e,Ro,(e=>o(189,Ae=e))),hr(e,Io,(e=>o(178,_=e))),hr(e,Ao,(e=>o(164,De=e))),hr(e,Lo,(e=>o(163,ze=e))),hr(e,Fo,(e=>o(15,ue=e))),hr(e,zo,(e=>o(28,He=e))),hr(e,Do,(e=>o(151,j=e))),hr(e,Oo,(e=>o(156,ee=e))),hr(e,Bo,(e=>o(155,K=e))),hr(e,Wo,(e=>o(188,Ee=e))),hr(e,Vo,(e=>o(148,V=e))),hr(e,No,(e=>o(182,ve=e))),hr(e,Ho,(e=>o(184,Te=e))),hr(e,jo,(e=>o(152,U=e))),hr(e,Uo,(e=>o(160,he=e))),hr(e,Go,(e=>o(186,Re=e))),hr(e,Zo,(e=>o(183,Se=e))),hr(e,Xo,(e=>o(185,Pe=e))),hr(e,Yo,(e=>o(159,pe=e))),hr(e,qo,(e=>o(158,ne=e))),hr(e,Ko,(e=>o(153,G=e))),hr(e,Qo,(e=>o(147,W=e)));const ni=(e,t)=>{const o={target:e,translate:t},i=je(Oe(he),Z),n=je(Oe(Re),Z);let r=Uf(K,o,{...q,x:0,y:0},{aspectRatio:Pe,minSize:i,maxSize:n});if(r=((e,t,o)=>{const[i,n,r,a]=kt(e),s={...e};if(i<t.y&&(e.height=e.height-(t.y-i),e.y=t.y),n>t.x+t.width&&(e.width=t.x+t.width-e.x),r>t.y+t.height&&(e.height=t.y+t.height-e.y),a<t.x&&(e.width=e.width-(t.x-a),e.x=t.x),o){const t=Math.min(1,s.width/e.width,s.height/e.height);return mt(s,t)}return e})(r,{...q,x:0,y:0},Pe),!pe)return{boundsLimited:r,boundsIntent:r};let a=ry(K,r,o,Ie,{aspectRatio:Pe,minSize:i,maxSize:n});return{boundsLimited:a,boundsIntent:a}},ri=(e,t)=>{const o={target:e,translate:t},i=je(Oe(he),Z),n=je(Oe(Re),Z),r=((e,t,o={})=>{const{target:i,translate:n}=t,{aspectRatio:r,minSize:a}=o,s=ce[Hf[i]],l=ke(et(e),me(s[0]*e.width,s[1]*e.height)),c=ce[i],d=ke(et(e),me(c[0]*e.width,c[1]*e.height)),[u,p,h,m,g,$,f]=jf(i);let y=n.x,b=n.y;g?b=0:$&&(y=0);let[x,v,w,S]=kt(e);if(u?S=l.x:p&&(v=l.x),m?x=l.y:h&&(w=l.y),u?v=d.x+y:p&&(S=d.x+y),m?w=d.y+b:h&&(x=d.y+b),a&&g&&w-x<a.height){const e=a.height-(w-x);x-=.5*e,w+=.5*e}if(a&&$&&v-S<a.width){const e=a.width-(v-S);S-=.5*e,v+=.5*e}if(r)if(f){let e=v-S,t=w-x;g?(t=e/r,x=l.y-.5*t,w=l.y+.5*t):$&&(e=t*r,S=l.x-.5*e,v=l.x+.5*e)}else{const e=me(d.x+y-l.x,d.y+b-l.y);i===ae?(e.x=Math.max(0,e.x),e.y=Math.min(0,e.y)):i===se?(e.x=Math.max(0,e.x),e.y=Math.max(0,e.y)):i===le?(e.x=Math.min(0,e.x),e.y=Math.max(0,e.y)):i===re&&(e.x=Math.min(0,e.x),e.y=Math.min(0,e.y));const t=be(e),o=me(r,1),n=Me(xe(o),t);i===ae?(v=l.x+n.x,x=l.y-n.y):i===se?(v=l.x+n.x,w=l.y+n.y):i===le?(S=l.x-n.x,w=l.y+n.y):i===re&&(S=l.x-n.x,x=l.y-n.y)}return lt(S,x,v-S,w-x)})(K,o,{aspectRatio:Pe,minSize:i});return{boundsLimited:Uf(K,o,{...q,x:0,y:0},{aspectRatio:Pe,minSize:i,maxSize:n}),boundsIntent:r}};let ai=void 0,si=void 0;const li=({translation:e,scalar:t})=>{H&&(t=1,e=fe($e(e)));const o=Math.min(ee.width/U.width,ee.height/U.height),i=Me($e(e),1/o);let n;if(si){const t=Ce($e(si),e);si=e,n=dt(et(U),t)}else n=dt(et(ai),fe($e(i))),void 0!==t&&ut(n,1/t);vr(No,ve=n,ve),vr(jo,U=n,U)},ci=qa([Zo,jo],(([e,t],o)=>{if(!t)return;const[i,n]=e,r=$t(t);o([We(Tt(wt(i,r),de)),We(Tt(St(n,r),de))])}));hr(e,ci,(e=>o(180,ie=e)));const di=qa([qo,Yo,Uo,Go,Zo,Fo],(([e,t,o,i,n,r],a)=>{if(!e)return;const s=n[0],l=n[1];let c,d;t?(c=((e,t,o)=>Q(o)?1-1/Math.min(e.height/t.width,e.width/t.height):1-1/Math.min(e.width/t.width,e.height/t.height))(e,l,r),d=Math.min(s.width/o.width,s.height/o.height)):(c=-1,d=1);a([c,d].map((e=>de(e))))}));hr(e,di,(e=>o(29,Ye=e)));const ui=qa([qo,jo,Zo,Fo],(([e,t,o,i],n)=>{if(!e||!t)return n(0);let r;const a=o[0],s=o[1],l=t.width,c=t.height,d=$t(t),u=Q(i)?Ne(e.height,e.width):e,p=St(u,d);if(l<=p.width||c<=p.height){const e=p.width-a.width,t=p.height-a.height;r=0===e||0===t?1:1-Math.min((l-a.width)/e,(c-a.height)/t)}else{const e=s.width-p.width,t=s.height-p.height,o=St({width:e,height:t},d);r=-Math.min((l-p.width)/o.width,(c-p.height)/o.height)}n(r)}));hr(e,ui,(e=>o(30,qe=e)));const pi=e=>{const t=$t(ai);let o,i,n;const r=Q(ue)?Ne(ne.height,ne.width):ne,a=St(r,t);if(e>=0){const r=a.width-Se[0].width,s=a.height-Se[0].height;o=a.width-r*e,i=a.height-s*e,n=wt({width:o,height:i},t)}else{const r=Se[1].width-a.width,s=Se[1].height-a.height;o=a.width+r*-e,i=a.height+s*-e,n=St({width:o,height:i},t)}o=n.width,i=n.height;const s=ai.x+.5*ai.width-.5*o,l=ai.y+.5*ai.height-.5*i;vr(jo,U={x:s,y:l,width:o,height:i},U)};let hi;const mi=e=>{const t=ut(et(hi),1/e);vr(No,ve=t,ve),vr(jo,U=t,U)};let gi;const $i=()=>{ei.set({})};let fi;const yi=xc(0,{precision:1e-4});hr(e,yi,(e=>o(31,Ke=e)));const bi=xc();hr(e,bi,(e=>o(32,Je=e)));const xi=qa([Xo,Do,ro],(([e,t,o],n)=>{if(!i)return;const r=iu(o),a=[...r].map((e=>e[0])).sort(((e,t)=>_o(e[0])&&!_o(t[0])?1:-1)).find((o=>{if(_o(o)&&t){const[i,n]=o,r=t.width===i&&t.height===n,a=e===X(i,n);return r&&a}return o===e}));if(!a)return n(void 0);n(r.map((e=>e[0])).findIndex((e=>_o(e)?vs(e,a):e===a)))}));hr(e,xi,(e=>o(161,Le=e)));const vi=(e,t)=>{if(!i||-1===e||void 0===e)return;const o=iu(t)[e][0];return o?_o(o)?X(o[0],o[1]):o:void 0},wi=qa([So,Vo,fo],(([e,t,o],i)=>{const{rows:n,cols:r,opacity:a}=at(no,o);if(!t||a<=0)return i([]);const{x:s,y:l,width:c,height:d}=t,u=c/r,p=d/n,h=[];for(let t=1;t<=n-1;t++){const o=l+p*t;h.push({id:"image-selection-guide-row-"+t,points:[me(s,o),me(s+c,o)],opacity:a,strokeWidth:1,strokeColor:e})}for(let t=1;t<=r-1;t++){const o=s+u*t;h.push({id:"image-selection-guide-col-"+t,points:[me(o,l),me(o,l+d)],opacity:a,strokeWidth:1,strokeColor:e})}i(h)}));hr(e,wi,(e=>o(146,B=e)));const Si="crop-"+L();let ki,Ci=Si+"-"+(yt?jt:"zoom"),Ti=Ci,Mi=void 0;const Pi=xc(D?20:0);hr(e,Pi,(e=>o(143,F=e)));return e.$$set=e=>{"isActive"in e&&tt(o(0,it=e.isActive)),"stores"in e&&o(99,nt=e.stores),"cropImageSelectionCornerStyle"in e&&o(1,rt=e.cropImageSelectionCornerStyle),"cropWillRenderImageSelectionGuides"in e&&o(100,at=e.cropWillRenderImageSelectionGuides),"cropAutoCenterImageSelectionTimeout"in e&&o(101,pt=e.cropAutoCenterImageSelectionTimeout),"cropEnableZoomMatchImageAspectRatio"in e&&o(102,ht=e.cropEnableZoomMatchImageAspectRatio),"cropEnableRotateMatchImageAspectRatio"in e&&o(103,ft=e.cropEnableRotateMatchImageAspectRatio),"cropEnableRotationInput"in e&&o(104,yt=e.cropEnableRotationInput),"cropEnableZoom"in e&&o(2,bt=e.cropEnableZoom),"cropEnableZoomInput"in e&&o(105,Ct=e.cropEnableZoomInput),"cropEnableZoomAutoHide"in e&&o(106,Mt=e.cropEnableZoomAutoHide),"cropEnableImageSelection"in e&&o(107,Pt=e.cropEnableImageSelection),"cropEnableInfoIndicator"in e&&o(108,Rt=e.cropEnableInfoIndicator),"cropEnableZoomTowardsWheelPosition"in e&&o(109,It=e.cropEnableZoomTowardsWheelPosition),"cropEnableLimitWheelInputToCropSelection"in e&&o(110,Et=e.cropEnableLimitWheelInputToCropSelection),"cropEnableCenterImageSelection"in e&&o(111,At=e.cropEnableCenterImageSelection),"cropEnableButtonRotateLeft"in e&&o(112,Lt=e.cropEnableButtonRotateLeft),"cropEnableButtonRotateRight"in e&&o(113,Ft=e.cropEnableButtonRotateRight),"cropEnableButtonFlipHorizontal"in e&&o(114,zt=e.cropEnableButtonFlipHorizontal),"cropEnableButtonFlipVertical"in e&&o(115,Dt=e.cropEnableButtonFlipVertical),"cropSelectPresetOptions"in e&&o(116,Ot=e.cropSelectPresetOptions),"cropEnableSelectPreset"in e&&o(117,Bt=e.cropEnableSelectPreset),"cropEnableFilterMatchAspectRatio"in e&&o(118,Wt=e.cropEnableFilterMatchAspectRatio),"cropSelectPresetFilter"in e&&o(97,_t=e.cropSelectPresetFilter),"cropEnableButtonToggleCropLimit"in e&&o(119,Vt=e.cropEnableButtonToggleCropLimit),"cropWillRenderTools"in e&&o(120,Nt=e.cropWillRenderTools),"cropWillRenderInfoIndicator"in e&&o(121,Ht=e.cropWillRenderInfoIndicator),"cropActiveTransformTool"in e&&o(122,jt=e.cropActiveTransformTool),"cropMinimizeToolbar"in e&&o(123,Ut=e.cropMinimizeToolbar),"cropInteractionFocus"in e&&o(124,Gt=e.cropInteractionFocus),"cropRotationRange"in e&&o(3,Zt=e.cropRotationRange),"cropMaskOpacity"in e&&o(125,Xt=e.cropMaskOpacity),"locale"in e&&o(4,Yt=e.locale),"cropFormatIconSelectPreset"in e&&o(126,qt=e.cropFormatIconSelectPreset),"cropFormatIconCropBoundary"in e&&o(127,Kt=e.cropFormatIconCropBoundary)},e.$$.update=()=>{8192&e.$$.dirty[0]|1&e.$$.dirty[4]&&to.set("selection"===Gt&&z),8388608&e.$$.dirty[3]&&o(134,i=Ot&&Array.isArray(Ot)&&Ot.length),8388608&e.$$.dirty[3]|1024&e.$$.dirty[4]&&ro.set(i?Ot:[]),8192&e.$$.dirty[0]|1048576&e.$$.dirty[4]&&z&&Eo.set(1,{hard:!D}),8192&e.$$.dirty[0]&&ko.set(!z),8192&e.$$.dirty[0]&&Co.set(!z),8192&e.$$.dirty[0]&&z&&To.set(!0),2097152&e.$$.dirty[4]&&o(129,h="overlay"===O.layoutMode),16777216&e.$$.dirty[3]|32&e.$$.dirty[4]&&o(133,S=Bt&&!h),16384&e.$$.dirty[0]|2&e.$$.dirty[5]&&o(142,l=q&&ee&&xt(q,ee)),262144&e.$$.dirty[4]|2&e.$$.dirty[5]&&o(140,c=!(!ee||!l)),327680&e.$$.dirty[4]|2&e.$$.dirty[5]&&o(138,d=c&>(ee,l,(e=>de(e,5)))),32784&e.$$.dirty[0]|209190928&e.$$.dirty[3]|2115072&e.$$.dirty[4]|2040&e.$$.dirty[5]&&o(12,n=Be&&Nt([Lt&&["Button","rotate-left",{label:Yt.cropLabelButtonRotateLeft,labelClass:"PinturaToolbarContentWide",icon:Yt.cropIconButtonRotateLeft,onclick:()=>{ho(-Math.PI/2),mo.write()}}],Ft&&["Button","rotate-right",{label:Yt.cropLabelButtonRotateRight,labelClass:"PinturaToolbarContentWide",icon:Yt.cropIconButtonRotateRight,onclick:()=>{ho(Math.PI/2),mo.write()}}],zt&&["Button","flip-horizontal",{label:Yt.cropLabelButtonFlipHorizontal,labelClass:"PinturaToolbarContentWide",icon:Yt.cropIconButtonFlipHorizontal,onclick:()=>{Q(ue)?vr(Lo,ze=!ze,ze):vr(Ao,De=!De,De),mo.write()}}],Dt&&["Button","flip-vertical",{label:Yt.cropLabelButtonFlipVertical,labelClass:"PinturaToolbarContentWide",icon:Yt.cropIconButtonFlipVertical,onclick:()=>{Q(ue)?vr(Ao,De=!De,De):vr(Lo,ze=!ze,ze),mo.write()}}],S&&i&&[!1===_t?"Dropdown":ty,"select-preset",{icon:ti(Yt,vi(Le,Fe)),label:ru(Yt.cropLabelSelectPreset,Yt,vi(Le,Fe)),labelClass:"PinturaToolbarContentWide",options:Fe,filter:_t,onfilterchange:lo,selectedIndex:Le,onchange:({value:e})=>{_o(e)?(vr(Xo,Pe=X(e[0],e[1]),Pe),vr(Do,j=_e(e),j)):vr(Xo,Pe=e,Pe),d&&$i(),mo.write()},optionMapper:e=>{let t=!1;const o=_o(e.value)?e.value[0]/e.value[1]:e.value;if(o){const e=hs(ne,ue,o);t=e.width<he.width||e.height<he.height}return e.icon=((e,t={})=>{const{width:o=24,height:i=24,bounds:n=16,radius:r=3}=t;let a,s,l,c,d=_o(e)?X(e[0],e[1]):e,u=!!d;return d=u?d:1,l=d>1?n:d*n,c=l/d,a=Math.round(.5*(o-l)),s=Math.round(.5*(i-c)),`<rect fill="${u?"currentColor":"none"}" stroke="${u?"none":"currentColor"}" stroke-width="${o/16}" stroke-dasharray="${[o/12,o/6].join(" ")}" x="${a}" y="${s}" width="${l}" height="${c}" rx="${r}"/>`})(e.value,{bounds:14}),{...e,disabled:t}}}],Vt&&["Dropdown","select-crop-limit",{icon:oi(Yt,pe),label:Yt.cropLabelCropBoundary,labelClass:"PinturaToolbarContentWide",onchange:({value:e})=>{vr(Yo,pe=e,pe),mo.write()},options:[[!0,Yt.cropLabelCropBoundaryEdge,{icon:oi(Yt,!0)}],[!1,Yt.cropLabelCropBoundaryNone,{icon:oi(Yt,!1)}]]}]].filter(Boolean),O,(()=>eo.set({}))).filter(Boolean)),12288&e.$$.dirty[0]|1073741824&e.$$.dirty[3]|2097184&e.$$.dirty[4]&&vr(Ro,Ae=z&&"never"!==Ut&&("always"===Ut||"short"===O.verticalSpace||h)?n.map((([e,t,o])=>Array.isArray(o)?[e,t,o]:[e,t,{...o,hideLabel:!0}])):[],Ae),16&e.$$.dirty[5]&&o(25,r=pe?0:-1),16384&e.$$.dirty[0]|4&e.$$.dirty[5]&&o(135,a=q&&me(-(te.x-q.x),-(te.y-q.y))),16779264&e.$$.dirty[4]&&o(136,s=V&&a&&me(Od(V.x+.5*V.width+a.x),Od(V.y+.5*V.height+a.y))),1&e.$$.dirty[5]&&o(139,u=null!=K),16384&e.$$.dirty[0]|262144&e.$$.dirty[4]&&o(141,p=q&&l&&(l.height===q.height||l.width===q.width)),1610743808&e.$$.dirty[4]&&o(137,m=!p&&Z<1&&G<1),122880&e.$$.dirty[4]&&o(9,g=c&&!u&&(!d||m)),32768&e.$$.dirty[3]|268435488&e.$$.dirty[4]&&o(11,$=Rt&&!!U&&!h),268435456&e.$$.dirty[3]&&o(24,f=!!Ht||void 0),2048&e.$$.dirty[0]|268435456&e.$$.dirty[3]|402653184&e.$$.dirty[4]&&o(23,y=$&&Ht?Ht(U,j):$&&function(e,t){let o={};if(t){const i=e.width/e.height;t.width&&!t.height&&(o=Ne(t.width,t.width/i)),t.height&&!t.width&&(o=Ne(t.height*i,t.height)),o=Oe(t)}else o=Ne(e.width,e.height);return`${Math.round(o.width)} × ${Math.round(o.height)}`}(U,j)),16779264&e.$$.dirty[4]&&o(8,v=V&&a&&{x:V.x+a.x,y:V.y+a.y,width:V.width,height:V.height}),256&e.$$.dirty[0]|16384&e.$$.dirty[3]|32&e.$$.dirty[4]&&o(22,b=Pt&&!!v&&!h),262400&e.$$.dirty[3]|67112960&e.$$.dirty[4]&&o(10,x=At&&!!s&&!pt&&!H),512&e.$$.dirty[0]|256&e.$$.dirty[3]|33554448&e.$$.dirty[4]&&g&&pt&&!N&&(clearTimeout(fi),o(128,fi=setTimeout($i,pt))),33554448&e.$$.dirty[4]&&N&&clearTimeout(fi),1536&e.$$.dirty[0]|1048576&e.$$.dirty[4]&&yi.set(x&&g?1:0,{hard:!1===D}),1052672&e.$$.dirty[4]&&bi.set(s,{hard:!1===D}),8192&e.$$.dirty[0]|8388608&e.$$.dirty[4]&&(z&&!W?(vr(Io,_.crop={maskOpacity:Xt,maskMarkupOpacity:Xt},_),Io.set(_)):(delete _.crop,Io.set(_))),4194304&e.$$.dirty[4]&&B&&Jo.update((e=>{const t=e.filter((e=>!/^image\-selection\-guide/.test(e.id)));return z?[...t,...B]:t})),2097152&e.$$.dirty[4]&&o(132,w="short"!==O.verticalSpace),1073741824&e.$$.dirty[3]|288&e.$$.dirty[4]&&o(21,k="never"===Ut&&!h||w&&"always"!==Ut),4&e.$$.dirty[0]|4096&e.$$.dirty[3]&&o(131,C=bt&&Ct),8192&e.$$.dirty[3]|384&e.$$.dirty[4]&&o(130,T=Mt?w&&C:C),2048&e.$$.dirty[3]|64&e.$$.dirty[4]&&o(20,M=yt||T),64&e.$$.dirty[4]&&(T||o(5,Ti=Ci)),32&e.$$.dirty[0]&&o(19,P={name:Si,selected:Ti}),16&e.$$.dirty[0]|2048&e.$$.dirty[3]|64&e.$$.dirty[4]&&o(7,I=[yt&&{id:Si+"-rotation",label:Yt.cropLabelTabRotation},T&&{id:Si+"-zoom",label:Yt.cropLabelTabZoom}].filter(Boolean)),128&e.$$.dirty[0]&&o(18,E=I.map((e=>e.id))),64&e.$$.dirty[0]|32&e.$$.dirty[4]&&ki&&!ki.children.length&&h&&ki.dispatchEvent(new CustomEvent("measure",{detail:ki.rect})),8192&e.$$.dirty[0]|1048576&e.$$.dirty[4]&&D&&Pi.set(z?0:20),524288&e.$$.dirty[4]&&o(17,A=F?`translateY(${F}px)`:"none")},[it,rt,bt,Zt,Yt,Ti,ki,I,v,g,x,$,n,z,q,ue,Mi,A,E,P,M,k,b,y,f,r,ye,Ve,He,Ye,qe,Ke,Je,Jt,Qt,eo,to,oo,io,ro,go,$o,yo,bo,xo,wo,Mo,Po,Ro,Io,Ao,Lo,Fo,zo,Do,Oo,Bo,Wo,Vo,No,Ho,jo,Uo,Go,Zo,Xo,Yo,qo,Ko,Qo,()=>{no="select",vr($o,N=!0,N),vr(Bo,K=et(ee),K),ii=H?ni:ri},({detail:e})=>{const{boundsLimited:t,boundsIntent:o}=ii(e.direction,e.translation);vr(yo,oe=!0,oe),vr(Wo,Ee=o,Ee),vr(Oo,ee=t,ee)},({detail:e})=>{const{boundsLimited:t}=ii(e.direction,e.translation);vr(yo,oe=!1,oe),vr($o,N=!1,N),vr(Wo,Ee=void 0,Ee),be(e.translation)&&(vr(Oo,ee=t,ee),mo.write()),vr(Bo,K=void 0,K),no=void 0},()=>{no="rotate",vr($o,N=!0,N),vr(Ho,Te=et(U),Te)},e=>{vr(yo,oe=!0,oe),vr(Fo,ue=e,ue)},e=>{vr(yo,oe=!1,oe),vr($o,N=!1,N),vr(Fo,ue=e,ue),mo.write(),vr(Ho,Te=void 0,Te)},()=>{no="pan",si=void 0,vr($o,N=!0,N),ai=et(U)},({detail:e})=>{vr(yo,oe=!0,oe),li(e)},({detail:e})=>{vr(yo,oe=!1,oe),vr($o,N=!1,N),(be(e.translation)>0||0!==e.scalar)&&(li(e),mo.write()),vr(No,ve=void 0,ve),ai=void 0},({detail:{translation:e}})=>{H&&(e=fe($e(e))),si=e,vr($o,N=!1,N)},ci,di,ui,()=>{no="zoom",vr($o,N=!0,N),ai=et(U)},e=>{vr(yo,oe=!1,oe),pi(e)},e=>{pi(e),mo.write(),vr(yo,oe=!1,oe),vr($o,N=!1,N),ai=void 0},()=>{no="zoom",ai||(hi=et(U),vr($o,N=!0,N))},({detail:e})=>{hi&&(vr(yo,oe=!0,oe),mi(e))},({detail:e})=>{hi&&(vr(yo,oe=!1,oe),vr($o,N=!1,N),mi(e),vr(No,ve=void 0,ve),hi=void 0,mo.write())},e=>{const t=hm(e,ye,te);if(Et&&!vt(ee,t))return;no="zoom",vr($o,N=!0,N),vr(yo,oe=!0,oe),e.preventDefault(),e.stopPropagation();const o=Ih(e,{fixScrollDirection:ge}),i=1+o/100,n=et(U),r=1===Math.min(U.width/he.width,U.height/he.height);if(ht&&pe){const e=uo(U,ne,ue);if(ao()&&e&&o>0&&d){vr($o,N=!1,N),vr(yo,oe=!1,oe);const e=Q(ue)?ot({height:ne.width,width:ne.height}):ot(ne);if(gt(n,e))return;if(clearTimeout(gi),gt(mo.state.crop,e))return;return vr(jo,U=e,U),void mo.write()}}let a=ct(U);if(It&&"selection"!==Gt&&o<0&&!r){const e=Ce($e(t),ee),o=Math.min(ee.width/U.width,ee.height/U.height),i=ut(et(ee),1.1);a=vt(i,t)?ke(et(U),Me(e,1/o)):a}let s=ut(et(U),i,a);if(Ze(ie[1],s)||(s=st(ct(s),ie[1])),Ze(s,ie[0])||(s=st(ct(s),ie[0])),gt(n,s,de))return vr($o,N=!1,N),void vr(yo,oe=!1,oe);vr(jo,U=Tt(s,(e=>de(e,5))),U),vr($o,N=!1,N),vr(yo,oe=!1,oe),clearTimeout(gi),gi=setTimeout((()=>{mo.write()}),500)},$i,yi,bi,xi,wi,Si,Pi,_t,"crop",nt,at,pt,ht,ft,yt,Ct,Mt,Pt,Rt,It,Et,At,Lt,Ft,zt,Dt,Ot,Bt,Wt,Vt,Nt,Ht,jt,Ut,Gt,Xt,qt,Kt,fi,h,T,C,w,S,i,a,s,m,d,u,c,p,l,F,D,O,B,W,V,N,H,j,U,G,Z,K,ee,te,ne,pe,he,Le,Fe,ze,De,Be,function(t){da.call(this,e,t)},({detail:e})=>o(5,Ti=e),function(e){pa[e?"unshift":"push"]((()=>{ki=e,o(6,ki)}))},e=>pm(e),function(e){Mi=e,o(16,Mi)},function(t){da.call(this,e,t)}]}var Sy={util:["crop",class extends Ga{constructor(e){super(),Ua(this,e,wy,yy,lr,{name:98,isActive:0,stores:99,cropImageSelectionCornerStyle:1,cropWillRenderImageSelectionGuides:100,cropAutoCenterImageSelectionTimeout:101,cropEnableZoomMatchImageAspectRatio:102,cropEnableRotateMatchImageAspectRatio:103,cropEnableRotationInput:104,cropEnableZoom:2,cropEnableZoomInput:105,cropEnableZoomAutoHide:106,cropEnableImageSelection:107,cropEnableInfoIndicator:108,cropEnableZoomTowardsWheelPosition:109,cropEnableLimitWheelInputToCropSelection:110,cropEnableCenterImageSelection:111,cropEnableButtonRotateLeft:112,cropEnableButtonRotateRight:113,cropEnableButtonFlipHorizontal:114,cropEnableButtonFlipVertical:115,cropSelectPresetOptions:116,cropEnableSelectPreset:117,cropEnableFilterMatchAspectRatio:118,cropSelectPresetFilter:97,cropEnableButtonToggleCropLimit:119,cropWillRenderTools:120,cropWillRenderInfoIndicator:121,cropActiveTransformTool:122,cropMinimizeToolbar:123,cropInteractionFocus:124,cropRotationRange:3,cropMaskOpacity:125,locale:4,cropFormatIconSelectPreset:126,cropFormatIconCropBoundary:127},null,[-1,-1,-1,-1,-1,-1,-1,-1])}get name(){return this.$$.ctx[98]}get isActive(){return this.$$.ctx[0]}set isActive(e){this.$$set({isActive:e}),ka()}get stores(){return this.$$.ctx[99]}set stores(e){this.$$set({stores:e}),ka()}get cropImageSelectionCornerStyle(){return this.$$.ctx[1]}set cropImageSelectionCornerStyle(e){this.$$set({cropImageSelectionCornerStyle:e}),ka()}get cropWillRenderImageSelectionGuides(){return this.$$.ctx[100]}set cropWillRenderImageSelectionGuides(e){this.$$set({cropWillRenderImageSelectionGuides:e}),ka()}get cropAutoCenterImageSelectionTimeout(){return this.$$.ctx[101]}set cropAutoCenterImageSelectionTimeout(e){this.$$set({cropAutoCenterImageSelectionTimeout:e}),ka()}get cropEnableZoomMatchImageAspectRatio(){return this.$$.ctx[102]}set cropEnableZoomMatchImageAspectRatio(e){this.$$set({cropEnableZoomMatchImageAspectRatio:e}),ka()}get cropEnableRotateMatchImageAspectRatio(){return this.$$.ctx[103]}set cropEnableRotateMatchImageAspectRatio(e){this.$$set({cropEnableRotateMatchImageAspectRatio:e}),ka()}get cropEnableRotationInput(){return this.$$.ctx[104]}set cropEnableRotationInput(e){this.$$set({cropEnableRotationInput:e}),ka()}get cropEnableZoom(){return this.$$.ctx[2]}set cropEnableZoom(e){this.$$set({cropEnableZoom:e}),ka()}get cropEnableZoomInput(){return this.$$.ctx[105]}set cropEnableZoomInput(e){this.$$set({cropEnableZoomInput:e}),ka()}get cropEnableZoomAutoHide(){return this.$$.ctx[106]}set cropEnableZoomAutoHide(e){this.$$set({cropEnableZoomAutoHide:e}),ka()}get cropEnableImageSelection(){return this.$$.ctx[107]}set cropEnableImageSelection(e){this.$$set({cropEnableImageSelection:e}),ka()}get cropEnableInfoIndicator(){return this.$$.ctx[108]}set cropEnableInfoIndicator(e){this.$$set({cropEnableInfoIndicator:e}),ka()}get cropEnableZoomTowardsWheelPosition(){return this.$$.ctx[109]}set cropEnableZoomTowardsWheelPosition(e){this.$$set({cropEnableZoomTowardsWheelPosition:e}),ka()}get cropEnableLimitWheelInputToCropSelection(){return this.$$.ctx[110]}set cropEnableLimitWheelInputToCropSelection(e){this.$$set({cropEnableLimitWheelInputToCropSelection:e}),ka()}get cropEnableCenterImageSelection(){return this.$$.ctx[111]}set cropEnableCenterImageSelection(e){this.$$set({cropEnableCenterImageSelection:e}),ka()}get cropEnableButtonRotateLeft(){return this.$$.ctx[112]}set cropEnableButtonRotateLeft(e){this.$$set({cropEnableButtonRotateLeft:e}),ka()}get cropEnableButtonRotateRight(){return this.$$.ctx[113]}set cropEnableButtonRotateRight(e){this.$$set({cropEnableButtonRotateRight:e}),ka()}get cropEnableButtonFlipHorizontal(){return this.$$.ctx[114]}set cropEnableButtonFlipHorizontal(e){this.$$set({cropEnableButtonFlipHorizontal:e}),ka()}get cropEnableButtonFlipVertical(){return this.$$.ctx[115]}set cropEnableButtonFlipVertical(e){this.$$set({cropEnableButtonFlipVertical:e}),ka()}get cropSelectPresetOptions(){return this.$$.ctx[116]}set cropSelectPresetOptions(e){this.$$set({cropSelectPresetOptions:e}),ka()}get cropEnableSelectPreset(){return this.$$.ctx[117]}set cropEnableSelectPreset(e){this.$$set({cropEnableSelectPreset:e}),ka()}get cropEnableFilterMatchAspectRatio(){return this.$$.ctx[118]}set cropEnableFilterMatchAspectRatio(e){this.$$set({cropEnableFilterMatchAspectRatio:e}),ka()}get cropSelectPresetFilter(){return this.$$.ctx[97]}set cropSelectPresetFilter(e){this.$$set({cropSelectPresetFilter:e}),ka()}get cropEnableButtonToggleCropLimit(){return this.$$.ctx[119]}set cropEnableButtonToggleCropLimit(e){this.$$set({cropEnableButtonToggleCropLimit:e}),ka()}get cropWillRenderTools(){return this.$$.ctx[120]}set cropWillRenderTools(e){this.$$set({cropWillRenderTools:e}),ka()}get cropWillRenderInfoIndicator(){return this.$$.ctx[121]}set cropWillRenderInfoIndicator(e){this.$$set({cropWillRenderInfoIndicator:e}),ka()}get cropActiveTransformTool(){return this.$$.ctx[122]}set cropActiveTransformTool(e){this.$$set({cropActiveTransformTool:e}),ka()}get cropMinimizeToolbar(){return this.$$.ctx[123]}set cropMinimizeToolbar(e){this.$$set({cropMinimizeToolbar:e}),ka()}get cropInteractionFocus(){return this.$$.ctx[124]}set cropInteractionFocus(e){this.$$set({cropInteractionFocus:e}),ka()}get cropRotationRange(){return this.$$.ctx[3]}set cropRotationRange(e){this.$$set({cropRotationRange:e}),ka()}get cropMaskOpacity(){return this.$$.ctx[125]}set cropMaskOpacity(e){this.$$set({cropMaskOpacity:e}),ka()}get locale(){return this.$$.ctx[4]}set locale(e){this.$$set({locale:e}),ka()}get cropFormatIconSelectPreset(){return this.$$.ctx[126]}set cropFormatIconSelectPreset(e){this.$$set({cropFormatIconSelectPreset:e}),ka()}get cropFormatIconCropBoundary(){return this.$$.ctx[127]}set cropFormatIconCropBoundary(e){this.$$set({cropFormatIconCropBoundary:e}),ka()}}]};function ky(e){let t,o,i,n,r,a,s,l=e[77],c=(R(e[77].label)?e[77].label(e[2]):e[77].label)+"";function d(...t){return e[51](e[77],...t)}const u=()=>e[52](o,l),p=()=>e[52](null,l);return{c(){t=Fr("div"),o=Fr("div"),i=Or(),n=Fr("span"),r=Dr(c),Nr(o,"class",Py),Nr(t,"slot","option"),Nr(t,"class","PinturaFilterOption")},m(e,l){Ar(e,t,l),Rr(t,o),u(),Rr(t,i),Rr(t,n),Rr(n,r),a||(s=[Wr(o,"measure",d),wr(Dc.call(null,o))],a=!0)},p(t,o){l!==(e=t)[77]&&(p(),l=e[77],u()),4&o[0]|32768&o[2]&&c!==(c=(R(e[77].label)?e[77].label(e[2]):e[77].label)+"")&&Ur(r,c)},d(e){e&&Lr(t),p(),a=!1,ar(s)}}}function Cy(e){let t,o;return t=new Lu({props:{locale:e[2],layout:"row",options:e[3],selectedIndex:e[12],onchange:e[32],$$slots:{option:[ky,({option:e})=>({77:e}),({option:e})=>[0,0,e?32768:0]]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};4&o[0]&&(i.locale=e[2]),8&o[0]&&(i.options=e[3]),4096&o[0]&&(i.selectedIndex=e[12]),1028&o[0]|98304&o[2]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Ty(e){let t,o,i,n,r,a,s,l;function c(t){e[54](t)}function d(t){e[55](t)}function u(t){e[56](t)}let p={elasticity:e[13]*e[19],onscroll:e[53],$$slots:{default:[Cy]},$$scope:{ctx:e}};return void 0!==e[4]&&(p.maskFeatherStartOpacity=e[4]),void 0!==e[5]&&(p.maskFeatherEndOpacity=e[5]),void 0!==e[6]&&(p.maskFeatherSize=e[6]),o=new Lh({props:p}),pa.push((()=>Va(o,"maskFeatherStartOpacity",c))),pa.push((()=>Va(o,"maskFeatherEndOpacity",d))),pa.push((()=>Va(o,"maskFeatherSize",u))),o.$on("measure",e[57]),{c(){t=Fr("div"),Na(o.$$.fragment),Nr(t,"slot","footer"),Zr(t,"transform",e[11])},m(i,n){Ar(i,t,n),Ha(o,t,null),a=!0,s||(l=[Wr(t,"transitionend",e[30]),Wr(t,"measure",e[58]),wr(Dc.call(null,t,{observePosition:!0}))],s=!0)},p(e,a){const s={};8192&a[0]&&(s.elasticity=e[13]*e[19]),128&a[0]&&(s.onscroll=e[53]),5132&a[0]|65536&a[2]&&(s.$$scope={dirty:a,ctx:e}),!i&&16&a[0]&&(i=!0,s.maskFeatherStartOpacity=e[4],xa((()=>i=!1))),!n&&32&a[0]&&(n=!0,s.maskFeatherEndOpacity=e[5],xa((()=>n=!1))),!r&&64&a[0]&&(r=!0,s.maskFeatherSize=e[6],xa((()=>r=!1))),o.$set(s),2048&a[0]&&Zr(t,"transform",e[11])},i(e){a||(Ea(o.$$.fragment,e),a=!0)},o(e){Aa(o.$$.fragment,e),a=!1},d(e){e&&Lr(t),ja(o),s=!1,ar(l)}}}function My(e){let t,o;return t=new Mf({props:{$$slots:{footer:[Ty]},$$scope:{ctx:e}}}),t.$on("measure",e[59]),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};16380&o[0]|65536&o[2]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}let Py="PinturaFilterPreview";function Ry(e,t,o){let i,n,r,a,s,l,c,d,u,p,h,m,g,$,f,y,b,x,v,w,S=tr,k=()=>(S(),S=ur(P,(e=>o(43,d=e))),P),C=tr,T=()=>(C(),C=ur(M,(e=>o(49,b=e))),M);e.$$.on_destroy.push((()=>S())),e.$$.on_destroy.push((()=>C()));let{isActive:M}=t;T();let{isActiveFraction:P}=t;k();let{stores:I}=t,{locale:E}=t,{filterFunctions:A}=t,{filterOptions:L}=t;const F=ca("elasticityMultiplier");hr(e,F,(e=>o(13,w=e)));const{history:z,interfaceImages:D,stageRectBase:O,utilRect:B,animation:W,scrollElasticity:_,imageSize:V,imagePreview:N,imageCropRect:H,imageRotation:j,imageFlipX:U,imageFlipY:G,imageBackgroundColor:Z,imageGamma:X,imageColorMatrix:Y,allowPan:q,allowZoom:K,allowZoomControls:J,allowPlayPause:Q}=I;hr(e,D,(e=>o(60,u=e))),hr(e,O,(e=>o(48,y=e))),hr(e,B,(e=>o(47,f=e))),hr(e,W,(e=>o(50,x=e))),hr(e,V,(e=>o(62,h=e))),hr(e,N,(e=>o(42,c=e))),hr(e,Z,(e=>o(61,p=e))),hr(e,X,(e=>o(44,m=e))),hr(e,Y,(e=>o(40,s=e)));const ee=Ya({});hr(e,ee,(e=>o(46,$=e)));const te=(e,t)=>vr(ee,$[e.value]=t,$),oe=qa(ee,(e=>{if(!e[void 0])return;const t=e[void 0];return v&&He(v,t)?v:Oe(t)}));hr(e,oe,(e=>o(63,v=e)));const ie=qa([M,oe,H,V,j,U,G],(([e,t,o,i,n,r,a],s)=>{if(!e||!t||!i)return g;const l=ot(i),c=ct(l),d=gs(i,o,n),u=ct(d),p=Ce($e(c),u),h=fe($e(p)),m=Math.max(t.width/o.width,t.height/o.height);s({origin:h,translation:p,rotation:{x:a?Math.PI:0,y:r?Math.PI:0,z:n},scale:m})}));hr(e,ie,(e=>o(45,g=e)));const ne=xc(x?20:0);let re;hr(e,ne,(e=>o(39,a=e)));const ae={};let se,le,ce,de,ue,pe,he={x:0,y:0};const ge=Ya([]);hr(e,ge,(e=>o(41,l=e)));const ye=e=>{const t={...e,data:c,size:h,offset:{...e.offset},mask:{...e.mask},backgroundColor:p};return t.opacity=d,t.offset.y+=a,t.mask.y+=a,t.id="filter",t},be=()=>u.filter((e=>"filter"!==e.id));aa((()=>{D.set([])}));return e.$$set=e=>{"isActive"in e&&T(o(0,M=e.isActive)),"isActiveFraction"in e&&k(o(1,P=e.isActiveFraction)),"stores"in e&&o(34,I=e.stores),"locale"in e&&o(2,E=e.locale),"filterFunctions"in e&&o(35,A=e.filterFunctions),"filterOptions"in e&&o(3,L=e.filterOptions)},e.$$.update=()=>{if(262144&e.$$.dirty[1]&&q.set(b),262144&e.$$.dirty[1]&&K.set(b),262144&e.$$.dirty[1]&&J.set(b),262144&e.$$.dirty[1]&&b&&Q.set(!1),8&e.$$.dirty[0]&&o(38,i=iu(L)),640&e.$$.dirty[1]&&o(12,n=((e,t)=>{if(!e||!e.filter||!t)return 0;const o=e.filter;return t.findIndex((([e])=>{if(!A[e])return!1;const t=A[e]();return vs(t,o)}))})(s,i)),786432&e.$$.dirty[1]&&x&&ne.set(b?0:20),512&e.$$.dirty[0]|458752&e.$$.dirty[1]&&b&&f&&y&&pe&&o(37,ue={x:y.x-f.x,y:y.y-f.y+pe.y}),496&e.$$.dirty[0]|58096&e.$$.dirty[1]&&g&&ue&&he&&de&&re){const e=ue.x+de.x+he.x,t=ue.y,o=de.x+ue.x,n=o+de.width;ge.set(i.map((([i],r)=>{const a=$[i],l=he.x+a.x,c=l+a.width;if(c<0||l>de.width)return!1;const d=e+a.x,u=t+a.y,p=(e=>({origin:$e(e.origin),translation:$e(e.translation),rotation:{...e.rotation},scale:e.scale}))(g);p.offset=me(.5*a.width+d,.5*a.height+u);p.maskOpacity=1,p.mask=lt(d+0,u,a.width+0,a.height),p.maskFeather=[1,0,1,0,1,n,1,n],l<ce&&se<1&&(p.maskFeather[0]=se,p.maskFeather[1]=o,p.maskFeather[2]=1,p.maskFeather[3]=o+ce),c>de.width-ce&&le<1&&(p.maskFeather[4]=le,p.maskFeather[5]=n-ce,p.maskFeather[6]=1,p.maskFeather[7]=n),p.maskCornerRadius=re[i];let h=s&&Object.keys(s).filter((e=>"filter"!=e)).map((e=>s[e]))||[];return R(A[i])&&h.push(A[i]()),p.colorMatrix=h.length?Qn(h):void 0,p.gamma=m,p})).filter(Boolean))}if(7424&e.$$.dirty[1])if(d>0&&l){const e=[...be(),...l.map(ye)];D.set(e)}else D.set(be());256&e.$$.dirty[1]&&o(11,r=a?`translateY(${a}px)`:"none")},[M,P,E,L,se,le,ce,he,de,pe,ae,r,n,w,F,D,O,B,W,_,V,N,Z,X,Y,ee,te,oe,ie,ne,e=>{e.target.className===Py&&o(36,re=Object.keys(ae).reduce(((e,t)=>{const o=ae[t],i=getComputedStyle(o),n=["top-left","top-right","bottom-left","bottom-right"].map((e=>i.getPropertyValue(`border-${e}-radius`))).map(Rh).map((e=>1.25*e));return e[t]=n,e}),{}))},ge,({value:e})=>{vr(Y,s={...s,filter:R(A[e])?A[e]():void 0},s),z.write()},"filter",I,A,re,ue,i,a,s,l,c,d,m,g,$,f,y,b,x,(e,t)=>te(e,t.detail),function(e,t){pa[e?"unshift":"push"]((()=>{ae[t.value]=e,o(10,ae)}))},e=>o(7,he=e),function(e){se=e,o(4,se)},function(e){le=e,o(5,le)},function(e){ce=e,o(6,ce)},e=>o(8,de=e.detail),e=>o(9,pe=e.detail),function(t){da.call(this,e,t)}]}var Iy={util:["filter",class extends Ga{constructor(e){super(),Ua(this,e,Ry,My,lr,{name:33,isActive:0,isActiveFraction:1,stores:34,locale:2,filterFunctions:35,filterOptions:3},null,[-1,-1,-1])}get name(){return this.$$.ctx[33]}get isActive(){return this.$$.ctx[0]}set isActive(e){this.$$set({isActive:e}),ka()}get isActiveFraction(){return this.$$.ctx[1]}set isActiveFraction(e){this.$$set({isActiveFraction:e}),ka()}get stores(){return this.$$.ctx[34]}set stores(e){this.$$set({stores:e}),ka()}get locale(){return this.$$.ctx[2]}set locale(e){this.$$set({locale:e}),ka()}get filterFunctions(){return this.$$.ctx[35]}set filterFunctions(e){this.$$set({filterFunctions:e}),ka()}get filterOptions(){return this.$$.ctx[3]}set filterOptions(e){this.$$set({filterOptions:e}),ka()}}]};function Ey(e){let t,o,i,n;t=new Lh({props:{elasticity:e[6]*e[9],class:"PinturaControlListScroller",$$slots:{default:[Ly]},$$scope:{ctx:e}}});const r=[{class:"PinturaControlPanels"},{panelClass:"PinturaControlPanel"},{panels:e[4]},e[5]];let a={$$slots:{default:[Fy,({panel:e})=>({42:e}),({panel:e})=>[0,e?2048:0]]},$$scope:{ctx:e}};for(let e=0;e<r.length;e+=1)a=ir(a,r[e]);return i=new gd({props:a}),{c(){Na(t.$$.fragment),o=Or(),Na(i.$$.fragment)},m(e,r){Ha(t,e,r),Ar(e,o,r),Ha(i,e,r),n=!0},p(e,o){const n={};64&o[0]&&(n.elasticity=e[6]*e[9]),38&o[0]|8192&o[1]&&(n.$$scope={dirty:o,ctx:e}),t.$set(n);const a=48&o[0]?Wa(r,[r[0],r[1],16&o[0]&&{panels:e[4]},32&o[0]&&_a(e[5])]):{};128&o[0]|10240&o[1]&&(a.$$scope={dirty:o,ctx:e}),i.$set(a)},i(e){n||(Ea(t.$$.fragment,e),Ea(i.$$.fragment,e),n=!0)},o(e){Aa(t.$$.fragment,e),Aa(i.$$.fragment,e),n=!1},d(e){ja(t,e),e&&Lr(o),ja(i,e)}}}function Ay(e){let t,o,i=e[43].label+"";return{c(){t=Fr("span"),o=Dr(i)},m(e,i){Ar(e,t,i),Rr(t,o)},p(e,t){4096&t[1]&&i!==(i=e[43].label+"")&&Ur(o,i)},d(e){e&&Lr(t)}}}function Ly(e){let t,o;const i=[{class:"PinturaControlList"},{tabs:e[1]},e[5]];let n={$$slots:{default:[Ay,({tab:e})=>({43:e}),({tab:e})=>[0,e?4096:0]]},$$scope:{ctx:e}};for(let e=0;e<i.length;e+=1)n=ir(n,i[e]);return t=new od({props:n}),t.$on("select",e[24]),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const n=34&o[0]?Wa(i,[i[0],2&o[0]&&{tabs:e[1]},32&o[0]&&_a(e[5])]):{};12288&o[1]&&(n.$$scope={dirty:o,ctx:e}),t.$set(n)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Fy(e){let t,o;const i=[e[7][e[42]]];let n={};for(let e=0;e<i.length;e+=1)n=ir(n,i[e]);return t=new Ef({props:n}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const n=128&o[0]|2048&o[1]?Wa(i,[_a(e[7][e[42]])]):{};t.$set(n)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function zy(e){let t,o,i=e[5]&&Ey(e);return{c(){t=Fr("div"),i&&i.c(),Nr(t,"slot","footer"),Zr(t,"transform",e[3])},m(e,n){Ar(e,t,n),i&&i.m(t,null),o=!0},p(e,o){e[5]?i?(i.p(e,o),32&o[0]&&Ea(i,1)):(i=Ey(e),i.c(),Ea(i,1),i.m(t,null)):i&&(Ra(),Aa(i,1,1,(()=>{i=null})),Ia()),8&o[0]&&Zr(t,"transform",e[3])},i(e){o||(Ea(i),o=!0)},o(e){Aa(i),o=!1},d(e){e&&Lr(t),i&&i.d()}}}function Dy(e){let t,o;return t=new Mf({props:{$$slots:{footer:[zy]},$$scope:{ctx:e}}}),t.$on("measure",e[25]),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};254&o[0]|8192&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Oy(e,t,o){let i,n,r,a,s,l,c,d,u,p,h,m=tr,g=()=>(m(),m=ur(f,(e=>o(21,c=e))),f);e.$$.on_destroy.push((()=>m()));let{stores:$}=t,{isActive:f}=t;g();let{locale:y={}}=t,{finetuneControlConfiguration:b}=t,{finetuneOptions:x}=t,{finetuneNudgePrecision:v}=t;const{history:w,animation:S,scrollElasticity:k,rangeInputElasticity:C,imageColorMatrix:T,imageConvolutionMatrix:M,imageGamma:P,imageVignette:I,imageNoise:E,allowPan:A,allowZoom:F,allowZoomControls:z,allowPlayPause:D}=$;hr(e,S,(e=>o(22,d=e)));const O={imageColorMatrix:T,imageConvolutionMatrix:M,imageGamma:P,imageVignette:I,imageNoise:E},B=ca("elasticityMultiplier");hr(e,B,(e=>o(6,p=e)));const W="finetune-"+L(),_=Ya({});hr(e,_,(e=>o(23,u=e)));const V=Ya({});hr(e,V,(e=>o(7,h=e)));let N=[];const H=xc(d?20:0);hr(e,H,(e=>o(20,l=e)));return e.$$set=e=>{"stores"in e&&o(15,$=e.stores),"isActive"in e&&g(o(0,f=e.isActive)),"locale"in e&&o(16,y=e.locale),"finetuneControlConfiguration"in e&&o(17,b=e.finetuneControlConfiguration),"finetuneOptions"in e&&o(18,x=e.finetuneOptions),"finetuneNudgePrecision"in e&&o(19,v=e.finetuneNudgePrecision)},e.$$.update=()=>{var t;2097152&e.$$.dirty[0]&&A.set(c),2097152&e.$$.dirty[0]&&F.set(c),2097152&e.$$.dirty[0]&&z.set(c),2097152&e.$$.dirty[0]&&c&&D.set(!0),327680&e.$$.dirty[0]&&o(1,i=x?x.map((([e,t])=>({id:e,label:R(t)?t(y):t}))):[]),2&e.$$.dirty[0]&&o(2,n=i.length?i[0].id:void 0),4&e.$$.dirty[0]&&o(5,r=n&&{name:W,selected:n}),2&e.$$.dirty[0]&&o(4,a=i.map((e=>e.id))),131072&e.$$.dirty[0]&&b&&(t=b,N&&N.forEach((e=>e())),N=a.map((e=>{const{getStore:o,getValue:i=Y}=t[e];return o(O).subscribe((t=>{const o=null!=t?i(t):t;vr(_,u={...u,[e]:o},u)}))}))),8519680&e.$$.dirty[0]&&b&&u&&vr(V,h=Object.keys(u).reduce(((e,t)=>{const{base:o,min:i,max:n,getLabel:r,getStore:a,setValue:s=((e,t)=>e.set(t))}=b[t],l=a(O),c=null!=u[t]?u[t]:o;return e[t]={base:o,min:i,max:n,value:c,valueLabel:r?r(c,i,n,n-i):Math.round(100*c),oninputmove:e=>{s(l,e)},oninputend:e=>{s(l,e),w.write()},elasticity:p*C,labelReset:y.labelReset,nudgeMultiplier:v},e}),{}),h),6291456&e.$$.dirty[0]&&d&&H.set(c?0:20),1048576&e.$$.dirty[0]&&o(3,s=l?`translateY(${l}px)`:"none")},[f,i,n,s,a,r,p,h,S,k,B,_,V,H,"finetune",$,y,b,x,v,l,c,d,u,({detail:e})=>o(2,n=e),function(t){da.call(this,e,t)}]}var By={util:["finetune",class extends Ga{constructor(e){super(),Ua(this,e,Oy,Dy,lr,{name:14,stores:15,isActive:0,locale:16,finetuneControlConfiguration:17,finetuneOptions:18,finetuneNudgePrecision:19},null,[-1,-1])}get name(){return this.$$.ctx[14]}get stores(){return this.$$.ctx[15]}set stores(e){this.$$set({stores:e}),ka()}get isActive(){return this.$$.ctx[0]}set isActive(e){this.$$set({isActive:e}),ka()}get locale(){return this.$$.ctx[16]}set locale(e){this.$$set({locale:e}),ka()}get finetuneControlConfiguration(){return this.$$.ctx[17]}set finetuneControlConfiguration(e){this.$$set({finetuneControlConfiguration:e}),ka()}get finetuneOptions(){return this.$$.ctx[18]}set finetuneOptions(e){this.$$set({finetuneOptions:e}),ka()}get finetuneNudgePrecision(){return this.$$.ctx[19]}set finetuneNudgePrecision(e){this.$$set({finetuneNudgePrecision:e}),ka()}}]},Wy=(e,t)=>{const o=t.length;return e<0?e%o+o:e>=o?e%o:e};function _y(e,t,o){const i=e.slice();return i[51]=t[o].key,i[52]=t[o].index,i[53]=t[o].translate,i[16]=t[o].scale,i[54]=t[o].selected,i[15]=t[o].rotate,i[55]=t[o].dir,i[56]=t[o].center,i[57]=t[o].type,i[4]=t[o].visible,i[58]=t[o].role,i[59]=t[o].tabindex,i[60]=t[o].label,i[61]=t[o].orientation,i[62]=t[o].valuemin,i[63]=t[o].valuemax,i[64]=t[o].valuenow,i}function Vy(e){let t;return{c(){t=Fr("div"),Nr(t,"class","PinturaShapeManipulator"),Nr(t,"data-control","point"),Zr(t,"pointer-events","none"),Zr(t,"opacity",e[6]),Zr(t,"transform",`translate3d(${e[56].x}px, ${e[56].y}px, 0) scale(${e[7]}, ${e[7]})`)},m(e,o){Ar(e,t,o)},p(e,o){64&o[0]&&Zr(t,"opacity",e[6]),160&o[0]&&Zr(t,"transform",`translate3d(${e[56].x}px, ${e[56].y}px, 0) scale(${e[7]}, ${e[7]})`)},d(e){e&&Lr(t)}}}function Ny(e,t){let o,i,n,r,a,s,l,c,d,u,p,h,m,g;function $(...e){return t[23](t[52],...e)}let f="edge"===t[57]&&t[4]&&Vy(t);return{key:e,first:null,c(){o=Fr("div"),p=Or(),f&&f.c(),h=Br(),Nr(o,"role",i=t[58]),Nr(o,"tabindex",n=t[59]),Nr(o,"aria-label",r=t[60]),Nr(o,"aria-orientation",a=t[61]),Nr(o,"aria-valuemin",s=t[62]),Nr(o,"aria-valuemax",l=t[63]),Nr(o,"aria-valuenow",c=t[64]),Nr(o,"class","PinturaShapeManipulator"),Nr(o,"data-control",d=t[57]),Nr(o,"data-selected",u=t[54]),Zr(o,"cursor",t[55]?t[55]+"-resize":"move"),Zr(o,"opacity",t[6]),Zr(o,"--tx",t[53].x),Zr(o,"--ty",t[53].y),Zr(o,"--r",("edge"===t[57]?t[15]:0)+"rad"),Zr(o,"--sx","point"===t[57]?t[7]:t[16].x),Zr(o,"--sy","point"===t[57]?t[7]:t[16].y),this.first=o},m(e,i){Ar(e,o,i),Ar(e,p,i),f&&f.m(e,i),Ar(e,h,i),m||(g=[Wr(o,"nudge",$),wr(sp.call(null,o,{preventDefault:!0})),Wr(o,"interactionstart",(function(){sr(t[11]("start",t[52]))&&t[11]("start",t[52]).apply(this,arguments)})),Wr(o,"interactionupdate",(function(){sr(t[11]("move",t[52]))&&t[11]("move",t[52]).apply(this,arguments)})),Wr(o,"interactionend",(function(){sr(t[11]("end",t[52]))&&t[11]("end",t[52]).apply(this,arguments)})),wr(Ch.call(null,o,{observeKeys:!0}))],m=!0)},p(e,p){t=e,32&p[0]&&i!==(i=t[58])&&Nr(o,"role",i),32&p[0]&&n!==(n=t[59])&&Nr(o,"tabindex",n),32&p[0]&&r!==(r=t[60])&&Nr(o,"aria-label",r),32&p[0]&&a!==(a=t[61])&&Nr(o,"aria-orientation",a),32&p[0]&&s!==(s=t[62])&&Nr(o,"aria-valuemin",s),32&p[0]&&l!==(l=t[63])&&Nr(o,"aria-valuemax",l),32&p[0]&&c!==(c=t[64])&&Nr(o,"aria-valuenow",c),32&p[0]&&d!==(d=t[57])&&Nr(o,"data-control",d),32&p[0]&&u!==(u=t[54])&&Nr(o,"data-selected",u),32&p[0]&&Zr(o,"cursor",t[55]?t[55]+"-resize":"move"),64&p[0]&&Zr(o,"opacity",t[6]),32&p[0]&&Zr(o,"--tx",t[53].x),32&p[0]&&Zr(o,"--ty",t[53].y),32&p[0]&&Zr(o,"--r",("edge"===t[57]?t[15]:0)+"rad"),160&p[0]&&Zr(o,"--sx","point"===t[57]?t[7]:t[16].x),160&p[0]&&Zr(o,"--sy","point"===t[57]?t[7]:t[16].y),"edge"===t[57]&&t[4]?f?f.p(t,p):(f=Vy(t),f.c(),f.m(h.parentNode,h)):f&&(f.d(1),f=null)},d(e){e&&Lr(o),e&&Lr(p),f&&f.d(e),e&&Lr(h),m=!1,ar(g)}}}function Hy(e){let t,o,i;return{c(){t=Fr("div"),Nr(t,"role","button"),Nr(t,"aria-label","Drag rotator"),Nr(t,"tabindex","0"),Nr(t,"class","PinturaShapeManipulator"),Nr(t,"data-control","rotate"),Zr(t,"transform",`translate3d(${e[0].x}px, ${e[0].y}px, 0) scale(${e[7]}, ${e[7]})`),Zr(t,"opacity",e[6])},m(n,r){Ar(n,t,r),o||(i=[Wr(t,"nudge",e[13]),wr(sp.call(null,t,{preventDefault:!0})),Wr(t,"interactionstart",e[15]("start")),Wr(t,"interactionupdate",e[15]("move")),Wr(t,"interactionend",e[15]("end")),wr(Ch.call(null,t,{observeKeys:!0}))],o=!0)},p(e,o){129&o[0]&&Zr(t,"transform",`translate3d(${e[0].x}px, ${e[0].y}px, 0) scale(${e[7]}, ${e[7]})`),64&o[0]&&Zr(t,"opacity",e[6])},d(e){e&&Lr(t),o=!1,ar(i)}}}function jy(e){let t,o,i;return{c(){t=Fr("div"),Nr(t,"role","button"),Nr(t,"aria-label","Drag scalar"),Nr(t,"tabindex","0"),Nr(t,"class","PinturaShapeManipulator"),Nr(t,"data-control","scale"),Zr(t,"transform",`translate3d(${e[1].x}px, ${e[1].y}px, 0) scale(${e[7]}, ${e[7]})`),Zr(t,"opacity",e[6])},m(n,r){Ar(n,t,r),o||(i=[Wr(t,"nudge",e[14]),wr(sp.call(null,t,{preventDefault:!0})),Wr(t,"interactionstart",e[16]("start")),Wr(t,"interactionupdate",e[16]("move")),Wr(t,"interactionend",e[16]("end")),wr(Ch.call(null,t,{observeKeys:!0}))],o=!0)},p(e,o){130&o[0]&&Zr(t,"transform",`translate3d(${e[1].x}px, ${e[1].y}px, 0) scale(${e[7]}, ${e[7]})`),64&o[0]&&Zr(t,"opacity",e[6])},d(e){e&&Lr(t),o=!1,ar(i)}}}function Uy(e){let t,o,i,n=[],r=new Map,a=e[5];const s=e=>e[51];for(let t=0;t<a.length;t+=1){let o=_y(e,a,t),i=s(o);r.set(i,n[t]=Ny(i,o))}let l=e[2]&&e[0]&&Hy(e),c=e[3]&&e[1]&&jy(e);return{c(){for(let e=0;e<n.length;e+=1)n[e].c();t=Or(),l&&l.c(),o=Or(),c&&c.c(),i=Br()},m(e,r){for(let t=0;t<n.length;t+=1)n[t].m(e,r);Ar(e,t,r),l&&l.m(e,r),Ar(e,o,r),c&&c.m(e,r),Ar(e,i,r)},p(e,d){6368&d[0]&&(a=e[5],n=Ba(n,d,s,1,e,a,r,t.parentNode,Da,Ny,t,_y)),e[2]&&e[0]?l?l.p(e,d):(l=Hy(e),l.c(),l.m(o.parentNode,o)):l&&(l.d(1),l=null),e[3]&&e[1]?c?c.p(e,d):(c=jy(e),c.c(),c.m(i.parentNode,i)):c&&(c.d(1),c=null)},i:tr,o:tr,d(e){for(let t=0;t<n.length;t+=1)n[t].d(e);e&&Lr(t),l&&l.d(e),e&&Lr(o),c&&c.d(e),e&&Lr(i)}}}function Gy(e,t,o){let i,n,r,a;const s=sa(),l=.5*J,c=K-l,d=K+l,u=-K,p=u-l,h=u+l,m=q-l,g=-q+l,$=l,f=-l,y=K-J,b=y-l,x=y+l,v=q-J,w=v-l,S=v+l,k=u-J,C=k+l,T=k-l,M=u+J,P=M+l,R=M-l;let{visible:I=!1}=t,{points:E=[]}=t,{rotatorPoint:A}=t,{bounds:L=null}=t,{scalarPoint:F}=t,{selectedPoint:z}=t,{enableDragEdges:D=!0}=t,{enableDragPoints:O=!0}=t,{enableRotatePoints:B=!0}=t,{enableScalePoints:W=!0}=t;const _=ca("isAnimated");hr(e,_,(e=>o(22,n=e)));const V=xc(.5,{precision:1e-4,stiffness:.3,damping:.7});hr(e,V,(e=>o(7,a=e)));const N=xc(0,{precision:.001,stiffness:.3,damping:.7});hr(e,N,(e=>o(6,r=e)));const H=e=>{let t="";return(e<=d&&e>=c||e>=p&&e<=h)&&(t="ns"),(e<=g||e>=m||e>=f&&e<=$)&&(t="ew"),(e>=w&&e<=S||e<=P&&e>=R)&&(t="nesw"),(e>=b&&e<=x||e<=C&&e>=T)&&(t="nwse"),t},j=(e,t)=>{let o=0;const i=Le(e),n=[],r=e.length,[a,s,l,c]=e.reduce((([e,t,o,i],{x:n,y:r})=>(i=Math.min(i,n),t=Math.max(t,n),[e=Math.min(e,r),t,o=Math.max(o,r),i])),[1/0,-1/0,-1/0,1/0]);for(;o<r;o++){const t=Wy(o-1,e),r=Wy(o+1,e),d=e[t],u=e[o],p=e[r],h=Math.atan2(p.y-u.y,p.x-u.x);if(O){const e=xe(me(d.x-u.x,d.y-u.y)),t=xe(me(p.x-u.x,p.y-u.y)),i=me(e.x+t.x,e.y+t.y),r=D?O&&H(Math.atan2(i.y,i.x)):void 0;n.push({index:[o],key:"point-"+o,type:"point",selected:z===o,scale:{x:1,y:1},translate:{x:u.x,y:u.y},angle:void 0,rotate:B,center:u,dir:r})}if(!D)continue;if(Array.isArray(D)&&!D.some((([e,t])=>o===e&&r===t)))continue;const m=me(u.x+.5*(p.x-u.x),u.y+.5*(p.y-u.y)),g=["t","r","b","l"][o];let $,f,y;"l"===g&&($=L.x,f=s,y=c),"t"===g&&($=L.y,f=l,y=a),"r"===g&&($=c,f=L.width,y=s),"b"===g&&($=a,f=L.height,y=l),n.push({index:[o,r],key:"edge-"+o,type:"edge",scale:{x:Ee(u,p),y:1},translate:{x:u.x,y:u.y},angle:h,rotate:h,center:m,visible:Array.isArray(D),dir:H(Math.atan2(i.y-m.y,i.x-m.x)),tabindex:0,role:"slider",tabindex:0,label:"Drag "+Lf[g],orientation:""+Df[g],valuemin:Math.round($),valuemax:Math.round(f),valuenow:Math.round(y)})}return n},U=(e,t)=>{s("resizestart",{indexes:e,translation:he(),isNudge:!0}),s("resizemove",{indexes:e,translation:t,isNudge:!0}),s("resizeend",{indexes:e,translation:he(),isNudge:!0})};return e.$$set=e=>{"visible"in e&&o(4,I=e.visible),"points"in e&&o(17,E=e.points),"rotatorPoint"in e&&o(0,A=e.rotatorPoint),"bounds"in e&&o(18,L=e.bounds),"scalarPoint"in e&&o(1,F=e.scalarPoint),"selectedPoint"in e&&o(19,z=e.selectedPoint),"enableDragEdges"in e&&o(20,D=e.enableDragEdges),"enableDragPoints"in e&&o(21,O=e.enableDragPoints),"enableRotatePoints"in e&&o(2,B=e.enableRotatePoints),"enableScalePoints"in e&&o(3,W=e.enableScalePoints)},e.$$.update=()=>{4194320&e.$$.dirty[0]&&V.set(I?1:.5,{hard:!1===n}),4194320&e.$$.dirty[0]&&N.set(I?1:0,{hard:!1===n}),131072&e.$$.dirty[0]&&o(5,i=j(E))},[A,F,B,W,I,i,r,a,_,V,N,(e,t)=>({detail:o})=>{const i=o&&o.translation?o.translation:me(0,0);s("resize"+e,{...o,indexes:t,translation:i})},U,({detail:e})=>{s("rotatestart",{translation:he(),isNudge:!0}),s("rotatemove",{translation:e,isNudge:!0}),s("rotateend",{translation:he(),isNudge:!0})},({detail:e})=>{s("scalestart",{translation:he(),isNudge:!0}),s("scalemove",{translation:e,isNudge:!0}),s("scaleend",{translation:he(),isNudge:!0})},e=>({detail:t})=>{const o=t&&t.translation?t.translation:me(0,0);s("rotate"+e,{...t,translation:o})},e=>({detail:t})=>{const o=t&&t.translation?t.translation:me(0,0);s("scale"+e,{...t,translation:o})},E,L,z,D,O,n,(e,{detail:t})=>U(e,t)]}class Zy extends Ga{constructor(e){super(),Ua(this,e,Gy,Uy,lr,{visible:4,points:17,rotatorPoint:0,bounds:18,scalarPoint:1,selectedPoint:19,enableDragEdges:20,enableDragPoints:21,enableRotatePoints:2,enableScalePoints:3},null,[-1,-1,-1])}}var Xy=(e,t)=>{const o=pm(e);return Ce(o,t)},Yy=e=>document.createTextNode(e),qy=e=>(Qt()&&e.endsWith("<div><br></div>")?e.replace(/<div><br><\/div>$/,"<br><br>"):e).replace(/<div><br><\/div>/g,"<br>").replace(/<\/div>/g,"").replace(/<div>/g,"<br>");function Ky(e){let t,o,i,n;return{c(){t=Fr("pre"),Nr(t,"class","PinturaContentEditable")},m(r,a){Ar(r,t,a),t.innerHTML=e[0],i||(n=wr(o=id.call(null,t,e[7]+";position:absolute;z-index:-1;pointer-events:none;")),i=!0)},p(e,i){1&i[0]&&(t.innerHTML=e[0]),o&&sr(o.update)&&128&i[0]&&o.update.call(null,e[7]+";position:absolute;z-index:-1;pointer-events:none;")},d(e){e&&Lr(t),i=!1,n()}}}function Jy(e){let t,o,i,n,r,a,s=e[8]&&Ky(e);return{c(){s&&s.c(),t=Or(),o=Fr("pre"),Nr(o,"class","PinturaContentEditable"),Nr(o,"data-wrap-content",i=e[4]||e[5]?"wrap":"nowrap"),Nr(o,"contenteditable",""),Nr(o,"spellcheck",e[1]),Nr(o,"autocorrect",e[2]),Nr(o,"autocapitalize",e[3])},m(i,l){s&&s.m(i,l),Ar(i,t,l),Ar(i,o,l),e[26](o),r||(a=[wr(n=id.call(null,o,e[8]?e[15](e[7]):e[7])),Wr(o,"input",e[13]),Wr(o,"compositionend",e[12]),Wr(o,"paste",e[14]),Wr(o,"keydown",e[10]),Wr(o,"keyup",e[11]),Wr(o,"blur",e[9])],r=!0)},p(e,r){e[8]?s?s.p(e,r):(s=Ky(e),s.c(),s.m(t.parentNode,t)):s&&(s.d(1),s=null),48&r[0]&&i!==(i=e[4]||e[5]?"wrap":"nowrap")&&Nr(o,"data-wrap-content",i),2&r[0]&&Nr(o,"spellcheck",e[1]),4&r[0]&&Nr(o,"autocorrect",e[2]),8&r[0]&&Nr(o,"autocapitalize",e[3]),n&&sr(n.update)&&384&r[0]&&n.update.call(null,e[8]?e[15](e[7]):e[7])},i:tr,o:tr,d(i){s&&s.d(i),i&&Lr(t),i&&Lr(o),e[26](null),r=!1,ar(a)}}}function Qy(e,t,o){let i,n,{spellcheck:a="false"}=t,{autocorrect:s="off"}=t,{autocapitalize:l="off"}=t,{wrapLines:c=!0}=t,{allowNewline:d=!0}=t,{textFormat:u="text"}=t,{formatInput:p=Y}=t,{formatPaste:h=Y}=t,{styles:m}=t,{innerHTML:g}=t,{oninput:f=r}=t,{enableTextStyleShortcuts:y=!1}=t;const b=()=>{if(!v)return;const e=document.createRange();e.selectNodeContents(v);const t=P();t.removeAllRanges(),t.addRange(e)},x=sa();let v;document.execCommand("defaultParagraphSeparator",!1,"br");const w=e=>e.replace(/<\/?(?:i|b|em|u|s|strike|strong|font)>/,"").replace(/style=".*?"/g,"").replace(/\n/gim,"<br>"),S=()=>{o(0,g=v.innerHTML);const e=qy(g);x("input",e),f(e),requestAnimationFrame((()=>v&&v.scrollTo(0,0)))},k=()=>{R(v);const e="html"===u?v.innerHTML:w(v.innerHTML);o(6,v.innerHTML=p(e),v),I(v),S()},C={b:"bold",i:"italic",u:"underline",s:"strikethrough"},T=e=>{const t=$("span");return t.dataset.bookmark=e,t},M=(e,t,o)=>{const i=T(o);if(e.nodeType===Node.TEXT_NODE){const n=e.textContent;if("start"===o){const o=Yy(n.substring(0,t)),r=Yy(n.substring(t));e.replaceWith(o,i,r)}else{const o=Yy(n.substring(0,t)),r=Yy(n.substring(t));e.replaceWith(o,i,r)}}else e.nodeType===Node.ELEMENT_NODE&&e.insertBefore(i,e.childNodes[t])},P=()=>{const e=v.getRootNode();return"getSelection"in e?e.getSelection():document.getSelection()},R=e=>{const t=P();if(!t.getRangeAt||!t.rangeCount)return;const o=t.getRangeAt(0),{startOffset:i,endOffset:n,startContainer:r,endContainer:a}=o;if(e.contains(o.startContainer)&&e.contains(o.endContainer))if(r.nodeType===Node.TEXT_NODE&&r===a){const e=r.textContent,t=e.substring(0,i),o=T("start"),a=n-i>0?e.substring(i,n):"",s=T("end"),l=e.substring(n);r.replaceWith(t,o,a,s,l)}else M(r,i,"start"),M(a,n+(r===a?1:0),"end")},I=e=>{const t=E(e,"start"),o=E(e,"end");if(!t||!o)return;const i=document.createRange();i.setStart(t,0),i.setEnd(o,0);const n=P();n.removeAllRanges(),n.addRange(i),t.remove(),o.remove()},E=(e,t)=>{const o=e.children;for(let e=0;e<o.length;e++){const i=o[e];if(i.dataset.bookmark===t)return i;if(i.children.length){const e=E(i,t);if(e)return e}}};let A;return e.$$set=e=>{"spellcheck"in e&&o(1,a=e.spellcheck),"autocorrect"in e&&o(2,s=e.autocorrect),"autocapitalize"in e&&o(3,l=e.autocapitalize),"wrapLines"in e&&o(4,c=e.wrapLines),"allowNewline"in e&&o(5,d=e.allowNewline),"textFormat"in e&&o(16,u=e.textFormat),"formatInput"in e&&o(17,p=e.formatInput),"formatPaste"in e&&o(18,h=e.formatPaste),"styles"in e&&o(19,m=e.styles),"innerHTML"in e&&o(0,g=e.innerHTML),"oninput"in e&&o(20,f=e.oninput),"enableTextStyleShortcuts"in e&&o(21,y=e.enableTextStyleShortcuts)},e.$$.update=()=>{var t;if(64&e.$$.dirty[0]&&o(25,i=!!v),33554433&e.$$.dirty[0]&&i&&g&&(t=g)!==v.innerHTML&&(o(6,v.innerHTML=t,v),v===document.activeElement&&b()),524336&e.$$.dirty[0])if(!c&&d){const e=m.includes(":right")?"text-indent:-100px!important":m.includes(":center")?"":"min-width:calc(100% + 100px)!important";o(7,A=m+";overflow:visible;"+e)}else o(7,A=m);524288&e.$$.dirty[0]&&o(8,n=m.includes("text-stroke"))},[g,a,s,l,c,d,v,A,n,()=>{x("blur")},e=>{if(/escape/i.test(e.code))return e.stopPropagation(),void x("cancel");const t=e.ctrlKey||e.metaKey;if("html"===u&&t&&/b|i|u|s/.test(e.key))return y&&(e=>{const t=C[e];t&&document.execCommand(t)})(e.key),void e.preventDefault();/enter/i.test(e.code)&&(e.stopPropagation(),e.isComposing||(t?x("confirm"):(d||e.preventDefault(),document.execCommand("insertLineBreak"),e.preventDefault())))},()=>{},e=>{""!==e.data&&k()},e=>{const{inputType:t}=e;"insertCompositionText"!==t&&"deleteCompositionText"!==t&&k()},e=>{e.preventDefault();const t=e.clipboardData.getData("text/plain"),o="html"===u?t:w(t),i=h(o);if(!i.length)return;const n=P().getRangeAt(0);n.deleteContents(),n.insertNode(document.createTextNode(i)),S()},e=>e.replace("-webkit-text-stroke","--text-stroke").replace("text-shadow","--text-shadow"),u,p,h,m,f,y,()=>k(),()=>v&&v.focus(),b,i,function(e){pa[e?"unshift":"push"]((()=>{v=e,o(6,v)}))}]}class eb extends Ga{constructor(e){super(),Ua(this,e,Qy,Jy,lr,{spellcheck:1,autocorrect:2,autocapitalize:3,wrapLines:4,allowNewline:5,textFormat:16,formatInput:17,formatPaste:18,styles:19,innerHTML:0,oninput:20,enableTextStyleShortcuts:21,confirm:22,focus:23,select:24},null,[-1,-1])}get spellcheck(){return this.$$.ctx[1]}set spellcheck(e){this.$$set({spellcheck:e}),ka()}get autocorrect(){return this.$$.ctx[2]}set autocorrect(e){this.$$set({autocorrect:e}),ka()}get autocapitalize(){return this.$$.ctx[3]}set autocapitalize(e){this.$$set({autocapitalize:e}),ka()}get wrapLines(){return this.$$.ctx[4]}set wrapLines(e){this.$$set({wrapLines:e}),ka()}get allowNewline(){return this.$$.ctx[5]}set allowNewline(e){this.$$set({allowNewline:e}),ka()}get textFormat(){return this.$$.ctx[16]}set textFormat(e){this.$$set({textFormat:e}),ka()}get formatInput(){return this.$$.ctx[17]}set formatInput(e){this.$$set({formatInput:e}),ka()}get formatPaste(){return this.$$.ctx[18]}set formatPaste(e){this.$$set({formatPaste:e}),ka()}get styles(){return this.$$.ctx[19]}set styles(e){this.$$set({styles:e}),ka()}get innerHTML(){return this.$$.ctx[0]}set innerHTML(e){this.$$set({innerHTML:e}),ka()}get oninput(){return this.$$.ctx[20]}set oninput(e){this.$$set({oninput:e}),ka()}get enableTextStyleShortcuts(){return this.$$.ctx[21]}set enableTextStyleShortcuts(e){this.$$set({enableTextStyleShortcuts:e}),ka()}get confirm(){return this.$$.ctx[22]}get focus(){return this.$$.ctx[23]}get select(){return this.$$.ctx[24]}}const tb=["i","b","u","strike"].map((e=>({tag:e,tagOpen:new RegExp(`<${e}>`,"g"),tagClose:new RegExp(`</${e}>`,"g"),placeholderOpen:new RegExp(`___${e}O___`,"g"),placeholderClose:new RegExp(`___${e}C___`,"g")})));var ob=e=>e=((e,t=tb)=>(t.forEach((({tag:t,placeholderOpen:o,placeholderClose:i})=>{e=e.replace(o,`<${t}>`).replace(i,`</${t}>`)})),e))(e=(e=((e,t=tb)=>(t.forEach((({tag:t,tagOpen:o,tagClose:i})=>{e=e.replace(o,`___${t}O___`).replace(i,`___${t}C___`)})),e))(e)).replace(/ {2,}/g," ").replace(/\u00a0/g," ").split("\n").join("<br>")),ib=(e,t)=>m(e)?parseFloat(e)/100*t:e,nb=(e,t)=>({x:Zo(e.x,t.width),y:Zo(e.y,t.height)});function rb(e,t,o){const i=e.slice();return i[317]=t[o],i[319]=o,i}function ab(e,t){let o,i,n,r,a,s,l,c,d,u,p,h=t[317].name+"";function m(){return t[198](t[319])}return n=new Dp({props:{color:t[317].color}}),{key:e,first:null,c(){o=Fr("li"),i=Fr("button"),Na(n.$$.fragment),r=Or(),a=Fr("span"),s=Dr(h),c=Or(),Nr(i,"class","PinturaShapeListItem"),Nr(i,"type","button"),Nr(i,"aria-label",l="Select shape "+t[317].name),this.first=o},m(e,t){Ar(e,o,t),Rr(o,i),Ha(n,i,null),Rr(i,r),Rr(i,a),Rr(a,s),Rr(o,c),d=!0,u||(p=Wr(i,"click",m),u=!0)},p(e,o){t=e;const r={};8388608&o[0]&&(r.color=t[317].color),n.$set(r),(!d||8388608&o[0])&&h!==(h=t[317].name+"")&&Ur(s,h),(!d||8388608&o[0]&&l!==(l="Select shape "+t[317].name))&&Nr(i,"aria-label",l)},i(e){d||(Ea(n.$$.fragment,e),d=!0)},o(e){Aa(n.$$.fragment,e),d=!1},d(e){e&&Lr(o),ja(n),u=!1,p()}}}function sb(e){let t,o;return t=new Zy({props:{visible:!0,points:e[13],bounds:e[4],rotatorPoint:e[31],scalarPoint:e[30],selectedPoint:e[18],enableDragEdges:e[19],enableDragPoints:e[33],enableRotatePoints:e[17],enableScalePoints:e[15]}}),t.$on("resizestart",e[42]),t.$on("resizemove",e[43]),t.$on("resizeend",e[44]),t.$on("rotatestart",e[45]),t.$on("rotatemove",e[46]),t.$on("rotateend",e[47]),t.$on("scalestart",e[48]),t.$on("scalemove",e[49]),t.$on("scaleend",e[50]),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};8192&o[0]&&(i.points=e[13]),16&o[0]&&(i.bounds=e[4]),1&o[1]&&(i.rotatorPoint=e[31]),1073741824&o[0]&&(i.scalarPoint=e[30]),262144&o[0]&&(i.selectedPoint=e[18]),524288&o[0]&&(i.enableDragEdges=e[19]),4&o[1]&&(i.enableDragPoints=e[33]),131072&o[0]&&(i.enableRotatePoints=e[17]),32768&o[0]&&(i.enableScalePoints=e[15]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function lb(e){let t,o,i,n;const r=[db,cb],a=[];function s(e,t){return"modal"===e[5]?0:"inline"===e[5]?1:-1}return~(t=s(e))&&(o=a[t]=r[t](e)),{c(){o&&o.c(),i=Br()},m(e,o){~t&&a[t].m(e,o),Ar(e,i,o),n=!0},p(e,n){let l=t;t=s(e),t===l?~t&&a[t].p(e,n):(o&&(Ra(),Aa(a[l],1,1,(()=>{a[l]=null})),Ia()),~t?(o=a[t],o?o.p(e,n):(o=a[t]=r[t](e),o.c()),Ea(o,1),o.m(i.parentNode,i)):o=null)},i(e){n||(Ea(o),n=!0)},o(e){Aa(o),n=!1},d(e){~t&&a[t].d(e),e&&Lr(i)}}}function cb(e){let t,o,i,n,r,a,s={formatInput:e[52],wrapLines:!!e[14].width,textFormat:e[14].format,enableTextStyleShortcuts:e[6],allowNewline:e[32],styles:e[29]};return o=new eb({props:s}),e[202](o),o.$on("input",e[53]),o.$on("keyup",e[57]),o.$on("cancel",e[59]),o.$on("confirm",e[58]),{c(){t=Fr("div"),Na(o.$$.fragment),Nr(t,"class","PinturaInlineInput")},m(s,l){Ar(s,t,l),Ha(o,t,null),n=!0,r||(a=[wr(i=id.call(null,t,e[28])),Wr(t,"focusout",e[203])],r=!0)},p(e,t){const n={};16384&t[0]&&(n.wrapLines=!!e[14].width),16384&t[0]&&(n.textFormat=e[14].format),64&t[0]&&(n.enableTextStyleShortcuts=e[6]),2&t[1]&&(n.allowNewline=e[32]),536870912&t[0]&&(n.styles=e[29]),o.$set(n),i&&sr(i.update)&&268435456&t[0]&&i.update.call(null,e[28])},i(e){n||(Ea(o.$$.fragment,e),n=!0)},o(e){Aa(o.$$.fragment,e),n=!1},d(i){i&&Lr(t),e[202](null),ja(o),r=!1,ar(a)}}}function db(e){let t,o;return t=new Gh({props:{panelOffset:e[2],onconfirm:e[58],oncancel:e[59],buttonCancel:{icon:e[7].shapeIconInputCancel,label:e[7].shapeLabelInputCancel},buttonConfirm:{icon:e[7].shapeIconInputConfirm,label:e[7].shapeLabelInputConfirm,hideLabel:!0},willHandleKeydown:e[201],$$slots:{default:[ub]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};4&o[0]&&(i.panelOffset=e[2]),128&o[0]&&(i.buttonCancel={icon:e[7].shapeIconInputCancel,label:e[7].shapeLabelInputCancel}),128&o[0]&&(i.buttonConfirm={icon:e[7].shapeIconInputConfirm,label:e[7].shapeLabelInputConfirm,hideLabel:!0}),2048&o[0]&&(i.willHandleKeydown=e[201]),671088896&o[0]|1024&o[10]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function ub(e){let t,o,i,n;return{c(){t=Fr("textarea"),Nr(t,"spellcheck","false"),Nr(t,"autocorrect","off"),Nr(t,"autocapitalize","off")},m(r,a){Ar(r,t,a),e[199](t),Gr(t,e[27]),i||(n=[Wr(t,"keydown",e[55]),Wr(t,"keypress",e[54]),Wr(t,"keyup",e[57]),Wr(t,"input",e[53]),Wr(t,"input",e[200]),wr(o=id.call(null,t,e[29]))],i=!0)},p(e,i){134217728&i[0]&&Gr(t,e[27]),o&&sr(o.update)&&536870912&i[0]&&o.update.call(null,e[29])},d(o){o&&Lr(t),e[199](null),i=!1,ar(n)}}}function pb(e){let t,o,i,n,r;return o=new gh({props:{items:e[24],key:e[10]}}),{c(){t=Fr("div"),Na(o.$$.fragment),Nr(t,"class","PinturaShapeControls"),Zr(t,"transform",e[26]),Zr(t,"opacity",e[25])},m(a,s){Ar(a,t,s),Ha(o,t,null),i=!0,n||(r=[Wr(t,"measure",e[204]),wr(Dc.call(null,t))],n=!0)},p(e,i){const n={};16777216&i[0]&&(n.items=e[24]),1024&i[0]&&(n.key=e[10]),o.$set(n),67108864&i[0]&&Zr(t,"transform",e[26]),33554432&i[0]&&Zr(t,"opacity",e[25])},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Lr(t),ja(o),n=!1,ar(r)}}}function hb(e){let t,o,i,n,a,s,l,c,d,u,p=[],h=new Map,m=e[23];const g=e=>e[317].id;for(let t=0;t<m.length;t+=1){let o=rb(e,m,t),i=g(o);h.set(i,p[t]=ab(i,o))}let $=e[16]&&sb(e),f=e[12]&&lb(e),y=e[20]>0&&pb(e);return{c(){t=Fr("div"),o=Fr("nav"),i=Fr("ul");for(let e=0;e<p.length;e+=1)p[e].c();n=Or(),$&&$.c(),a=Or(),f&&f.c(),s=Or(),y&&y.c(),Nr(o,"class","PinturaShapeList"),Nr(o,"data-visible",e[21]),Nr(t,"class","PinturaShapeEditor"),Nr(t,"tabindex","0")},m(h,m){Ar(h,t,m),Rr(t,o),Rr(o,i);for(let e=0;e<p.length;e+=1)p[e].m(i,null);Rr(t,n),$&&$.m(t,null),Rr(t,a),f&&f.m(t,null),Rr(t,s),y&&y.m(t,null),e[205](t),c=!0,d||(u=[Wr(o,"focusin",e[62]),Wr(o,"focusout",e[63]),Wr(t,"keydown",(function(){sr(e[0]?r:e[51])&&(e[0]?r:e[51]).apply(this,arguments)})),Wr(t,"nudge",(function(){sr(e[0]?r:e[61])&&(e[0]?r:e[61]).apply(this,arguments)})),Wr(t,"measure",e[197]),Wr(t,"pointermove",(function(){sr(e[0]?r:e[64])&&(e[0]?r:e[64]).apply(this,arguments)})),Wr(t,"pointerleave",(function(){sr(e[0]?r:e[65])&&(e[0]?r:e[65]).apply(this,arguments)})),Wr(t,"interactionstart",(function(){sr(e[0]?r:e[36])&&(e[0]?r:e[36]).apply(this,arguments)})),Wr(t,"interactionupdate",(function(){sr(e[0]?r:e[38])&&(e[0]?r:e[38]).apply(this,arguments)})),Wr(t,"interactioncancel",(function(){sr(e[0]?r:e[37])&&(e[0]?r:e[37]).apply(this,arguments)})),Wr(t,"interactionrelease",(function(){sr(e[0]?r:e[39])&&(e[0]?r:e[39]).apply(this,arguments)})),Wr(t,"interactionend",(function(){sr(e[0]?r:e[40])&&(e[0]?r:e[40]).apply(this,arguments)})),wr(Dc.call(null,t)),wr(sp.call(null,t)),wr(l=Ch.call(null,t,{drag:!0,inertia:!0,multiTouch:!1,observeKeys:!0,shouldStartInteraction:$b,getEventPosition:e[206]}))],d=!0)},p(n,r){e=n,8388608&r[0]|16&r[2]&&(m=e[23],Ra(),p=Ba(p,r,g,1,e,m,h,i,Oa,ab,null,rb),Ia()),(!c||2097152&r[0])&&Nr(o,"data-visible",e[21]),e[16]?$?($.p(e,r),65536&r[0]&&Ea($,1)):($=sb(e),$.c(),Ea($,1),$.m(t,a)):$&&(Ra(),Aa($,1,1,(()=>{$=null})),Ia()),e[12]?f?(f.p(e,r),4096&r[0]&&Ea(f,1)):(f=lb(e),f.c(),Ea(f,1),f.m(t,s)):f&&(Ra(),Aa(f,1,1,(()=>{f=null})),Ia()),e[20]>0?y?(y.p(e,r),1048576&r[0]&&Ea(y,1)):(y=pb(e),y.c(),Ea(y,1),y.m(t,null)):y&&(Ra(),Aa(y,1,1,(()=>{y=null})),Ia()),l&&sr(l.update)&&8&r[0]&&l.update.call(null,{drag:!0,inertia:!0,multiTouch:!1,observeKeys:!0,shouldStartInteraction:$b,getEventPosition:e[206]})},i(e){if(!c){for(let e=0;e<m.length;e+=1)Ea(p[e]);Ea($),Ea(f),Ea(y),c=!0}},o(e){for(let e=0;e<p.length;e+=1)Aa(p[e]);Aa($),Aa(f),Aa(y),c=!1},d(o){o&&Lr(t);for(let e=0;e<p.length;e+=1)p[e].d();$&&$.d(),f&&f.d(),y&&y.d(),e[205](null),d=!1,ar(u)}}}const mb=256,gb="markup-hover",$b=(e,t)=>e.target===t||"PinturaContentEditable"===e.target.className;function fb(e,t,o){let i,n,a,s,l,c,d,u,p,h,g,$,f,y,b,x,v,w,S,k,C,T,M,P,R,I,E,A,F,z,D,B,W,_,V,N,H,j,U,G,Z,X,q,K,J,Q,ee,te,oe,ie,ne,re,ae,se,le,ce,ue,ge,fe,be,Te,Pe,Re,Ae,De,Oe,We=tr,_e=()=>(We(),We=ur(Ue,(e=>o(193,Pe=e))),Ue);e.$$.on_destroy.push((()=>We()));let{uid:Ve=L()}=t,{ui:He}=t,{disabled:je=!1}=t,{shapes:Ue}=t;_e();let{selection:Ge}=t,{offset:Ze}=t,{contextRotation:qe=0}=t,{contextFlipX:Je=!1}=t,{contextFlipY:Qe=!1}=t,{contextZoom:et=1}=t,{active:tt=!1}=t,{opacity:ot=1}=t,{parentRect:it}=t,{rootRect:st}=t,{utilRect:dt}=t,{hoverColor:ut}=t,{caretColor:pt}=t,{gridColor:ht}=t,{snapColor:mt}=t,{textInputMode:gt="inline"}=t,{oninteractionstart:$t=r}=t,{oninteractionupdate:ft=r}=t,{oninteractionrelease:yt=r}=t,{oninteractionend:xt=r}=t,{oninteractioncancel:vt=r}=t,{onaddshape:wt=r}=t,{onupdateshape:Tt=r}=t,{onselectshape:Mt=r}=t,{onblurshape:Pt=r}=t,{onremoveshape:Rt=r}=t,{ontapshape:It=r}=t,{onhovershape:Et=r}=t,{ontriggerhistorywrite:Ft=r}=t,{onhovercanvas:Dt=r}=t,{ontapcanvas:Ot=r}=t,{onleavecanvas:Ht=r}=t,{beforeSelectShape:jt=(()=>!0)}=t,{beforeDeselectShape:Ut=(()=>!0)}=t,{beforeRemoveShape:Gt=(()=>!0)}=t,{beforeUpdateShape:Zt=((e,t,o)=>t)}=t,{willRenderShapeControls:Xt=Y}=t,{willRenderShapeTextControls:Yt=Y}=t,{willStartInteraction:qt=((e,t)=>!0)}=t,{mapEditorPointToImagePoint:Kt}=t,{mapImagePointToEditorPoint:Jt}=t,{eraseRadius:Qt}=t,{selectRadius:eo}=t,{enableButtonFlipVertical:to=!1}=t,{enableTapToAddText:oo=!0}=t,{enableMultiSelect:io=!1}=t,{enableTextStyleControls:no=!0}=t,{locale:ro}=t,{snapThreshold:ao=0}=t,{snapPointer:so=!0}=t,{enableSnapToContext:lo=!0}=t,{gridSize:co=0}=t;const uo=e=>{if(0===ao)return[];let t;return lo&&(t={...it,x:0,y:0}),[...Pe.filter((t=>t!==e)).filter((e=>!Bi(e))).filter((e=>(e=>!0!==e.disableAcceptSnap)(e))).map((e=>wn({...e},it))),t].filter(Boolean)},po=(e,t,o,i)=>0===e?{snapTargets:[]}:{snapThreshold:e,gridSize:t,gridRect:o,snapTargets:uo(i)},ho=ca("isAnimated");hr(e,ho,(e=>o(194,Ae=e)));const mo=ca("softKeyboardState"),go=e=>e.set(pr(e)),$o=e=>pr(e).find(Bi),fo=(e,t)=>{if(!$o(t))return Hi(e),vo(e,t)},yo=e=>{$o(e)&&e.update((e=>e.filter((e=>!Bi(e)))))},bo=e=>{const t=$o(e);if(t)return ji(t),go(e),t},xo=(e,t,o=((e,t)=>({...e,...t})))=>{$o(t)&&t.update((t=>t.map((t=>Bi(t)?o(t,e):t))))},vo=(e,t=Ue)=>(t.update((t=>[...t,e])),e),wo=(e,t,o)=>{const i=Zt({...e},t,{...o});return Tn(e,i,o),e},So=(e,t)=>{const o=Ee(e,t),i=ve(e,t),n=Math.PI/8,r=n*Math.round(i/n)-qe%n;t.x=e.x+o*Math.cos(r),t.y=e.y+o*Math.sin(r)},ko=ca("keysPressed");hr(e,ko,(e=>o(195,De=e)));const Co=(e,t,o)=>0===e||t&&o?e:t||o?-e:e,To=e=>{if(null===e.x&&null===e.y)return Mo();e.x&&o(149,Po=Kt({x:e.x,y:0}).x),e.y&&o(150,Ro=Kt({x:0,y:e.y}).y)},Mo=()=>{o(149,Po=null),o(150,Ro=null)};let Po=null,Ro=null;const Io=(e,t)=>{const o=Jt(e);return Kt(ke(o,t))},Eo=(e,t,o)=>{const i=(o-t)/e+1;return Array.from({length:i},((o,i)=>t+i*e))},Ao=e=>{let t=[],o=[],i=e.points;if(void 0!==e.x1&&(i=[{x:e.x1,y:e.y1},{x:e.x2,y:e.y2}]),i){const e=i.map(Jt),n=rt(e),r=e[0],a=e[e.length-1];t=[n.x,n.x+.5*n.width,n.x+n.width,r.x,a.x],o=[n.y,n.y+.5*n.height,n.y+n.height,r.y,a.y]}else if(e.text||void 0!==e.width||void 0!==e.rx){let i;if(e.text&&void 0===e.height){const t=li(e.text,e);i=lt(e.x,e.y,t.width,t.height)}else i=void 0!==e.width?nt(e):nt({x:e.x-e.rx,y:e.y-e.ry,width:2*e.rx,height:2*e.ry});const n=Ct(i).map(Jt),r=Math.abs(e.rotation)>0?bt(i,e.rotation).map(Jt):n,a=rt(r),s=ct(a),l=.5*a.width,c=.5*a.height;t=[s.x-l,s.x,s.x+l],o=[s.y-c,s.y,s.y+c]}else if(void 0!==e.x){const i=Jt(e);t=[i.x],o=[i.y]}return{x:t,y:o}},Lo=(e,t,o)=>{let i,n,r,a=Number.Infinity,s=null,l=null;for(let c=0;c<e.length;c++){n=e[c];for(let e=0;e<t.length;e++)r=t[e],i=Math.abs(n-r),i<o&&(null===l||i<a)&&(a=i,s=n,l=r)}return{origin:s,target:l}},Fo=(e,t,o,i,n)=>{const r={x:null,y:null},a={x:null,y:null},s=t.map(Ao);if(i>0){const e=Jt({x:0,y:0}),t=Jt({x:i,y:i}),o=Jt({x:n.width,y:n.height}),r=t.x-e.x,a=Eo(r,e.x,o.x),l=Eo(r,e.y,o.y);s.push({x:a,y:l})}return s.forEach((t=>{const{snapTranslation:i,snapLine:n}=((e,t,o)=>{const i={x:null,y:null},n={x:null,y:null},r=Lo(e.x,t.x,o);null!==r.target&&(i.x=r.target,n.x=r.target-r.origin);const a=Lo(e.y,t.y,o);return null!==a.target&&(i.y=a.target,n.y=a.target-a.origin),{snapTranslation:n,snapLine:i}})(e,t,o);null!==i.x&&(null===a.x||Math.abs(i.x)<Math.abs(a.x))&&(a.x=i.x||0,r.x=n.x),null!==i.y&&(null===a.y||Math.abs(i.y)<Math.abs(a.y))&&(a.y=i.y||0,r.y=n.y)})),{snapTranslation:a,snapLines:r}},zo=(e,t)=>(null!==t.x&&(e.x+=t.x),null!==t.y&&(e.y+=t.y),e),Do=(e,t,o,i)=>{const{snapThreshold:n=0,gridSize:r=0,gridRect:a,snapTargets:s=[]}=i||{};let l=null;if(Ai(e)){if(n){const i=wn({...e},it),l=Io(Ci(t),o),c=Io(Ti(t),o),d=Ao({...i,x1:l.x,y1:l.y,x2:c.x,y2:c.y}),{snapTranslation:u,snapLines:p}=Fo(d,s,n,r,a);zo(o,u),To(p)}const i=Io(Ci(t),o),c=Io(Ti(t),o);l={x1:i.x,y1:i.y,x2:c.x,y2:c.y}}else if(e.points){if(Ji(Si)&&Jo(Si,{selectedPoint:void 0}),n){const i=wn({...e},it),l=Ao({...i,points:t.points.map((e=>Io(e,o)))}),{snapTranslation:c,snapLines:d}=Fo(l,s,n,r,a);zo(o,c),To(d)}l={points:t.points.map((e=>Io(e,o)))}}else if(Ii(e)||Mi(e)||Ei(e)){if(n){const i=wn({...e},it),l=Io(t,o),c=Ao({...i,...l}),{snapTranslation:d,snapLines:u}=Fo(c,s,n,r,a);zo(o,d),To(u)}l=Io(t,o)}l&&(wo(e,l,it),qo())},Bo={0:1,1:0,2:3,3:2},_o={0:3,1:2,2:1,3:0},Vo=(e,t,o,i,n)=>{const{shiftKey:a,snapThreshold:s=0,gridSize:l=0,gridRect:c,snapTargets:d=[],aspectRatio:u,beforeResizeShape:p=r}=n||{},h=s?(e,t,o)=>{const{snapTranslation:i,snapLines:n}=Fo(Ao(e),d,s,l,c);zo(t,i),To(n);const r=Io(o(),t);e.x=r.x,e.y=r.y}:r;if(Ai(e)||Li(e)&&Wo(e,"pathClose")){const[n]=o,r=a?So:(e,t)=>t;let s,l,c;if(Ai(e))0===n?(s=()=>Ci(t),l=e=>r(Ti(t),e),c=(e,t)=>{e.x1=t.x,e.y1=t.y}):1===n&&(s=()=>Ti(t),l=e=>r(Ci(t),e),c=(e,t)=>{e.x2=t.x,e.y2=t.y});else{const e=t.points;s=()=>({...e[n]}),l=t=>{const o=e[Wy(n-1,e)],i=e[Wy(n+1,e)];r(o,t),r(i,t)},c=(e,t)=>e.points=e.points.map(((e,o)=>n===o?t:e))}const d=Io(s(),i);h(d,i,s),l(d),c(e,d)}else if(Wi(e)||Ei(e)||Mi(e)){let r,a=!1,s=!1;if(Ei(t))r=at(t);else if(Wi(t))r=nt(t);else if(Wo(t,"width")){a=!0,r=nt(t);const e=li(t.text,t);r.height=e.height}else{s=!0,r=nt(t);const e=li(t.text,t);r.width=e.width,r.height=e.height}let l=u;e.aspectRatio?l=e.aspectRatio:!n.shiftKey||a||s||(l=r.width/r.height);const c=nt(r),d=ct(c),m=e.rotation,g=Ct(c),$=bt(c,m);if(1===o.length){let t=o[0];e.flipX&&(t=Bo[t]),e.flipY&&(t=_o[t]);const[n,r,a,s]=g,c=Jt($[t]),u=ke({...c},i),f=Kt(u);h(f,i,(()=>Kt(c)));const y=me(f.x-$[t].x,f.y-$[t].y),b=ye($e(y),-m),x=me(g[t].x+b.x,g[t].y+b.y);let v;0===t&&(v=a),1===t&&(v=s),2===t&&(v=n),3===t&&(v=r);const w=rt([v,x]);if(l){const{width:e,height:t}=St(w,l),[o,i,n,r]=kt(w);w.width=e,w.height=t,x.y<v.y&&(w.y=n-t),x.x<v.x&&(w.x=i-e)}const S=bt(w,m,d),k=Le(S),C=ye(S[0],-m,k),T=ye(S[2],-m,k),M=rt([C,T]);p(M),wo(e,Ei(e)?pe(M):M,it)}else{o=o.map((t=>(e.flipX&&(t=Bo[t]),e.flipY&&(t=_o[t]),t)));const[t,n]=o.map((e=>$[e])),r={x:t.x+.5*(n.x-t.x),y:t.y+.5*(n.y-t.y)},[s,c]=o.map((e=>g[e])),[u,p]=o.map((e=>{const t=e+2;return t<4?g[t]:g[t-4]})),f={x:u.x+.5*(p.x-u.x),y:u.y+.5*(p.y-u.y)},y=Jt(r),b=ke({...y},i),x=Kt(b);h(x,i,(()=>Kt(y)));const v=me(x.x-r.x,x.y-r.y),w=ye($e(v),-m),S=Ce($e(s),c),k=Se(S,(e=>1-Math.abs(Math.sign(e)))),C=me(w.x*k.x,w.y*k.y);ke(s,C),ke(c,C);const T=rt(g);if(l){let e=T.width,t=T.height;0===k.y?t=e/l:e=t*l,T.width=e,T.height=t,0===k.y?T.y=f.y-.5*t:T.x=f.x-.5*e}const M=bt(T,m,d),P=Le(M),R=ye(M[0],-m,P),I=ye(M[2],-m,P),E=rt([R,I]);let A;Ei(e)?A=pe(E):Wi(e)?A=E:a&&(A={x:E.x,y:E.y,width:E.width}),wo(e,A,it)}}qo()};let No;const Ho=(e,t)=>{const o=e.points.filter(((e,o)=>o!==t));Jo(e,{points:o,selectedPoint:void 0})},jo=()=>{if(Pe.length)return Pe.find(Bi)},Uo=()=>{if(Pe.length)return Pe.findIndex(Bi)},Go=()=>{const e=jo();if(e)return ji(e),qo(),e},Yo=()=>{if(!jo())return;const e=[...Pe];e.splice(Uo(),1),Ue.set(e)},qo=()=>{Ue.set(Pe)},Ko=(e,t=[],o=!0)=>{t.filter(Boolean).forEach((t=>delete e[t])),o&&qo()},Jo=(e,t,o=!0)=>{e=Object.assign(e,t),o&&qo()},Qo=(e,t,o,i=!0)=>{e[t]=o,i&&qo()},ei=(e,t=!0)=>{Pe.forEach((t=>Jo(t,e,!1))),t&&qo()},ti=()=>[...Pe].reverse().filter(Di),oi=()=>[...Pe].reverse().find(Di),ii=()=>!!oi(),ni=(e,t=!0,o=!1)=>{const i=Pe.filter((e=>Zi(e)&&Gi(e))),n=i.findIndex((t=>t===e));if(!1===((e,t=!1)=>{if(!Gt(e))return!1;Ue.set(Pe.filter((t=>t!==e))),t||Rt(e)})(e,o))return;if(ai=e,i.length-1<=0)return si();if(!t)return!0;const r=n-1<0?i.length-1:n-1;return di(i[r]),!0},ri=()=>{if(s){const e=[];return a.forEach(((t,o)=>{if(!Zi(t))return;ni(t,o===a.length-1,!0)&&e.push(t)})),void(e.length&&Ft())}const e=oi();e&&ni(e)};let ai=void 0;const si=(e={})=>{const{storePrevious:t=!0}=e;Object.keys(Un).forEach((e=>Un[e]={}));const o=ci();t&&(ai=o),ei({isSelected:!1,isEditing:!1,_prerender:!1}),o&&Pt(o)},ci=()=>Pe.find(Di),di=(e,t=!0,o=!1)=>{if(Bi(e))return;const i=ci()||ai,n=Di(e);ai=void 0,jt(i,e)&&(o||si(),(e=>{e.isSelected=!0})(e),!n&&Mt(e),t&&qo())},ui=e=>{Dn&&Dn.confirm&&e.isEditing&&Dn.confirm();const t={isSelected:!1,isEditing:!1,_prerender:!1};e.selectedPoint>-1&&(t.selectedPoint=void 0),Jo(e,t),Pt(e)},pi=e=>{Jo(e,{isSelected:!0,isEditing:!0,_prerender:"inline"===gt})},hi=e=>{Jo(e,{isSelected:!0,isEditing:!1,_prerender:!1})},mi=e=>{if(!e.length)return[];const t=e.filter(Gt);return Ue.set(Pe.filter((e=>!t.includes(e)))),t},gi=e=>{const t=li(e.text,e);return lt(e.x,e.y,e.width?Math.min(e.width,t.width):t.width,e.height?Math.min(e.height,t.height):t.height)},$i=e=>{if(Wi(e))return nt(e);if(Ei(e))return at(e);const t=gi(e);return t.width=Math.max(10,e.width||t.width),t},fi=(e,t,o=0,i=(()=>!0))=>[...e].reverse().filter(i).map((e=>({shape:e,priority:1}))).filter((e=>{const{shape:i}=e,n=wn(xi(i),it),r=o+.5*(n.strokeWidth||0);if(Ii(n))return Nt(t,r,n,i.rotation);if(Mi(n)){const o=$i(n),a=Nt(t,r,o,i.rotation);let s=!1;if(a&&!Di(i)){const a=gi(n);"right"!==i.textAlign||i.flipX||(a.x=o.x+o.width-a.width),"center"===i.textAlign&&(a.x=o.x+.5*o.width-.5*a.width),s=Nt(t,r,a,i.rotation,ct(o)),s||(e.priority=-1)}return a}return Ei(n)?((e,t,o,i,n,r)=>{const a=Bt(me(o.x,o.y),o.rx,o.ry,i,n,r,12);return Vt(e,t,a)})(t,r,n,i.rotation,i.flipX,i.flipY):Ai(n)?Wt(t,Math.max(16,r),Ci(n),Ti(n)):Li(n)&&n.pathClose?Vt(t,r,n.points):!!Li(n)&&(1===n.points.length?Ie(t,n.points[0])<r*r:_t(t,Math.max(16,r),n.points))})).sort(((e,t)=>e.priority<t.priority?1:e.priority>t.priority?-1:0)).map((e=>e.shape)),yi=(e,t,o,i=0)=>{const n=Math.abs(i),r=Ye(t,o),a=Ke(r,n),s=(({start:e,end:t},o)=>{if(0===o)return[me(e.x,e.y),me(e.x,e.y),me(t.x,t.y),me(t.x,t.y)];const i=Math.atan2(t.y-e.y,t.x-e.x),n=Math.sin(i)*o,r=Math.cos(i)*o;return[me(n+e.x,-r+e.y),me(-n+e.x,r+e.y),me(-n+t.x,r+t.y),me(n+t.x,-r+t.y)]})(a,n);return e.filter((e=>{const t=wn(xi(e),it);if(Ai(t)||Li(t)){const e=t.points?[...t.points]:[Ci(t),Ti(t)];return!!At(a,e)}return((e,t)=>!!e.find((e=>Lt(e,t)))||!!t.find((t=>Lt(t,e))))(s,((e,t=12)=>{if(Ii(e))return bt(e,e.rotation,ct(e));if(Mi(e)){const t=$i(e);return bt(t,e.rotation,ct(t))}return Ei(e)?Bt(me(e.x,e.y),e.rx,e.ry,e.rotation,e.flipX,e.flipY,t):[]})(t))}))};let bi=void 0,vi=void 0,wi=void 0,Si=void 0,ki=void 0,zi=void 0,Oi=!1,_i=!1,Vi=!1,Ni=!1,on=void 0;const nn=e=>{on=e.map((e=>({shape:e,shapeOrigin:xi(e),shapeOriginComputed:wn(xi(e),it)})))},rn=()=>{clearTimeout(vi),vi=void 0,o(152,Ni=!1),Mo()};let an=null;const sn=e=>{const t=Oo(e.rotation)&&0!==e.rotation;if(Ii(e)){if(e.width<1&&e.height<1)return;const o=ct(e),i=Ct(e);return(e.flipX||e.flipY)&&Fe(i,e.flipX,e.flipY,o.x,o.y),t?ze(i,e.rotation,o.x,o.y):i}if(Ei(e)){if(e.rx<1&&e.ry<1)return;const o=e,i=Ct(at(e));return(e.flipX||e.flipY)&&Fe(i,e.flipX,e.flipY,o.x,o.y),t?ze(i,e.rotation,o.x,o.y):i}if(Ai(e))return[Ci(e),Ti(e)];if(Li(e)){if(e.bitmap&&!e.pathClose){const t=rt(e.points);t.x-=.5*e.strokeWidth,t.y-=.5*e.strokeWidth,t.width+=e.strokeWidth,t.height+=e.strokeWidth;return sn({...e,...t})}return[...e.points]}if(Mi(e)){if(e.width<5&&e.height<5)return;const o=$i(e);o.width=Math.max(10,o.width);const i=ct(o),n=Ct(o);return(e.flipX||e.flipY)&&Fe(n,e.flipX,e.flipY,i.x,i.y),t?ze(n,e.rotation,i.x,i.y):n}return[]},ln=e=>{const t=sn(e);let o,i;return e.flipY?(o=Le([t[0],t[1]]),i=xe(me(t[1].x-t[2].x,t[1].y-t[2].y))):(o=Le([t[2],t[3]]),i=xe(me(t[2].x-t[1].x,t[2].y-t[1].y))),Me(i,20/et),{origin:o,dir:i}};const cn=e=>t=>t.id===e,dn=e=>{const t=cn(e);return e=>e.filter((e=>t=>!e(t))(t))},un=e=>{const t=cn(e),o=dn(e);return()=>He.update((e=>e.some(t)?o(e):e))},pn=e=>{const t=dn(e);return(...e)=>{He.update((o=>[...t(o),...e.filter(Boolean)]))}},hn=un(gb),gn=pn(gb);let $n;const fn="markup-manipulator-segment-"+Ve,yn=un(fn),bn=pn(fn),xn=(e,t)=>{const o=e[t],i=t-1<0?e[e.length-1]:e[t-1],n=t+1<e.length?e[t+1]:e[0],r=Ce($e(i),o);xe(r);const a=ke(Me(r,10),o),s=Ce($e(n),o);xe(s);return[a,o,ke(Me(s,10),o)]},vn=()=>{o(153,$n=void 0),hn()},Sn="markup-multi-selection-segment-"+Ve,kn=un(Sn),Mn=pn(Sn),Pn=(e,t)=>{if(ao<=0)return e;if(t)return Mo(),e;const o=Kt(e),n=uo(),{snapTranslation:r,snapLines:a}=Fo(Ao(o),n,ao,co,i);return To(a),zo(e,r),e},Rn=xc(0);hr(e,Rn,(e=>o(196,Oe=e)));const In="markup-grid-line-"+Ve,En=un(In),An=pn(In),Ln="markup-snap-line",Fn=un(Ln),zn=pn(Ln);let Dn;mo.subscribe((e=>{"inline"===gt&&n&&n.isEditing&&"hidden"===e&&Vn()}));const On=e=>{o(8,Dn.innerHTML=ob(e),Dn)},Bn=e=>{const t=void 0===e.value?e.innerHTML:e.value,o="text"===n.format?qy(t).split(/<br>|<br\/>/g).join("\n").replace(/ /g,String.fromCharCode(160)).replace(/&/g,"&"):t;return Pi(n)&&!1!==n.disableNewline?(e=>{const t=e.split(/[\n\r]/g);return t.length>1?t.map((e=>e.trim())).filter((e=>e.length)).join(" "):t[0]})(o):o},Wn=()=>{const e=Bn(Dn),t=qi(n,e),o=!0===t?e:t;let i=H.x,r=H.y;if(!n.height){const e=bt({...U},n.rotation),t=li(o,p),a=bt({x:i,y:r,...t},n.rotation),[s,,l]=e,[c,,d]=a;let u=s,h=c;n.flipX&&(u=l,h=d);const m=Ce($e(u),h);i+=m.x,r+=m.y}Jo(n,{x:m(N.x)?Zo(i,it.width):i,y:m(N.y)?Zo(r,it.height):r,text:o})},_n=e=>{const{key:t,ctrlKey:o,metaKey:i,altKey:n}=e;return"Enter"===t&&(o||n||i)},Vn=()=>{d&&Go(),Dn&&Dn.confirm&&Dn.confirm(),Dn&&Wn(),hi(n),Tt(n)},Nn=()=>{d?Yo():(Jo(n,{text:N.text,x:N.x,y:N.y}),hi(n))},Hn=(e,t,{flipX:o,flipY:i,rotation:n},r="top left")=>{let a,s;const[l,c,d,u]=bt(e,n),[p,h,m,g]=bt(t,n);if("top center"===r){a=Le(i?[u,d]:[l,c]),s=Le(i?[g,m]:[p,h])}else"top right"===r&&!o||"top left"===r&&o?(a=i?d:c,s=i?m:h):(a=i?u:l,s=i?g:p);return Ce($e(a),s)},jn=(e,t,o)=>me(m(e.x)?Zo(t.x+o.x,it.width):t.x+o.x,m(e.y)?Zo(t.y+o.y,it.height):t.y+o.y),Un={},Gn=()=>Ho(n,n.selectedPoint),Zn=()=>pi(n),Xn=(e,t,o)=>{const{width:i,height:n,...r}=o,a=li(t.text,r),s=Hn(lt(o.x,o.y,e.width,e.height),lt(o.x,o.y,a.width,a.height),o,"top "+t.textAlign),l=!1!==o.disableNewline;Ko(t,["width","height",l&&"textAlign"]),Jo(t,{...jn(t,o,s)})},Yn=(e,t,o,i,n={})=>{const{height:r,...a}=o,s=Xe(li(t.text,a),(e=>Math.ceil(e))),l=Ne(n.width||o.width||i.width,s.height),c=n.textAlign||"left",d=Hn(lt(o.x,o.y,e.width,e.height),lt(o.x,o.y,l.width,l.height),o,"top "+c);Ko(t,["height"]),Jo(t,{...jn(t,o,d),width:m(t.width)?Zo(l.width,it.width):l.width,textAlign:c})},qn=(e,t,o,i,n={})=>{const r=Ne(n.width||i.width,n.height||i.height),a=n.textAlign||"left",s=Hn(lt(o.x,o.y,e.width,e.height),lt(o.x,o.y,r.width,r.height),o,"top "+a);Jo(t,{...jn(t,o,s),width:m(t.width)?Zo(r.width,it.width):r.width,height:m(t.width)?Zo(r.height,it.height):r.height,textAlign:a})},Kn=()=>{const e=Xe(li(n.text,p),(e=>Math.ceil(e))),t=Wo(n,"height"),o=!t&&Wo(n,"width"),i=n.id;let r=Un[i];if(r||(Un[i]={},r=Un[i]),t){r.textAlign=n.textAlign,r.width=p.width,r.height=p.height;const t=Ne(p.width,p.height);Ki(n,"auto-height")?Yn(t,n,p,e,r):Ki(n,"auto-width")&&Xn(t,n,p)}else if(o){r.textAlign=n.textAlign,r.width=p.width;const t=Ne(p.width,e.height);Ki(n,"auto-width")?Xn(t,n,p):Ki(n,"fixed-size")&&qn(t,n,p,e,r)}else{r.textAlign=n.textAlign||r.textAlign;const t=Ne(Math.ceil(e.width),Math.ceil(e.height));Ki(n,"fixed-size")?qn(t,n,p,e,r):Ki(n,"auto-height")&&Yn(t,n,p,e,r)}},Jn=e=>{e.stopPropagation();const t=n.flipX||!1;Qo(n,"flipX",!t),Tt(n)},Qn=e=>{e.stopPropagation();const t=n.flipY||!1;Qo(n,"flipY",!t),Tt(n)},er=e=>{Qo(n,"opacity",e)},or=e=>{er(e),Tt(n)},ir=e=>{e.stopPropagation(),e.target.blur(),ri()},nr=e=>{e.stopPropagation();Pe.findIndex((e=>e===n))!==Pe.length-1&&(Ue.set(Pe.filter((e=>e!==n)).concat([n])),Tt(n))},rr=e=>{e.stopPropagation(),ar()},ar=()=>{const e=(s?a:[n]).filter(Xi).map((e=>{const t=xi(e);t.id=L();const o=me(50,-50);if(Wo(t,"points")){const e=Cn(t,["points"],it);e.points.forEach((e=>{e.x+=o.x,e.y+=o.y})),Tn(t,e,it)}else if(Ai(t)){const e=Cn(t,["x1","y1","x2","y2"],it);e.x1+=o.x,e.y1+=o.y,e.x2+=o.x,e.y2+=o.y,Tn(t,e,it)}else{const e=Cn(t,["x","y"],it);e.x+=50,e.y-=50,Tn(t,e,it)}return Ue.set([...Pe,t]),wt(t),t}));if(e.length>1)return si(),void e.forEach((e=>{di(e,!0,!0)}));di(e[0])},sr=xc(0,{stiffness:.2,damping:.7});hr(e,sr,(e=>o(20,Re=e)));let lr;const cr=(e,t)=>{const{disableTextLayout:o=[]}=t;return"height"in t?o.includes("auto-height")?e.shapeIconButtonTextLayoutAutoWidth:e.shapeIconButtonTextLayoutAutoHeight:"width"in t?o.includes("auto-width")?e.shapeIconButtonTextLayoutFixedSize:e.shapeIconButtonTextLayoutAutoWidth:o.includes("fixed-size")?e.shapeIconButtonTextLayoutAutoHeight:e.shapeIconButtonTextLayoutFixedSize},dr=(e,t)=>{const{disableTextLayout:o=[]}=t;return"height"in t?o.includes("auto-height")?e.shapeTitleButtonTextLayoutAutoWidth:e.shapeTitleButtonTextLayoutAutoHeight:"width"in t?o.includes("auto-width")?e.shapeTitleButtonTextLayoutFixedSize:e.shapeTitleButtonTextLayoutAutoWidth:o.includes("fixed-size")?e.shapeTitleButtonTextLayoutAutoHeight:e.shapeTitleButtonTextLayoutFixedSize};let mr=!1;let gr=he(),$r=void 0;const fr=e=>{Et(e),o(153,$n=e)},yr=e=>{di(Pe[e])};let br;aa((()=>{Fn(),En(),yn(),hn()}));return e.$$set=e=>{"uid"in e&&o(67,Ve=e.uid),"ui"in e&&o(68,He=e.ui),"disabled"in e&&o(0,je=e.disabled),"shapes"in e&&_e(o(1,Ue=e.shapes)),"selection"in e&&o(69,Ge=e.selection),"offset"in e&&o(2,Ze=e.offset),"contextRotation"in e&&o(70,qe=e.contextRotation),"contextFlipX"in e&&o(71,Je=e.contextFlipX),"contextFlipY"in e&&o(72,Qe=e.contextFlipY),"contextZoom"in e&&o(73,et=e.contextZoom),"active"in e&&o(74,tt=e.active),"opacity"in e&&o(75,ot=e.opacity),"parentRect"in e&&o(76,it=e.parentRect),"rootRect"in e&&o(3,st=e.rootRect),"utilRect"in e&&o(4,dt=e.utilRect),"hoverColor"in e&&o(77,ut=e.hoverColor),"caretColor"in e&&o(78,pt=e.caretColor),"gridColor"in e&&o(79,ht=e.gridColor),"snapColor"in e&&o(80,mt=e.snapColor),"textInputMode"in e&&o(5,gt=e.textInputMode),"oninteractionstart"in e&&o(81,$t=e.oninteractionstart),"oninteractionupdate"in e&&o(82,ft=e.oninteractionupdate),"oninteractionrelease"in e&&o(83,yt=e.oninteractionrelease),"oninteractionend"in e&&o(84,xt=e.oninteractionend),"oninteractioncancel"in e&&o(85,vt=e.oninteractioncancel),"onaddshape"in e&&o(86,wt=e.onaddshape),"onupdateshape"in e&&o(87,Tt=e.onupdateshape),"onselectshape"in e&&o(88,Mt=e.onselectshape),"onblurshape"in e&&o(89,Pt=e.onblurshape),"onremoveshape"in e&&o(90,Rt=e.onremoveshape),"ontapshape"in e&&o(91,It=e.ontapshape),"onhovershape"in e&&o(92,Et=e.onhovershape),"ontriggerhistorywrite"in e&&o(93,Ft=e.ontriggerhistorywrite),"onhovercanvas"in e&&o(94,Dt=e.onhovercanvas),"ontapcanvas"in e&&o(95,Ot=e.ontapcanvas),"onleavecanvas"in e&&o(96,Ht=e.onleavecanvas),"beforeSelectShape"in e&&o(97,jt=e.beforeSelectShape),"beforeDeselectShape"in e&&o(98,Ut=e.beforeDeselectShape),"beforeRemoveShape"in e&&o(99,Gt=e.beforeRemoveShape),"beforeUpdateShape"in e&&o(100,Zt=e.beforeUpdateShape),"willRenderShapeControls"in e&&o(101,Xt=e.willRenderShapeControls),"willRenderShapeTextControls"in e&&o(102,Yt=e.willRenderShapeTextControls),"willStartInteraction"in e&&o(103,qt=e.willStartInteraction),"mapEditorPointToImagePoint"in e&&o(104,Kt=e.mapEditorPointToImagePoint),"mapImagePointToEditorPoint"in e&&o(105,Jt=e.mapImagePointToEditorPoint),"eraseRadius"in e&&o(106,Qt=e.eraseRadius),"selectRadius"in e&&o(107,eo=e.selectRadius),"enableButtonFlipVertical"in e&&o(108,to=e.enableButtonFlipVertical),"enableTapToAddText"in e&&o(109,oo=e.enableTapToAddText),"enableMultiSelect"in e&&o(110,io=e.enableMultiSelect),"enableTextStyleControls"in e&&o(6,no=e.enableTextStyleControls),"locale"in e&&o(7,ro=e.locale),"snapThreshold"in e&&o(111,ao=e.snapThreshold),"snapPointer"in e&&o(112,so=e.snapPointer),"enableSnapToContext"in e&&o(113,lo=e.enableSnapToContext),"gridSize"in e&&o(114,co=e.gridSize)},e.$$.update=()=>{var t,r;if(16384&e.$$.dirty[2]|2097152&e.$$.dirty[3]&&o(180,i=co>0?{x:0,y:0,...it}:void 0),1&e.$$.dirty[0]|128&e.$$.dirty[6]&&o(11,n=!je&&Pe&&(jo()||oi())),131072&e.$$.dirty[3]|128&e.$$.dirty[6]&&o(172,a=io?Pe.filter(Di):[]),131072&e.$$.dirty[5]&&o(171,s=a.length>1),16384&e.$$.dirty[2]|196608&e.$$.dirty[5]&&o(192,l=s?a.map((e=>wn(xi(e),it))):[]),2048&e.$$.dirty[0]&&o(189,c=!!n),2048&e.$$.dirty[0]&&o(174,d=n&&Bi(n)),2048&e.$$.dirty[0]|524288&e.$$.dirty[5]&&o(10,u=n&&!d?n.id:void 0),2056&e.$$.dirty[0]|16384&e.$$.dirty[2]&&o(14,p=st&&n&&wn(xi(n),it)),2048&e.$$.dirty[0]|524288&e.$$.dirty[5]&&o(155,h=!(!n||!d)),18432&e.$$.dirty[0]|8192&e.$$.dirty[2]&&o(187,g=n&&ot&&sn(p)||[]),65536&e.$$.dirty[5]|64&e.$$.dirty[6]&&o(184,$=s?l.map(sn):[]),2048&e.$$.dirty[0]|65536&e.$$.dirty[5]&&o(191,f=!s&&n&&(en(t=n)&&tn(t)&&!0!==t.disableResize&&(Wi(t)||Ri(t)||Ei(t)||Ai(t)||Li(t)&&Wo(t,"pathClose")))&&!Fi(n)),2048&e.$$.dirty[0]|65536&e.$$.dirty[5]&&o(17,y=!s&&n&&(e=>en(e)&&!0!==e.disableRotate&&(Wi(e)||Wo(e,"text")||Ei(e)))(n)&&!Fi(n)),2048&e.$$.dirty[0]&&o(15,b=n&&Mi(n)&&!Ri(n)&&!Fi(n)&&!1===n.disableTextScale),2048&e.$$.dirty[0]|32&e.$$.dirty[6]&&o(19,x=!!f&&function(e){return!!e&&(Mi(e)&&!e.height?[[1,2],[3,0]]:!Ai(e)&&!Li(e))}(n)),526336&e.$$.dirty[0]|32&e.$$.dirty[6]&&o(33,v=!!n&&(!Array.isArray(x)&&f)),196608&e.$$.dirty[5]&&o(190,w=s?(e=>{const t=e.map((e=>sn(wn(e,it)))).flat(),o=rt(t);return Ct(o)})(a):[]),2048&e.$$.dirty[0]|65536&e.$$.dirty[5]|2&e.$$.dirty[6]&&o(16,S=n&&g.length>1||s),4096&e.$$.dirty[3]|65536&e.$$.dirty[5]|18&e.$$.dirty[6]&&o(185,k=s?w.map(Jt):g.map(Jt)),4&e.$$.dirty[0]|1073741824&e.$$.dirty[5]&&o(13,C=k.map((e=>me(e.x-Ze.x,e.y-Ze.y)))),2048&e.$$.dirty[0]&&o(18,T=n&&n.points&&Oo(n.selectedPoint)?n.selectedPoint:-1),262144&e.$$.dirty[0]&&o(164,M=T>=0),270336&e.$$.dirty[0]|512&e.$$.dirty[5]&&o(169,P=M?C[T]:void 0),2048&e.$$.dirty[0]|8&e.$$.dirty[6]&&o(32,R=c&&(Ri(n)?!Wo(n,"disableNewline")||!n.disableNewline:!1===n.disableNewline)),4096&e.$$.dirty[3]|536870912&e.$$.dirty[4]&&($n&&Jt&&!Di($n)&&Gi($n)?(e=>{const t=sn(wn(xi(e),it));if(!t)return;const o=t.map(Jt),i=!!e.pathClose||!(!e.bitmap&&(Li(e)||Ai(e))),n="hook"===e.selectionStyle,r=n?o.map(((e,t,o)=>({id:gb,points:xn(o,t),strokeColor:[0,0,0,.1],strokeWidth:2}))):[{id:gb,points:o.map((e=>me(e.x+1,e.y+1))),strokeColor:[0,0,0,.1],strokeWidth:2,pathClose:i}],a=n?o.map(((e,t,o)=>({id:gb,points:xn(o,t),strokeColor:ut,strokeWidth:2}))):[{id:gb,points:o,strokeColor:ut,strokeWidth:2,pathClose:i}];gn(...r,...a)})($n):hn()),221184&e.$$.dirty[0]|8192&e.$$.dirty[2]&&o(186,I=S&&y&&ot&&C?(e=>{const t=ln(e),o=Jt({x:t.origin.x+t.dir.x,y:t.origin.y+t.dir.y});return{origin:Jt(t.origin),position:o}})(p):void 0),4&e.$$.dirty[0]|1&e.$$.dirty[6]&&o(31,E=I&&me(I.position.x-Ze.x,I.position.y-Ze.y)),122880&e.$$.dirty[0]|8192&e.$$.dirty[2]&&o(188,A=S&&b&&ot&&C?(e=>{const t=sn(e);let o=2;e.flipX&&e.flipY?o=0:e.flipX?o=3:e.flipY&&(o=1);const i={...t[o]};return Jt({x:i.x,y:i.y})})(p):void 0),4&e.$$.dirty[0]|4&e.$$.dirty[6]&&o(30,F=A&&me(A.x-Ze.x,A.y-Ze.y)),512&e.$$.dirty[6]&&o(179,W=!!(De||[]).find((e=>[91,93,17].includes(e)))),524288&e.$$.dirty[3]|16777216&e.$$.dirty[5]&&o(181,z=!(W||!so)),2048&e.$$.dirty[0]|8192&e.$$.dirty[2]|1073741824&e.$$.dirty[4]|1141374976&e.$$.dirty[5]&&n&&k&&ot>0&&(n===$n&&vn(),((e,t,o)=>{if(!Gi(t))return;const i=Li(t),n=i&&Wo(t,"pathClose"),r=n&&(e=>e.strokeWidth&&((e,t)=>{const o=e.strokeColor;return!!o&&(3===o.length||o[3]>0)})(e))(t),a=Bi(t),s=Fi(t),l="hook"===t.selectionStyle,c=!0!==t.disableShowPoints,{selectionOpacity:d=1}=t;if(a&&i&&!n)return;const u=[],p=[...k],h=p[p.length-1],m=p[0],$=(s?.05:.1)*e*d,f=$>0,y=(s?.5:1)*e*d,b=y>0,x=[0,0,0],v=[1,1,1],w=s?1:1.5;De.includes(16)&&h&&o&&So(h,o);const S=p.length&&n&&a&&o?Ie(m,o):1/0,C=p.length&&n&&a&&o?Ie(h,o):1/0,T=S<=mb,M=C<=mb;!T&&o&&p.push(o);const P=p.length>1,R=!!t.pathClose||!(!t.bitmap&&(Li(t)||Ai(t)))||p.length>2&&T;P&&f&&(l?u.push(...p.map(((e,t,o)=>({id:fn,points:xn(o,t),strokeColor:x,opacity:$})))):u.push({id:fn,points:p.map((e=>me(e.x+1,e.y+1))),pathClose:R,strokeColor:x,strokeWidth:2,opacity:$})),n&&f&&c&&u.push(...p.map((e=>({id:fn,...e,rx:2*w,ry:2*w,backgroundColor:x,opacity:$})))),I&&f&&u.push({id:fn,points:[me(I.origin.x+1,I.origin.y+1),me(I.position.x+1,I.position.y+1)],strokeColor:x,strokeWidth:2,opacity:$}),P&&b&&(l?u.push(...p.map(((e,t,o)=>({id:fn,points:xn(o,t),strokeColor:v,strokeWidth:w,opacity:y})))):u.push({id:fn,points:p,pathClose:R,strokeColor:v,strokeWidth:w,backgroundColor:a&&n&&t.backgroundColor&&t.backgroundColor[3]>0?t.backgroundColor:[0,0,0,0],opacity:y})),n&&c&&u.push(...p.map((e=>({id:fn,...e,rx:3*w,ry:3*w,backgroundColor:[.5,.5,.5],strokeWidth:w,strokeColor:v})))),n&&a&&c&&k.length>=3&&u.push({...m,id:fn,rx:w*(T?5:4),ry:w*(T?5:4),backgroundColor:T?ut:[.5,.5,.5],strokeWidth:w,strokeColor:v}),n&&a&&r&&c&&!T&&g.length>=2&&u.push({...h,id:fn,rx:w*(M?5:4),ry:w*(M?5:4),backgroundColor:M?ut:[.5,.5,.5],strokeWidth:w,strokeColor:v}),I&&b&&!l&&u.push({id:fn,points:[{x:I.origin.x,y:I.origin.y},{x:I.position.x,y:I.position.y}],strokeColor:v,strokeWidth:w,opacity:y}),bn(...u)})(ot,n,d&&Li(n)?Pn({...$r},!z):void 0)),2048&e.$$.dirty[0]&&(n||(vn(),yn())),4096&e.$$.dirty[3]|536870912&e.$$.dirty[5])if($.length){kn();const e=$.map((e=>({id:Sn,points:e.map(Jt),strokeWidth:1,strokeColor:[1,1,1,.5],pathClose:!0})));Mn(...e)}else kn();536870912&e.$$.dirty[4]&&o(182,D=!!$n),134217728&e.$$.dirty[4]&&o(183,B=!!Si),1073741824&e.$$.dirty[4]|469762048&e.$$.dirty[5]&&(!$r||B||D||Pn({...$r},!z)),131072&e.$$.dirty[2]|2101248&e.$$.dirty[3]|33554432&e.$$.dirty[5]|1024&e.$$.dirty[6]&&co>0&&i&&Jt&&((e,t,o,i)=>{const n=Jt({x:0,y:0}),r=Jt({x:e,y:e}),a=Jt({x:t.width,y:t.height}),s=r.x-n.x;if(Rn.set(s>6?1:0),i<=0)return En();const l=Eo(s,n.x,a.x).map((e=>({id:In,opacity:i,points:[{x:e,y:n.y},{x:e,y:a.y}],strokeWidth:1,strokeColor:o}))),c=Eo(s,n.y,a.y).map((e=>({id:In,opacity:i,points:[{x:n.x,y:e},{x:a.x,y:e}],strokeWidth:1,strokeColor:o})));An(...c,...l)})(co,i,ht,Oe),262144&e.$$.dirty[2]|4096&e.$$.dirty[3]|100663296&e.$$.dirty[4]|16777216&e.$$.dirty[5]&&Jt&&(W?Fn():((e,t,o)=>{if(null===e&&null===t)return Fn();let i,n;null!==e&&(i={id:Ln,strokeColor:o,strokeWidth:1.5,points:[Jt({x:e,y:0}),Jt({x:e,y:it.height})]}),null!==t&&(n={id:Ln,strokeColor:o,strokeWidth:1.5,points:[Jt({x:0,y:t}),Jt({x:it.width,y:t})]}),zn(i,n)})(Po,Ro,mt)),4096&e.$$.dirty[2]&&(e=>{if(!e)return ei({_prerender:!1});const t=Pe.find((e=>e.isEditing));t&&Jo(t,{_prerender:"inline"===gt})})(tt),512&e.$$.dirty[6]&&De&&De.length&&(()=>{const[e]=De;8!==e&&46!==e||ii()&&(n.isEditing||(Li(n)&&Oo(n.selectedPoint)?setTimeout((()=>Ho(n,n.selectedPoint)),0):setTimeout((()=>ri()),0)))})(),288&e.$$.dirty[0]&&Dn&&"inline"===gt&&Dn.focus(),2048&e.$$.dirty[0]&&o(178,_=n&&Mi(n)),2048&e.$$.dirty[0]|8388608&e.$$.dirty[5]&&o(12,V=_&&!1!==qi(n)&&Fi(n)),4096&e.$$.dirty[0]&&o(173,N=V?{...n}:void 0),16384&e.$$.dirty[2]|262144&e.$$.dirty[5]&&o(175,H=N&&wn({...N},it)),1048576&e.$$.dirty[5]&&o(177,j=H&&li(H.text,H)),5242880&e.$$.dirty[5]&&(U=H&<(H.x,H.y,j.width,j.height)),6144&e.$$.dirty[0]&&o(27,G=V?n.text:""),6152&e.$$.dirty[0]|16384&e.$$.dirty[2]&&o(176,Z=st&&n&&V&&wn({...xi(n),width:Oo(n.width)?Math.floor(n.width):void 0,height:Oo(n.height)?Math.floor(n.height):void 0},it)),4128&e.$$.dirty[0]|2097152&e.$$.dirty[5]&&o(29,X=V&&((e,t)=>{const{textAlign:o="left",fontFamily:i="sans-serif",fontWeight:n="normal",fontStyle:r="normal",letterSpacing:a="normal",textShadowX:s=0,textShadowY:l=0,textShadowBlur:c=0,textShadowColor:d,textOutlineWidth:u=0,textOutlineColor:p}=e,h="!important",m=`caret-color:${K};text-align:${o}${h};font-family:${i}${h};font-weight:${n}${h};font-style:${r}${h};letter-spacing:${Oo(a)?a+"px":"normal"}${h}`;if("modal"===t)return m;const g=u?`;-webkit-text-stroke:${2*u}px ${Xo(p)} ${h}`:"",$=c||s||l?`;text-shadow:${s}px ${l}px ${c}px ${Xo(d)} ${h}`:"";let f=e.fontSize,y=1,b="";f>1e3&&O()&&(y=f/1e3,b=`transform-origin:0 0;transform:scale(${y})`,f=1e3);let x=e.lineHeight/y;const v=Xo(e.color),w=.5*Math.max(0,f-x);return`--font-scalar:${y};--bottom-inset:${w}px;padding:${w}px 0 0${h};color:${v}${h};font-size:${f}px${h};line-height:${x}px${h};${m};${b}${g}${$}`})(Z,gt)),4100&e.$$.dirty[0]|2304&e.$$.dirty[2]|2097152&e.$$.dirty[5]&&o(28,q=V&&((e,t,o,i)=>{let r,a;e.width&&e.height?(r=ct(e),a=Be(e)):(a=li(n.text,p),a.width=p.width||a.width,r=me(e.x+.5*a.width,e.y+.5*a.height));const s=Math.max(0,e.fontSize-e.lineHeight)+e.lineHeight,l=Jt(r);let c=l.x-t.x-.5*a.width,d=l.y-t.y-.5*a.height,u=e.flipX,h=e.flipY,m=e.rotation;Je&&Qe?(u=!u,h=!h):Je?(u=!u,m=-m):Qe&&(h=!h,m=-m),m+=i;const g=o*(u?-1:1),$=o*(h?-1:1);return`--line-height:${s}px;width:${a.width}px;height:${a.height}px;transform:translate(${c}px,${d}px) rotate(${m}rad) scale(${g}, ${$})`})(Z,Ze,et,qe)),65536&e.$$.dirty[2]&&(K=pt?Xo(pt):"auto"),4384&e.$$.dirty[0]&&V&&Dn&&"inline"===gt&&On(G),2048&e.$$.dirty[0]|33&e.$$.dirty[5]&&o(160,J=n&&!h?n:J),32&e.$$.dirty[5]&&o(162,Q=J&&Yi(J)),32&e.$$.dirty[5]&&o(157,ee=J&&Ki(J)),32&e.$$.dirty[5]&&o(159,te=J&&Xi(J)),32&e.$$.dirty[5]&&o(158,oe=J&&Zi(J)),65568&e.$$.dirty[5]&&o(161,ie=!s&&J&&(e=>!0!==e.disableReorder)(J)),32&e.$$.dirty[5]&&o(156,ne=J&&!1!==qi(J)),32&e.$$.dirty[5]&&o(163,re=J&&Wo(J,"backgroundImage")&&Ui(J,"opacity")),2080&e.$$.dirty[0]&&o(166,ae=n&&"html"===n.format&&"inline"===gt),2048&e.$$.dirty[0]|2049&e.$$.dirty[5]&&o(170,se=n&&(!h||ae)),268435456&e.$$.dirty[4]|32768&e.$$.dirty[5]|256&e.$$.dirty[6]&&sr.set(se&&!Ni?1:0,{hard:!1===Ae}),8192&e.$$.dirty[0]|40960&e.$$.dirty[5]&&o(168,le=se&&C.length?(r=rt(C),Se(me(r.x+.5*r.width,r.y),Od)):le),528&e.$$.dirty[0]|24576&e.$$.dirty[5]&&o(167,ce=(P||le)&&lr&&dt&&((e,t,o,i)=>{const n=e.x,r=e.y,a=n+e.width;let s=Math.max(t.x-.5*o.width,n),l=Math.max(t.y-o.height+i,r);return s+o.width>a&&(s=a-o.width),me(s,l)})(dt,P||le,lr,-16)),4096&e.$$.dirty[5]&&o(26,ue=ce?`translate(${ce.x}px, ${ce.y}px)`:void 0),1048576&e.$$.dirty[0]|4096&e.$$.dirty[5]&&o(25,ge=ce?Re:void 0),4096&e.$$.dirty[0]&&o(165,fe=V?"text":"shape"),3200&e.$$.dirty[0]|33536&e.$$.dirty[3]|4094&e.$$.dirty[5]|128&e.$$.dirty[6]&&o(24,be="text"===fe&&Yt&&ae?cm((()=>Yt([["div","text-styles",{class:"PinturaShapeControlsGroup"},[...[["bold",{label:"B",style:"font-weight:900;",title:"Bold",shortcut:["CMD","B"]}],["italic",{label:"I",style:"font-family:Times New Roman;font-style:italic;",title:"Italic",shortcut:["CMD","I"]}],["underline",{label:"U",style:"text-decoration:underline;",title:"Underline",shortcut:["CMD","U"]}],["strikeThrough",{label:"S",style:"text-decoration:line-through;",title:"Strikethrough",shortcut:["CMD","S"]}]].map((([e,t])=>["Button","style-"+e,{onclick:()=>document.execCommand(e),...t,style:"font-size:1.25em;text-underline-offset:1px;text-decoration-thickness:1.5px;font-weight:400;"+t.style}]))]],["div","text-reset",{class:"PinturaShapeControlsGroup"},[["Button","style-reset",{onclick:()=>document.execCommand("removeFormat"),style:"font-weight:400",title:"Remove styles",label:[["span","T",{style:"font-size:1.25em;font-style:italic;font-family:Times New Roman;text-decoration:underline",textContent:"T"}],["span","x",{style:"position:relative;top:.175rem;",innerHTML:"×"}]]}]]]],u))):"shape"===fe&&Xt&&u?cm((()=>Xt(M?[["div","epsilon",{class:"PinturaShapeControlsGroup"},[["Button","remove-point",{onclick:Gn,label:ro.shapeTitleButtonRemove,icon:ro.shapeIconButtonRemove,shortcut:["Backspace"],hideLabel:!0}]]]]:[re&&["div","alpha",{class:"PinturaShapeControlsGroup"},[["ToggleSlider","adjust-opacity",{onrelease:or,onchange:er,step:.01,value:Wo(n,"opacity")?n.opacity:1,label:(e,t,o)=>Math.round(e/o*100)+"%",min:0,max:1,direction:"x"}]]],["div","beta",{class:"PinturaShapeControlsGroup"},[Q&&["Button","flip-horizontal",{onclick:Jn,label:ro.shapeTitleButtonFlipHorizontal,icon:ro.shapeIconButtonFlipHorizontal,hideLabel:!0}],Q&&to&&["Button","flip-vertical",{onclick:Qn,label:ro.shapeTitleButtonFlipVertical,icon:ro.shapeIconButtonFlipVertical,hideLabel:!0}],ie&&["Button","to-front",{onclick:nr,label:ro.shapeTitleButtonMoveToFront,icon:ro.shapeIconButtonMoveToFront,hideLabel:!0,disabled:Pe[Pe.length-1]===J}],te&&["Button","duplicate",{onclick:rr,label:ro.shapeTitleButtonDuplicate,icon:ro.shapeIconButtonDuplicate,shortcut:["CMD","D"],hideLabel:!0}],oe&&["Button","remove",{onclick:ir,label:ro.shapeTitleButtonRemove,icon:ro.shapeIconButtonRemove,shortcut:["Backspace"],hideLabel:!0}]].filter(Boolean)],ne&&ee&&["div","gamma",{class:"PinturaShapeControlsGroup"},[["Button","text-layout",{onclick:Kn,label:ru(dr,ro,n),icon:ru(cr,ro,n),hideLabel:!0}]]],ne&&["div","delta",{class:"PinturaShapeControlsGroup"},[["Button","edit-text",{label:ro.shapeLabelInputText,onclick:Zn}]]]].filter(Boolean),u))):[]),128&e.$$.dirty[0]|128&e.$$.dirty[6]&&o(23,Te=Pe.filter(Gi).filter((e=>e.id)).filter((e=>!Bi(e))).map((e=>({id:e.id,color:Mi(e)?e.color:Ai(e)?e.strokeColor:e.backgroundColor,name:e.name||ro["shapeLabelTool"+as(mn(e))]}))))},[je,Ue,Ze,st,dt,gt,no,ro,Dn,lr,u,n,V,C,p,b,S,y,T,x,Re,mr,br,Te,be,ge,ue,G,q,X,F,E,R,v,ho,ko,e=>{const{origin:t}=e.detail,i=io&&De.includes(16);on=void 0,o(151,Si=void 0),ki=void 0,zi=void 0,Oi=!1,wi=void 0,_i=!1,Vi=!1,Mo(),clearTimeout(vi),vi=setTimeout((()=>o(152,Ni=!0)),250);const r=jo();if(!r||Li(r)&&Wo(r,"pathClose")||Go(),bi=Kt($e(t)),r&&Li(r)&&Wo(r,"pathClose"))return $t(e);const l=fi(Pe,bi,eo,(e=>Gi(e))),c=l.length&&l.shift();if(n&&Fi(n))if(c!==n)Vn();else{const e=Wo(n,"height"),t=!e&&Wo(n,"width");if(e||t){const e=xi(n),t=xi(e);wn(t,it);const o=Xe(li(e.text,t),(e=>Math.ceil(e))),i=Ne(t.width,t.height||o.height);Xn(i,e,t);const r=fi([{...e,strokeWidth:"5%"}],bi,0);Vi=0===r.length}}if(n&&oo&&(_i=!0),!c&&n&&Fi(n)&&ui(n),!qt(t))return;if(c&&Di(c))return Oi=!0,o(151,Si=c),s?(i&&ui(c),void nn(a)):(ki=xi(Si),void(zi=wn(xi(Si),it)));wi=c||void 0;if(!$t(e)&&c){if(di(c,!0,i),o(151,Si=c),s)return nn(a);ki=xi(Si),zi=wn(xi(Si),it)}},e=>{rn(),vt(e)},e=>{const{translation:t,ctrlKey:o,metaKey:n,shiftKey:r,position:s}=e.detail;if(Si){if(!tn(Si))return;if(Fi(Si)){if(!Vi)return;Vn()}if(r){let e=Math.abs(t.x),o=Math.abs(t.y);"x"===an&&(o-=64),"y"===an&&(e-=64),e>o?(t.y=0,an="x"):o>e&&(t.x=0,an="y")}else an=null;const e=o||n;if(on){if(!a.every(tn))return;return void on.forEach((({shape:e,shapeOriginComputed:o})=>{Do(e,o,t,{...po(0,co,i,e)})}))}return Do(Si,zi,t,{...po(e?0:ao,co,i,Si)})}ft(e)},e=>{if(rn(),Si){if(!s)if(e.detail.isTap&&Li(Si)&&Qi(Si)){const{position:t}=e.detail,o=Kt($e(t));((e,t)=>{const o=e.points,i=[];for(let e=0;e<o.length-1;e++)i.push([o[e],o[e+1]]);i.push([o[o.length-1],o[0]]);const n=i.findIndex((([e,o])=>Wt(t,6,e,o)));let r;const a=[];for(let e=0;e<i.length;e++)a.push(i[e][0]),e===n&&(r=e+1,a.push(t));Jo(e,{points:a,selectedPoint:r})})(Si,o)}else e.detail.isTap&&Oi&&Mi(Si)&&!1!==qi(Si)&&pi(Si)}else yt(e)},e=>{const t=wi&&e.detail.isTap,i=io&&De.includes(16);if(e.detail.isTap&&setTimeout((()=>{Ot({target:Si||wi,position:bi},0)})),Si)return It(Si),n=Si,r=ki,JSON.stringify(n)!==JSON.stringify(r)&&Tt(Si),void o(151,Si=void 0);var n,r;let a=!0;if(!i){const e=ci();a=!e||Ut(e,wi||void 0),a&&si({storePrevious:!1})}xt(e),a&&t&&di(wi,!0,i)},Rn,e=>{o(152,Ni=!0),o(151,Si=n),zi=p},e=>{if(!Si)return void o(152,Ni=!1);const{translation:t,indexes:n,shiftKey:r,ctrlKey:a,metaKey:s,isNudge:l}=e.detail;Vo(Si,zi,n,t,{shiftKey:!l&&r,...po(a||s?0:ao,co,i,Si)}),Ji(Si)&&Ie(t)>16&&Jo(Si,{selectedPoint:void 0})},e=>{if(!Si)return void o(152,Ni=!1);di(Si);const{isTap:t,translation:i,indexes:r}=e.detail;t&&(Ji(Si)&&Jo(Si,{selectedPoint:Si.selectedPoint===r[0]?void 0:r[0]}),It(Si)),o(151,Si=void 0),o(152,Ni=!1),Tt(n)},e=>{No=ln(p).origin,o(152,Ni=!0),o(151,Si=n),zi=p},e=>{if(!Si)return void o(152,Ni=!1);const{translation:t,shiftKey:i}=e.detail;((e,t,o,i)=>{const n=$i(wn(xi(e),it)),r=ct(n),a=Io(No,o);let s=ve(a,r)+Math.PI/2;if(i.shiftKey){const e=Math.PI/16;s=e*Math.round(s/e)-qe%e}wo(e,{rotation:s},it),qo()})(Si,0,t,{shiftKey:i})},()=>{Si?(di(Si),o(151,Si=void 0),o(152,Ni=!1),Tt(n)):o(152,Ni=!1)},e=>{o(152,Ni=!0),o(151,Si=n),zi=p},e=>{if(!Si)return void o(152,Ni=!1);const{translation:t,ctrlKey:n,metaKey:r}=e.detail;((e,t,o,i)=>{const n=nt(t),r=li(t.text,t);n.width||(n.width=r.width),n.height||(n.height=r.height);let a=2;e.flipX&&e.flipY?a=0:e.flipX?a=3:e.flipY&&(a=1),Vo(e,t,[a],o,{...i,aspectRatio:n.width/n.height,beforeResizeShape:e=>{const o=e.width/n.width;e.fontSize=t.fontSize*o,t.width||delete e.width,t.height||delete e.height}})})(Si,zi,t,{...po(n||r?0:ao,co,i,Si)})},()=>{Si?(di(Si),o(151,Si=void 0),o(152,Ni=!1),Tt(n)):o(152,Ni=!1)},e=>{const{key:t}=e,o=/escape/i.test(t);if(ii())return o?(e.preventDefault(),e.stopPropagation(),ui(n)):void(te&&"d"===t&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),e.stopPropagation(),ar()))},e=>{const t=qi(n,e);return!0===t?e:t},Wn,e=>{const{target:t,key:o}=e,i=t.value||t.innerText,r=t.selectionStart||0,a=t.selectionEnd||i.length,s=i.substring(0,r)+o+i.substring(a);if(qi(n,s)!==s)return e.preventDefault()},e=>Pi(n)&&/enter/i.test(e.code)&&!1!==n.disableNewline?e.preventDefault():/arrow/i.test(e.code)?e.stopPropagation():/escape/i.test(e.key)?Nn():void 0,_n,e=>{if(_n(e))return Vn()},Vn,Nn,sr,e=>{const t=ti();t&&(t.find(Fi)||t.find((e=>!tn(e)))||t.forEach((t=>{o(151,Si=t),zi=wn(xi(Si),it),Do(Si,zi,e.detail)})))},e=>{o(21,mr=!0)},({relatedTarget:e})=>{e&&e.classList.contains("shape-selector__button")||o(21,mr=!1)},e=>{if("touch"===e.pointerType||"PinturaShapeEditor"!==e.target.className)return void Ht();(Ni||vi)&&fr(void 0);const t=Xy(e,st);o(154,$r=$e(t));const i=Se(Kt(t),(e=>Math.round(e)));if(we(i,gr))return;if(gr=$e(i),Dt(Ni,t,i),Ni||vi)return;if(h)return;const[n]=fi(Pe,i,0,Gi);n&&Bi(n)||fr(n)},e=>{"touch"!==e.pointerType&&Ht()},yr,Ve,He,Ge,qe,Je,Qe,et,tt,ot,it,ut,pt,ht,mt,$t,ft,yt,xt,vt,wt,Tt,Mt,Pt,Rt,It,Et,Ft,Dt,Ot,Ht,jt,Ut,Gt,Zt,Xt,Yt,qt,Kt,Jt,Qt,eo,to,oo,io,ao,so,lo,co,go,$o,fo,yo,bo,xo,vo,(e,t={})=>{let o,n,r,a=[],s=Ei(e),l=Mi(e),c="relative"===t.position;const d=t.interpolateInput,u=uo(),p=e=>{if(!ao)return e;const t=Kt(e),{snapTranslation:o,snapLines:n}=Fo(Ao(t),u,ao,co,i);return zo(e,o),To(n),e},h=!!ci(),g=t.isSelection?Ge:Ue,$="step"===t.inputMode;if(Li(e)){if($){let t=!1;const i=(e,o)=>{const i=$o(g),n=e&&me(ib(e.x,it.width),ib(e.y,it.height)),r=n&&Jt(n);De.includes(16)&&r&&So(r,o);const a=Kt(o),s=i.points.length?i.points[0]:a,l=me(ib(s.x,it.width),ib(s.y,it.height)),d=Jt(l),u=Ie(d,o);if(!t&&1===i.points.length&&u<36)return yo(g);if(i.points.length>2&&u<=mb){i.pathClose=!0,Gi(i)&&di(i);const e=bo(g);return void wt(e)}const p=i.strokeWidth&&i.strokeColor&&(void 0===i.strokeColor[3]||i.strokeColor[3]>0),h=Ie(r,o);if(p&&i.points.length>1&&h<mb){i.pathClose=!1,i.backgroundColor=[0,0,0,0],Gi(i)&&di(i);const e=bo(g);wt(e)}else if(!(i.points.length>0&&h<100))return c?nb(a,it):a};return{start:e=>{const a=$o(g),{origin:s}=e.detail;if(n=4,o=p($e(s)),r=$e(o),a){const e=a.points[a.points.length-1],t=i(e,o);return t&&(a.points=[...a.points,t]),void xo({points:a.points},g)}t=!0},update:e=>{if(!t)return;const n=$o(g);if(!n)return;const r=n.points[0],a=i(r,me(o.x+e.detail.translation.x,o.y+e.detail.translation.y));a&&(n.points[1]=a,xo({points:n.points},g))},release:e=>e.detail.preventInertia(),cancel:()=>{yo(g)},end:i=>{if(!t)return;const n=Kt(o),r=c?nb(n,it):n,{isTap:a}=i.detail;if(a){if(fi(Pe,n,0,Gi).length)return yo(g)}fo({...e,points:[r]},g)}}}return{start:t=>{const{origin:i}=t.detail;n=4,o=$e(i),r=$e(o),a.push({...r});const s=Kt(o),l=c?nb(s,it):s;fo({...e,points:[l]},g)},update:e=>{const t=$o(g);if(!t)return;const{translation:i}=e.detail,s=me(o.x+i.x,o.y+i.y),l=Ee(r,s);if(de(l,5)<=n)return;const u=[],p=ve(s,r),h=n-l,m={x:r.x+h*Math.cos(p),y:r.y+h*Math.sin(p)};if(a.push({...m}),d&&t.points.length>1){const e=a.length,t=Math.ceil(l/10);let o=l/30;const i=a[e-3],n=a[e-2],r=a[e-1];a[e-4]||(o*=.1),u.push(...zt(i,n,r,t,o).slice(1,-1)),a.splice(e-1,0,...u)}u.push(m),r.x=m.x,r.y=m.y,xo({points:t.points.concat(u.map((e=>{const t=Kt(e);return c?nb(t,it):t})))},g)},release:e=>e.detail.preventInertia(),cancel:()=>{yo(g)},end:e=>{const t=$o(g);if(!t)return;if(e.detail.isTap){let e=!1;if(t.bitmap?(wi&&(e=!0),h&&(e=!0)):e=!0,e)return yo(g)}const o=bo(g);wt(o)}}}return s||l||Ii(e)?{start:t=>{const{origin:i}=t.detail;o=p($e(i));const n=Kt(o),r=c?nb(n,it):n,a=-1*Co(qe,Je,Qe),l={...e,rotation:a,...r};l.flipX=Je,l.flipY=Qe,delete l.position,l.opacity=0;(s?["rx","ry"]:["width","height"]).forEach((e=>{l[e]=c?"0%":0})),fo(l,g)},update:e=>{const t=$o(g);if(!t)return;t.opacity=1;let{aspectRatio:i}=t,{translation:n,shiftKey:r,ctrlKey:a}=e.detail;!i&&r&&(i=1);const l=p(me(o.x+n.x,o.y+n.y)),c=Kt(o),d=Kt(l);if(i){const e=rt([c,d]),t=St(e,i),o=d.x<c.x?-1:1,n=d.y<c.y?-1:1;d.x=c.x+t.width*o,d.y=c.y+t.height*n}const u={x:c.x+.5*(d.x-c.x),y:c.y+.5*(d.y-c.y)},h=Co(qe,Je,Qe);ye(c,h,u),ye(d,h,u);const m=Math.min(c.x,d.x),$=Math.min(c.y,d.y);let f=Math.max(c.x,d.x)-m,y=Math.max(c.y,d.y)-$,b={};s?(a?(b.x=c.x,b.y=c.y):(b.x=m+.5*f,b.y=$+.5*y),b.rx=.5*f,b.ry=.5*y):(a?(b.x=c.x-.5*f,b.y=c.y-.5*y):(b.x=m,b.y=$),b.width=f,b.height=y),xo(b,g,((e,t)=>wo(e,t,it)))},release:e=>{e.detail.preventInertia()},cancel:()=>{yo(g)},end:e=>{const t=$o(g);if(t){if(e.detail.isTap){if(Mi(t)&&oo&&_i)return yo(g);if(!Mi(t)||!oo||wi)return yo(g);delete t.width,delete t.height,!1!==t.disableNewline&&delete t.textAlign;const e=wn({...t},it),i=li(t.text,e),n=Kt({x:o.x,y:o.y-.5*i.height}),r=Kt({x:o.x+i.width,y:o.y+.5*i.height}),a={x:n.x+.5*(r.x-n.x),y:n.y+.5*(r.y-n.y)},s=Co(qe,Je,Qe);ye(n,s,a),ye(r,s,a);let l=Math.min(n.x,r.x),c=Math.min(n.y,r.y);l<0&&(l=0),c<0&&(c=0),l+i.width>it.width&&(l=it.width-i.width),c+i.height>it.height&&(c=it.height-i.height),t.x=m(t.x)?Zo(l,it.width):l,t.y=m(t.y)?Zo(c,it.height):c}if(t.opacity=1,Mi(t))wt(t);else{const e=bo(g);wt(e)}Gi(t)&&di(t),Mi(t)&&pi(t)}}}:Ai(e)?{start:t=>{const{origin:i}=t.detail,n=Kt(p(i)),r=Se(n,Od);o=$e(i),fo({...e,x1:c?Zo(r.x,it.width):r.x,y1:c?Zo(r.y,it.height):r.y,x2:c?Zo(r.x,it.width):r.x,y2:c?Zo(r.y,it.height):r.y,opacity:0},g)},update:e=>{if(!$o(g))return;const{translation:t}=e.detail,i=p(ke($e(o),t));if(De.includes(16)){const e=Ee(o,i),t=ve(o,i),n=Math.PI/4,r=n*Math.round(t/n);i.x=o.x+e*Math.cos(r),i.y=o.y+e*Math.sin(r)}const n=Kt(i);xo({x2:c?Zo(n.x,it.width):n.x,y2:c?Zo(n.y,it.height):n.y,opacity:1},g)},release:e=>e.detail.preventInertia(),cancel:()=>{yo(g)},end:e=>{const t=$o(g);if(!t)return;if(e.detail.isTap)return yo(g);t.opacity=1;const o=bo(g);wt(o),Gi(t)&&di(o)}}:void 0},()=>{let e,t;const o=Qt*Qt,i=(e,t,i=!1)=>{const n=Ie(e,t);if(!i&&n<2)return!1;const r=Pe.filter((e=>!e.disableErase));let a;a=n<o?fi(Pe,Kt(t),Qt):yi(r,Kt(e),Kt(t),Qt);return mi(a).forEach(Rt),!0};return{start:o=>{e=me(Math.round(o.detail.origin.x),Math.round(o.detail.origin.y)),i(e,e,!0),t=e},update:o=>{const{translation:n}=o.detail,r=me(Math.round(e.x+n.x),Math.round(e.y+n.y));i(t,r)&&(t=$e(r))},release:e=>e.detail.preventInertia(),cancel:()=>{yo(collection)},end:()=>{}}},jo,Uo,e=>{if(!jo())return Hi(e),vo(e)},Go,Yo,(e={})=>({id:L(),...e}),qo,Ko,Jo,Qo,(e,t,o=!0)=>{Pe.forEach((o=>Qo(o,e,t,!1))),o&&qo()},ei,ti,oi,ii,si,di,ui,pi,hi,mi,gi,$i,fi,yi,Po,Ro,Si,Ni,$n,$r,h,ne,ee,oe,te,J,ie,Q,re,M,fe,ae,ce,le,P,se,s,a,N,d,H,Z,j,_,W,i,z,D,B,$,k,I,g,A,c,w,f,l,Pe,Ae,De,Oe,function(t){da.call(this,e,t)},e=>yr(e),function(e){pa[e?"unshift":"push"]((()=>{Dn=e,o(8,Dn)}))},function(){G=this.value,o(27,G),o(12,V),o(11,n),o(178,_),o(0,je),o(193,Pe)},e=>{const{key:t}=e;if("Enter"===t){if(_n(e))return!0;if(!1===n.disableNewline)return!1}return!0},function(e){pa[e?"unshift":"push"]((()=>{Dn=e,o(8,Dn)}))},()=>{br&&br.focus()},e=>o(9,lr=e.detail),function(e){pa[e?"unshift":"push"]((()=>{br=e,o(22,br)}))},e=>Xy(e,st)]}class yb extends Ga{constructor(e){super(),Ua(this,e,fb,hb,lr,{uid:67,ui:68,disabled:0,shapes:1,selection:69,offset:2,contextRotation:70,contextFlipX:71,contextFlipY:72,contextZoom:73,active:74,opacity:75,parentRect:76,rootRect:3,utilRect:4,hoverColor:77,caretColor:78,gridColor:79,snapColor:80,textInputMode:5,oninteractionstart:81,oninteractionupdate:82,oninteractionrelease:83,oninteractionend:84,oninteractioncancel:85,onaddshape:86,onupdateshape:87,onselectshape:88,onblurshape:89,onremoveshape:90,ontapshape:91,onhovershape:92,ontriggerhistorywrite:93,onhovercanvas:94,ontapcanvas:95,onleavecanvas:96,beforeSelectShape:97,beforeDeselectShape:98,beforeRemoveShape:99,beforeUpdateShape:100,willRenderShapeControls:101,willRenderShapeTextControls:102,willStartInteraction:103,mapEditorPointToImagePoint:104,mapImagePointToEditorPoint:105,eraseRadius:106,selectRadius:107,enableButtonFlipVertical:108,enableTapToAddText:109,enableMultiSelect:110,enableTextStyleControls:6,locale:7,snapThreshold:111,snapPointer:112,enableSnapToContext:113,gridSize:114,syncShapeCollection:115,getShapeDraft:116,addShapeDraft:117,discardShapeDraft:118,confirmShapeDraft:119,updateShapeDraft:120,addShape:121,createShape:122,eraseShape:123,getMarkupItemDraft:124,getMarkupItemDraftIndex:125,addMarkupItemDraft:126,confirmMarkupItemDraft:127,discardMarkupItemDraft:128,createMarkupItem:129,syncShapes:130,removeMarkupShapeProps:131,updateMarkupShape:132,updateMarkupShapeProperty:133,updateMarkupItemsShapeProperty:134,updateMarkupShapeItems:135,getActiveMarkupItems:136,getActiveMarkupItem:137,hasActiveMarkupItem:138,blurShapes:139,selectShape:140,deselectMarkupItem:141,editMarkupItem:142,finishEditMarkupItem:143,removeMarkupItems:144,getTextShapeRect:145,getMarkupShapeRect:146,getShapesNearPosition:147,getShapesBetweenPoints:148},null,[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1])}get syncShapeCollection(){return this.$$.ctx[115]}get getShapeDraft(){return this.$$.ctx[116]}get addShapeDraft(){return this.$$.ctx[117]}get discardShapeDraft(){return this.$$.ctx[118]}get confirmShapeDraft(){return this.$$.ctx[119]}get updateShapeDraft(){return this.$$.ctx[120]}get addShape(){return this.$$.ctx[121]}get createShape(){return this.$$.ctx[122]}get eraseShape(){return this.$$.ctx[123]}get getMarkupItemDraft(){return this.$$.ctx[124]}get getMarkupItemDraftIndex(){return this.$$.ctx[125]}get addMarkupItemDraft(){return this.$$.ctx[126]}get confirmMarkupItemDraft(){return this.$$.ctx[127]}get discardMarkupItemDraft(){return this.$$.ctx[128]}get createMarkupItem(){return this.$$.ctx[129]}get syncShapes(){return this.$$.ctx[130]}get removeMarkupShapeProps(){return this.$$.ctx[131]}get updateMarkupShape(){return this.$$.ctx[132]}get updateMarkupShapeProperty(){return this.$$.ctx[133]}get updateMarkupItemsShapeProperty(){return this.$$.ctx[134]}get updateMarkupShapeItems(){return this.$$.ctx[135]}get getActiveMarkupItems(){return this.$$.ctx[136]}get getActiveMarkupItem(){return this.$$.ctx[137]}get hasActiveMarkupItem(){return this.$$.ctx[138]}get blurShapes(){return this.$$.ctx[139]}get selectShape(){return this.$$.ctx[140]}get deselectMarkupItem(){return this.$$.ctx[141]}get editMarkupItem(){return this.$$.ctx[142]}get finishEditMarkupItem(){return this.$$.ctx[143]}get removeMarkupItems(){return this.$$.ctx[144]}get getTextShapeRect(){return this.$$.ctx[145]}get getMarkupShapeRect(){return this.$$.ctx[146]}get getShapesNearPosition(){return this.$$.ctx[147]}get getShapesBetweenPoints(){return this.$$.ctx[148]}}function bb(e){let t,o,i;return o=new gh({props:{items:e[2]}}),{c(){t=Fr("ul"),Na(o.$$.fragment),Nr(t,"class","PinturaShapeStyleList")},m(e,n){Ar(e,t,n),Ha(o,t,null),i=!0},p(e,t){const i={};4&t&&(i.items=e[2]),o.$set(i)},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Lr(t),ja(o)}}}function xb(e){let t,o;return t=new Lh({props:{class:"PinturaShapeStyles",elasticity:e[0],$$slots:{default:[vb]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};1&o&&(i.elasticity=e[0]),524292&o&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function vb(e){let t,o,i;return o=new gh({props:{items:e[2]}}),{c(){t=Fr("ul"),Na(o.$$.fragment),Nr(t,"class","PinturaShapeStyleList")},m(e,n){Ar(e,t,n),Ha(o,t,null),i=!0},p(e,t){const i={};4&t&&(i.items=e[2]),o.$set(i)},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Lr(t),ja(o)}}}function wb(e){let t,o,i,n;const r=[xb,bb],a=[];function s(e,t){return e[1]?0:1}return o=s(e),i=a[o]=r[o](e),{c(){t=Fr("div"),i.c(),Zr(t,"opacity",e[5]),Zr(t,"pointer-events",e[4]),Zr(t,"visibility",e[3])},m(e,i){Ar(e,t,i),a[o].m(t,null),n=!0},p(e,[n]){let l=o;o=s(e),o===l?a[o].p(e,n):(Ra(),Aa(a[l],1,1,(()=>{a[l]=null})),Ia(),i=a[o],i?i.p(e,n):(i=a[o]=r[o](e),i.c()),Ea(i,1),i.m(t,null)),32&n&&Zr(t,"opacity",e[5]),16&n&&Zr(t,"pointer-events",e[4]),8&n&&Zr(t,"visibility",e[3])},i(e){n||(Ea(i),n=!0)},o(e){Aa(i),n=!1},d(e){e&&Lr(t),a[o].d()}}}function Sb(e,t,o){let i,n,r,a,s,l,c,d,{isActive:u=!1}=t,{controls:p=[]}=t,{locale:h}=t,{scrollElasticity:m}=t,{scrollEnable:g=!0}=t,{hideTitles:$=!1}=t,{willRenderControls:f=Y}=t;const y=ca("redrawTrigger");hr(e,y,(e=>o(16,l=e)));const b=ca("env");hr(e,b,(e=>o(15,s=e)));const x=ca("isAnimated");hr(e,x,(e=>o(18,d=e)));const v=xc(0,{stiffness:.25,damping:.9});return hr(e,v,(e=>o(17,c=e))),e.$$set=e=>{"isActive"in e&&o(10,u=e.isActive),"controls"in e&&o(11,p=e.controls),"locale"in e&&o(12,h=e.locale),"scrollElasticity"in e&&o(0,m=e.scrollElasticity),"scrollEnable"in e&&o(1,g=e.scrollEnable),"hideTitles"in e&&o(13,$=e.hideTitles),"willRenderControls"in e&&o(14,f=e.willRenderControls)},e.$$.update=()=>{263168&e.$$.dirty&&v.set(u?1:0,{hard:!1===d}),131072&e.$$.dirty&&o(5,i=c),1024&e.$$.dirty&&o(4,n=u?"auto":"none"),131072&e.$$.dirty&&o(3,r=c<=0?"hidden":"visible"),129024&e.$$.dirty&&o(2,a=l&&f(p.map((e=>["ShapeStyle",e.id,{title:e.componentProps.title,locale:h,hideTitle:$,items:[[e.component,e.id,e.componentProps]]}])),s,(()=>y.set({}))))},[m,g,a,r,n,i,y,b,x,v,u,p,h,$,f,s,l,c,d]}class kb extends Ga{constructor(e){super(),Ua(this,e,Sb,wb,lr,{isActive:10,controls:11,locale:12,scrollElasticity:0,scrollEnable:1,hideTitles:13,willRenderControls:14})}}function Cb(e,t,o){const i=e.slice();return i[15]=t[o].key,i[6]=t[o].controls,i[16]=t[o].isActive,i}function Tb(e,t){let o,i,n;return i=new kb({props:{isActive:t[16],controls:t[6],locale:t[1],scrollElasticity:t[2],scrollEnable:t[3],hideTitles:t[4],willRenderControls:t[5]}}),{key:e,first:null,c(){o=Br(),Na(i.$$.fragment),this.first=o},m(e,t){Ar(e,o,t),Ha(i,e,t),n=!0},p(e,o){t=e;const n={};128&o&&(n.isActive=t[16]),128&o&&(n.controls=t[6]),2&o&&(n.locale=t[1]),4&o&&(n.scrollElasticity=t[2]),8&o&&(n.scrollEnable=t[3]),16&o&&(n.hideTitles=t[4]),32&o&&(n.willRenderControls=t[5]),i.$set(n)},i(e){n||(Ea(i.$$.fragment,e),n=!0)},o(e){Aa(i.$$.fragment,e),n=!1},d(e){e&&Lr(o),ja(i,e)}}}function Mb(e){let t,o,i,n=[],r=new Map,a=e[7];const s=e=>e[15];for(let t=0;t<a.length;t+=1){let o=Cb(e,a,t),i=s(o);r.set(i,n[t]=Tb(i,o))}return{c(){t=Fr("div");for(let e=0;e<n.length;e+=1)n[e].c();Nr(t,"class",o=Xc(["PinturaShapeStyleEditor",!e[3]&&"PinturaShapeStyleEditorOverflow",e[0]]))},m(e,o){Ar(e,t,o);for(let e=0;e<n.length;e+=1)n[e].m(t,null);i=!0},p(e,[l]){190&l&&(a=e[7],Ra(),n=Ba(n,l,s,1,e,a,r,t,Oa,Tb,null,Cb),Ia()),(!i||9&l&&o!==(o=Xc(["PinturaShapeStyleEditor",!e[3]&&"PinturaShapeStyleEditorOverflow",e[0]])))&&Nr(t,"class",o)},i(e){if(!i){for(let e=0;e<a.length;e+=1)Ea(n[e]);i=!0}},o(e){for(let e=0;e<n.length;e+=1)Aa(n[e]);i=!1},d(e){e&&Lr(t);for(let e=0;e<n.length;e+=1)n[e].d()}}}function Pb(e,t,o){let i,n,r,{class:a}=t,{controls:s={}}=t,{shapeProps:l}=t,{onchange:c}=t,{locale:d}=t,{scrollElasticity:u}=t,{scrollEnable:p=!0}=t,{hideTitles:h=!1}=t,{willRenderControls:g}=t;const $=[];return e.$$set=e=>{"class"in e&&o(0,a=e.class),"controls"in e&&o(6,s=e.controls),"shapeProps"in e&&o(8,l=e.shapeProps),"onchange"in e&&o(9,c=e.onchange),"locale"in e&&o(1,d=e.locale),"scrollElasticity"in e&&o(2,u=e.scrollElasticity),"scrollEnable"in e&&o(3,p=e.scrollEnable),"hideTitles"in e&&o(4,h=e.hideTitles),"willRenderControls"in e&&o(5,g=e.willRenderControls)},e.$$.update=()=>{64&e.$$.dirty&&o(11,i=Object.keys(s).filter((e=>s[e]))),2304&e.$$.dirty&&o(10,n=l&&Object.keys(l).length&&i&&Ui(l)?(e=>i.filter((t=>t.split("_").every((t=>Wo(e,t)&&Ui(e,t))))).map((t=>{const o=(e.settings&&e.settings[t]||{}).control||t,i=t.split("_");let n=i.length>1?i.map((t=>e[t])):e[t];if(R(s[o])){const{title:i,component:r}=s[o](n,(e=>{c({[t]:e})}),{selectedShapeId:e.id});return{id:o,component:gh,componentProps:{title:i,items:r}}}let[r,a]=s[o];if(m(r)&&s[r]){const e={...a};[r,a]=s[r],a={...a,...e}}const l=R(a.options)?a.options(e):a.options;return"RadioGroup"===r&&(a.selectedIndex=-1),a.formatValue&&(n=a.formatValue(n)),{id:o,component:r,componentProps:{...a,options:l,locale:d,value:n,optionLabelClass:"PinturaButtonLabel",onchange:o=>{const n=T(o)&&!_o(o)?o.value:o;a.onchange&&a.onchange(n,e);const r=i.length>1?i.reduce(((e,t,o)=>({...e,[t]:Array.isArray(n)?n[o]:n})),{}):{[t]:n};c(r)}}}})).filter(Boolean))(l):[]),1280&e.$$.dirty&&o(7,r=((e,t)=>{let o=$.find((t=>t.key===e));return o||(o={key:e,controls:t},$.push(o)),$.forEach((e=>e.isActive=!1)),o.controls=t,o.isActive=!0,$})(l&&Object.keys(l).length?Object.keys(l).join("_"):"none",n||[]))},[a,d,u,p,h,g,s,r,l,c,n,i]}class Rb extends Ga{constructor(e){super(),Ua(this,e,Pb,Mb,lr,{class:0,controls:6,shapeProps:8,onchange:9,locale:1,scrollElasticity:2,scrollEnable:3,hideTitles:4,willRenderControls:5})}}var Ib=e=>/<svg /.test(e);function Eb(e){let t,o;return t=new gh({props:{items:e[10]}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};1024&o&&(i.items=e[10]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Ab(e){let t,o,i,n;const r=[Fb,Lb],a=[];function s(e,t){return e[8]?0:1}return t=s(e),o=a[t]=r[t](e),{c(){o.c(),i=Br()},m(e,o){a[t].m(e,o),Ar(e,i,o),n=!0},p(e,n){let l=t;t=s(e),t===l?a[t].p(e,n):(Ra(),Aa(a[l],1,1,(()=>{a[l]=null})),Ia(),o=a[t],o?o.p(e,n):(o=a[t]=r[t](e),o.c()),Ea(o,1),o.m(i.parentNode,i))},i(e){n||(Ea(o),n=!0)},o(e){Aa(o),n=!1},d(e){a[t].d(e),e&&Lr(i)}}}function Lb(e){let t,o,i,n,r=e[10]&&zb(e);return i=new Lh({props:{scrollAutoCancel:e[9],elasticity:e[0],$$slots:{default:[Db]},$$scope:{ctx:e}}}),{c(){t=Fr("div"),r&&r.c(),o=Or(),Na(i.$$.fragment),Nr(t,"class","PinturaShapePresetsFlat")},m(e,a){Ar(e,t,a),r&&r.m(t,null),Rr(t,o),Ha(i,t,null),n=!0},p(e,n){e[10]?r?(r.p(e,n),1024&n&&Ea(r,1)):(r=zb(e),r.c(),Ea(r,1),r.m(t,o)):r&&(Ra(),Aa(r,1,1,(()=>{r=null})),Ia());const a={};512&n&&(a.scrollAutoCancel=e[9]),1&n&&(a.elasticity=e[0]),536871070&n&&(a.$$scope={dirty:n,ctx:e}),i.$set(a)},i(e){n||(Ea(r),Ea(i.$$.fragment,e),n=!0)},o(e){Aa(r),Aa(i.$$.fragment,e),n=!1},d(e){e&&Lr(t),r&&r.d(),ja(i)}}}function Fb(e){let t,o,i,n,r;o=new Lh({props:{elasticity:e[0],class:"PinturaShapePresetsGroups",$$slots:{default:[Nb]},$$scope:{ctx:e}}});const a=[{class:"PinturaControlPanels"},{panelClass:"PinturaControlPanel"},{panels:e[11]},e[12]];let s={$$slots:{default:[jb,({panel:e,panelIsActive:t})=>({26:e,27:t}),({panel:e,panelIsActive:t})=>(e?67108864:0)|(t?134217728:0)]},$$scope:{ctx:e}};for(let e=0;e<a.length;e+=1)s=ir(s,a[e]);return n=new gd({props:s}),{c(){t=Fr("div"),Na(o.$$.fragment),i=Or(),Na(n.$$.fragment),Nr(t,"class","PinturaShapePresetsGrouped")},m(e,a){Ar(e,t,a),Ha(o,t,null),Rr(t,i),Ha(n,t,null),r=!0},p(e,t){const i={};1&t&&(i.elasticity=e[0]),536876128&t&&(i.$$scope={dirty:t,ctx:e}),o.$set(i);const r=6144&t?Wa(a,[a[0],a[1],2048&t&&{panels:e[11]},4096&t&&_a(e[12])]):{};738206239&t&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){r||(Ea(o.$$.fragment,e),Ea(n.$$.fragment,e),r=!0)},o(e){Aa(o.$$.fragment,e),Aa(n.$$.fragment,e),r=!1},d(e){e&&Lr(t),ja(o),ja(n)}}}function zb(e){let t,o;return t=new gh({props:{items:e[10]}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};1024&o&&(i.items=e[10]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Db(e){let t,o;return t=new Fd({props:{items:e[7],onclickitem:e[1],ongrabitem:e[2],ondragitem:e[3],ondropitem:e[4]}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};128&o&&(i.items=e[7]),2&o&&(i.onclickitem=e[1]),4&o&&(i.ongrabitem=e[2]),8&o&&(i.ondragitem=e[3]),16&o&&(i.ondropitem=e[4]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Ob(e){let t,o;return t=new gh({props:{items:e[10]}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};1024&o&&(i.items=e[10]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Bb(e){let t,o;return t=new Sd({props:{$$slots:{default:[Wb]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};805306368&o&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Wb(e){let t,o=e[28].icon+"";return{c(){t=zr("g")},m(e,i){Ar(e,t,i),t.innerHTML=o},p(e,i){268435456&i&&o!==(o=e[28].icon+"")&&(t.innerHTML=o)},d(e){e&&Lr(t)}}}function _b(e){let t,o,i=e[28].label+"";return{c(){t=Fr("span"),o=Dr(i)},m(e,i){Ar(e,t,i),Rr(t,o)},p(e,t){268435456&t&&i!==(i=e[28].label+"")&&Ur(o,i)},d(e){e&&Lr(t)}}}function Vb(e){let t,o,i,n=e[28].icon&&Bb(e),r=!e[28].hideLabel&&_b(e);return{c(){n&&n.c(),t=Or(),r&&r.c(),o=Br()},m(e,a){n&&n.m(e,a),Ar(e,t,a),r&&r.m(e,a),Ar(e,o,a),i=!0},p(e,i){e[28].icon?n?(n.p(e,i),268435456&i&&Ea(n,1)):(n=Bb(e),n.c(),Ea(n,1),n.m(t.parentNode,t)):n&&(Ra(),Aa(n,1,1,(()=>{n=null})),Ia()),e[28].hideLabel?r&&(r.d(1),r=null):r?r.p(e,i):(r=_b(e),r.c(),r.m(o.parentNode,o))},i(e){i||(Ea(n),i=!0)},o(e){Aa(n),i=!1},d(e){n&&n.d(e),e&&Lr(t),r&&r.d(e),e&&Lr(o)}}}function Nb(e){let t,o,i,n=e[10]&&Ob(e);const r=[{class:"PinturaControlList"},{tabs:e[5]},e[12],{layout:"compact"}];let a={$$slots:{default:[Vb,({tab:e})=>({28:e}),({tab:e})=>e?268435456:0]},$$scope:{ctx:e}};for(let e=0;e<r.length;e+=1)a=ir(a,r[e]);return o=new od({props:a}),o.$on("select",e[18]),{c(){n&&n.c(),t=Or(),Na(o.$$.fragment)},m(e,r){n&&n.m(e,r),Ar(e,t,r),Ha(o,e,r),i=!0},p(e,i){e[10]?n?(n.p(e,i),1024&i&&Ea(n,1)):(n=Ob(e),n.c(),Ea(n,1),n.m(t.parentNode,t)):n&&(Ra(),Aa(n,1,1,(()=>{n=null})),Ia());const a=4128&i?Wa(r,[r[0],32&i&&{tabs:e[5]},4096&i&&_a(e[12]),r[3]]):{};805306368&i&&(a.$$scope={dirty:i,ctx:e}),o.$set(a)},i(e){i||(Ea(n),Ea(o.$$.fragment,e),i=!0)},o(e){Aa(n),Aa(o.$$.fragment,e),i=!1},d(e){n&&n.d(e),e&&Lr(t),ja(o,e)}}}function Hb(e){let t,o;return t=new Fd({props:{items:e[13][e[26]].items,disabled:e[13][e[26]].disabled,onclickitem:e[1],ongrabitem:e[2],ondragitem:e[3],ondropitem:e[4]}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};67117056&o&&(i.items=e[13][e[26]].items),67117056&o&&(i.disabled=e[13][e[26]].disabled),2&o&&(i.onclickitem=e[1]),4&o&&(i.ongrabitem=e[2]),8&o&&(i.ondragitem=e[3]),16&o&&(i.ondropitem=e[4]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function jb(e){let t,o;return t=new Lh({props:{scroll:e[27]?{scrollOffset:0,animate:!1}:void 0,scrollAutoCancel:e[9],elasticity:e[0],$$slots:{default:[Hb]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};134217728&o&&(i.scroll=e[27]?{scrollOffset:0,animate:!1}:void 0),512&o&&(i.scrollAutoCancel=e[9]),1&o&&(i.elasticity=e[0]),603987998&o&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Ub(e){let t,o,i,n;const r=[Ab,Eb],a=[];function s(e,t){return e[9]?0:e[10]?1:-1}return~(o=s(e))&&(i=a[o]=r[o](e)),{c(){t=Fr("div"),i&&i.c(),Nr(t,"class","PinturaShapePresetsPalette")},m(e,i){Ar(e,t,i),~o&&a[o].m(t,null),n=!0},p(e,[n]){let l=o;o=s(e),o===l?~o&&a[o].p(e,n):(i&&(Ra(),Aa(a[l],1,1,(()=>{a[l]=null})),Ia()),~o?(i=a[o],i?i.p(e,n):(i=a[o]=r[o](e),i.c()),Ea(i,1),i.m(t,null)):i=null)},i(e){n||(Ea(i),n=!0)},o(e){Aa(i),n=!1},d(e){e&&Lr(t),~o&&a[o].d()}}}function Gb(e,t,o){let i,n,a,s,l,c,d,u,p,{locale:h}=t,{presets:g}=t,{scrollElasticity:$}=t,{enableSelectImage:f=!0}=t,{willRenderPresetToolbar:y=Y}=t,{onaddpreset:b=r}=t,{ongrabpreset:x}=t,{ondragpreset:v}=t,{ondroppreset:w}=t;const S="presets-"+L(),k=(e,t="")=>Ib(e)?e:Bo(e)?Uo(e,t):`<img src="${e}" alt="${t}"/>`,C=e=>j(Zt(e)),T=["src","alt","thumb","shape","id","mount","disabled"],M=e=>e.map((e=>(e=>_o(e)&&m(e[0])&&_o(e[1]))(e)?{...e[2],id:`${S}-${e[0].toLowerCase()}`,label:e[0],items:M(e[1])}:(e=>{let t,o,i,n,r,a,s,l=e;return m(e)?Bo(e)?(t=e,r=e,n=k(t,r)):(t=e,r=C(t),n=k(t,r)):(t=e.src,r=e.alt||(m(t)?C(t):m(e.thumb)?C(e.thumb):void 0),n=k(e.thumb||t,r),o=e.shape,a=e.mount,s=e.disabled,i=Object.keys(e).reduce(((t,o)=>(T.includes(o)||(t[o]=e[o]),t)),{})),{id:l,src:t,thumb:n,shape:o,shapeProps:i,alt:r,title:r,mount:a,disabled:s}})(e)));return e.$$set=e=>{"locale"in e&&o(14,h=e.locale),"presets"in e&&o(15,g=e.presets),"scrollElasticity"in e&&o(0,$=e.scrollElasticity),"enableSelectImage"in e&&o(16,f=e.enableSelectImage),"willRenderPresetToolbar"in e&&o(17,y=e.willRenderPresetToolbar),"onaddpreset"in e&&o(1,b=e.onaddpreset),"ongrabpreset"in e&&o(2,x=e.ongrabpreset),"ondragpreset"in e&&o(3,v=e.ondragpreset),"ondroppreset"in e&&o(4,w=e.ondroppreset)},e.$$.update=()=>{32768&e.$$.dirty&&o(7,i=M(g)),128&e.$$.dirty&&o(9,n=i.length),640&e.$$.dirty&&o(8,a=n&&i.some((e=>!!e.items))),384&e.$$.dirty&&o(5,s=a&&i),384&e.$$.dirty&&o(13,l=a&&i.reduce(((e,t)=>(e[t.id]=t,e)),{})),96&e.$$.dirty&&o(6,c=c||s&&(s.find((e=>!e.disabled))||{}).id),64&e.$$.dirty&&o(12,d={name:S,selected:c}),32&e.$$.dirty&&o(11,u=s&&s.map((e=>e.id))),212994&e.$$.dirty&&o(10,p=h&&y([f&&["Button","browse",{label:h.shapeLabelButtonSelectSticker,icon:h.shapeIconButtonSelectSticker,onclick:()=>{lm().then((e=>{e&&b(e)}))}}]]))},[$,b,x,v,w,s,c,i,a,n,p,u,d,l,h,g,f,y,({detail:e})=>o(6,c=e)]}class Zb extends Ga{constructor(e){super(),Ua(this,e,Gb,Ub,lr,{locale:14,presets:15,scrollElasticity:0,enableSelectImage:16,willRenderPresetToolbar:17,onaddpreset:1,ongrabpreset:2,ondragpreset:3,ondroppreset:4})}}function Xb(e){let t,o,i,n;return t=new gh({props:{items:e[30]}}),i=new Rb({props:{locale:e[4],shapeProps:e[49],onchange:e[85],controls:e[9],scrollEnable:!1,hideTitles:!0,willRenderControls:e[165]}}),{c(){Na(t.$$.fragment),o=Or(),Na(i.$$.fragment)},m(e,r){Ha(t,e,r),Ar(e,o,r),Ha(i,e,r),n=!0},p(e,o){const n={};1073741824&o[0]&&(n.items=e[30]),t.$set(n);const r={};16&o[0]&&(r.locale=e[4]),262144&o[1]&&(r.shapeProps=e[49]),512&o[0]&&(r.controls=e[9]),i.$set(r)},i(e){n||(Ea(t.$$.fragment,e),Ea(i.$$.fragment,e),n=!0)},o(e){Aa(t.$$.fragment,e),Aa(i.$$.fragment,e),n=!1},d(e){ja(t,e),e&&Lr(o),ja(i,e)}}}function Yb(e){let t,o,i;return o=new hf({props:{$$slots:{default:[Xb]},$$scope:{ctx:e}}}),{c(){t=Fr("div"),Na(o.$$.fragment),Nr(t,"slot","header")},m(e,n){Ar(e,t,n),Ha(o,t,null),i=!0},p(e,t){const i={};1073742352&t[0]|262144&t[1]|134217728&t[6]&&(i.$$scope={dirty:t,ctx:e}),o.$set(i)},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Lr(t),ja(o)}}}function qb(e){let t,o;const i=[{locale:e[4]},{ui:e[69]},{shapes:e[5]},{selection:e[58]},{uid:e[20]},{parentRect:e[37]},{rootRect:e[55]},{utilRect:e[39]},{offset:e[50]},{disabled:e[38]},{contextRotation:e[23]},{contextFlipX:e[24]},{contextFlipY:e[25]},{contextZoom:e[36]?e[36].scale:void 0},{active:e[35]},{opacity:e[56]},{hoverColor:e[57]},{caretColor:e[57]},{snapColor:e[57]},{gridColor:[1,1,1,.125]},{eraseRadius:e[47]},{selectRadius:e[6]},{enableButtonFlipVertical:e[10]},{enableMultiSelect:e[14]},{mapEditorPointToImagePoint:e[21]},{mapImagePointToEditorPoint:e[22]},{enableTapToAddText:e[13]},{textInputMode:e[8]},{snapThreshold:e[16]},{snapPointer:!e[48]},{enableSnapToContext:e[17]},{gridSize:e[15]},{willStartInteraction:e[95]},{oninteractionstart:e[79]},{oninteractionupdate:e[80]},{oninteractionrelease:e[81]},{oninteractionend:e[83]},{oninteractioncancel:e[82]},{onleavecanvas:e[87]},{onhovercanvas:e[86]},{onhovershape:e[89]},{ontapcanvas:e[88]},{onaddshape:e[156]},{onselectshape:e[157]},{onblurshape:e[158]},{ontapshape:e[159]},{onupdateshape:e[160]},{onremoveshape:e[161]},{ontriggerhistorywrite:e[162]},e[42]];let n={};for(let e=0;e<i.length;e+=1)n=ir(n,i[e]);return t=new yb({props:n}),e[163](t),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const n=66315632&o[0]|252381681&o[1]|255721600&o[2]|12&o[3]?Wa(i,[16&o[0]&&{locale:e[4]},128&o[2]&&{ui:e[69]},32&o[0]&&{shapes:e[5]},134217728&o[1]&&{selection:e[58]},1048576&o[0]&&{uid:e[20]},64&o[1]&&{parentRect:e[37]},16777216&o[1]&&{rootRect:e[55]},256&o[1]&&{utilRect:e[39]},524288&o[1]&&{offset:e[50]},128&o[1]&&{disabled:e[38]},8388608&o[0]&&{contextRotation:e[23]},16777216&o[0]&&{contextFlipX:e[24]},33554432&o[0]&&{contextFlipY:e[25]},32&o[1]&&{contextZoom:e[36]?e[36].scale:void 0},16&o[1]&&{active:e[35]},33554432&o[1]&&{opacity:e[56]},67108864&o[1]&&{hoverColor:e[57]},67108864&o[1]&&{caretColor:e[57]},67108864&o[1]&&{snapColor:e[57]},i[19],65536&o[1]&&{eraseRadius:e[47]},64&o[0]&&{selectRadius:e[6]},1024&o[0]&&{enableButtonFlipVertical:e[10]},16384&o[0]&&{enableMultiSelect:e[14]},2097152&o[0]&&{mapEditorPointToImagePoint:e[21]},4194304&o[0]&&{mapImagePointToEditorPoint:e[22]},8192&o[0]&&{enableTapToAddText:e[13]},256&o[0]&&{textInputMode:e[8]},65536&o[0]&&{snapThreshold:e[16]},131072&o[1]&&{snapPointer:!e[48]},131072&o[0]&&{enableSnapToContext:e[17]},32768&o[0]&&{gridSize:e[15]},4&o[3]&&{willStartInteraction:e[95]},131072&o[2]&&{oninteractionstart:e[79]},262144&o[2]&&{oninteractionupdate:e[80]},524288&o[2]&&{oninteractionrelease:e[81]},2097152&o[2]&&{oninteractionend:e[83]},1048576&o[2]&&{oninteractioncancel:e[82]},33554432&o[2]&&{onleavecanvas:e[87]},16777216&o[2]&&{onhovercanvas:e[86]},134217728&o[2]&&{onhovershape:e[89]},67108864&o[2]&&{ontapcanvas:e[88]},1&o[1]|8&o[3]&&{onaddshape:e[156]},1&o[1]&&{onselectshape:e[157]},1&o[1]&&{onblurshape:e[158]},1&o[1]&&{ontapshape:e[159]},1&o[1]|8&o[3]&&{onupdateshape:e[160]},1&o[1]|8&o[3]&&{onremoveshape:e[161]},8&o[3]&&{ontriggerhistorywrite:e[162]},2048&o[1]&&_a(e[42])]):{};t.$set(n)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(o){e[163](null),ja(t,o)}}}function Kb(e){let t,o,i,n,a=e[51]&&qb(e);return{c(){t=Fr("div"),a&&a.c(),Nr(t,"slot","main"),Zr(t,"cursor",e[46])},m(s,l){Ar(s,t,l),a&&a.m(t,null),e[164](t),o=!0,i||(n=[Wr(t,"keydown",e[84]),wr(_c.call(null,t)),Wr(t,"dropfiles",(function(){sr(e[12]?e[94]:r)&&(e[12]?e[94]:r).apply(this,arguments)})),wr(Dc.call(null,t)),Wr(t,"measure",e[152])],i=!0)},p(o,i){(e=o)[51]?a?(a.p(e,i),1048576&i[1]&&Ea(a,1)):(a=qb(e),a.c(),Ea(a,1),a.m(t,null)):a&&(Ra(),Aa(a,1,1,(()=>{a=null})),Ia()),32768&i[1]&&Zr(t,"cursor",e[46])},i(e){o||(Ea(a),o=!0)},o(e){Aa(a),o=!1},d(o){o&&Lr(t),a&&a.d(),e[164](null),i=!1,ar(n)}}}function Jb(e){let t,o;return t=new Zb({props:{locale:e[4],presets:e[19],enableSelectImage:e[11],willRenderPresetToolbar:e[43],onaddpreset:e[93],ongrabpreset:e[90],ondragpreset:e[91],ondroppreset:e[92],scrollElasticity:e[44]}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};16&o[0]&&(i.locale=e[4]),524288&o[0]&&(i.presets=e[19]),2048&o[0]&&(i.enableSelectImage=e[11]),4096&o[1]&&(i.willRenderPresetToolbar=e[43]),8192&o[1]&&(i.scrollElasticity=e[44]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Qb(e){let t,o,i,n="stack"===e[7]&&ex(e),r=(e[53]&&e[34]||"row"===e[7])&&ix(e);return{c(){n&&n.c(),t=Or(),r&&r.c(),o=Br()},m(e,a){n&&n.m(e,a),Ar(e,t,a),r&&r.m(e,a),Ar(e,o,a),i=!0},p(e,i){"stack"===e[7]?n?(n.p(e,i),128&i[0]&&Ea(n,1)):(n=ex(e),n.c(),Ea(n,1),n.m(t.parentNode,t)):n&&(Ra(),Aa(n,1,1,(()=>{n=null})),Ia()),e[53]&&e[34]||"row"===e[7]?r?(r.p(e,i),128&i[0]|4194312&i[1]&&Ea(r,1)):(r=ix(e),r.c(),Ea(r,1),r.m(o.parentNode,o)):r&&(Ra(),Aa(r,1,1,(()=>{r=null})),Ia())},i(e){i||(Ea(n),Ea(r),i=!0)},o(e){Aa(n),Aa(r),i=!1},d(e){n&&n.d(e),e&&Lr(t),r&&r.d(e),e&&Lr(o)}}}function ex(e){let t,o,i,n;const r=[ox,tx],a=[];function s(e,t){return e[45]?0:1}return o=s(e),i=a[o]=r[o](e),{c(){t=Fr("div"),i.c(),Nr(t,"class","PinturaControlPanels")},m(e,i){Ar(e,t,i),a[o].m(t,null),n=!0},p(e,n){let l=o;o=s(e),o===l?a[o].p(e,n):(Ra(),Aa(a[l],1,1,(()=>{a[l]=null})),Ia(),i=a[o],i?i.p(e,n):(i=a[o]=r[o](e),i.c()),Ea(i,1),i.m(t,null))},i(e){n||(Ea(i),n=!0)},o(e){Aa(i),n=!1},d(e){e&&Lr(t),a[o].d()}}}function tx(e){let t,o,i;return o=new Rb({props:{locale:e[4],shapeProps:e[49],onchange:e[85],controls:e[9],scrollElasticity:e[44],willRenderControls:e[18]}}),{c(){t=Fr("div"),Na(o.$$.fragment),Nr(t,"class","PinturaControlPanel")},m(e,n){Ar(e,t,n),Ha(o,t,null),i=!0},p(e,t){const i={};16&t[0]&&(i.locale=e[4]),262144&t[1]&&(i.shapeProps=e[49]),512&t[0]&&(i.controls=e[9]),8192&t[1]&&(i.scrollElasticity=e[44]),262144&t[0]&&(i.willRenderControls=e[18]),o.$set(i)},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Lr(t),ja(o)}}}function ox(e){let t,o,i;return o=new Zb({props:{locale:e[4],presets:e[19],enableSelectImage:e[11],willRenderPresetToolbar:e[43],onaddpreset:e[93],ongrabpreset:e[90],ondragpreset:e[91],ondroppreset:e[92],scrollElasticity:e[44]}}),{c(){t=Fr("div"),Na(o.$$.fragment),Nr(t,"class","PinturaControlPanel")},m(e,n){Ar(e,t,n),Ha(o,t,null),i=!0},p(e,t){const i={};16&t[0]&&(i.locale=e[4]),524288&t[0]&&(i.presets=e[19]),2048&t[0]&&(i.enableSelectImage=e[11]),4096&t[1]&&(i.willRenderPresetToolbar=e[43]),8192&t[1]&&(i.scrollElasticity=e[44]),o.$set(i)},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Lr(t),ja(o)}}}function ix(e){let t,o;return t=new Lh({props:{class:"PinturaControlListScroller",elasticity:e[44],$$slots:{default:[dx]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};8192&o[1]&&(i.elasticity=e[44]),262801&o[0]|262154&o[1]|134217728&o[6]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function nx(e){let t,o;return t=new Lu({props:{locale:e[4],class:"PinturaControlList",optionClass:"PinturaControlListOption",layout:"row",options:e[32],selectedIndex:e[32].findIndex(e[153]),onchange:e[78],$$slots:{option:[lx,({option:e})=>({212:e}),({option:e})=>[0,0,0,0,0,0,e?67108864:0]]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};16&o[0]&&(i.locale=e[4]),2&o[1]&&(i.options=e[32]),1&o[0]|2&o[1]&&(i.selectedIndex=e[32].findIndex(e[153])),16&o[0]|201326592&o[6]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function rx(e){let t,o;return t=new Sd({props:{$$slots:{default:[ax]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};16&o[0]|201326592&o[6]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function ax(e){let t,o=(R(e[212].icon)?e[212].icon(e[4]):e[212].icon)+"";return{c(){t=zr("g")},m(e,i){Ar(e,t,i),t.innerHTML=o},p(e,i){16&i[0]|67108864&i[6]&&o!==(o=(R(e[212].icon)?e[212].icon(e[4]):e[212].icon)+"")&&(t.innerHTML=o)},d(e){e&&Lr(t)}}}function sx(e){let t,o,i=(R(e[212].label)?e[212].label(e[4]):e[212].label)+"";return{c(){t=Fr("span"),o=Dr(i)},m(e,i){Ar(e,t,i),Rr(t,o)},p(e,t){16&t[0]|67108864&t[6]&&i!==(i=(R(e[212].label)?e[212].label(e[4]):e[212].label)+"")&&Ur(o,i)},d(e){e&&Lr(t)}}}function lx(e){let t,o,i,n=e[212].icon&&rx(e),r=!e[212].hideLabel&&sx(e);return{c(){t=Fr("div"),n&&n.c(),o=Or(),r&&r.c(),Nr(t,"slot","option")},m(e,a){Ar(e,t,a),n&&n.m(t,null),Rr(t,o),r&&r.m(t,null),i=!0},p(e,i){e[212].icon?n?(n.p(e,i),67108864&i[6]&&Ea(n,1)):(n=rx(e),n.c(),Ea(n,1),n.m(t,o)):n&&(Ra(),Aa(n,1,1,(()=>{n=null})),Ia()),e[212].hideLabel?r&&(r.d(1),r=null):r?r.p(e,i):(r=sx(e),r.c(),r.m(t,null))},i(e){i||(Ea(n),i=!0)},o(e){Aa(n),i=!1},d(e){e&&Lr(t),n&&n.d(),r&&r.d()}}}function cx(e){let t,o;return t=new Rb({props:{locale:e[4],shapeProps:e[49],onchange:e[85],controls:e[9],scrollEnable:!1,hideTitles:!0,willRenderControls:e[154]}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};16&o[0]&&(i.locale=e[4]),262144&o[1]&&(i.shapeProps=e[49]),512&o[0]&&(i.controls=e[9]),262144&o[0]&&(i.willRenderControls=e[154]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function dx(e){let t,o,i,n=e[34]&&nx(e),r="row"===e[7]&&cx(e);return{c(){n&&n.c(),t=Or(),r&&r.c(),o=Br()},m(e,a){n&&n.m(e,a),Ar(e,t,a),r&&r.m(e,a),Ar(e,o,a),i=!0},p(e,i){e[34]?n?(n.p(e,i),8&i[1]&&Ea(n,1)):(n=nx(e),n.c(),Ea(n,1),n.m(t.parentNode,t)):n&&(Ra(),Aa(n,1,1,(()=>{n=null})),Ia()),"row"===e[7]?r?(r.p(e,i),128&i[0]&&Ea(r,1)):(r=cx(e),r.c(),Ea(r,1),r.m(o.parentNode,o)):r&&(Ra(),Aa(r,1,1,(()=>{r=null})),Ia())},i(e){i||(Ea(n),Ea(r),i=!0)},o(e){Aa(n),Aa(r),i=!1},d(e){n&&n.d(e),e&&Lr(t),r&&r.d(e),e&&Lr(o)}}}function ux(e){let t,o;return t=new Lh({props:{class:"PinturaControlListScroller",elasticity:e[44],$$slots:{default:[gx]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};8192&o[1]&&(i.elasticity=e[44]),134217744&o[0]|8388608&o[1]|134217728&o[6]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function px(e){let t,o;return t=new Sd({props:{$$slots:{default:[hx]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};16&o[0]|201326592&o[6]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function hx(e){let t,o=(R(e[212].icon)?e[212].icon(e[4]):e[212].icon)+"";return{c(){t=zr("g")},m(e,i){Ar(e,t,i),t.innerHTML=o},p(e,i){16&i[0]|67108864&i[6]&&o!==(o=(R(e[212].icon)?e[212].icon(e[4]):e[212].icon)+"")&&(t.innerHTML=o)},d(e){e&&Lr(t)}}}function mx(e){let t,o,i,n,r,a=(R(e[212].label)?e[212].label(e[4]):e[212].label)+"",s=e[212].icon&&px(e);return{c(){t=Fr("div"),s&&s.c(),o=Or(),i=Fr("span"),n=Dr(a),Nr(t,"slot","option")},m(e,a){Ar(e,t,a),s&&s.m(t,null),Rr(t,o),Rr(t,i),Rr(i,n),r=!0},p(e,i){e[212].icon?s?(s.p(e,i),67108864&i[6]&&Ea(s,1)):(s=px(e),s.c(),Ea(s,1),s.m(t,o)):s&&(Ra(),Aa(s,1,1,(()=>{s=null})),Ia()),(!r||16&i[0]|67108864&i[6])&&a!==(a=(R(e[212].label)?e[212].label(e[4]):e[212].label)+"")&&Ur(n,a)},i(e){r||(Ea(s),r=!0)},o(e){Aa(s),r=!1},d(e){e&&Lr(t),s&&s.d()}}}function gx(e){let t,o;return t=new Lu({props:{locale:e[4],class:"PinturaControlList",optionClass:"PinturaControlListOption",layout:"row",options:e[54],selectedIndex:e[54].findIndex(e[155]),onchange:e[77],$$slots:{option:[mx,({option:e})=>({212:e}),({option:e})=>[0,0,0,0,0,0,e?67108864:0]]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};16&o[0]&&(i.locale=e[4]),8388608&o[1]&&(i.options=e[54]),134217728&o[0]|8388608&o[1]&&(i.selectedIndex=e[54].findIndex(e[155])),16&o[0]|201326592&o[6]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function $x(e){let t,o,i,n,r;const a=[Qb,Jb],s=[];function l(e,t){return e[52]?0:e[45]?1:-1}~(o=l(e))&&(i=s[o]=a[o](e));let c=e[33]&&ux(e);return{c(){t=Fr("div"),i&&i.c(),n=Or(),c&&c.c(),Nr(t,"slot","footer"),Zr(t,"transform",e[40])},m(e,i){Ar(e,t,i),~o&&s[o].m(t,null),Rr(t,n),c&&c.m(t,null),r=!0},p(e,r){let d=o;o=l(e),o===d?~o&&s[o].p(e,r):(i&&(Ra(),Aa(s[d],1,1,(()=>{s[d]=null})),Ia()),~o?(i=s[o],i?i.p(e,r):(i=s[o]=a[o](e),i.c()),Ea(i,1),i.m(t,n)):i=null),e[33]?c?(c.p(e,r),4&r[1]&&Ea(c,1)):(c=ux(e),c.c(),Ea(c,1),c.m(t,null)):c&&(Ra(),Aa(c,1,1,(()=>{c=null})),Ia()),512&r[1]&&Zr(t,"transform",e[40])},i(e){r||(Ea(i),Ea(c),r=!0)},o(e){Aa(i),Aa(c),r=!1},d(e){e&&Lr(t),~o&&s[o].d(),c&&c.d()}}}function fx(e){let t,o;return t=new Mf({props:{hasHeader:e[41],$$slots:{footer:[$x],main:[Kb],header:[Yb]},$$scope:{ctx:e}}}),t.$on("measure",e[166]),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};1024&o[1]&&(i.hasHeader=e[41]),2080374769&o[0]|134216703&o[1]|134217728&o[6]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function yx(e,t,o){let i,n,r,a,s,l,c,d,u,p,h,g,$,f,y,b,x,v,w,S,k,C,T,M,P,R,I,E,A,L,F,z,D,O,B,W,_,V,N,H,j,U,G,Z,X,q,K,J,Q,ee,te,oe,ie,ne,re,ae,se,le,ce,de,ue,pe,he,ge,$e,fe,ye,be,xe=tr,ve=()=>(xe(),xe=ur(Ie,(e=>o(35,X=e))),Ie),we=tr,Se=()=>(we(),we=ur(Oe,(e=>o(145,Q=e))),Oe),ke=tr,Ce=()=>(ke(),ke=ur(ft,(e=>o(37,ae=e))),ft),Te=tr,Me=()=>(Te(),Te=ur(Fe,(e=>o(151,ge=e))),Fe),Pe=tr,Re=()=>(Pe(),Pe=ur(Ae,(e=>o(56,ye=e))),Ae);e.$$.on_destroy.push((()=>xe())),e.$$.on_destroy.push((()=>we())),e.$$.on_destroy.push((()=>ke())),e.$$.on_destroy.push((()=>Te())),e.$$.on_destroy.push((()=>Pe()));let{isActive:Ie}=t;ve();let{isActiveFraction:Ae}=t;Re();let{isVisible:Fe}=t;Me();let{stores:ze}=t,{locale:De={}}=t,{shapes:Oe}=t;Se();let{toolbar:Be=[]}=t,{toolShapes:We={}}=t,{toolActive:_e}=t,{toolSelectRadius:Ve}=t,{toolRetainStyles:Ne=!1}=t,{toolbarLayout:He="stack"}=t,{textInputMode:je}=t,{shapeControls:Ue={}}=t,{enableButtonFlipVertical:Ge=!1}=t,{enablePresetSelectImage:Ze=!0}=t,{enablePresetDropImage:Xe=!0}=t,{enableSelectToolToAddShape:Ye=!1}=t,{enableAutoSelectMoveTool:qe=["line","arrow","path","rectangle","ellipse","text"]}=t,{enableTapToAddText:Ke=!1}=t,{enableMoveTool:Je=!1}=t,{enableViewTool:Qe=!1}=t,{enableToolShareStyles:et=!0}=t,{enableMultiSelect:tt=!1}=t,{gridSize:ot=0}=t,{snapThreshold:it=0}=t,{enableSnapToContext:nt=!0}=t,{willRenderHeaderTools:rt=Y}=t,{willRenderPresetToolbar:at}=t,{willRenderShapeStyleControls:st}=t,{willStartInteraction:lt}=t,{shapePresets:dt=[]}=t,{utilKey:ut}=t,{mapScreenPointToImagePoint:pt}=t,{mapImagePointToScreenPoint:ht}=t,{imageRotation:mt=0}=t,{imageFlipX:gt=!1}=t,{imageFlipY:$t=!1}=t,{parentRect:ft}=t;Ce();let{hooks:yt={}}=t;const bt=ca("selection");hr(e,bt,(e=>o(150,ue=e)));const xt=ca("isAnimated");hr(e,xt,(e=>o(142,q=e)));const wt=ca("elasticityMultiplier");hr(e,wt,(e=>o(146,ee=e)));const St=ca("ui");hr(e,St,(e=>o(177,pe=e)));const kt=ca("keysPressed");let Ct;hr(e,kt,(e=>o(149,de=e)));const{env:Tt,history:Mt,rootRect:Pt,rootColorSecondary:Rt,enablePanInput:It,enablePanInputStatus:Et,enableZoomInput:At,stageRect:Lt,utilRectPadded:Ft,scrollElasticity:zt,imageOverlayMarkup:Dt,imagePreviewModifiers:Ot,imageCropRect:Bt,stageScalar:Wt,imageSelectionRect:_t,imageTransformsInterpolated:Vt,imageSelectionPan:Nt,imageSize:Ht,allowPan:jt,allowZoom:Ut,allowZoomControls:Gt,allowPlayPause:Zt}=ze;hr(e,Tt,(e=>o(143,K=e))),hr(e,Pt,(e=>o(55,fe=e))),hr(e,Rt,(e=>o(57,be=e))),hr(e,Et,(e=>o(38,le=e))),hr(e,Lt,(e=>o(147,te=e))),hr(e,Ft,(e=>o(39,he=e))),hr(e,Ot,(e=>o(178,$e=e))),hr(e,Bt,(e=>o(176,se=e))),hr(e,Wt,(e=>o(174,ne=e))),hr(e,_t,(e=>o(175,re=e))),hr(e,Vt,(e=>o(36,oe=e))),hr(e,Nt,(e=>o(173,ie=e))),hr(e,Ht,(e=>o(148,ce=e)));let Xt=0,Yt={};const qt=e=>{const[t,o]=Ct[e];let i,n,r="relative"===o.position;const a=r?"0%":0,s=r?"0%":0;Ii(t)||Mi(t)?(n=r?"20%":.2*ae.width,i=xi(t),ln(i),cn(i),i.x=a,i.y=s,Tn(i,{width:n,height:n},ae)):Ei(t)?(n=r?"10%":.1*ae.width,i=xi(t),i.x=a,i.y=s,Tn(i,{rx:n,ry:n},ae)):Ai(t)&&(n=r?"10%":.1*ae.width,i=xi(t),i.x1=a,i.y1=s,i.x2=a,i.y2=s),i&&Promise.resolve().then((()=>{ho(uo(i,void 0,n))}))},Kt=e=>pt(Xy(e,fe));let Jt,Qt={};let eo;let to;const oo=e=>{if(!(Li(e)&&Wo(e,"pathClose")))return;const t=[...e.strokeColor];t[3]=1,Jt.updateMarkupShape(e,{pathClose:!1,strokeColor:t},!1),Jt.removeMarkupShapeProps(e,["backgroundColor"],!1),Jt.confirmMarkupItemDraft(),Jt.selectShape(e),_("addshape",e),Mt.write()},io=e=>{const t=xi(e);return Object.assign(t,pe[ut]?pe[ut][_e]:{}),hn(t),t};let no;const ro=(e,t)=>{const o={};return Object.entries(e).forEach((([e,i])=>{Wo(t,e)&&(o[e]=i)})),o},ao=(e,t)=>{if(Oo(e))return e;if(e.endsWith("%")){return parseFloat(e)/100*t.width}};let so=void 0,lo=void 0,co=void 0;const uo=(e,t,o)=>{let i=!1;t||(i=!0,t=W?pt(ct(te)):ct(se)),t.x-=ae.x||0,t.y-=ae.y||0,(gt||$t)&&(e.flipX=gt,e.flipY=$t);const n=Jt.getShapesNearPosition(Q,t);if(i&&n.length){const e=.1*Math.min(se.width,se.height);t.x+=Math.round(-e+Math.random()*e*2),t.y+=Math.round(-e+Math.random()*e*2)}if(0!==mt&&(e.rotation=gt&&$t?-mt:gt||$t?mt:-mt),Wo(e,"width")&&Wo(e,"height")){const{width:o,height:i}=Cn(e,["width","height"],ae);Tn(e,{x:t.x-.5*o,y:t.y-.5*i},ae)}else if(Ei(e))Tn(e,{x:t.x,y:t.y},ae);else if(Ai(e)){const{x1:i,y1:n,x2:r,y2:a}=Cn(e,["x1","y1","x2","y2"],ae),s=Ee(me(i,n),me(r,a)),l=m(o)?gn(o,ae.width):s;Tn(e,{x1:t.x-l,y1:t.y+l,x2:t.x+l,y2:t.y-l},ae)}else if(Li(e)){const{points:o}=Cn(e,["points"],ae),i=Le(o);Tn(e,{points:o.map((e=>({x:e.x+t.x-i.x,y:e.y+t.y-i.y})))},ae)}return e},po=(e,t)=>{const o=uo(ki(e,se),t);return e.shape&&(Wo(e.shape,"x")&&(o.x=e.shape.x),Wo(e.shape,"y")&&(o.y=e.shape.y)),ho(o)},ho=e=>{const{beforeAddShape:t=(()=>!0)}=yt;if(t(e))return Jt.addShape(e),Jt.selectShape(e),_("addshape",e),Mt.write(),e};let mo=!1;const go=()=>{Mt.write()};let $o;const fo=ca("redrawTrigger");hr(e,fo,(e=>o(144,J=e)));const yo=[],bo=xc(q?20:0);hr(e,bo,(e=>o(141,Z=e)));return e.$$set=e=>{"isActive"in e&&ve(o(1,Ie=e.isActive)),"isActiveFraction"in e&&Re(o(2,Ae=e.isActiveFraction)),"isVisible"in e&&Me(o(3,Fe=e.isVisible)),"stores"in e&&o(100,ze=e.stores),"locale"in e&&o(4,De=e.locale),"shapes"in e&&Se(o(5,Oe=e.shapes)),"toolbar"in e&&o(101,Be=e.toolbar),"toolShapes"in e&&o(102,We=e.toolShapes),"toolActive"in e&&o(0,_e=e.toolActive),"toolSelectRadius"in e&&o(6,Ve=e.toolSelectRadius),"toolRetainStyles"in e&&o(103,Ne=e.toolRetainStyles),"toolbarLayout"in e&&o(7,He=e.toolbarLayout),"textInputMode"in e&&o(8,je=e.textInputMode),"shapeControls"in e&&o(9,Ue=e.shapeControls),"enableButtonFlipVertical"in e&&o(10,Ge=e.enableButtonFlipVertical),"enablePresetSelectImage"in e&&o(11,Ze=e.enablePresetSelectImage),"enablePresetDropImage"in e&&o(12,Xe=e.enablePresetDropImage),"enableSelectToolToAddShape"in e&&o(104,Ye=e.enableSelectToolToAddShape),"enableAutoSelectMoveTool"in e&&o(105,qe=e.enableAutoSelectMoveTool),"enableTapToAddText"in e&&o(13,Ke=e.enableTapToAddText),"enableMoveTool"in e&&o(106,Je=e.enableMoveTool),"enableViewTool"in e&&o(107,Qe=e.enableViewTool),"enableToolShareStyles"in e&&o(108,et=e.enableToolShareStyles),"enableMultiSelect"in e&&o(14,tt=e.enableMultiSelect),"gridSize"in e&&o(15,ot=e.gridSize),"snapThreshold"in e&&o(16,it=e.snapThreshold),"enableSnapToContext"in e&&o(17,nt=e.enableSnapToContext),"willRenderHeaderTools"in e&&o(109,rt=e.willRenderHeaderTools),"willRenderPresetToolbar"in e&&o(110,at=e.willRenderPresetToolbar),"willRenderShapeStyleControls"in e&&o(18,st=e.willRenderShapeStyleControls),"willStartInteraction"in e&&o(111,lt=e.willStartInteraction),"shapePresets"in e&&o(19,dt=e.shapePresets),"utilKey"in e&&o(20,ut=e.utilKey),"mapScreenPointToImagePoint"in e&&o(21,pt=e.mapScreenPointToImagePoint),"mapImagePointToScreenPoint"in e&&o(22,ht=e.mapImagePointToScreenPoint),"imageRotation"in e&&o(23,mt=e.imageRotation),"imageFlipX"in e&&o(24,gt=e.imageFlipX),"imageFlipY"in e&&o(25,$t=e.imageFlipY),"parentRect"in e&&Ce(o(26,ft=e.parentRect)),"hooks"in e&&o(112,yt=e.hooks)},e.$$.update=()=>{var t,ie,ne,re;if(33554432&e.$$.dirty[4]&&o(124,i=de.includes(18)),1049088&e.$$.dirty[3]&&(Ct&&We===Ct||o(113,Ct=We)),16&e.$$.dirty[1]&&jt.set(X),16&e.$$.dirty[1]&&Ut.set(X),16&e.$$.dirty[1]&&Gt.set(X),256&e.$$.dirty[3]&&o(33,n=Array.isArray(Be)&&Be.length>1&&Array.isArray(Be[0][1])),4&e.$$.dirty[1]|256&e.$$.dirty[3]&&o(54,r=n?Be.map(((e,t)=>[t,e[0]])):[]),134217728&e.$$.dirty[0]|4&e.$$.dirty[1]|256&e.$$.dirty[3]&&o(140,a=n?Be[Xt][1]:Be),524288&e.$$.dirty[0]|155648&e.$$.dirty[3]|65536&e.$$.dirty[4]&&o(32,s=((e,{willRenderPresetToolbar:t,shapePresets:o,enableViewTool:i,enableMoveTool:r})=>{let a=0!==o.length||t?e:e.filter((e=>"preset"!==e[0]));return n&&(a=[["move",e=>e.shapeLabelToolMove,{icon:e=>e.shapeIconToolMove}],["view",e=>e.shapeLabelToolView,{icon:e=>e.shapeIconToolView}],...a]),a=r?a:a.filter((e=>"move"!==e[0])),i?a:a.filter((e=>"view"!==e[0]))})(a,{willRenderPresetToolbar:at,shapePresets:dt,enableMoveTool:Je,enableViewTool:Qe})),2&e.$$.dirty[1]&&o(138,d=!!s.length),1&e.$$.dirty[0]|2&e.$$.dirty[1]|16384&e.$$.dirty[4]&&d&&void 0===_e&&o(0,_e=s[0][0]),134217729&e.$$.dirty[0]|4&e.$$.dirty[1]|2097152&e.$$.dirty[3]|65536&e.$$.dirty[4]&&n&&o(114,Yt={...Yt,[Xt]:a.map((([e])=>e)).includes(_e)?_e:Yt[Xt]||a[0][0]}),512&e.$$.dirty[0]&&o(137,l=!!Object.keys(Ue).length),2&e.$$.dirty[1]&&o(34,c=s.length>1),12&e.$$.dirty[1]&&o(53,u=c||n),1&e.$$.dirty[0]&&o(139,p=void 0!==_e),57344&e.$$.dirty[4]&&o(52,h=(!p||d)&&l),536870912&e.$$.dirty[0]&&o(31,_=$o&&(t=$o,(e,o)=>{t.dispatchEvent(qh(e,o))})),1&e.$$.dirty[0]|17&e.$$.dirty[1]&&X&&_&&_("selectcontrol",_e),16&e.$$.dirty[1]&&(X?vr(Ot,$e[ut]={maskMarkupOpacity:.85},$e):delete $e[ut]),1&e.$$.dirty[0]|1048576&e.$$.dirty[3]&&o(136,g=_e&&Ct[_e]?Ct[_e][1]:void 0),4096&e.$$.dirty[4]&&o(125,$=g&&g.isSelection?"selection":"shapes"),3&e.$$.dirty[4]&&(e=>{if(!Jt)return;const t=Jt.getShapeDraft(bt);t&&(e&&(eo=t.drawMode),Jt.updateShapeDraft({drawMode:e?"subtract":eo},bt))})("selection"===$&&i),268435457&e.$$.dirty[0]&&_e&&Jt){const e=Jt.getMarkupItemDraft();e&&oo(e)}if(1&e.$$.dirty[0]&&_e&&Jt&&"move"!==_e&&Jt.blurShapes(),16&e.$$.dirty[1]|134217728&e.$$.dirty[4]&&o(51,f=ge&&X),256&e.$$.dirty[1]|8388608&e.$$.dirty[4]&&o(50,y=he&&me(te.x-he.x,te.y-he.y)),512&e.$$.dirty[0]&&o(135,b=Object.keys(Ue)),16384&e.$$.dirty[0]|16&e.$$.dirty[1]|2097152&e.$$.dirty[4]&&o(122,x=tt?X&&Q.filter(Di):[]),536870912&e.$$.dirty[3]&&o(123,v=x.length>1),16&e.$$.dirty[1]|2097152&e.$$.dirty[4]&&o(119,w=X&&Q.filter(Di)[0]),16&e.$$.dirty[1]|2097152&e.$$.dirty[4]&&o(130,S=X&&Q.find((e=>Oi(e)))),16&e.$$.dirty[1]|2097152&e.$$.dirty[4]&&o(133,k=X&&Q.find((e=>Bi(e)))),1&e.$$.dirty[0]|16&e.$$.dirty[1]|1048576&e.$$.dirty[3]&&o(127,C=X&&Ct[_e]?io(Ct[_e][0]):{}),1048576&e.$$.dirty[3]&&Ct&&o(115,Qt={}),1&e.$$.dirty[0]|4227072&e.$$.dirty[3]|2056&e.$$.dirty[4]&&o(126,T=C&&Object.keys(C).reduce(((e,t)=>{const o="disableStyle"===t,i="settings"===t,n=!!b.find((e=>e.split("_").includes(t)));if(!o&&!i&&!n)return e;if(void 0===C[t])return e;if(!0===C.disableStyle)return e;if(C.disableStyle&&C.disableStyle.includes(t))return e;if("strokeWidth"===t&&Object.keys(Qt).includes("strokeWidth")&&void 0===Qt[t]&&Wo(C,"points"))return e[t]=C[t],e;const{share:r=!0}=C.settings&&C.settings[t]||{},a=et&&r?Qt:Qt[_e]||{};return e[t]=Wo(a,t)?a[t]:C[t],e}),{})),1048577&e.$$.dirty[0]|1024&e.$$.dirty[3]|4&e.$$.dirty[4]&&(Ne?((e,t,o)=>{const i=pe[e],n=i?i[t]:{};St.set({...pe,[e]:{...i,[t]:{...n,...o}}})})(ut,_e,T):(ie=ut,St.set({[ie]:{}}))),16&e.$$.dirty[1]|67108864&e.$$.dirty[3]|67108868&e.$$.dirty[4]&&o(134,M=ue&&X?w||T:void 0),1610612736&e.$$.dirty[3]|1536&e.$$.dirty[4]&&o(49,P=v?function(e){const t={};return e.forEach((e=>{Object.entries(e).filter((([e])=>!e.startsWith("_"))).forEach((([e,o])=>{Wo(t,e)?"disableStyle"===e&&_o(o)&&t[e].push(...o):t[e]=o}))})),t}(x):M||k),1&e.$$.dirty[0]|8&e.$$.dirty[4]&&o(48,R=Wo(C,"eraseRadius")||Wo(C,"points")&&!Wo(C,"pathClose")||"move"===_e||"view"===_e),64&e.$$.dirty[1]|8&e.$$.dirty[4]&&o(47,I=C&&void 0!==C.eraseRadius?ao(C.eraseRadius,ae):void 0),16&e.$$.dirty[1]|33554432&e.$$.dirty[4]&&o(131,E=X&&de.includes(32)),1&e.$$.dirty[0]|16&e.$$.dirty[1]&&o(132,A=X&&"view"===_e),384&e.$$.dirty[4]&&o(129,L=A||E),96&e.$$.dirty[4]&&o(128,F=!!L&&(!!S||_d(document.activeElement))),16&e.$$.dirty[1]|48&e.$$.dirty[4]&&It.set(!X||L&&!F),16&e.$$.dirty[1]|16&e.$$.dirty[4]&&At.set(!X||!F),64&e.$$.dirty[1]|12&e.$$.dirty[4]&&o(120,z=C.cursorStyle?(({cursorStyle:e,cursorSize:t},o,i)=>{let n;const r=o[t];if(void 0===r?n=ao(t,i):Oo(r)?n=r:m(r)&&(n=bn(t,o[t],i),"strokeWidth"===t&&(n*=.5)),!(n<=0||void 0===n))return{size:n,style:e}})(C,{...C,...T},ae):void 0),33554432&e.$$.dirty[3]|16777216&e.$$.dirty[4]&&o(121,D=co&&(re=ce,(ne=co).x>=0&&ne.y>=0&&ne.x<=re.width&&ne.y<=re.height)),1048576&e.$$.dirty[0]|160&e.$$.dirty[1]|427819008&e.$$.dirty[3]|3&e.$$.dirty[4])if(D&&!so&&z&&!le){const e=z.size*oe.scale,t={id:"cursor-"+ut,x:lo.x,y:lo.y,strokeWidth:.5,strokeColor:[0,0,0]};"ellipse"===z.style&&(t.rx=e,t.ry=e);const o={strokeWidth:2.5,strokeColor:[1,1,1],opacity:.75},n=[{...t,...o},t];if("selection"===$&&i){const t=e,i=lo.x+t,r=lo.y+t+4,a={id:"cursor-"+ut,strokeWidth:.75,strokeColor:[0,0,0],points:[{x:i,y:r},{x:i+4,y:r}]};n.push({...a,...o,strokeWidth:2,points:[{x:i-.5,y:r},{x:i+4.5,y:r}]},a)}(e=>{Dt.update((t=>[...t.filter((e=>e.id!=="cursor-"+ut)),...e]))})(n)}else Dt.update((e=>e.filter((e=>e.id!=="cursor-"+ut))));1&e.$$.dirty[0]|128&e.$$.dirty[1]|478150656&e.$$.dirty[3]&&o(46,O=D?((e,t,o,i,n,r)=>{if(i)return n?"grabbing":"grab";if(e&&!t)return"none";if(!t)return"move"===r?"default":"crosshair";let a=t||o;return Di(a)?Oi(a)?"modal"===je?"default":"text":!tn(a)||v&&!x.every(tn)?"default":"move":"default"})(z,so,w,le,false,_e):"default"),526337&e.$$.dirty[0]|131072&e.$$.dirty[3]&&o(45,B="preset"===_e&&(dt.length>0||Ze||at)),64&e.$$.dirty[1]&&(W=!Wo(ae,"x")&&!Wo(ae,"y")),4194304&e.$$.dirty[4]&&o(44,V=ee*zt),131072&e.$$.dirty[3]|1572864&e.$$.dirty[4]&&o(43,N=J&&at?e=>cm((()=>at(e,po,{...K},(()=>fo.set({}))))):Y),524288&e.$$.dirty[3]&&o(42,H=Object.keys(yt).reduce(((e,t)=>("beforeAddShape"===t||void 0===yt[t]||(e[t]=yt[t]),e)),{})),16&e.$$.dirty[1]&&(e=>{Q&&Oe.update((t=>t.map((t=>(t._prerender=!!e&&Oi(t),t)))))})(X),65536&e.$$.dirty[3]|1572864&e.$$.dirty[4]&&o(30,j=J&&rt([],K,(()=>fo.set({})))),1073742336&e.$$.dirty[0]&&o(41,U=!!j.length||!!Object.keys(Ue).some((e=>yo.includes(e)))),16&e.$$.dirty[1]|262144&e.$$.dirty[4]&&q&&bo.set(X?0:20),e.$$.dirty[4],131072&e.$$.dirty[4]&&o(40,G=Z?`translateY(${Z}px)`:"none")},Zt.set(!1),[_e,Ie,Ae,Fe,De,Oe,Ve,He,je,Ue,Ge,Ze,Xe,Ke,tt,ot,it,nt,st,dt,ut,pt,ht,mt,gt,$t,ft,Xt,Jt,$o,j,_,s,n,c,X,oe,ae,le,he,G,U,H,N,V,B,O,I,R,P,y,f,h,u,r,fe,ye,be,bt,xt,wt,St,kt,Tt,Pt,Rt,Et,Lt,Ft,Dt,Ot,Bt,Wt,_t,Vt,Nt,Ht,({index:e},t)=>{o(27,Xt=e),o(0,_e=Yt[e])},({value:e},t)=>{o(0,_e=e),(Ye||/enter/i.test(t.key))&&qt(e)},e=>{if("eraser"===_e)to=Jt.eraseShape();else if(_e&&Ct[_e]){const[e,t={}]=Ct[_e],o=xi(e);ln(o),cn(o);const{drawMode:n}=M;"selection"===$&&"new"===n&&bt.set([]);let r={};"selection"===$&&(_("selectiondown",[...ue]),i&&(eo=o.drawMode,r.drawMode="subtract")),to=Jt.createShape({...o,...T,...r},t)}else to=void 0;return!!to&&(to.start(e),!0)},e=>!!to&&(to.update(e),!0),e=>!!to&&(to.release(e),!0),e=>!!to&&(to.cancel(e),to=void 0,!0),e=>{if(!to)return!1;if(to.end(e),to=void 0,"selection"===$){if(e.detail.isTap){const[e]=Ct[_e];e.bitmap||bt.set([])}_("selectionup",[...ue])}const t=Jt.getMarkupItemDraft(),i=Je&&(!0===qe||Array.isArray(qe)&&qe.includes(_e));return t&&!t.isEditing||!i||o(0,_e="move"),!0},e=>{const{key:t}=e,o=Jt.getMarkupItemDraft();/escape/i.test(t)&&o&&(e.preventDefault(),e.stopPropagation(),Jt.discardMarkupItemDraft(),to=void 0),/enter/i.test(t)&&o&&(e.preventDefault(),e.stopPropagation(),oo(o),to=void 0)},function(e){Object.keys(e).forEach((t=>{const{retain:i=!0,share:n=!0}=C.settings&&C.settings[t]||{};i&&(et&&n?o(115,Qt[t]=e[t],Qt):(Qt[_e]||o(115,Qt[_e]={},Qt),o(115,Qt[_e][t]=e[t],Qt)))})),_("selectstyle",e),w&&(v?x.forEach((t=>{Jt.updateMarkupShape(t,ro(e,t))})):Jt.updateMarkupShape(w,e),clearTimeout(no),no=setTimeout((()=>{go()}),200))},(e,t,i)=>{o(117,lo=t),o(118,co=i)},()=>{o(118,co=void 0),o(117,lo=void 0)},e=>{_("markuptap",e)},e=>o(116,so=e),()=>{mo=!1},(e,t)=>{if(mo)return;const{beforeAddShape:o=(()=>!0)}=yt,i=Kt(t),n=Jt.getMarkupItemDraft(),r=vt(se,{x:i.x+(ae.x||0),y:i.y+(ae.y||0)});if(n&&!r&&Jt.discardMarkupItemDraft(),r){if(!n){const n=ki(e,se),r=uo(n,i);return o(r)?(Hi(r),void Jt.addShape(r)):(mo=!0,void t.preventDefault())}Ii(n)&&(i.x-=.5*n.width,i.y-=.5*n.height),e.shape&&(Wo(e.shape,"x")&&(i.x=e.shape.x),Wo(e.shape,"y")&&(i.y=e.shape.y)),Jt.updateMarkupShape(n,i)}},(e,t)=>{if(mo)return;const o=Kt(t);if(!vt(se,{x:o.x+(ae.x||0),y:o.y+(ae.y||0)}))return void Jt.discardMarkupItemDraft();const i=Jt.confirmMarkupItemDraft();Jt.selectShape(i),_("addshape",i),Mt.write()},e=>po(e),e=>{return t=e.detail.resources,o=Kt(e.detail.event),t.forEach((e=>po(e,o)));var t,o},e=>{if(!lt)return!0;const t=rectClone(re);return rectScale(t,1/ne),rectTranslate(t,ie),rectScale(t,oe.scale),lt(e,{...t,x:t.x+te.x,y:t.y+te.y})},go,fo,yo,bo,ze,Be,We,Ne,Ye,qe,Je,Qe,et,rt,at,lt,yt,Ct,Yt,Qt,so,lo,co,w,z,D,x,v,i,$,T,C,F,L,S,E,A,k,M,b,g,l,d,p,a,Z,q,K,J,Q,ee,te,ce,de,ue,ge,function(t){da.call(this,e,t)},e=>e[0]===_e,(e,t,o)=>{const i=e.filter((([,e])=>!yo.includes(e)));return st?st(i,t,o):i},e=>e[0]===Xt,e=>{Promise.resolve().then((()=>{_("addshape",e),go()}))},e=>{_("selectshape",e)},e=>{Promise.resolve().then((()=>{_("blurshape",e)}))},e=>{_("tapshape",e)},e=>{_("updateshape",e),go()},e=>{_("removeshape",e),go()},()=>{go()},function(e){pa[e?"unshift":"push"]((()=>{Jt=e,o(28,Jt)}))},function(e){pa[e?"unshift":"push"]((()=>{$o=e,o(29,$o)}))},e=>e.filter((([,e])=>yo.includes(e))),function(t){da.call(this,e,t)}]}class bx extends Ga{constructor(e){super(),Ua(this,e,yx,fx,lr,{isActive:1,isActiveFraction:2,isVisible:3,stores:100,locale:4,shapes:5,toolbar:101,toolShapes:102,toolActive:0,toolSelectRadius:6,toolRetainStyles:103,toolbarLayout:7,textInputMode:8,shapeControls:9,enableButtonFlipVertical:10,enablePresetSelectImage:11,enablePresetDropImage:12,enableSelectToolToAddShape:104,enableAutoSelectMoveTool:105,enableTapToAddText:13,enableMoveTool:106,enableViewTool:107,enableToolShareStyles:108,enableMultiSelect:14,gridSize:15,snapThreshold:16,enableSnapToContext:17,willRenderHeaderTools:109,willRenderPresetToolbar:110,willRenderShapeStyleControls:18,willStartInteraction:111,shapePresets:19,utilKey:20,mapScreenPointToImagePoint:21,mapImagePointToScreenPoint:22,imageRotation:23,imageFlipX:24,imageFlipY:25,parentRect:26,hooks:112},null,[-1,-1,-1,-1,-1,-1,-1])}get isActive(){return this.$$.ctx[1]}set isActive(e){this.$$set({isActive:e}),ka()}get isActiveFraction(){return this.$$.ctx[2]}set isActiveFraction(e){this.$$set({isActiveFraction:e}),ka()}get isVisible(){return this.$$.ctx[3]}set isVisible(e){this.$$set({isVisible:e}),ka()}get stores(){return this.$$.ctx[100]}set stores(e){this.$$set({stores:e}),ka()}get locale(){return this.$$.ctx[4]}set locale(e){this.$$set({locale:e}),ka()}get shapes(){return this.$$.ctx[5]}set shapes(e){this.$$set({shapes:e}),ka()}get toolbar(){return this.$$.ctx[101]}set toolbar(e){this.$$set({toolbar:e}),ka()}get toolShapes(){return this.$$.ctx[102]}set toolShapes(e){this.$$set({toolShapes:e}),ka()}get toolActive(){return this.$$.ctx[0]}set toolActive(e){this.$$set({toolActive:e}),ka()}get toolSelectRadius(){return this.$$.ctx[6]}set toolSelectRadius(e){this.$$set({toolSelectRadius:e}),ka()}get toolRetainStyles(){return this.$$.ctx[103]}set toolRetainStyles(e){this.$$set({toolRetainStyles:e}),ka()}get toolbarLayout(){return this.$$.ctx[7]}set toolbarLayout(e){this.$$set({toolbarLayout:e}),ka()}get textInputMode(){return this.$$.ctx[8]}set textInputMode(e){this.$$set({textInputMode:e}),ka()}get shapeControls(){return this.$$.ctx[9]}set shapeControls(e){this.$$set({shapeControls:e}),ka()}get enableButtonFlipVertical(){return this.$$.ctx[10]}set enableButtonFlipVertical(e){this.$$set({enableButtonFlipVertical:e}),ka()}get enablePresetSelectImage(){return this.$$.ctx[11]}set enablePresetSelectImage(e){this.$$set({enablePresetSelectImage:e}),ka()}get enablePresetDropImage(){return this.$$.ctx[12]}set enablePresetDropImage(e){this.$$set({enablePresetDropImage:e}),ka()}get enableSelectToolToAddShape(){return this.$$.ctx[104]}set enableSelectToolToAddShape(e){this.$$set({enableSelectToolToAddShape:e}),ka()}get enableAutoSelectMoveTool(){return this.$$.ctx[105]}set enableAutoSelectMoveTool(e){this.$$set({enableAutoSelectMoveTool:e}),ka()}get enableTapToAddText(){return this.$$.ctx[13]}set enableTapToAddText(e){this.$$set({enableTapToAddText:e}),ka()}get enableMoveTool(){return this.$$.ctx[106]}set enableMoveTool(e){this.$$set({enableMoveTool:e}),ka()}get enableViewTool(){return this.$$.ctx[107]}set enableViewTool(e){this.$$set({enableViewTool:e}),ka()}get enableToolShareStyles(){return this.$$.ctx[108]}set enableToolShareStyles(e){this.$$set({enableToolShareStyles:e}),ka()}get enableMultiSelect(){return this.$$.ctx[14]}set enableMultiSelect(e){this.$$set({enableMultiSelect:e}),ka()}get gridSize(){return this.$$.ctx[15]}set gridSize(e){this.$$set({gridSize:e}),ka()}get snapThreshold(){return this.$$.ctx[16]}set snapThreshold(e){this.$$set({snapThreshold:e}),ka()}get enableSnapToContext(){return this.$$.ctx[17]}set enableSnapToContext(e){this.$$set({enableSnapToContext:e}),ka()}get willRenderHeaderTools(){return this.$$.ctx[109]}set willRenderHeaderTools(e){this.$$set({willRenderHeaderTools:e}),ka()}get willRenderPresetToolbar(){return this.$$.ctx[110]}set willRenderPresetToolbar(e){this.$$set({willRenderPresetToolbar:e}),ka()}get willRenderShapeStyleControls(){return this.$$.ctx[18]}set willRenderShapeStyleControls(e){this.$$set({willRenderShapeStyleControls:e}),ka()}get willStartInteraction(){return this.$$.ctx[111]}set willStartInteraction(e){this.$$set({willStartInteraction:e}),ka()}get shapePresets(){return this.$$.ctx[19]}set shapePresets(e){this.$$set({shapePresets:e}),ka()}get utilKey(){return this.$$.ctx[20]}set utilKey(e){this.$$set({utilKey:e}),ka()}get mapScreenPointToImagePoint(){return this.$$.ctx[21]}set mapScreenPointToImagePoint(e){this.$$set({mapScreenPointToImagePoint:e}),ka()}get mapImagePointToScreenPoint(){return this.$$.ctx[22]}set mapImagePointToScreenPoint(e){this.$$set({mapImagePointToScreenPoint:e}),ka()}get imageRotation(){return this.$$.ctx[23]}set imageRotation(e){this.$$set({imageRotation:e}),ka()}get imageFlipX(){return this.$$.ctx[24]}set imageFlipX(e){this.$$set({imageFlipX:e}),ka()}get imageFlipY(){return this.$$.ctx[25]}set imageFlipY(e){this.$$set({imageFlipY:e}),ka()}get parentRect(){return this.$$.ctx[26]}set parentRect(e){this.$$set({parentRect:e}),ka()}get hooks(){return this.$$.ctx[112]}set hooks(e){this.$$set({hooks:e}),ka()}}var xx=(e,t,o,i,n,r,a,s,l)=>{const c=$e(e),d=.5*o.width,u=.5*o.height,p=.5*t.width,h=.5*t.height,m=n.x+i.x,g=n.y+i.y;s&&(c.x=o.width-c.x),l&&(c.y=o.height-c.y);const $=Math.cos(r),f=Math.sin(r);c.x-=d,c.y-=u;const y=c.x*$-c.y*f,b=c.x*f+c.y*$;c.x=d+y,c.y=u+b,c.x*=a,c.y*=a,c.x+=p,c.y+=h,c.x+=m,c.y+=g,c.x-=d*a,c.y-=u*a;const x=(n.x-m)*a,v=(n.y-g)*a,w=x*$-v*f,S=x*f+v*$;return c.x+=w,c.y+=S,c},vx=(e,t,o,i,n,r,a,s,l)=>{const c=$e(e),d=Ue(o),u=Ue(t),p=me(n.x+i.x,n.y+i.y),h=Math.cos(r),m=Math.sin(r);c.x-=u.x,c.y-=u.y;const g=(n.x-p.x)*a,$=(n.y-p.y)*a,f=g*h-$*m,y=g*m+$*h;c.x-=f,c.y-=y,c.x-=p.x,c.y-=p.y,c.x/=a,c.y/=a;const b=c.x*h+c.y*m,x=c.x*m-c.y*h;return c.x=b,c.y=-x,c.x+=d.x,c.y+=d.y,s&&(c.x=o.width-c.x),l&&(c.y=o.height-c.y),c},wx=e=>"boolean"==typeof e;function Sx(e){let t,o,i;function n(t){e[60](t)}let r={utilKey:e[1],stores:e[5],locale:e[6],isActive:e[2],isActiveFraction:e[3],isVisible:e[4],mapScreenPointToImagePoint:e[46],mapImagePointToScreenPoint:e[45],imageRotation:e[47],imageFlipX:e[44],imageFlipY:e[43],shapes:e[49],toolbar:e[21]||e[7],toolShapes:e[22]||e[8],toolRetainStyles:e[9],enableSelectToolToAddShape:e[31],enableTapToAddText:e[32],enableViewTool:e[30],enableMoveTool:e[34],enableAutoSelectMoveTool:e[33],enableMultiSelect:e[35],snapThreshold:e[16],gridSize:Oo(e[18])?e[18]:e[15],enableSnapToContext:wx(e[19])?e[19]:e[17],enableToolShareStyles:e[13],shapeControls:e[23]||e[10],shapePresets:e[27],enableButtonFlipVertical:e[24],parentRect:e[50],enablePresetDropImage:e[26],enablePresetSelectImage:e[25],toolSelectRadius:e[11],textInputMode:e[12],willStartInteraction:e[14],willRenderPresetToolbar:e[28]||e[20],willRenderShapeStyleControls:e[29],hooks:{willRenderShapeControls:e[36],willRenderShapeTextControls:e[37],beforeAddShape:e[38],beforeRemoveShape:e[39],beforeDeselectShape:e[40],beforeSelectShape:e[41],beforeUpdateShape:e[42]}};return void 0!==e[0]&&(r.toolActive=e[0]),t=new bx({props:r}),pa.push((()=>Va(t,"toolActive",n))),t.$on("measure",e[61]),{c(){Na(t.$$.fragment)},m(e,o){Ha(t,e,o),i=!0},p(e,i){const n={};32&i[0]&&(n.stores=e[5]),64&i[0]&&(n.locale=e[6]),4&i[0]&&(n.isActive=e[2]),8&i[0]&&(n.isActiveFraction=e[3]),16&i[0]&&(n.isVisible=e[4]),32768&i[1]&&(n.mapScreenPointToImagePoint=e[46]),16384&i[1]&&(n.mapImagePointToScreenPoint=e[45]),65536&i[1]&&(n.imageRotation=e[47]),8192&i[1]&&(n.imageFlipX=e[44]),4096&i[1]&&(n.imageFlipY=e[43]),2097280&i[0]&&(n.toolbar=e[21]||e[7]),4194560&i[0]&&(n.toolShapes=e[22]||e[8]),512&i[0]&&(n.toolRetainStyles=e[9]),1&i[1]&&(n.enableSelectToolToAddShape=e[31]),2&i[1]&&(n.enableTapToAddText=e[32]),1073741824&i[0]&&(n.enableViewTool=e[30]),8&i[1]&&(n.enableMoveTool=e[34]),4&i[1]&&(n.enableAutoSelectMoveTool=e[33]),16&i[1]&&(n.enableMultiSelect=e[35]),65536&i[0]&&(n.snapThreshold=e[16]),294912&i[0]&&(n.gridSize=Oo(e[18])?e[18]:e[15]),655360&i[0]&&(n.enableSnapToContext=wx(e[19])?e[19]:e[17]),8192&i[0]&&(n.enableToolShareStyles=e[13]),8389632&i[0]&&(n.shapeControls=e[23]||e[10]),134217728&i[0]&&(n.shapePresets=e[27]),16777216&i[0]&&(n.enableButtonFlipVertical=e[24]),67108864&i[0]&&(n.enablePresetDropImage=e[26]),33554432&i[0]&&(n.enablePresetSelectImage=e[25]),2048&i[0]&&(n.toolSelectRadius=e[11]),4096&i[0]&&(n.textInputMode=e[12]),16384&i[0]&&(n.willStartInteraction=e[14]),269484032&i[0]&&(n.willRenderPresetToolbar=e[28]||e[20]),536870912&i[0]&&(n.willRenderShapeStyleControls=e[29]),4064&i[1]&&(n.hooks={willRenderShapeControls:e[36],willRenderShapeTextControls:e[37],beforeAddShape:e[38],beforeRemoveShape:e[39],beforeDeselectShape:e[40],beforeSelectShape:e[41],beforeUpdateShape:e[42]}),!o&&1&i[0]&&(o=!0,n.toolActive=e[0],xa((()=>o=!1))),t.$set(n)},i(e){i||(Ea(t.$$.fragment,e),i=!0)},o(e){Aa(t.$$.fragment,e),i=!1},d(e){ja(t,e)}}}function kx(e,t,o){let i,n,r,a,s,l,c,d,u;let{isActive:p}=t,{isActiveFraction:h}=t,{isVisible:m}=t,{stores:g}=t,{locale:$={}}=t,{markupEditorToolbar:f}=t,{markupEditorToolStyles:y}=t,{markupEditorToolRetainStyles:b}=t,{markupEditorShapeStyleControls:x}=t,{markupEditorToolSelectRadius:v}=t,{markupEditorTextInputMode:w}=t,{markupEditorToolShareStyles:S}=t,{markupEditorWillStartInteraction:k}=t,{markupEditorGridSize:C=0}=t,{markupEditorSnapThreshold:T=0}=t,{markupEditorSnapToContext:M=!1}=t,{annotateGridSize:P}=t,{annotateSnapToContext:R}=t,{willRenderShapePresetToolbar:I}=t,{annotateTools:E}=t,{annotateToolShapes:A}=t,{annotateShapeControls:L}=t,{annotateActiveTool:F}=t,{annotateEnableButtonFlipVertical:z=!1}=t,{annotateEnableSelectImagePreset:D=!1}=t,{annotateEnableDropImagePreset:O=!0}=t,{annotatePresets:B=[]}=t,{annotateWillRenderShapePresetToolbar:W}=t,{annotateWillRenderShapeStyleControls:_}=t,{enableViewTool:V}=t,{enableSelectToolToAddShape:N}=t,{enableTapToAddText:H}=t,{enableAutoSelectMoveTool:j}=t,{enableMoveTool:U}=t,{enableMultiSelect:G}=t,{willRenderShapeControls:Z}=t,{willRenderShapeTextControls:X}=t,{beforeAddShape:Y}=t,{beforeRemoveShape:q}=t,{beforeDeselectShape:K}=t,{beforeSelectShape:J}=t,{beforeUpdateShape:Q}=t;const{rootRect:ee,imageAnnotation:te,imageSize:oe,imageRotation:ie,imageFlipX:ne,imageFlipY:re,imageTransforms:ae,imageTransformsInterpolated:se}=g;return hr(e,ee,(e=>o(59,d=e))),hr(e,oe,(e=>o(58,c=e))),hr(e,ie,(e=>o(47,u=e))),hr(e,ne,(e=>o(44,a=e))),hr(e,re,(e=>o(43,r=e))),hr(e,ae,(e=>o(57,l=e))),hr(e,se,(e=>o(56,s=e))),e.$$set=e=>{"isActive"in e&&o(2,p=e.isActive),"isActiveFraction"in e&&o(3,h=e.isActiveFraction),"isVisible"in e&&o(4,m=e.isVisible),"stores"in e&&o(5,g=e.stores),"locale"in e&&o(6,$=e.locale),"markupEditorToolbar"in e&&o(7,f=e.markupEditorToolbar),"markupEditorToolStyles"in e&&o(8,y=e.markupEditorToolStyles),"markupEditorToolRetainStyles"in e&&o(9,b=e.markupEditorToolRetainStyles),"markupEditorShapeStyleControls"in e&&o(10,x=e.markupEditorShapeStyleControls),"markupEditorToolSelectRadius"in e&&o(11,v=e.markupEditorToolSelectRadius),"markupEditorTextInputMode"in e&&o(12,w=e.markupEditorTextInputMode),"markupEditorToolShareStyles"in e&&o(13,S=e.markupEditorToolShareStyles),"markupEditorWillStartInteraction"in e&&o(14,k=e.markupEditorWillStartInteraction),"markupEditorGridSize"in e&&o(15,C=e.markupEditorGridSize),"markupEditorSnapThreshold"in e&&o(16,T=e.markupEditorSnapThreshold),"markupEditorSnapToContext"in e&&o(17,M=e.markupEditorSnapToContext),"annotateGridSize"in e&&o(18,P=e.annotateGridSize),"annotateSnapToContext"in e&&o(19,R=e.annotateSnapToContext),"willRenderShapePresetToolbar"in e&&o(20,I=e.willRenderShapePresetToolbar),"annotateTools"in e&&o(21,E=e.annotateTools),"annotateToolShapes"in e&&o(22,A=e.annotateToolShapes),"annotateShapeControls"in e&&o(23,L=e.annotateShapeControls),"annotateActiveTool"in e&&o(0,F=e.annotateActiveTool),"annotateEnableButtonFlipVertical"in e&&o(24,z=e.annotateEnableButtonFlipVertical),"annotateEnableSelectImagePreset"in e&&o(25,D=e.annotateEnableSelectImagePreset),"annotateEnableDropImagePreset"in e&&o(26,O=e.annotateEnableDropImagePreset),"annotatePresets"in e&&o(27,B=e.annotatePresets),"annotateWillRenderShapePresetToolbar"in e&&o(28,W=e.annotateWillRenderShapePresetToolbar),"annotateWillRenderShapeStyleControls"in e&&o(29,_=e.annotateWillRenderShapeStyleControls),"enableViewTool"in e&&o(30,V=e.enableViewTool),"enableSelectToolToAddShape"in e&&o(31,N=e.enableSelectToolToAddShape),"enableTapToAddText"in e&&o(32,H=e.enableTapToAddText),"enableAutoSelectMoveTool"in e&&o(33,j=e.enableAutoSelectMoveTool),"enableMoveTool"in e&&o(34,U=e.enableMoveTool),"enableMultiSelect"in e&&o(35,G=e.enableMultiSelect),"willRenderShapeControls"in e&&o(36,Z=e.willRenderShapeControls),"willRenderShapeTextControls"in e&&o(37,X=e.willRenderShapeTextControls),"beforeAddShape"in e&&o(38,Y=e.beforeAddShape),"beforeRemoveShape"in e&&o(39,q=e.beforeRemoveShape),"beforeDeselectShape"in e&&o(40,K=e.beforeDeselectShape),"beforeSelectShape"in e&&o(41,J=e.beforeSelectShape),"beforeUpdateShape"in e&&o(42,Q=e.beforeUpdateShape)},e.$$.update=()=>{503328768&e.$$.dirty[1]&&o(46,i=e=>vx(e,d,c,s.origin,s.translation,l.rotation.z,s.scale,a,r)),503328768&e.$$.dirty[1]&&o(45,n=e=>xx(e,d,c,s.origin,s.translation,l.rotation.z,s.scale,a,r))},[F,"annotate",p,h,m,g,$,f,y,b,x,v,w,S,k,C,T,M,P,R,I,E,A,L,z,D,O,B,W,_,V,N,H,j,U,G,Z,X,Y,q,K,J,Q,r,a,n,i,u,ee,te,oe,ie,ne,re,ae,se,s,l,c,d,function(e){F=e,o(0,F)},function(t){da.call(this,e,t)}]}var Cx={util:["annotate",class extends Ga{constructor(e){super(),Ua(this,e,kx,Sx,lr,{name:1,isActive:2,isActiveFraction:3,isVisible:4,stores:5,locale:6,markupEditorToolbar:7,markupEditorToolStyles:8,markupEditorToolRetainStyles:9,markupEditorShapeStyleControls:10,markupEditorToolSelectRadius:11,markupEditorTextInputMode:12,markupEditorToolShareStyles:13,markupEditorWillStartInteraction:14,markupEditorGridSize:15,markupEditorSnapThreshold:16,markupEditorSnapToContext:17,annotateGridSize:18,annotateSnapToContext:19,willRenderShapePresetToolbar:20,annotateTools:21,annotateToolShapes:22,annotateShapeControls:23,annotateActiveTool:0,annotateEnableButtonFlipVertical:24,annotateEnableSelectImagePreset:25,annotateEnableDropImagePreset:26,annotatePresets:27,annotateWillRenderShapePresetToolbar:28,annotateWillRenderShapeStyleControls:29,enableViewTool:30,enableSelectToolToAddShape:31,enableTapToAddText:32,enableAutoSelectMoveTool:33,enableMoveTool:34,enableMultiSelect:35,willRenderShapeControls:36,willRenderShapeTextControls:37,beforeAddShape:38,beforeRemoveShape:39,beforeDeselectShape:40,beforeSelectShape:41,beforeUpdateShape:42},null,[-1,-1])}get name(){return this.$$.ctx[1]}get isActive(){return this.$$.ctx[2]}set isActive(e){this.$$set({isActive:e}),ka()}get isActiveFraction(){return this.$$.ctx[3]}set isActiveFraction(e){this.$$set({isActiveFraction:e}),ka()}get isVisible(){return this.$$.ctx[4]}set isVisible(e){this.$$set({isVisible:e}),ka()}get stores(){return this.$$.ctx[5]}set stores(e){this.$$set({stores:e}),ka()}get locale(){return this.$$.ctx[6]}set locale(e){this.$$set({locale:e}),ka()}get markupEditorToolbar(){return this.$$.ctx[7]}set markupEditorToolbar(e){this.$$set({markupEditorToolbar:e}),ka()}get markupEditorToolStyles(){return this.$$.ctx[8]}set markupEditorToolStyles(e){this.$$set({markupEditorToolStyles:e}),ka()}get markupEditorToolRetainStyles(){return this.$$.ctx[9]}set markupEditorToolRetainStyles(e){this.$$set({markupEditorToolRetainStyles:e}),ka()}get markupEditorShapeStyleControls(){return this.$$.ctx[10]}set markupEditorShapeStyleControls(e){this.$$set({markupEditorShapeStyleControls:e}),ka()}get markupEditorToolSelectRadius(){return this.$$.ctx[11]}set markupEditorToolSelectRadius(e){this.$$set({markupEditorToolSelectRadius:e}),ka()}get markupEditorTextInputMode(){return this.$$.ctx[12]}set markupEditorTextInputMode(e){this.$$set({markupEditorTextInputMode:e}),ka()}get markupEditorToolShareStyles(){return this.$$.ctx[13]}set markupEditorToolShareStyles(e){this.$$set({markupEditorToolShareStyles:e}),ka()}get markupEditorWillStartInteraction(){return this.$$.ctx[14]}set markupEditorWillStartInteraction(e){this.$$set({markupEditorWillStartInteraction:e}),ka()}get markupEditorGridSize(){return this.$$.ctx[15]}set markupEditorGridSize(e){this.$$set({markupEditorGridSize:e}),ka()}get markupEditorSnapThreshold(){return this.$$.ctx[16]}set markupEditorSnapThreshold(e){this.$$set({markupEditorSnapThreshold:e}),ka()}get markupEditorSnapToContext(){return this.$$.ctx[17]}set markupEditorSnapToContext(e){this.$$set({markupEditorSnapToContext:e}),ka()}get annotateGridSize(){return this.$$.ctx[18]}set annotateGridSize(e){this.$$set({annotateGridSize:e}),ka()}get annotateSnapToContext(){return this.$$.ctx[19]}set annotateSnapToContext(e){this.$$set({annotateSnapToContext:e}),ka()}get willRenderShapePresetToolbar(){return this.$$.ctx[20]}set willRenderShapePresetToolbar(e){this.$$set({willRenderShapePresetToolbar:e}),ka()}get annotateTools(){return this.$$.ctx[21]}set annotateTools(e){this.$$set({annotateTools:e}),ka()}get annotateToolShapes(){return this.$$.ctx[22]}set annotateToolShapes(e){this.$$set({annotateToolShapes:e}),ka()}get annotateShapeControls(){return this.$$.ctx[23]}set annotateShapeControls(e){this.$$set({annotateShapeControls:e}),ka()}get annotateActiveTool(){return this.$$.ctx[0]}set annotateActiveTool(e){this.$$set({annotateActiveTool:e}),ka()}get annotateEnableButtonFlipVertical(){return this.$$.ctx[24]}set annotateEnableButtonFlipVertical(e){this.$$set({annotateEnableButtonFlipVertical:e}),ka()}get annotateEnableSelectImagePreset(){return this.$$.ctx[25]}set annotateEnableSelectImagePreset(e){this.$$set({annotateEnableSelectImagePreset:e}),ka()}get annotateEnableDropImagePreset(){return this.$$.ctx[26]}set annotateEnableDropImagePreset(e){this.$$set({annotateEnableDropImagePreset:e}),ka()}get annotatePresets(){return this.$$.ctx[27]}set annotatePresets(e){this.$$set({annotatePresets:e}),ka()}get annotateWillRenderShapePresetToolbar(){return this.$$.ctx[28]}set annotateWillRenderShapePresetToolbar(e){this.$$set({annotateWillRenderShapePresetToolbar:e}),ka()}get annotateWillRenderShapeStyleControls(){return this.$$.ctx[29]}set annotateWillRenderShapeStyleControls(e){this.$$set({annotateWillRenderShapeStyleControls:e}),ka()}get enableViewTool(){return this.$$.ctx[30]}set enableViewTool(e){this.$$set({enableViewTool:e}),ka()}get enableSelectToolToAddShape(){return this.$$.ctx[31]}set enableSelectToolToAddShape(e){this.$$set({enableSelectToolToAddShape:e}),ka()}get enableTapToAddText(){return this.$$.ctx[32]}set enableTapToAddText(e){this.$$set({enableTapToAddText:e}),ka()}get enableAutoSelectMoveTool(){return this.$$.ctx[33]}set enableAutoSelectMoveTool(e){this.$$set({enableAutoSelectMoveTool:e}),ka()}get enableMoveTool(){return this.$$.ctx[34]}set enableMoveTool(e){this.$$set({enableMoveTool:e}),ka()}get enableMultiSelect(){return this.$$.ctx[35]}set enableMultiSelect(e){this.$$set({enableMultiSelect:e}),ka()}get willRenderShapeControls(){return this.$$.ctx[36]}set willRenderShapeControls(e){this.$$set({willRenderShapeControls:e}),ka()}get willRenderShapeTextControls(){return this.$$.ctx[37]}set willRenderShapeTextControls(e){this.$$set({willRenderShapeTextControls:e}),ka()}get beforeAddShape(){return this.$$.ctx[38]}set beforeAddShape(e){this.$$set({beforeAddShape:e}),ka()}get beforeRemoveShape(){return this.$$.ctx[39]}set beforeRemoveShape(e){this.$$set({beforeRemoveShape:e}),ka()}get beforeDeselectShape(){return this.$$.ctx[40]}set beforeDeselectShape(e){this.$$set({beforeDeselectShape:e}),ka()}get beforeSelectShape(){return this.$$.ctx[41]}set beforeSelectShape(e){this.$$set({beforeSelectShape:e}),ka()}get beforeUpdateShape(){return this.$$.ctx[42]}set beforeUpdateShape(e){this.$$set({beforeUpdateShape:e}),ka()}}]};function Tx(e){let t,o,i;function n(t){e[52](t)}let r={utilKey:e[1],stores:e[5],locale:e[6],isActive:e[2],isActiveFraction:e[3],isVisible:e[4],mapScreenPointToImagePoint:e[44],mapImagePointToScreenPoint:e[43],shapes:e[46],toolbar:e[20]||e[7],toolShapes:e[21]||e[8],toolRetainStyles:e[9],shapeControls:e[22]||e[10],shapePresets:e[26],enableSelectToolToAddShape:e[29],enableTapToAddText:e[30],enableViewTool:e[31],enableMoveTool:e[32],enableAutoSelectMoveTool:e[33],enableMultiSelect:e[34],snapThreshold:e[16],gridSize:Oo(e[18])?e[18]:e[15],enableSnapToContext:wx(e[19])?e[19]:e[17],enableToolShareStyles:e[13],enablePresetSelectImage:e[24],enablePresetDropImage:e[25],enableButtonFlipVertical:e[23],parentRect:e[45],toolSelectRadius:e[11],textInputMode:e[12],willStartInteraction:e[42],willRenderPresetToolbar:e[27]||e[14],willRenderShapeStyleControls:e[28],hooks:{willRenderShapeControls:e[35],willRenderShapeTextControls:e[36],beforeAddShape:e[37],beforeRemoveShape:e[38],beforeDeselectShape:e[39],beforeSelectShape:e[40],beforeUpdateShape:e[41]}};return void 0!==e[0]&&(r.toolActive=e[0]),t=new bx({props:r}),pa.push((()=>Va(t,"toolActive",n))),t.$on("measure",e[53]),{c(){Na(t.$$.fragment)},m(e,o){Ha(t,e,o),i=!0},p(e,i){const n={};32&i[0]&&(n.stores=e[5]),64&i[0]&&(n.locale=e[6]),4&i[0]&&(n.isActive=e[2]),8&i[0]&&(n.isActiveFraction=e[3]),16&i[0]&&(n.isVisible=e[4]),8192&i[1]&&(n.mapScreenPointToImagePoint=e[44]),4096&i[1]&&(n.mapImagePointToScreenPoint=e[43]),1048704&i[0]&&(n.toolbar=e[20]||e[7]),2097408&i[0]&&(n.toolShapes=e[21]||e[8]),512&i[0]&&(n.toolRetainStyles=e[9]),4195328&i[0]&&(n.shapeControls=e[22]||e[10]),67108864&i[0]&&(n.shapePresets=e[26]),536870912&i[0]&&(n.enableSelectToolToAddShape=e[29]),1073741824&i[0]&&(n.enableTapToAddText=e[30]),1&i[1]&&(n.enableViewTool=e[31]),2&i[1]&&(n.enableMoveTool=e[32]),4&i[1]&&(n.enableAutoSelectMoveTool=e[33]),8&i[1]&&(n.enableMultiSelect=e[34]),65536&i[0]&&(n.snapThreshold=e[16]),294912&i[0]&&(n.gridSize=Oo(e[18])?e[18]:e[15]),655360&i[0]&&(n.enableSnapToContext=wx(e[19])?e[19]:e[17]),8192&i[0]&&(n.enableToolShareStyles=e[13]),16777216&i[0]&&(n.enablePresetSelectImage=e[24]),33554432&i[0]&&(n.enablePresetDropImage=e[25]),8388608&i[0]&&(n.enableButtonFlipVertical=e[23]),2048&i[0]&&(n.toolSelectRadius=e[11]),4096&i[0]&&(n.textInputMode=e[12]),2048&i[1]&&(n.willStartInteraction=e[42]),134234112&i[0]&&(n.willRenderPresetToolbar=e[27]||e[14]),268435456&i[0]&&(n.willRenderShapeStyleControls=e[28]),2032&i[1]&&(n.hooks={willRenderShapeControls:e[35],willRenderShapeTextControls:e[36],beforeAddShape:e[37],beforeRemoveShape:e[38],beforeDeselectShape:e[39],beforeSelectShape:e[40],beforeUpdateShape:e[41]}),!o&&1&i[0]&&(o=!0,n.toolActive=e[0],xa((()=>o=!1))),t.$set(n)},i(e){i||(Ea(t.$$.fragment,e),i=!0)},o(e){Aa(t.$$.fragment,e),i=!1},d(e){ja(t,e)}}}function Mx(e,t,o){let i,n,r,a,s;let{isActive:l}=t,{isActiveFraction:c}=t,{isVisible:d}=t,{stores:u}=t,{locale:p={}}=t,{markupEditorToolbar:h}=t,{markupEditorToolStyles:m}=t,{markupEditorToolRetainStyles:g}=t,{markupEditorShapeStyleControls:$}=t,{markupEditorToolSelectRadius:f}=t,{markupEditorTextInputMode:y}=t,{markupEditorToolShareStyles:b}=t,{willRenderShapePresetToolbar:x}=t,{markupEditorGridSize:v}=t,{markupEditorSnapThreshold:w}=t,{markupEditorSnapToContext:S=!0}=t,{decorateGridSize:k}=t,{decorateSnapToContext:C}=t,{decorateTools:T}=t,{decorateToolShapes:M}=t,{decorateShapeControls:P}=t,{decorateActiveTool:R}=t,{decorateEnableButtonFlipVertical:I=!1}=t,{decorateEnableSelectImagePreset:E=!1}=t,{decorateEnableDropImagePreset:A=!0}=t,{decoratePresets:L=[]}=t,{decorateWillRenderShapePresetToolbar:F}=t,{decorateWillRenderShapeStyleControls:z}=t,{enableSelectToolToAddShape:D}=t,{enableTapToAddText:O}=t,{enableViewTool:B}=t,{enableMoveTool:W}=t,{enableAutoSelectMoveTool:_}=t,{enableMultiSelect:V}=t,{willRenderShapeControls:N}=t,{willRenderShapeTextControls:H}=t,{beforeAddShape:j}=t,{beforeRemoveShape:U}=t,{beforeDeselectShape:G}=t,{beforeSelectShape:Z}=t,{beforeUpdateShape:X}=t,{markupEditorWillStartInteraction:Y}=t;const{imageCropRect:q,imageDecoration:K,imageSelectionRectPresentation:J,imageTransformsInterpolated:Q}=u;return hr(e,J,(e=>o(50,a=e))),hr(e,Q,(e=>o(51,s=e))),e.$$set=e=>{"isActive"in e&&o(2,l=e.isActive),"isActiveFraction"in e&&o(3,c=e.isActiveFraction),"isVisible"in e&&o(4,d=e.isVisible),"stores"in e&&o(5,u=e.stores),"locale"in e&&o(6,p=e.locale),"markupEditorToolbar"in e&&o(7,h=e.markupEditorToolbar),"markupEditorToolStyles"in e&&o(8,m=e.markupEditorToolStyles),"markupEditorToolRetainStyles"in e&&o(9,g=e.markupEditorToolRetainStyles),"markupEditorShapeStyleControls"in e&&o(10,$=e.markupEditorShapeStyleControls),"markupEditorToolSelectRadius"in e&&o(11,f=e.markupEditorToolSelectRadius),"markupEditorTextInputMode"in e&&o(12,y=e.markupEditorTextInputMode),"markupEditorToolShareStyles"in e&&o(13,b=e.markupEditorToolShareStyles),"willRenderShapePresetToolbar"in e&&o(14,x=e.willRenderShapePresetToolbar),"markupEditorGridSize"in e&&o(15,v=e.markupEditorGridSize),"markupEditorSnapThreshold"in e&&o(16,w=e.markupEditorSnapThreshold),"markupEditorSnapToContext"in e&&o(17,S=e.markupEditorSnapToContext),"decorateGridSize"in e&&o(18,k=e.decorateGridSize),"decorateSnapToContext"in e&&o(19,C=e.decorateSnapToContext),"decorateTools"in e&&o(20,T=e.decorateTools),"decorateToolShapes"in e&&o(21,M=e.decorateToolShapes),"decorateShapeControls"in e&&o(22,P=e.decorateShapeControls),"decorateActiveTool"in e&&o(0,R=e.decorateActiveTool),"decorateEnableButtonFlipVertical"in e&&o(23,I=e.decorateEnableButtonFlipVertical),"decorateEnableSelectImagePreset"in e&&o(24,E=e.decorateEnableSelectImagePreset),"decorateEnableDropImagePreset"in e&&o(25,A=e.decorateEnableDropImagePreset),"decoratePresets"in e&&o(26,L=e.decoratePresets),"decorateWillRenderShapePresetToolbar"in e&&o(27,F=e.decorateWillRenderShapePresetToolbar),"decorateWillRenderShapeStyleControls"in e&&o(28,z=e.decorateWillRenderShapeStyleControls),"enableSelectToolToAddShape"in e&&o(29,D=e.enableSelectToolToAddShape),"enableTapToAddText"in e&&o(30,O=e.enableTapToAddText),"enableViewTool"in e&&o(31,B=e.enableViewTool),"enableMoveTool"in e&&o(32,W=e.enableMoveTool),"enableAutoSelectMoveTool"in e&&o(33,_=e.enableAutoSelectMoveTool),"enableMultiSelect"in e&&o(34,V=e.enableMultiSelect),"willRenderShapeControls"in e&&o(35,N=e.willRenderShapeControls),"willRenderShapeTextControls"in e&&o(36,H=e.willRenderShapeTextControls),"beforeAddShape"in e&&o(37,j=e.beforeAddShape),"beforeRemoveShape"in e&&o(38,U=e.beforeRemoveShape),"beforeDeselectShape"in e&&o(39,G=e.beforeDeselectShape),"beforeSelectShape"in e&&o(40,Z=e.beforeSelectShape),"beforeUpdateShape"in e&&o(41,X=e.beforeUpdateShape),"markupEditorWillStartInteraction"in e&&o(42,Y=e.markupEditorWillStartInteraction)},e.$$.update=()=>{1048576&e.$$.dirty[1]&&o(49,i=s?s.scale:1),786432&e.$$.dirty[1]&&o(44,n=e=>{const t=$e(e);return t.x-=a.x,t.y-=a.y,t.x/=i,t.y/=i,t}),786432&e.$$.dirty[1]&&o(43,r=e=>{const t=$e(e);return t.x*=i,t.y*=i,t.x+=a.x,t.y+=a.y,t})},[R,"decorate",l,c,d,u,p,h,m,g,$,f,y,b,x,v,w,S,k,C,T,M,P,I,E,A,L,F,z,D,O,B,W,_,V,N,H,j,U,G,Z,X,Y,r,n,q,K,J,Q,i,a,s,function(e){R=e,o(0,R)},function(t){da.call(this,e,t)}]}var Px={util:["decorate",class extends Ga{constructor(e){super(),Ua(this,e,Mx,Tx,lr,{name:1,isActive:2,isActiveFraction:3,isVisible:4,stores:5,locale:6,markupEditorToolbar:7,markupEditorToolStyles:8,markupEditorToolRetainStyles:9,markupEditorShapeStyleControls:10,markupEditorToolSelectRadius:11,markupEditorTextInputMode:12,markupEditorToolShareStyles:13,willRenderShapePresetToolbar:14,markupEditorGridSize:15,markupEditorSnapThreshold:16,markupEditorSnapToContext:17,decorateGridSize:18,decorateSnapToContext:19,decorateTools:20,decorateToolShapes:21,decorateShapeControls:22,decorateActiveTool:0,decorateEnableButtonFlipVertical:23,decorateEnableSelectImagePreset:24,decorateEnableDropImagePreset:25,decoratePresets:26,decorateWillRenderShapePresetToolbar:27,decorateWillRenderShapeStyleControls:28,enableSelectToolToAddShape:29,enableTapToAddText:30,enableViewTool:31,enableMoveTool:32,enableAutoSelectMoveTool:33,enableMultiSelect:34,willRenderShapeControls:35,willRenderShapeTextControls:36,beforeAddShape:37,beforeRemoveShape:38,beforeDeselectShape:39,beforeSelectShape:40,beforeUpdateShape:41,markupEditorWillStartInteraction:42},null,[-1,-1])}get name(){return this.$$.ctx[1]}get isActive(){return this.$$.ctx[2]}set isActive(e){this.$$set({isActive:e}),ka()}get isActiveFraction(){return this.$$.ctx[3]}set isActiveFraction(e){this.$$set({isActiveFraction:e}),ka()}get isVisible(){return this.$$.ctx[4]}set isVisible(e){this.$$set({isVisible:e}),ka()}get stores(){return this.$$.ctx[5]}set stores(e){this.$$set({stores:e}),ka()}get locale(){return this.$$.ctx[6]}set locale(e){this.$$set({locale:e}),ka()}get markupEditorToolbar(){return this.$$.ctx[7]}set markupEditorToolbar(e){this.$$set({markupEditorToolbar:e}),ka()}get markupEditorToolStyles(){return this.$$.ctx[8]}set markupEditorToolStyles(e){this.$$set({markupEditorToolStyles:e}),ka()}get markupEditorToolRetainStyles(){return this.$$.ctx[9]}set markupEditorToolRetainStyles(e){this.$$set({markupEditorToolRetainStyles:e}),ka()}get markupEditorShapeStyleControls(){return this.$$.ctx[10]}set markupEditorShapeStyleControls(e){this.$$set({markupEditorShapeStyleControls:e}),ka()}get markupEditorToolSelectRadius(){return this.$$.ctx[11]}set markupEditorToolSelectRadius(e){this.$$set({markupEditorToolSelectRadius:e}),ka()}get markupEditorTextInputMode(){return this.$$.ctx[12]}set markupEditorTextInputMode(e){this.$$set({markupEditorTextInputMode:e}),ka()}get markupEditorToolShareStyles(){return this.$$.ctx[13]}set markupEditorToolShareStyles(e){this.$$set({markupEditorToolShareStyles:e}),ka()}get willRenderShapePresetToolbar(){return this.$$.ctx[14]}set willRenderShapePresetToolbar(e){this.$$set({willRenderShapePresetToolbar:e}),ka()}get markupEditorGridSize(){return this.$$.ctx[15]}set markupEditorGridSize(e){this.$$set({markupEditorGridSize:e}),ka()}get markupEditorSnapThreshold(){return this.$$.ctx[16]}set markupEditorSnapThreshold(e){this.$$set({markupEditorSnapThreshold:e}),ka()}get markupEditorSnapToContext(){return this.$$.ctx[17]}set markupEditorSnapToContext(e){this.$$set({markupEditorSnapToContext:e}),ka()}get decorateGridSize(){return this.$$.ctx[18]}set decorateGridSize(e){this.$$set({decorateGridSize:e}),ka()}get decorateSnapToContext(){return this.$$.ctx[19]}set decorateSnapToContext(e){this.$$set({decorateSnapToContext:e}),ka()}get decorateTools(){return this.$$.ctx[20]}set decorateTools(e){this.$$set({decorateTools:e}),ka()}get decorateToolShapes(){return this.$$.ctx[21]}set decorateToolShapes(e){this.$$set({decorateToolShapes:e}),ka()}get decorateShapeControls(){return this.$$.ctx[22]}set decorateShapeControls(e){this.$$set({decorateShapeControls:e}),ka()}get decorateActiveTool(){return this.$$.ctx[0]}set decorateActiveTool(e){this.$$set({decorateActiveTool:e}),ka()}get decorateEnableButtonFlipVertical(){return this.$$.ctx[23]}set decorateEnableButtonFlipVertical(e){this.$$set({decorateEnableButtonFlipVertical:e}),ka()}get decorateEnableSelectImagePreset(){return this.$$.ctx[24]}set decorateEnableSelectImagePreset(e){this.$$set({decorateEnableSelectImagePreset:e}),ka()}get decorateEnableDropImagePreset(){return this.$$.ctx[25]}set decorateEnableDropImagePreset(e){this.$$set({decorateEnableDropImagePreset:e}),ka()}get decoratePresets(){return this.$$.ctx[26]}set decoratePresets(e){this.$$set({decoratePresets:e}),ka()}get decorateWillRenderShapePresetToolbar(){return this.$$.ctx[27]}set decorateWillRenderShapePresetToolbar(e){this.$$set({decorateWillRenderShapePresetToolbar:e}),ka()}get decorateWillRenderShapeStyleControls(){return this.$$.ctx[28]}set decorateWillRenderShapeStyleControls(e){this.$$set({decorateWillRenderShapeStyleControls:e}),ka()}get enableSelectToolToAddShape(){return this.$$.ctx[29]}set enableSelectToolToAddShape(e){this.$$set({enableSelectToolToAddShape:e}),ka()}get enableTapToAddText(){return this.$$.ctx[30]}set enableTapToAddText(e){this.$$set({enableTapToAddText:e}),ka()}get enableViewTool(){return this.$$.ctx[31]}set enableViewTool(e){this.$$set({enableViewTool:e}),ka()}get enableMoveTool(){return this.$$.ctx[32]}set enableMoveTool(e){this.$$set({enableMoveTool:e}),ka()}get enableAutoSelectMoveTool(){return this.$$.ctx[33]}set enableAutoSelectMoveTool(e){this.$$set({enableAutoSelectMoveTool:e}),ka()}get enableMultiSelect(){return this.$$.ctx[34]}set enableMultiSelect(e){this.$$set({enableMultiSelect:e}),ka()}get willRenderShapeControls(){return this.$$.ctx[35]}set willRenderShapeControls(e){this.$$set({willRenderShapeControls:e}),ka()}get willRenderShapeTextControls(){return this.$$.ctx[36]}set willRenderShapeTextControls(e){this.$$set({willRenderShapeTextControls:e}),ka()}get beforeAddShape(){return this.$$.ctx[37]}set beforeAddShape(e){this.$$set({beforeAddShape:e}),ka()}get beforeRemoveShape(){return this.$$.ctx[38]}set beforeRemoveShape(e){this.$$set({beforeRemoveShape:e}),ka()}get beforeDeselectShape(){return this.$$.ctx[39]}set beforeDeselectShape(e){this.$$set({beforeDeselectShape:e}),ka()}get beforeSelectShape(){return this.$$.ctx[40]}set beforeSelectShape(e){this.$$set({beforeSelectShape:e}),ka()}get beforeUpdateShape(){return this.$$.ctx[41]}set beforeUpdateShape(e){this.$$set({beforeUpdateShape:e}),ka()}get markupEditorWillStartInteraction(){return this.$$.ctx[42]}set markupEditorWillStartInteraction(e){this.$$set({markupEditorWillStartInteraction:e}),ka()}}]};function Rx(e){let t,o;return t=new bx({props:{stores:e[3],locale:e[4],isActive:e[0],isActiveFraction:e[1],isVisible:e[2],mapScreenPointToImagePoint:e[26],mapImagePointToScreenPoint:e[25],utilKey:"sticker",shapePresets:e[5],shapes:e[6]?e[35]:e[36],toolActive:"preset",imageFlipX:!!e[6]&&e[24],imageFlipY:!!e[6]&&e[23],imageRotation:e[6]?e[31]:0,parentRect:e[6]?e[37]:e[33],snapThreshold:e[29],gridSize:e[28],enableMultiSelect:e[12],enableSnapToContext:e[27],enablePresetDropImage:e[7],enablePresetSelectImage:e[30],enableButtonFlipVertical:e[10]||e[8],toolSelectRadius:e[15],willStartInteraction:e[22],willRenderPresetToolbar:e[11]||e[9]||e[16],hooks:{willRenderShapeControls:e[13],willRenderShapeTextControls:e[14],beforeAddShape:e[17],beforeRemoveShape:e[18],beforeDeselectShape:e[19],beforeSelectShape:e[20],beforeUpdateShape:e[21]}}}),t.$on("measure",e[60]),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};8&o[0]&&(i.stores=e[3]),16&o[0]&&(i.locale=e[4]),1&o[0]&&(i.isActive=e[0]),2&o[0]&&(i.isActiveFraction=e[1]),4&o[0]&&(i.isVisible=e[2]),67108864&o[0]&&(i.mapScreenPointToImagePoint=e[26]),33554432&o[0]&&(i.mapImagePointToScreenPoint=e[25]),32&o[0]&&(i.shapePresets=e[5]),64&o[0]&&(i.shapes=e[6]?e[35]:e[36]),16777280&o[0]&&(i.imageFlipX=!!e[6]&&e[24]),8388672&o[0]&&(i.imageFlipY=!!e[6]&&e[23]),64&o[0]|1&o[1]&&(i.imageRotation=e[6]?e[31]:0),64&o[0]&&(i.parentRect=e[6]?e[37]:e[33]),536870912&o[0]&&(i.snapThreshold=e[29]),268435456&o[0]&&(i.gridSize=e[28]),4096&o[0]&&(i.enableMultiSelect=e[12]),134217728&o[0]&&(i.enableSnapToContext=e[27]),128&o[0]&&(i.enablePresetDropImage=e[7]),1073741824&o[0]&&(i.enablePresetSelectImage=e[30]),1280&o[0]&&(i.enableButtonFlipVertical=e[10]||e[8]),32768&o[0]&&(i.toolSelectRadius=e[15]),4194304&o[0]&&(i.willStartInteraction=e[22]),68096&o[0]&&(i.willRenderPresetToolbar=e[11]||e[9]||e[16]),4087808&o[0]&&(i.hooks={willRenderShapeControls:e[13],willRenderShapeTextControls:e[14],beforeAddShape:e[17],beforeRemoveShape:e[18],beforeDeselectShape:e[19],beforeSelectShape:e[20],beforeUpdateShape:e[21]}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Ix(e,t,o){let i,n,r,a,s,l,c,d,u,p,h,m,g,$,f;let{isActive:y}=t,{isActiveFraction:b}=t,{isVisible:x}=t,{stores:v}=t,{locale:w={}}=t,{stickers:S=[]}=t,{stickerForceEnable:k=!1}=t,{stickerStickToImage:C=!1}=t,{stickerEnableSelectImagePreset:T=!0}=t,{stickerEnableDropImagePreset:M=!0}=t,{stickerEnableButtonFlipVertical:P=!1}=t,{stickerWillRenderShapePresetToolbar:R}=t,{stickerEnableSelectImage:I=!0}=t,{stickersEnableButtonFlipVertical:E=!1}=t,{stickersWillRenderShapePresetToolbar:A}=t,{markupEditorGridSize:L=0}=t,{markupEditorSnapThreshold:F=0}=t,{markupEditorSnapToContext:z=!1}=t,{enableMultiSelect:D}=t,{annotateGridSize:O}=t,{annotateSnapToContext:B}=t,{decorateGridSize:W}=t,{decorateSnapToContext:_}=t,{willRenderShapeControls:V}=t,{willRenderShapeTextControls:N}=t,{markupEditorToolSelectRadius:H}=t,{willRenderShapePresetToolbar:j}=t,{beforeAddShape:U}=t,{beforeRemoveShape:G}=t,{beforeDeselectShape:Z}=t,{beforeSelectShape:X}=t,{beforeUpdateShape:Y}=t,{markupEditorWillStartInteraction:q}=t;const{rootRect:K,imageCropRect:J,imageSelectionRectPresentation:Q,imageAnnotation:ee,imageDecoration:te,imageSize:oe,imageTransforms:ie,imageTransformsInterpolated:ne,imageRotation:re,imageFlipX:ae,imageFlipY:se}=v;return hr(e,K,(e=>o(59,$=e))),hr(e,Q,(e=>o(55,d=e))),hr(e,oe,(e=>o(58,g=e))),hr(e,ie,(e=>o(57,m=e))),hr(e,ne,(e=>o(56,h=e))),hr(e,re,(e=>o(31,f=e))),hr(e,ae,(e=>o(24,p=e))),hr(e,se,(e=>o(23,u=e))),e.$$set=e=>{"isActive"in e&&o(0,y=e.isActive),"isActiveFraction"in e&&o(1,b=e.isActiveFraction),"isVisible"in e&&o(2,x=e.isVisible),"stores"in e&&o(3,v=e.stores),"locale"in e&&o(4,w=e.locale),"stickers"in e&&o(5,S=e.stickers),"stickerForceEnable"in e&&o(44,k=e.stickerForceEnable),"stickerStickToImage"in e&&o(6,C=e.stickerStickToImage),"stickerEnableSelectImagePreset"in e&&o(45,T=e.stickerEnableSelectImagePreset),"stickerEnableDropImagePreset"in e&&o(7,M=e.stickerEnableDropImagePreset),"stickerEnableButtonFlipVertical"in e&&o(8,P=e.stickerEnableButtonFlipVertical),"stickerWillRenderShapePresetToolbar"in e&&o(9,R=e.stickerWillRenderShapePresetToolbar),"stickerEnableSelectImage"in e&&o(46,I=e.stickerEnableSelectImage),"stickersEnableButtonFlipVertical"in e&&o(10,E=e.stickersEnableButtonFlipVertical),"stickersWillRenderShapePresetToolbar"in e&&o(11,A=e.stickersWillRenderShapePresetToolbar),"markupEditorGridSize"in e&&o(47,L=e.markupEditorGridSize),"markupEditorSnapThreshold"in e&&o(48,F=e.markupEditorSnapThreshold),"markupEditorSnapToContext"in e&&o(49,z=e.markupEditorSnapToContext),"enableMultiSelect"in e&&o(12,D=e.enableMultiSelect),"annotateGridSize"in e&&o(50,O=e.annotateGridSize),"annotateSnapToContext"in e&&o(51,B=e.annotateSnapToContext),"decorateGridSize"in e&&o(52,W=e.decorateGridSize),"decorateSnapToContext"in e&&o(53,_=e.decorateSnapToContext),"willRenderShapeControls"in e&&o(13,V=e.willRenderShapeControls),"willRenderShapeTextControls"in e&&o(14,N=e.willRenderShapeTextControls),"markupEditorToolSelectRadius"in e&&o(15,H=e.markupEditorToolSelectRadius),"willRenderShapePresetToolbar"in e&&o(16,j=e.willRenderShapePresetToolbar),"beforeAddShape"in e&&o(17,U=e.beforeAddShape),"beforeRemoveShape"in e&&o(18,G=e.beforeRemoveShape),"beforeDeselectShape"in e&&o(19,Z=e.beforeDeselectShape),"beforeSelectShape"in e&&o(20,X=e.beforeSelectShape),"beforeUpdateShape"in e&&o(21,Y=e.beforeUpdateShape),"markupEditorWillStartInteraction"in e&&o(22,q=e.markupEditorWillStartInteraction)},e.$$.update=()=>{33554432&e.$$.dirty[1]&&o(54,i=h?h.scale:1),49152&e.$$.dirty[1]&&o(30,n=!1!==T&&I),131072&e.$$.dirty[1]&&o(29,r=F),64&e.$$.dirty[0]|2686976&e.$$.dirty[1]&&o(28,a=C?Oo(O)?O:L:Oo(W)?W:L),64&e.$$.dirty[0]|5505024&e.$$.dirty[1]&&o(27,s=C?wx(B)?B:z:wx(_)?_:z),25165888&e.$$.dirty[0]|528482304&e.$$.dirty[1]&&o(26,l=C?e=>vx(e,$,g,h.origin,h.translation,m.rotation.z,h.scale,p,u):e=>{const t=$e(e);return t.x-=d.x,t.y-=d.y,t.x/=i,t.y/=i,t}),25165888&e.$$.dirty[0]|528482304&e.$$.dirty[1]&&o(25,c=C?e=>xx(e,$,g,h.origin,h.translation,m.rotation.z,h.scale,p,u):e=>{const t=$e(e);return t.x*=i,t.y*=i,t.x+=d.x,t.y+=d.y,t})},[y,b,x,v,w,S,C,M,P,R,E,A,D,V,N,H,j,U,G,Z,X,Y,q,u,p,c,l,s,a,r,n,f,K,J,Q,ee,te,oe,ie,ne,re,ae,se,"sticker",k,T,I,L,F,z,O,B,W,_,i,d,h,m,g,$,function(t){da.call(this,e,t)}]}var Ex={util:["sticker",class extends Ga{constructor(e){super(),Ua(this,e,Ix,Rx,lr,{name:43,isActive:0,isActiveFraction:1,isVisible:2,stores:3,locale:4,stickers:5,stickerForceEnable:44,stickerStickToImage:6,stickerEnableSelectImagePreset:45,stickerEnableDropImagePreset:7,stickerEnableButtonFlipVertical:8,stickerWillRenderShapePresetToolbar:9,stickerEnableSelectImage:46,stickersEnableButtonFlipVertical:10,stickersWillRenderShapePresetToolbar:11,markupEditorGridSize:47,markupEditorSnapThreshold:48,markupEditorSnapToContext:49,enableMultiSelect:12,annotateGridSize:50,annotateSnapToContext:51,decorateGridSize:52,decorateSnapToContext:53,willRenderShapeControls:13,willRenderShapeTextControls:14,markupEditorToolSelectRadius:15,willRenderShapePresetToolbar:16,beforeAddShape:17,beforeRemoveShape:18,beforeDeselectShape:19,beforeSelectShape:20,beforeUpdateShape:21,markupEditorWillStartInteraction:22},null,[-1,-1])}get name(){return this.$$.ctx[43]}get isActive(){return this.$$.ctx[0]}set isActive(e){this.$$set({isActive:e}),ka()}get isActiveFraction(){return this.$$.ctx[1]}set isActiveFraction(e){this.$$set({isActiveFraction:e}),ka()}get isVisible(){return this.$$.ctx[2]}set isVisible(e){this.$$set({isVisible:e}),ka()}get stores(){return this.$$.ctx[3]}set stores(e){this.$$set({stores:e}),ka()}get locale(){return this.$$.ctx[4]}set locale(e){this.$$set({locale:e}),ka()}get stickers(){return this.$$.ctx[5]}set stickers(e){this.$$set({stickers:e}),ka()}get stickerForceEnable(){return this.$$.ctx[44]}set stickerForceEnable(e){this.$$set({stickerForceEnable:e}),ka()}get stickerStickToImage(){return this.$$.ctx[6]}set stickerStickToImage(e){this.$$set({stickerStickToImage:e}),ka()}get stickerEnableSelectImagePreset(){return this.$$.ctx[45]}set stickerEnableSelectImagePreset(e){this.$$set({stickerEnableSelectImagePreset:e}),ka()}get stickerEnableDropImagePreset(){return this.$$.ctx[7]}set stickerEnableDropImagePreset(e){this.$$set({stickerEnableDropImagePreset:e}),ka()}get stickerEnableButtonFlipVertical(){return this.$$.ctx[8]}set stickerEnableButtonFlipVertical(e){this.$$set({stickerEnableButtonFlipVertical:e}),ka()}get stickerWillRenderShapePresetToolbar(){return this.$$.ctx[9]}set stickerWillRenderShapePresetToolbar(e){this.$$set({stickerWillRenderShapePresetToolbar:e}),ka()}get stickerEnableSelectImage(){return this.$$.ctx[46]}set stickerEnableSelectImage(e){this.$$set({stickerEnableSelectImage:e}),ka()}get stickersEnableButtonFlipVertical(){return this.$$.ctx[10]}set stickersEnableButtonFlipVertical(e){this.$$set({stickersEnableButtonFlipVertical:e}),ka()}get stickersWillRenderShapePresetToolbar(){return this.$$.ctx[11]}set stickersWillRenderShapePresetToolbar(e){this.$$set({stickersWillRenderShapePresetToolbar:e}),ka()}get markupEditorGridSize(){return this.$$.ctx[47]}set markupEditorGridSize(e){this.$$set({markupEditorGridSize:e}),ka()}get markupEditorSnapThreshold(){return this.$$.ctx[48]}set markupEditorSnapThreshold(e){this.$$set({markupEditorSnapThreshold:e}),ka()}get markupEditorSnapToContext(){return this.$$.ctx[49]}set markupEditorSnapToContext(e){this.$$set({markupEditorSnapToContext:e}),ka()}get enableMultiSelect(){return this.$$.ctx[12]}set enableMultiSelect(e){this.$$set({enableMultiSelect:e}),ka()}get annotateGridSize(){return this.$$.ctx[50]}set annotateGridSize(e){this.$$set({annotateGridSize:e}),ka()}get annotateSnapToContext(){return this.$$.ctx[51]}set annotateSnapToContext(e){this.$$set({annotateSnapToContext:e}),ka()}get decorateGridSize(){return this.$$.ctx[52]}set decorateGridSize(e){this.$$set({decorateGridSize:e}),ka()}get decorateSnapToContext(){return this.$$.ctx[53]}set decorateSnapToContext(e){this.$$set({decorateSnapToContext:e}),ka()}get willRenderShapeControls(){return this.$$.ctx[13]}set willRenderShapeControls(e){this.$$set({willRenderShapeControls:e}),ka()}get willRenderShapeTextControls(){return this.$$.ctx[14]}set willRenderShapeTextControls(e){this.$$set({willRenderShapeTextControls:e}),ka()}get markupEditorToolSelectRadius(){return this.$$.ctx[15]}set markupEditorToolSelectRadius(e){this.$$set({markupEditorToolSelectRadius:e}),ka()}get willRenderShapePresetToolbar(){return this.$$.ctx[16]}set willRenderShapePresetToolbar(e){this.$$set({willRenderShapePresetToolbar:e}),ka()}get beforeAddShape(){return this.$$.ctx[17]}set beforeAddShape(e){this.$$set({beforeAddShape:e}),ka()}get beforeRemoveShape(){return this.$$.ctx[18]}set beforeRemoveShape(e){this.$$set({beforeRemoveShape:e}),ka()}get beforeDeselectShape(){return this.$$.ctx[19]}set beforeDeselectShape(e){this.$$set({beforeDeselectShape:e}),ka()}get beforeSelectShape(){return this.$$.ctx[20]}set beforeSelectShape(e){this.$$set({beforeSelectShape:e}),ka()}get beforeUpdateShape(){return this.$$.ctx[21]}set beforeUpdateShape(e){this.$$set({beforeUpdateShape:e}),ka()}get markupEditorWillStartInteraction(){return this.$$.ctx[22]}set markupEditorWillStartInteraction(e){this.$$set({markupEditorWillStartInteraction:e}),ka()}},({stickers:e,stickerEnableSelectImage:t,stickerEnableSelectImagePreset:o,stickerEnableDropImagePreset:i,stickerForceEnable:n})=>e&&e.length||t||o||i||n]};function Ax(e){let t,o,i=(e[14](e[36].value)||"")+"";return{c(){t=new Yr(!1),o=Br(),t.a=o},m(e,n){t.m(i,e,n),Ar(e,o,n)},p(e,o){32&o[1]&&i!==(i=(e[14](e[36].value)||"")+"")&&t.p(i)},i:tr,o:tr,d(e){e&&Lr(o),e&&t.d()}}}function Lx(e){let t,o;return t=new gh({props:{items:e[16](e[36].value)}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};32&o[1]&&(i.items=e[16](e[36].value)),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Fx(e){let t,o,i,n,r,a,s,l,c=(R(e[36].label)?e[36].label(e[1]):e[36].label)+"";const d=[Lx,Ax],u=[];function p(e,t){return 32&t[1]&&(o=null),null==o&&(o=!!e[15](e[36].value)),o?0:1}return i=p(e,[-1,-1]),n=u[i]=d[i](e),{c(){t=Fr("div"),n.c(),r=Or(),a=Fr("span"),s=Dr(c),Nr(t,"slot","option")},m(e,o){Ar(e,t,o),u[i].m(t,null),Rr(t,r),Rr(t,a),Rr(a,s),l=!0},p(e,o){let a=i;i=p(e,o),i===a?u[i].p(e,o):(Ra(),Aa(u[a],1,1,(()=>{u[a]=null})),Ia(),n=u[i],n?n.p(e,o):(n=u[i]=d[i](e),n.c()),Ea(n,1),n.m(t,r)),(!l||2&o[0]|32&o[1])&&c!==(c=(R(e[36].label)?e[36].label(e[1]):e[36].label)+"")&&Ur(s,c)},i(e){l||(Ea(n),l=!0)},o(e){Aa(n),l=!1},d(e){e&&Lr(t),u[i].d()}}}function zx(e){let t,o;return t=new Lu({props:{locale:e[1],class:"PinturaControlList",layout:"row",options:e[2],selectedIndex:e[6],onchange:e[12],$$slots:{option:[Fx,({option:e})=>({36:e}),({option:e})=>[0,e?32:0]]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};2&o[0]&&(i.locale=e[1]),4&o[0]&&(i.options=e[2]),64&o[0]&&(i.selectedIndex=e[6]),2&o[0]|96&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Dx(e){let t,o,i,n,r;return o=new Rb({props:{locale:e[1],class:"PinturaControlPanels",shapeProps:e[4],onchange:e[13],controls:e[3],scrollElasticity:e[7]}}),n=new Lh({props:{elasticity:e[10],$$slots:{default:[zx]},$$scope:{ctx:e}}}),{c(){t=Fr("div"),Na(o.$$.fragment),i=Or(),Na(n.$$.fragment),Nr(t,"slot","footer"),Zr(t,"transform",e[5])},m(e,a){Ar(e,t,a),Ha(o,t,null),Rr(t,i),Ha(n,t,null),r=!0},p(e,i){const r={};2&i[0]&&(r.locale=e[1]),16&i[0]&&(r.shapeProps=e[4]),8&i[0]&&(r.controls=e[3]),128&i[0]&&(r.scrollElasticity=e[7]),o.$set(r);const a={};70&i[0]|64&i[1]&&(a.$$scope={dirty:i,ctx:e}),n.$set(a),32&i[0]&&Zr(t,"transform",e[5])},i(e){r||(Ea(o.$$.fragment,e),Ea(n.$$.fragment,e),r=!0)},o(e){Aa(o.$$.fragment,e),Aa(n.$$.fragment,e),r=!1},d(e){e&&Lr(t),ja(o),ja(n)}}}function Ox(e){let t,o;return t=new Mf({props:{$$slots:{footer:[Dx]},$$scope:{ctx:e}}}),t.$on("measure",e[25]),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};254&o[0]|64&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Bx(e,t,o){let i,n,r,a,s,l,c,d,u=tr,p=()=>(u(),u=ur(h,(e=>o(22,s=e))),h);e.$$.on_destroy.push((()=>u()));let{isActive:h}=t;p();let{stores:m}=t,{locale:g={}}=t,{frameStyles:$={}}=t,{frameOptions:f=[]}=t,{markupEditorShapeStyleControls:y}=t;const b=ca("elasticityMultiplier");hr(e,b,(e=>o(24,d=e)));const{history:x,animation:v,scrollElasticity:w,imageFrame:S,allowPan:k,allowZoom:C,allowZoomControls:T,allowPlayPause:M}=m;hr(e,v,(e=>o(23,l=e))),hr(e,S,(e=>o(4,c=e)));let P={};let R;const I=xc(l?20:0);return hr(e,I,(e=>o(21,a=e))),e.$$set=e=>{"isActive"in e&&p(o(0,h=e.isActive)),"stores"in e&&o(19,m=e.stores),"locale"in e&&o(1,g=e.locale),"frameStyles"in e&&o(20,$=e.frameStyles),"frameOptions"in e&&o(2,f=e.frameOptions),"markupEditorShapeStyleControls"in e&&o(3,y=e.markupEditorShapeStyleControls)},e.$$.update=()=>{4194304&e.$$.dirty[0]&&k.set(s),4194304&e.$$.dirty[0]&&C.set(s),4194304&e.$$.dirty[0]&&T.set(s),4194304&e.$$.dirty[0]&&s&&M.set(!0),16777216&e.$$.dirty[0]&&o(7,i=d*w),20&e.$$.dirty[0]&&o(6,n=c?f.findIndex((([e])=>e===c.id)):0),12582912&e.$$.dirty[0]&&l&&I.set(s?0:20),2097152&e.$$.dirty[0]&&o(5,r=a?`translateY(${a}px)`:"none")},[h,g,f,y,c,r,n,i,b,v,w,S,({value:e})=>{const t=$[e];if(!t||!t.shape)return S.set(void 0),void x.write();const{shape:o}=t,i={id:e,...xi(o),...Object.keys(P).reduce(((e,t)=>o[t]?(e[t]=P[t],e):e),{})};S.set(i),x.write()},function(e){Wo(e,"frameColor")&&(P.frameColor=e.frameColor),c&&(Tn(c,e),S.set(c),clearTimeout(R),R=setTimeout((()=>{x.write()}),200))},e=>{const t=$[e];var o;if(t&&t.thumb)return o=t.thumb,/div/i.test(o)||Ib(o)?o:/rect|path|circle|line|<g>/i.test(o)?`<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" stroke-width="1" stroke="currentColor" fill="none" aria-hidden="true" focusable="false" stroke-linecap="round" stroke-linejoin="round">${o}</svg>`:`<img src="${o}" alt=""/>`},e=>{const t=$[e];return!(!t||!t.thumb)&&_o(t.thumb)},e=>$[e].thumb,I,"frame",m,$,a,s,l,d,function(t){da.call(this,e,t)}]}var Wx={util:["frame",class extends Ga{constructor(e){super(),Ua(this,e,Bx,Ox,lr,{name:18,isActive:0,stores:19,locale:1,frameStyles:20,frameOptions:2,markupEditorShapeStyleControls:3},null,[-1,-1])}get name(){return this.$$.ctx[18]}get isActive(){return this.$$.ctx[0]}set isActive(e){this.$$set({isActive:e}),ka()}get stores(){return this.$$.ctx[19]}set stores(e){this.$$set({stores:e}),ka()}get locale(){return this.$$.ctx[1]}set locale(e){this.$$set({locale:e}),ka()}get frameStyles(){return this.$$.ctx[20]}set frameStyles(e){this.$$set({frameStyles:e}),ka()}get frameOptions(){return this.$$.ctx[2]}set frameOptions(e){this.$$set({frameOptions:e}),ka()}get markupEditorShapeStyleControls(){return this.$$.ctx[3]}set markupEditorShapeStyleControls(e){this.$$set({markupEditorShapeStyleControls:e}),ka()}},({src:e})=>e&&!Zs(e)]};function _x(e){let t,o,i,n,r,a,s,l;return{c(){t=Fr("div"),o=Fr("input"),n=Or(),r=Fr("label"),a=Dr(e[1]),Nr(o,"id",e[0]),Nr(o,"type","number"),Nr(o,"min","1"),Nr(o,"inputmode","numeric"),Nr(o,"pattern","[0-9]*"),Nr(o,"data-state",e[3]),Nr(o,"autocomplete","off"),Nr(o,"placeholder",e[4]),o.value=i=void 0===e[5]?"":e[7](e[5]+""),Nr(r,"for",e[0]),Nr(r,"title",e[2]),Nr(r,"aria-label",e[2]),Nr(t,"class","PinturaInputDimension")},m(i,c){Ar(i,t,c),Rr(t,o),Rr(t,n),Rr(t,r),Rr(r,a),s||(l=Wr(o,"input",e[8]),s=!0)},p(e,[t]){1&t&&Nr(o,"id",e[0]),8&t&&Nr(o,"data-state",e[3]),16&t&&Nr(o,"placeholder",e[4]),160&t&&i!==(i=void 0===e[5]?"":e[7](e[5]+""))&&o.value!==i&&(o.value=i),2&t&&Ur(a,e[1]),1&t&&Nr(r,"for",e[0]),4&t&&Nr(r,"title",e[2]),4&t&&Nr(r,"aria-label",e[2])},i:tr,o:tr,d(e){e&&Lr(t),s=!1,l()}}}function Vx(e,t,o){let{id:i}=t,{label:n}=t,{title:r}=t,{state:a}=t,{placeholder:s}=t,{value:l}=t,{onchange:c}=t,{format:d=(e=>e.replace(/\D/g,""))}=t;return e.$$set=e=>{"id"in e&&o(0,i=e.id),"label"in e&&o(1,n=e.label),"title"in e&&o(2,r=e.title),"state"in e&&o(3,a=e.state),"placeholder"in e&&o(4,s=e.placeholder),"value"in e&&o(5,l=e.value),"onchange"in e&&o(6,c=e.onchange),"format"in e&&o(7,d=e.format)},[i,n,r,a,s,l,c,d,e=>c(d(e.currentTarget.value))]}class Nx extends Ga{constructor(e){super(),Ua(this,e,Vx,_x,lr,{id:0,label:1,title:2,state:3,placeholder:4,value:5,onchange:6,format:7})}}function Hx(e){let t;return{c(){t=zr("g")},m(o,i){Ar(o,t,i),t.innerHTML=e[2]},p(e,o){4&o&&(t.innerHTML=e[2])},d(e){e&&Lr(t)}}}function jx(e){let t,o,i,n,r,a,s,l;return r=new Sd({props:{$$slots:{default:[Hx]},$$scope:{ctx:e}}}),{c(){t=Fr("div"),o=Fr("input"),i=Or(),n=Fr("label"),Na(r.$$.fragment),Nr(o,"id",e[0]),Nr(o,"class","implicit"),Nr(o,"type","checkbox"),o.checked=e[1],Nr(n,"for",e[0]),Nr(n,"title",e[3])},m(c,d){Ar(c,t,d),Rr(t,o),Rr(t,i),Rr(t,n),Ha(r,n,null),a=!0,s||(l=Wr(o,"change",e[5]),s=!0)},p(e,[t]){(!a||1&t)&&Nr(o,"id",e[0]),(!a||2&t)&&(o.checked=e[1]);const i={};68&t&&(i.$$scope={dirty:t,ctx:e}),r.$set(i),(!a||1&t)&&Nr(n,"for",e[0]),(!a||8&t)&&Nr(n,"title",e[3])},i(e){a||(Ea(r.$$.fragment,e),a=!0)},o(e){Aa(r.$$.fragment,e),a=!1},d(e){e&&Lr(t),ja(r),s=!1,l()}}}function Ux(e,t,o){let{id:i}=t,{locked:n}=t,{icon:r}=t,{title:a}=t,{onchange:s}=t;return e.$$set=e=>{"id"in e&&o(0,i=e.id),"locked"in e&&o(1,n=e.locked),"icon"in e&&o(2,r=e.icon),"title"in e&&o(3,a=e.title),"onchange"in e&&o(4,s=e.onchange)},[i,n,r,a,s,e=>s(e.currentTarget.checked)]}class Gx extends Ga{constructor(e){super(),Ua(this,e,Ux,jx,lr,{id:0,locked:1,icon:2,title:3,onchange:4})}}function Zx(e){let t;return{c(){t=Dr("Save")},m(e,o){Ar(e,t,o)},d(e){e&&Lr(t)}}}function Xx(e){let t,o,i,n,r,a,s,l,c,d,u,p,h,m=e[1].resizeLabelFormCaption+"";return l=new gh({props:{items:e[4]}}),d=new wh({props:{type:"submit",class:"implicit",$$slots:{default:[Zx]},$$scope:{ctx:e}}}),{c(){t=Fr("form"),o=Fr("div"),i=Fr("fieldset"),n=Fr("legend"),r=Dr(m),a=Or(),s=Fr("div"),Na(l.$$.fragment),c=Or(),Na(d.$$.fragment),Nr(n,"class","implicit"),Nr(s,"class","PinturaFieldsetInner"),Nr(o,"class","PinturaFormInner"),Nr(t,"slot","footer"),Zr(t,"transform",e[3])},m(m,g){Ar(m,t,g),Rr(t,o),Rr(o,i),Rr(i,n),Rr(n,r),Rr(i,a),Rr(i,s),Ha(l,s,null),e[66](s),Rr(o,c),Ha(d,o,null),u=!0,p||(h=[Wr(s,"focusin",e[15]),Wr(s,"focusout",e[16]),Wr(t,"submit",_r(e[17]))],p=!0)},p(e,o){(!u||2&o[0])&&m!==(m=e[1].resizeLabelFormCaption+"")&&Ur(r,m);const i={};16&o[0]&&(i.items=e[4]),l.$set(i);const n={};32&o[3]&&(n.$$scope={dirty:o,ctx:e}),d.$set(n),8&o[0]&&Zr(t,"transform",e[3])},i(e){u||(Ea(l.$$.fragment,e),Ea(d.$$.fragment,e),u=!0)},o(e){Aa(l.$$.fragment,e),Aa(d.$$.fragment,e),u=!1},d(o){o&&Lr(t),ja(l),e[66](null),ja(d),p=!1,ar(h)}}}function Yx(e){let t,o;return t=new Mf({props:{$$slots:{footer:[Xx]},$$scope:{ctx:e}}}),t.$on("measure",e[67]),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};30&o[0]|32&o[3]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function qx(e,t,o){let i,n,r,a,s,l,c,d,u,p,h,g,$,f,y,b,x,v,w,S,k,C,T,M,P,I,E,A,F,z,D=tr,O=()=>(D(),D=ur(W,(e=>o(50,h=e))),W);e.$$.on_destroy.push((()=>D()));const B=(e,t=0,o=9999)=>{if(m(e)&&!(e=e.replace(/\D/g,"")).length)return;const i=Math.round(e);return Number.isNaN(i)?void 0:$s(i,t,o)};let{isActive:W}=t;O();let{stores:_}=t,{locale:V={}}=t,{resizeMinSize:N=Ne(1,1)}=t,{resizeMaxSize:H=Ne(9999,9999)}=t,{resizeAspectRatioLocked:j=!1}=t,{resizeEnableButtonLockAspectRatio:U=!0}=t,{resizeSizePresetOptions:G}=t,{resizeWidthPresetOptions:Z}=t,{resizeHeightPresetOptions:q}=t,{resizeWillRenderFooter:K=Y}=t,{resizeFormatIconButtonMaintainAspectRatio:J=function(e){const{active:t,activeFraction:o}=e;return{active:t,activeFraction:3*(o-1)}}}=t;const Q=xc(0,{stiffness:.15,damping:.3});hr(e,Q,(e=>o(55,b=e)));const{animation:ee,imageSize:te,imageCropRect:oe,imageCropRectAspectRatio:ie,imageCropAspectRatio:ne,imageOutputSize:re,imageSelectionZoom:ae,imageSelectionPan:se,history:le,env:ce,allowPan:de,allowZoom:ue,allowZoomControls:pe,allowPlayPause:me}=_;hr(e,ee,(e=>o(51,g=e))),hr(e,te,(e=>o(74,A=e))),hr(e,oe,(e=>o(53,f=e))),hr(e,ie,(e=>o(54,y=e))),hr(e,ne,(e=>o(73,M=e))),hr(e,re,(e=>o(62,T=e))),hr(e,ae,(e=>o(75,F=e))),hr(e,se,(e=>o(76,z=e))),hr(e,ce,(e=>o(52,$=e)));const ge=L();let $e,fe,ye,be,xe,ve,we=he();const Se=(e,t,o,i,n)=>null!=e&&o!==t?e>=i[t]&&e<=n[t]?"valid":"invalid":"undetermined",ke=(e,t,o)=>Math.round(null!=e?e/t:o.height),Ce=()=>{j&&fe&&ye&&("width"===be?o(40,ye=Math.round(fe/y)):"height"===be?o(39,fe=Math.round(ye*y)):("width"===xe?o(40,ye=Math.round(fe/y)):"height"===xe&&o(39,fe=Math.round(ye*y)),Te()))},Te=e=>{let t=B(fe),i=B(ye),n=t,r=i,a=n&&r,s=e||y;if(!n&&!r)return;n&&!r?r=Math.round(n/s):r&&!n&&(n=Math.round(r*s)),s=e||a?X(n,r):y;let l=Ne(n,r);Ze(H,l)||(l=St(H,s)),Ze(l,N)||(l=wt(N,s)),o(39,fe=null!=t?Math.round(l.width):void 0),o(40,ye=null!=i?Math.round(l.height):void 0)},Me=()=>{Te();const{width:e,height:t}=T||{};e===fe&&t===ye||(fe||ye?(fe&&ye&&vr(ne,M=fe/ye,M),vr(re,T=Ne(fe,ye),T)):(vr(ne,M=A.width/A.height,M),vr(ne,M=void 0,M),vr(re,T=void 0,T)),le.write())},Pe=re.subscribe((e=>{if(!e)return o(39,fe=void 0),void o(40,ye=void 0);o(39,fe=e.width),o(40,ye=e.height),Te()})),Re=ne.subscribe((e=>{(fe||ye)&&e&&(fe&&ye&&X(fe,ye)!==e?(o(40,ye=fe/e),Te(e)):Te())})),Ie=e=>m(e[0])?(e[1]=e[1].map(Ie),e):Oo(e)?[e,""+e]:e,Ee=e=>{if(m(e[0]))return e[1]=e[1].map(Ee),e;let[t,o]=e;if(Oo(t)&&Oo(o)){const[e,i]=[t,o];o=`${e} × ${i}`,t=[e,i]}return[t,o]},Ae=Ya();hr(e,Ae,(e=>o(61,C=e)));const Le=Ya();hr(e,Le,(e=>o(65,E=e)));const Fe=Ya();hr(e,Fe,(e=>o(59,S=e)));const ze=Ya();hr(e,ze,(e=>o(64,I=e)));const De=Ya();hr(e,De,(e=>o(57,v=e)));const Oe=Ya();hr(e,Oe,(e=>o(63,P=e)));const Be=qa([re,Le],(([e,t],o)=>{if(!t)return o(-1);const i=t.findIndex((([t])=>{if(!t&&!e)return!0;if(!t)return!1;const[o,i]=t;return e.width===o&&e.height===i}));o(i<0?0:i)}));hr(e,Be,(e=>o(60,k=e)));const We=qa([re,ze],(([e,t],o)=>{if(!t)return o(-1);const i=t.findIndex((([t])=>!t&&!e||!!t&&e.width===t));o(i<0?0:i)}));hr(e,We,(e=>o(58,w=e)));const Ve=qa([re,Oe],(([e,t],o)=>{if(!t)return o(-1);const i=t.findIndex((([t])=>!t&&!e||!!t&&e.height===t));o(i<0?0:i)}));hr(e,Ve,(e=>o(56,x=e)));let He=void 0,je=void 0;const Ue=ca("redrawTrigger"),Ge=xc(g?20:0);return hr(e,Ge,(e=>o(49,p=e))),aa((()=>{Pe(),Re()})),e.$$set=e=>{"isActive"in e&&O(o(0,W=e.isActive)),"stores"in e&&o(30,_=e.stores),"locale"in e&&o(1,V=e.locale),"resizeMinSize"in e&&o(31,N=e.resizeMinSize),"resizeMaxSize"in e&&o(32,H=e.resizeMaxSize),"resizeAspectRatioLocked"in e&&o(28,j=e.resizeAspectRatioLocked),"resizeEnableButtonLockAspectRatio"in e&&o(33,U=e.resizeEnableButtonLockAspectRatio),"resizeSizePresetOptions"in e&&o(34,G=e.resizeSizePresetOptions),"resizeWidthPresetOptions"in e&&o(35,Z=e.resizeWidthPresetOptions),"resizeHeightPresetOptions"in e&&o(36,q=e.resizeHeightPresetOptions),"resizeWillRenderFooter"in e&&o(37,K=e.resizeWillRenderFooter),"resizeFormatIconButtonMaintainAspectRatio"in e&&o(38,J=e.resizeFormatIconButtonMaintainAspectRatio)},e.$$.update=()=>{524288&e.$$.dirty[1]&&de.set(!h),524288&e.$$.dirty[1]&&ue.set(!h),524288&e.$$.dirty[1]&&pe.set(!h),524288&e.$$.dirty[1]&&h&&me.set(!0),1073741832&e.$$.dirty[1]&&G&&(vr(Ae,C=G.map(Ee),C),vr(Le,E=iu(C),E)),1073741824&e.$$.dirty[1]&&o(48,a=!!C),536870912&e.$$.dirty[1]|8&e.$$.dirty[2]&&o(47,i=k>-1&&E[k][1]),268435472&e.$$.dirty[1]&&Z&&(vr(Fe,S=Z.map(Ie),S),vr(ze,I=iu(S),I)),268566528&e.$$.dirty[1]&&o(45,s=!a&&S),134217728&e.$$.dirty[1]|4&e.$$.dirty[2]&&o(46,n=w>-1&&I[w][1]),67108896&e.$$.dirty[1]&&q&&(vr(De,v=q.map(Ie),v),vr(Oe,P=iu(v),P)),67239936&e.$$.dirty[1]&&o(44,l=!a&&v),33554432&e.$$.dirty[1]|2&e.$$.dirty[2]&&o(43,r=x>-1&&P[x][1]),155648&e.$$.dirty[1]&&o(42,c=!a&&!s&&!l),268435458&e.$$.dirty[0]|2145648583&e.$$.dirty[1]&&o(4,d=Ue&&cm((()=>{return K([a&&["Dropdown","size-presets",{label:i,options:C,onchange:e=>{return(t=e.value)&&!He&&(He={...f},je=M),t?(vr(ne,M=X(t[0],t[1]),M),vr(re,T=_e(t),T)):(vr(oe,f=He,f),vr(ne,M=je,M),vr(re,T=void 0,T),He=void 0,je=void 0),void le.write();var t},selectedIndex:k}],s&&["Dropdown","width-presets",{label:n,options:S,onchange:e=>{o(39,fe=e.value),Me()},selectedIndex:w}],s&&l&&["span","times",{class:"PinturaResizeLabel",innerHTML:"×"}],l&&["Dropdown","height-presets",{label:r,options:v,onchange:e=>{o(40,ye=e.value),Me()},selectedIndex:x}],c&&[Nx,"width-input",{id:"width-"+ge,title:V.resizeTitleInputWidth,label:V.resizeLabelInputWidth,placeholder:(e=B(ye),t=y,d=f,Math.round(null!=e?e*t:d.width)),value:fe,state:Se(B(fe),"width",be,N,H),onchange:e=>{o(39,fe=e),Ce()}}],c&&U&&[Gx,"aspect-ratio-lock",{id:"aspect-ratio-lock-"+ge,title:V.resizeTitleButtonMaintainAspectRatio,icon:R(V.resizeIconButtonMaintainAspectRatio)?V.resizeIconButtonMaintainAspectRatio(j,b):Il(V.resizeIconButtonMaintainAspectRatio,J({active:j,activeFraction:b}),"{","}"),locked:j,onchange:e=>{o(28,j=e),Ce()}}],c&&[Nx,"height-input",{id:"height-"+ge,title:V.resizeTitleInputHeight,label:V.resizeLabelInputHeight,placeholder:ke(B(fe),y,f),value:ye,state:Se(B(ye),"height",be,N,H),onchange:e=>{o(40,ye=e),Ce()}}]].filter(Boolean),{...$},(()=>Ue.set({})));var e,t,d})).filter(Boolean)),268435456&e.$$.dirty[0]&&Q.set(j?1:0),1024&e.$$.dirty[1]&&be&&(xe=be),524288&e.$$.dirty[1]&&h&&(we=z,ve=F),524288&e.$$.dirty[1]|1&e.$$.dirty[2]&&(h?setTimeout((()=>{return e=T,vr(se,z=he(),z),void vr(ae,F=e&&f?e.width/f.width||e.height/f.height:1,F);var e}),0):(vr(se,z=we,z),vr(ae,F=ve,F))),1572864&e.$$.dirty[1]&&g&&Ge.set(h?0:20),262144&e.$$.dirty[1]&&o(3,u=p?`translateY(${p}px)`:"none")},[W,V,$e,u,d,Q,ee,te,oe,ie,ne,re,ae,se,ce,e=>{const t=e.target.id;/width/.test(t)?o(41,be="width"):/height/.test(t)?o(41,be="height"):/aspectRatio/i.test(t)?o(41,be="lock"):o(41,be=void 0)},e=>{$e.contains(e.relatedTarget)||Me(),o(41,be=void 0)},Me,Ae,Le,Fe,ze,De,Oe,Be,We,Ve,Ge,j,"resize",_,N,H,U,G,Z,q,K,J,fe,ye,be,c,r,l,s,n,i,a,p,h,g,$,f,y,b,x,v,w,S,k,C,T,P,I,E,function(e){pa[e?"unshift":"push"]((()=>{$e=e,o(2,$e)}))},function(t){da.call(this,e,t)}]}var Kx={util:["resize",class extends Ga{constructor(e){super(),Ua(this,e,qx,Yx,lr,{name:29,isActive:0,stores:30,locale:1,resizeMinSize:31,resizeMaxSize:32,resizeAspectRatioLocked:28,resizeEnableButtonLockAspectRatio:33,resizeSizePresetOptions:34,resizeWidthPresetOptions:35,resizeHeightPresetOptions:36,resizeWillRenderFooter:37,resizeFormatIconButtonMaintainAspectRatio:38},null,[-1,-1,-1,-1])}get name(){return this.$$.ctx[29]}get isActive(){return this.$$.ctx[0]}set isActive(e){this.$$set({isActive:e}),ka()}get stores(){return this.$$.ctx[30]}set stores(e){this.$$set({stores:e}),ka()}get locale(){return this.$$.ctx[1]}set locale(e){this.$$set({locale:e}),ka()}get resizeMinSize(){return this.$$.ctx[31]}set resizeMinSize(e){this.$$set({resizeMinSize:e}),ka()}get resizeMaxSize(){return this.$$.ctx[32]}set resizeMaxSize(e){this.$$set({resizeMaxSize:e}),ka()}get resizeAspectRatioLocked(){return this.$$.ctx[28]}set resizeAspectRatioLocked(e){this.$$set({resizeAspectRatioLocked:e}),ka()}get resizeEnableButtonLockAspectRatio(){return this.$$.ctx[33]}set resizeEnableButtonLockAspectRatio(e){this.$$set({resizeEnableButtonLockAspectRatio:e}),ka()}get resizeSizePresetOptions(){return this.$$.ctx[34]}set resizeSizePresetOptions(e){this.$$set({resizeSizePresetOptions:e}),ka()}get resizeWidthPresetOptions(){return this.$$.ctx[35]}set resizeWidthPresetOptions(e){this.$$set({resizeWidthPresetOptions:e}),ka()}get resizeHeightPresetOptions(){return this.$$.ctx[36]}set resizeHeightPresetOptions(e){this.$$set({resizeHeightPresetOptions:e}),ka()}get resizeWillRenderFooter(){return this.$$.ctx[37]}set resizeWillRenderFooter(e){this.$$set({resizeWillRenderFooter:e}),ka()}get resizeFormatIconButtonMaintainAspectRatio(){return this.$$.ctx[38]}set resizeFormatIconButtonMaintainAspectRatio(e){this.$$set({resizeFormatIconButtonMaintainAspectRatio:e}),ka()}}]};function Jx(e){let t,o;return t=new bx({props:{stores:e[3],locale:e[4],isActive:e[0],isActiveFraction:e[1],isVisible:e[2],mapScreenPointToImagePoint:e[10],mapImagePointToScreenPoint:e[9],enableMultiSelect:e[6],utilKey:"redact",imageRotation:e[11],imageFlipX:e[8],imageFlipY:e[7],shapes:e[12],toolbar:["rect"],toolShapes:{rectangle:[{x:0,y:0,width:0,height:0}]},toolActive:"rectangle",parentRect:e[14],enablePresetDropImage:!1,enablePresetSelectImage:!1,willStartInteraction:e[5],hooks:{willRenderShapeControls:e[25]}}}),t.$on("measure",e[26]),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,[o]){const i={};8&o&&(i.stores=e[3]),16&o&&(i.locale=e[4]),1&o&&(i.isActive=e[0]),2&o&&(i.isActiveFraction=e[1]),4&o&&(i.isVisible=e[2]),1024&o&&(i.mapScreenPointToImagePoint=e[10]),512&o&&(i.mapImagePointToScreenPoint=e[9]),64&o&&(i.enableMultiSelect=e[6]),2048&o&&(i.imageRotation=e[11]),256&o&&(i.imageFlipX=e[8]),128&o&&(i.imageFlipY=e[7]),32&o&&(i.willStartInteraction=e[5]),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function Qx(e,t,o){let i,n,r,a,s,l,c,d,u;let{isActive:p}=t,{isActiveFraction:h}=t,{isVisible:m}=t,{stores:g}=t,{locale:$={}}=t,{markupEditorWillStartInteraction:f}=t,{enableMultiSelect:y}=t;const{imageRedaction:b,rootRect:x,imageSize:v,imageRotation:w,imageFlipX:S,imageFlipY:k,imageTransforms:C,imageTransformsInterpolated:T}=g;hr(e,x,(e=>o(24,d=e))),hr(e,v,(e=>o(23,c=e))),hr(e,w,(e=>o(11,u=e))),hr(e,S,(e=>o(8,a=e))),hr(e,k,(e=>o(7,r=e))),hr(e,C,(e=>o(22,l=e))),hr(e,T,(e=>o(21,s=e)));return e.$$set=e=>{"isActive"in e&&o(0,p=e.isActive),"isActiveFraction"in e&&o(1,h=e.isActiveFraction),"isVisible"in e&&o(2,m=e.isVisible),"stores"in e&&o(3,g=e.stores),"locale"in e&&o(4,$=e.locale),"markupEditorWillStartInteraction"in e&&o(5,f=e.markupEditorWillStartInteraction),"enableMultiSelect"in e&&o(6,y=e.enableMultiSelect)},e.$$.update=()=>{31457664&e.$$.dirty&&o(10,i=e=>vx(e,d,c,s.origin,s.translation,l.rotation.z,s.scale,a,r)),31457664&e.$$.dirty&&o(9,n=e=>xx(e,d,c,s.origin,s.translation,l.rotation.z,s.scale,a,r))},[p,h,m,g,$,f,y,r,a,n,i,u,b,x,v,w,S,k,C,T,"redact",s,l,c,d,e=>{const t=ag(e[0]);return lg("to-front",t),e},function(t){da.call(this,e,t)}]}var ev={util:["redact",class extends Ga{constructor(e){super(),Ua(this,e,Qx,Jx,lr,{name:20,isActive:0,isActiveFraction:1,isVisible:2,stores:3,locale:4,markupEditorWillStartInteraction:5,enableMultiSelect:6})}get name(){return this.$$.ctx[20]}get isActive(){return this.$$.ctx[0]}set isActive(e){this.$$set({isActive:e}),ka()}get isActiveFraction(){return this.$$.ctx[1]}set isActiveFraction(e){this.$$set({isActiveFraction:e}),ka()}get isVisible(){return this.$$.ctx[2]}set isVisible(e){this.$$set({isVisible:e}),ka()}get stores(){return this.$$.ctx[3]}set stores(e){this.$$set({stores:e}),ka()}get locale(){return this.$$.ctx[4]}set locale(e){this.$$set({locale:e}),ka()}get markupEditorWillStartInteraction(){return this.$$.ctx[5]}set markupEditorWillStartInteraction(e){this.$$set({markupEditorWillStartInteraction:e}),ka()}get enableMultiSelect(){return this.$$.ctx[6]}set enableMultiSelect(e){this.$$set({enableMultiSelect:e}),ka()}},({src:e})=>e&&!Zs(e)]};function tv(e){let t;return{c(){t=Fr("div")},m(e,o){Ar(e,t,o)},p:tr,d(e){e&&Lr(t)}}}function ov(e){let t,o,i,n;return{c(){t=Fr("div"),Nr(t,"class","PinturaFillTile")},m(r,a){Ar(r,t,a),i||(n=wr(o=cv.call(null,t,e[31].value)),i=!0)},p(e,t){o&&sr(o.update)&&1&t[1]&&o.update.call(null,e[31].value)},d(e){e&&Lr(t),i=!1,n()}}}function iv(e){let t,o,i;return{c(){t=Fr("div"),o=Fr("img"),dr(o.src,i=e[31].value)||Nr(o,"src",i),Nr(o,"alt",""),Nr(o,"width","48"),Nr(o,"height","64"),Nr(t,"class","PinturaFillTile")},m(e,i){Ar(e,t,i),Rr(t,o)},p(e,t){1&t[1]&&!dr(o.src,i=e[31].value)&&Nr(o,"src",i)},d(e){e&&Lr(t)}}}function nv(e){let t,o,i=(R(e[31].label)?e[31].label(e[1]):e[31].label)+"";return{c(){t=Fr("span"),o=Dr(i)},m(e,i){Ar(e,t,i),Rr(t,o)},p(e,t){2&t[0]|1&t[1]&&i!==(i=(R(e[31].label)?e[31].label(e[1]):e[31].label)+"")&&Ur(o,i)},d(e){e&&Lr(t)}}}function rv(e){let t,o,i,n;function r(e,t){return 1&t[1]&&(o=null),1&t[1]&&(i=null),null==o&&(o=!!m(e[31].value)),o?iv:(null==i&&(i=!!_o(e[31].value)),i?ov:tv)}let a=r(e,[-1,-1]),s=a(e),l=e[31].label&&nv(e);return{c(){t=Fr("div"),s.c(),n=Or(),l&&l.c(),Nr(t,"slot","option")},m(e,o){Ar(e,t,o),s.m(t,null),Rr(t,n),l&&l.m(t,null)},p(e,o){a===(a=r(e,o))&&s?s.p(e,o):(s.d(1),s=a(e),s&&(s.c(),s.m(t,n))),e[31].label?l?l.p(e,o):(l=nv(e),l.c(),l.m(t,null)):l&&(l.d(1),l=null)},d(e){e&&Lr(t),s.d(),l&&l.d()}}}function av(e){let t,o;return t=new Lu({props:{locale:e[1],class:"PinturaControlList",layout:"row",options:e[2],selectedIndex:e[4],onchange:e[10],$$slots:{option:[rv,({option:e})=>({31:e}),({option:e})=>[0,e?1:0]]},$$scope:{ctx:e}}}),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};2&o[0]&&(i.locale=e[1]),4&o[0]&&(i.options=e[2]),16&o[0]&&(i.selectedIndex=e[4]),2&o[0]|3&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function sv(e){let t,o,i;return o=new Lh({props:{elasticity:e[5],$$slots:{default:[av]},$$scope:{ctx:e}}}),{c(){t=Fr("div"),Na(o.$$.fragment),Nr(t,"slot","footer"),Zr(t,"transform",e[3])},m(e,n){Ar(e,t,n),Ha(o,t,null),i=!0},p(e,i){const n={};32&i[0]&&(n.elasticity=e[5]),22&i[0]|2&i[1]&&(n.$$scope={dirty:i,ctx:e}),o.$set(n),8&i[0]&&Zr(t,"transform",e[3])},i(e){i||(Ea(o.$$.fragment,e),i=!0)},o(e){Aa(o.$$.fragment,e),i=!1},d(e){e&&Lr(t),ja(o)}}}function lv(e){let t,o;return t=new Mf({props:{$$slots:{footer:[sv]},$$scope:{ctx:e}}}),t.$on("measure",e[21]),{c(){Na(t.$$.fragment)},m(e,i){Ha(t,e,i),o=!0},p(e,o){const i={};62&o[0]|2&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(Ea(t.$$.fragment,e),o=!0)},o(e){Aa(t.$$.fragment,e),o=!1},d(e){ja(t,e)}}}function cv(e){const t=document.createElement("div");return e.append(t),{update(o){const[i,n,r,a]=o.map(((e,t)=>t<3?Math.round(255*e):e));e.dataset.transparent=a<1,t.style.backgroundColor=`rgba(${i},${n},${r},${a})`}}}function dv(e,t,o){let i,n,r,a,s,l,c,d,u,p,h=tr,g=()=>(h(),h=ur($,(e=>o(16,l=e))),$);e.$$.on_destroy.push((()=>h()));let{isActive:$}=t;g();let{stores:f}=t,{locale:y={}}=t,{fillOptions:b=[]}=t;const x=e=>e.map((e=>(e=>_o(e)&&m(e[0])&&_o(e[1]))(e)?[e[0],x(e[1]),e[2]]:(e=>[Array.isArray(e)&&3===e.length?[...e,1]:e,void 0,{disabled:!1}])(e))),v=ca("elasticityMultiplier");hr(e,v,(e=>o(20,p=e)));const{history:w,animation:S,scrollElasticity:k,imageBackgroundColor:C,imageBackgroundImage:T,allowPan:M,allowZoom:P,allowZoomControls:R,allowPlayPause:I}=f;hr(e,S,(e=>o(17,c=e))),hr(e,C,(e=>o(19,u=e))),hr(e,T,(e=>o(18,d=e)));const E=xc(c?20:0);return hr(e,E,(e=>o(15,s=e))),e.$$set=e=>{"isActive"in e&&g(o(0,$=e.isActive)),"stores"in e&&o(13,f=e.stores),"locale"in e&&o(1,y=e.locale),"fillOptions"in e&&o(14,b=e.fillOptions)},e.$$.update=()=>{16384&e.$$.dirty[0]&&o(2,i=x(b)),65536&e.$$.dirty[0]&&M.set(l),65536&e.$$.dirty[0]&&P.set(l),65536&e.$$.dirty[0]&&R.set(l),65536&e.$$.dirty[0]&&l&&I.set(!0),1048576&e.$$.dirty[0]&&o(5,n=p*k),786436&e.$$.dirty[0]&&o(4,r=i.findIndex((([e])=>d?e===d:Array.isArray(e)?vs(e,u):void 0))||0),196608&e.$$.dirty[0]&&c&&E.set(l?0:20),32768&e.$$.dirty[0]&&o(3,a=s?`translateY(${s}px)`:"none")},[$,y,i,a,r,n,v,S,C,T,({value:e})=>{m(e)&&(vr(C,u=void 0,u),vr(T,d=e,d)),_o(e)&&(vr(C,u=e,u),vr(T,d=void 0,d)),w.write()},E,"fill",f,b,s,l,c,d,u,p,function(t){da.call(this,e,t)}]}var uv={util:["fill",class extends Ga{constructor(e){super(),Ua(this,e,dv,lv,lr,{name:12,isActive:0,stores:13,locale:1,fillOptions:14},null,[-1,-1])}get name(){return this.$$.ctx[12]}get isActive(){return this.$$.ctx[0]}set isActive(e){this.$$set({isActive:e}),ka()}get stores(){return this.$$.ctx[13]}set stores(e){this.$$set({stores:e}),ka()}get locale(){return this.$$.ctx[1]}set locale(e){this.$$set({locale:e}),ka()}get fillOptions(){return this.$$.ctx[14]}set fillOptions(e){this.$$set({fillOptions:e}),ka()}},({src:e,fillOptions:t})=>e&&!Zs(e)&&t&&t.length]};function pv(e){let t,o,i;function n(t){e[42](t)}let r={utilKey:"retouch",stores:e[4],locale:e[5],isActive:e[1],isActiveFraction:e[2],isVisible:e[3],mapScreenPointToImagePoint:e[27],mapImagePointToScreenPoint:e[26],imageRotation:e[28],imageFlipX:e[25],imageFlipY:e[24],toolbar:e[6],toolbarLayout:"stack",shapes:e[30],toolShapes:e[7],enableMultiSelect:e[23],enableViewTool:e[14],enableMoveTool:e[13],enableToolShareStyles:!1,shapeControls:e[8],enablePresetSelectImage:!1,enablePresetDropImage:!1,parentRect:e[31],willStartInteraction:e[12],willRenderHeaderTools:e[10]||e[17],willRenderShapeStyleControls:e[9],hooks:{willRenderShapeControls:e[11]||e[15],willRenderShapeTextControls:e[16],beforeAddShape:e[18],beforeRemoveShape:e[19],beforeDeselectShape:e[20],beforeSelectShape:e[21],beforeUpdateShape:e[22]}};return void 0!==e[0]&&(r.toolActive=e[0]),t=new bx({props:r}),pa.push((()=>Va(t,"toolActive",n))),t.$on("measure",e[43]),{c(){Na(t.$$.fragment)},m(e,o){Ha(t,e,o),i=!0},p(e,i){const n={};16&i[0]&&(n.stores=e[4]),32&i[0]&&(n.locale=e[5]),2&i[0]&&(n.isActive=e[1]),4&i[0]&&(n.isActiveFraction=e[2]),8&i[0]&&(n.isVisible=e[3]),134217728&i[0]&&(n.mapScreenPointToImagePoint=e[27]),67108864&i[0]&&(n.mapImagePointToScreenPoint=e[26]),268435456&i[0]&&(n.imageRotation=e[28]),33554432&i[0]&&(n.imageFlipX=e[25]),16777216&i[0]&&(n.imageFlipY=e[24]),64&i[0]&&(n.toolbar=e[6]),128&i[0]&&(n.toolShapes=e[7]),8388608&i[0]&&(n.enableMultiSelect=e[23]),16384&i[0]&&(n.enableViewTool=e[14]),8192&i[0]&&(n.enableMoveTool=e[13]),256&i[0]&&(n.shapeControls=e[8]),4096&i[0]&&(n.willStartInteraction=e[12]),132096&i[0]&&(n.willRenderHeaderTools=e[10]||e[17]),512&i[0]&&(n.willRenderShapeStyleControls=e[9]),8226816&i[0]&&(n.hooks={willRenderShapeControls:e[11]||e[15],willRenderShapeTextControls:e[16],beforeAddShape:e[18],beforeRemoveShape:e[19],beforeDeselectShape:e[20],beforeSelectShape:e[21],beforeUpdateShape:e[22]}),!o&&1&i[0]&&(o=!0,n.toolActive=e[0],xa((()=>o=!1))),t.$set(n)},i(e){i||(Ea(t.$$.fragment,e),i=!0)},o(e){Aa(t.$$.fragment,e),i=!1},d(e){ja(t,e)}}}function hv(e,t,o){let i,n,r,a,s,l,c,d,u;let{isActive:p}=t,{isActiveFraction:h}=t,{isVisible:m}=t,{stores:g}=t,{locale:$={}}=t,{retouchTools:f}=t,{retouchToolShapes:y}=t,{retouchShapeControls:b}=t,{retouchActiveTool:x}=t,{retouchWillRenderShapeStyleControls:v}=t,{retouchWillRenderHeaderTools:w}=t,{retouchWillRenderShapeControls:S}=t,{markupEditorWillStartInteraction:k}=t,{retouchEnableMoveTool:C}=t,{retouchEnableViewTool:T}=t,{willRenderShapeControls:M}=t,{willRenderShapeTextControls:P}=t,{willRenderHeaderTools:R}=t,{beforeAddShape:I}=t,{beforeRemoveShape:E}=t,{beforeDeselectShape:A}=t,{beforeSelectShape:L}=t,{beforeUpdateShape:F}=t,{enableMultiSelect:z}=t;const{rootRect:D,imageManipulation:O,imageSize:B,imageRotation:W,imageFlipX:_,imageFlipY:V,imageTransforms:N,imageTransformsInterpolated:H}=g;return hr(e,D,(e=>o(41,d=e))),hr(e,B,(e=>o(40,c=e))),hr(e,W,(e=>o(28,u=e))),hr(e,_,(e=>o(25,a=e))),hr(e,V,(e=>o(24,r=e))),hr(e,N,(e=>o(39,l=e))),hr(e,H,(e=>o(38,s=e))),e.$$set=e=>{"isActive"in e&&o(1,p=e.isActive),"isActiveFraction"in e&&o(2,h=e.isActiveFraction),"isVisible"in e&&o(3,m=e.isVisible),"stores"in e&&o(4,g=e.stores),"locale"in e&&o(5,$=e.locale),"retouchTools"in e&&o(6,f=e.retouchTools),"retouchToolShapes"in e&&o(7,y=e.retouchToolShapes),"retouchShapeControls"in e&&o(8,b=e.retouchShapeControls),"retouchActiveTool"in e&&o(0,x=e.retouchActiveTool),"retouchWillRenderShapeStyleControls"in e&&o(9,v=e.retouchWillRenderShapeStyleControls),"retouchWillRenderHeaderTools"in e&&o(10,w=e.retouchWillRenderHeaderTools),"retouchWillRenderShapeControls"in e&&o(11,S=e.retouchWillRenderShapeControls),"markupEditorWillStartInteraction"in e&&o(12,k=e.markupEditorWillStartInteraction),"retouchEnableMoveTool"in e&&o(13,C=e.retouchEnableMoveTool),"retouchEnableViewTool"in e&&o(14,T=e.retouchEnableViewTool),"willRenderShapeControls"in e&&o(15,M=e.willRenderShapeControls),"willRenderShapeTextControls"in e&&o(16,P=e.willRenderShapeTextControls),"willRenderHeaderTools"in e&&o(17,R=e.willRenderHeaderTools),"beforeAddShape"in e&&o(18,I=e.beforeAddShape),"beforeRemoveShape"in e&&o(19,E=e.beforeRemoveShape),"beforeDeselectShape"in e&&o(20,A=e.beforeDeselectShape),"beforeSelectShape"in e&&o(21,L=e.beforeSelectShape),"beforeUpdateShape"in e&&o(22,F=e.beforeUpdateShape),"enableMultiSelect"in e&&o(23,z=e.enableMultiSelect)},e.$$.update=()=>{50331648&e.$$.dirty[0]|1920&e.$$.dirty[1]&&o(27,i=e=>vx(e,d,c,s.origin,s.translation,l.rotation.z,s.scale,a,r)),50331648&e.$$.dirty[0]|1920&e.$$.dirty[1]&&o(26,n=e=>xx(e,d,c,s.origin,s.translation,l.rotation.z,s.scale,a,r))},[x,p,h,m,g,$,f,y,b,v,w,S,k,C,T,M,P,R,I,E,A,L,F,z,r,a,n,i,u,D,O,B,W,_,V,N,H,"retouch",s,l,c,d,function(e){x=e,o(0,x)},function(t){da.call(this,e,t)}]}var mv={util:["retouch",class extends Ga{constructor(e){super(),Ua(this,e,hv,pv,lr,{name:37,isActive:1,isActiveFraction:2,isVisible:3,stores:4,locale:5,retouchTools:6,retouchToolShapes:7,retouchShapeControls:8,retouchActiveTool:0,retouchWillRenderShapeStyleControls:9,retouchWillRenderHeaderTools:10,retouchWillRenderShapeControls:11,markupEditorWillStartInteraction:12,retouchEnableMoveTool:13,retouchEnableViewTool:14,willRenderShapeControls:15,willRenderShapeTextControls:16,willRenderHeaderTools:17,beforeAddShape:18,beforeRemoveShape:19,beforeDeselectShape:20,beforeSelectShape:21,beforeUpdateShape:22,enableMultiSelect:23},null,[-1,-1])}get name(){return this.$$.ctx[37]}get isActive(){return this.$$.ctx[1]}set isActive(e){this.$$set({isActive:e}),ka()}get isActiveFraction(){return this.$$.ctx[2]}set isActiveFraction(e){this.$$set({isActiveFraction:e}),ka()}get isVisible(){return this.$$.ctx[3]}set isVisible(e){this.$$set({isVisible:e}),ka()}get stores(){return this.$$.ctx[4]}set stores(e){this.$$set({stores:e}),ka()}get locale(){return this.$$.ctx[5]}set locale(e){this.$$set({locale:e}),ka()}get retouchTools(){return this.$$.ctx[6]}set retouchTools(e){this.$$set({retouchTools:e}),ka()}get retouchToolShapes(){return this.$$.ctx[7]}set retouchToolShapes(e){this.$$set({retouchToolShapes:e}),ka()}get retouchShapeControls(){return this.$$.ctx[8]}set retouchShapeControls(e){this.$$set({retouchShapeControls:e}),ka()}get retouchActiveTool(){return this.$$.ctx[0]}set retouchActiveTool(e){this.$$set({retouchActiveTool:e}),ka()}get retouchWillRenderShapeStyleControls(){return this.$$.ctx[9]}set retouchWillRenderShapeStyleControls(e){this.$$set({retouchWillRenderShapeStyleControls:e}),ka()}get retouchWillRenderHeaderTools(){return this.$$.ctx[10]}set retouchWillRenderHeaderTools(e){this.$$set({retouchWillRenderHeaderTools:e}),ka()}get retouchWillRenderShapeControls(){return this.$$.ctx[11]}set retouchWillRenderShapeControls(e){this.$$set({retouchWillRenderShapeControls:e}),ka()}get markupEditorWillStartInteraction(){return this.$$.ctx[12]}set markupEditorWillStartInteraction(e){this.$$set({markupEditorWillStartInteraction:e}),ka()}get retouchEnableMoveTool(){return this.$$.ctx[13]}set retouchEnableMoveTool(e){this.$$set({retouchEnableMoveTool:e}),ka()}get retouchEnableViewTool(){return this.$$.ctx[14]}set retouchEnableViewTool(e){this.$$set({retouchEnableViewTool:e}),ka()}get willRenderShapeControls(){return this.$$.ctx[15]}set willRenderShapeControls(e){this.$$set({willRenderShapeControls:e}),ka()}get willRenderShapeTextControls(){return this.$$.ctx[16]}set willRenderShapeTextControls(e){this.$$set({willRenderShapeTextControls:e}),ka()}get willRenderHeaderTools(){return this.$$.ctx[17]}set willRenderHeaderTools(e){this.$$set({willRenderHeaderTools:e}),ka()}get beforeAddShape(){return this.$$.ctx[18]}set beforeAddShape(e){this.$$set({beforeAddShape:e}),ka()}get beforeRemoveShape(){return this.$$.ctx[19]}set beforeRemoveShape(e){this.$$set({beforeRemoveShape:e}),ka()}get beforeDeselectShape(){return this.$$.ctx[20]}set beforeDeselectShape(e){this.$$set({beforeDeselectShape:e}),ka()}get beforeSelectShape(){return this.$$.ctx[21]}set beforeSelectShape(e){this.$$set({beforeSelectShape:e}),ka()}get beforeUpdateShape(){return this.$$.ctx[22]}set beforeUpdateShape(e){this.$$set({beforeUpdateShape:e}),ka()}get enableMultiSelect(){return this.$$.ctx[23]}set enableMultiSelect(e){this.$$set({enableMultiSelect:e}),ka()}},({src:e})=>e&&!Zs(e)]};const gv='<g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M18 6L6 18M6 6l12 12"></path></path></g>',$v='<path fill="none" d="M9 15 L12 9 L15 15 M10 13.5 h3" stroke="currentColor" stroke-width=".125em"/>';var fv={labelReset:"Reset",labelDefault:"Default",labelAuto:"Auto",labelNone:"None",labelEdit:"Edit",labelClose:"Close",labelSupportError:"{features} not supported on this browser",labelColor:"Color",labelWidth:"Width",labelSize:"Size",labelOffset:"Offset",labelAmount:"Amount",labelInset:"Inset",labelRadius:"Radius",labelColorPalette:"Color palette",labelSizeExtraSmall:"Extra small",labelSizeSmall:"Small",labelSizeMediumSmall:"Medium small",labelSizeMedium:"Medium",labelSizeMediumLarge:"Medium large",labelSizeLarge:"Large",labelSizeExtraLarge:"Extra large",labelButtonCancel:"Cancel",labelButtonUndo:"Undo",labelButtonRedo:"Redo",labelButtonRevert:"Revert",labelButtonExport:"Done",labelZoom:"Zoom",labelZoomIn:"Zoom in",labelZoomOut:"Zoom out",labelZoomFit:"Fit to view",labelZoomActual:"Actual size",iconZoomIn:'<path stroke="currentColor" stroke-width=".125em" d="M8 12 h8 M12 8 v8" />',iconZoomOut:'<path stroke="currentColor" stroke-width=".125em" d="M9 12 h6" />',iconSupportError:'<g fill="none" stroke="currentColor" stroke-width="2"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/><g><line x1="12" y1="9" x2="12" y2="13"/><line x1="12" y1="17" x2="12.01" y2="17"/></g>',iconButtonClose:gv,iconButtonRevert:'<g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M7.388 18.538a8 8 0 10-2.992-9.03"/><path fill="currentColor" d="M2.794 11.696L2.37 6.714l5.088 3.18z"/><path d="M12 8v4M12 12l4 2"/></g>',iconButtonUndo:'<g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M10 8h4c2.485 0 5 2 5 5s-2.515 5-5 5h-4"/><path fill="currentColor" d="M5 8l4-3v6z"/></g>',iconButtonRedo:'<g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M14 8h-4c-2.485 0-5 2-5 5s2.515 5 5 5h4"/><path fill="currentColor" d="M19 8l-4-3v6z"/></g>',iconButtonExport:'<polyline points="20 6 9 17 4 12" fill="none" stroke="currentColor" stroke-width=".125em"></polyline>',statusLabelButtonClose:"Close",statusIconButtonClose:gv,statusImageLoadNone:"Waiting for image",statusImageLoadMinSize:"Minimum image size is {minWidth} × {minHeight}",statusImageLoadPrepare:"Preparing image…",statusImageLoadBusy:"Loading image…",statusImageLoadError:"Error loading image",statusImageProcessBusy:"Processing image…",statusImageProcessError:"Error processing image",statusImageUploadBusy:"Uploading image…",statusImageUploadError:"Error uploading image"};const yv={shapeLabelButtonSelectSticker:"Select image",shapeIconButtonSelectSticker:'<g fill="none" stroke="currentColor" stroke-width="0.0625em"><path d="M8 21 L15 11 L19 15"/><path d="M15 2 v5 h5"/><path d="M8 2 h8 l4 4 v12 q0 4 -4 4 h-8 q-4 0 -4 -4 v-12 q0 -4 4 -4z"/></g><circle fill="currentColor" cx="10" cy="8" r="1.5"/>',shapeIconButtonFlipHorizontal:'<g stroke="currentColor" stroke-width=".125em"><path fill="none" d="M6 6.5h5v11H6z"/><path fill="currentColor" d="M15 6.5h3v11h-3z"/><path d="M11 4v16" fill="currentColor"/></g>',shapeIconButtonFlipVertical:'<g stroke="currentColor" stroke-width=".125em"><rect x="7" y="8" width="11" height="5" fill="none"/><rect x="7" y="17" width="11" height="2" fill="currentColor"/><line x1="5" y1="13" x2="20" y2="13"/></g>',shapeIconButtonRemove:'<g fill="none" fill-rule="evenodd"><path stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M7.5 7h9z"/><path d="M7.916 9h8.168a1 1 0 01.99 1.14l-.972 6.862a2 2 0 01-1.473 1.653c-.877.23-1.753.345-2.629.345-.876 0-1.752-.115-2.628-.345a2 2 0 01-1.473-1.653l-.973-6.862A1 1 0 017.916 9z" fill="currentColor"/><rect fill="currentColor" x="10" y="5" width="4" height="3" rx="1"/></g>',shapeIconButtonDuplicate:'<g fill="none" fill-rule="evenodd"><path d="M15 13.994V16a2 2 0 01-2 2H8a2 2 0 01-2-2v-5a2 2 0 012-2h2.142" stroke="currentColor" stroke-width=".125em"/><path d="M15 9V8a1 1 0 00-2 0v1h-1a1 1 0 000 2h1v1a1 1 0 002 0v-1h1a1 1 0 000-2h-1zm-4-4h6a2 2 0 012 2v6a2 2 0 01-2 2h-6a2 2 0 01-2-2V7a2 2 0 012-2z" fill="currentColor"/></g>',shapeIconButtonMoveToFront:'<g fill="none" fill-rule="evenodd"><rect fill="currentColor" x="11" y="13" width="8" height="2" rx="1"/><rect fill="currentColor" x="9" y="17" width="10" height="2" rx="1"/><path d="M11.364 8H10a5 5 0 000 10M12 6.5L14.5 8 12 9.5z" stroke="currentColor" stroke-width=".125em" stroke-linecap="round"/></g>',shapeIconButtonTextLayoutAutoWidth:""+$v,shapeIconButtonTextLayoutAutoHeight:'<g fill="currentColor"><circle cx="4" cy="12" r="1.5"/><circle cx="20" cy="12" r="1.5"/></g>'+$v,shapeIconButtonTextLayoutFixedSize:'<g fill="currentColor"><circle cx="5" cy="6" r="1.5"/><circle cx="19" cy="6" r="1.5"/><circle cx="19" cy="19" r="1.5"/><circle cx="5" cy="19" r="1.5"/></g>'+$v,shapeTitleButtonTextLayoutAutoWidth:"Auto width",shapeTitleButtonTextLayoutAutoHeight:"Auto height",shapeTitleButtonTextLayoutFixedSize:"Fixed size",shapeTitleButtonFlipHorizontal:"Flip Horizontal",shapeTitleButtonFlipVertical:"Flip Vertical",shapeTitleButtonRemove:"Remove",shapeTitleButtonDuplicate:"Duplicate",shapeTitleButtonMoveToFront:"Move to front",shapeLabelInputText:"Edit text",shapeIconInputCancel:'<g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M18 6L6 18M6 6l12 12"/></g>',shapeIconInputConfirm:'<g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><polyline points="20 6 9 17 4 12"/></g>',shapeLabelInputCancel:"Cancel",shapeLabelInputConfirm:"Confirm",shapeLabelStrokeNone:"No outline",shapeLabelFontStyleNormal:"Normal",shapeLabelFontStyleBold:"Bold",shapeLabelFontStyleItalic:"Italic",shapeLabelFontStyleItalicBold:"Bold Italic",shapeTitleBackgroundColor:"Fill color",shapeTitleCornerRadius:"Corner radius",shapeTitleFontFamily:"Font",shapeTitleFontSize:"Font size",shapeTitleFontStyle:"Font style",shapeTitleLineHeight:"Line height",shapeTitleLineStart:"Start",shapeTitleLineEnd:"End",shapeTitleStrokeWidth:"Line width",shapeTitleStrokeColor:"Line color",shapeTitleLineDecorationBar:"Bar",shapeTitleLineDecorationCircle:"Circle",shapeTitleLineDecorationSquare:"Square",shapeTitleLineDecorationArrow:"Arrow",shapeTitleLineDecorationCircleSolid:"Circle solid",shapeTitleLineDecorationSquareSolid:"Square solid",shapeTitleLineDecorationArrowSolid:"Arrow solid",shapeIconLineDecorationBar:'<g stroke="currentColor" stroke-linecap="round" stroke-width=".125em"><path d="M5,12 H16"/><path d="M16,8 V16"/></g>',shapeIconLineDecorationCircle:'<g stroke="currentColor" stroke-linecap="round"><path stroke-width=".125em" d="M5,12 H12"/><circle fill="none" stroke-width=".125em" cx="16" cy="12" r="4"/></g>',shapeIconLineDecorationSquare:'<g stroke="currentColor" stroke-linecap="round"><path stroke-width=".125em" d="M5,12 H12"/><rect fill="none" stroke-width=".125em" x="12" y="8" width="8" height="8"/></g>',shapeIconLineDecorationArrow:'<g stroke="currentColor" stroke-linecap="round" stroke-width=".125em"><path d="M5,12 H16 M13,7 l6,5 l-6,5" fill="none"/></g>',shapeIconLineDecorationCircleSolid:'<g stroke="currentColor" stroke-linecap="round"><path stroke-width=".125em" d="M5,12 H12"/><circle fill="currentColor" cx="16" cy="12" r="4"/></g>',shapeIconLineDecorationSquareSolid:'<g stroke="currentColor" stroke-linecap="round"><path stroke-width=".125em" d="M5,12 H12"/><rect fill="currentColor" x="12" y="8" width="8" height="8"/></g>',shapeIconLineDecorationArrowSolid:'<g stroke="currentColor" stroke-linecap="round" stroke-width=".125em"><path d="M5,12 H16"/><path d="M13,7 l6,5 l-6,5z" fill="currentColor"/></g>',shapeTitleColorTransparent:"Transparent",shapeTitleColorWhite:"White",shapeTitleColorSilver:"Silver",shapeTitleColorGray:"Gray",shapeTitleColorBlack:"Black",shapeTitleColorNavy:"Navy",shapeTitleColorBlue:"Blue",shapeTitleColorAqua:"Aqua",shapeTitleColorTeal:"Teal",shapeTitleColorOlive:"Olive",shapeTitleColorGreen:"Green",shapeTitleColorYellow:"Yellow",shapeTitleColorOrange:"Orange",shapeTitleColorRed:"Red",shapeTitleColorMaroon:"Maroon",shapeTitleColorFuchsia:"Fuchsia",shapeTitleColorPurple:"Purple",shapeTitleTextOutline:"Text outline",shapeTitleTextOutlineWidth:"Width",shapeTitleTextShadow:"Text shadow",shapeTitleTextShadowBlur:"Blur",shapeTitleTextColor:"Font color",shapeTitleTextAlign:"Text align",shapeTitleTextAlignLeft:"Left align text",shapeTitleTextAlignCenter:"Center align text",shapeTitleTextAlignRight:"Right align text",shapeIconTextAlignLeft:'<g stroke-width=".125em" stroke="currentColor"><line x1="5" y1="8" x2="15" y2="8"/><line x1="5" y1="12" x2="19" y2="12"/><line x1="5" y1="16" x2="14" y2="16"/></g>',shapeIconTextAlignCenter:'<g stroke-width=".125em" stroke="currentColor"><line x1="7" y1="8" x2="17" y2="8"/><line x1="5" y1="12" x2="19" y2="12"/><line x1="8" y1="16" x2="16" y2="16"/></g>',shapeIconTextAlignRight:'<g stroke-width=".125em" stroke="currentColor"><line x1="9" y1="8" x2="19" y2="8"/><line x1="5" y1="12" x2="19" y2="12"/><line x1="11" y1="16" x2="19" y2="16"/></g>',shapeLabelToolMove:"Move",shapeLabelToolView:"View",shapeLabelToolSharpie:"Sharpie",shapeLabelToolEraser:"Eraser",shapeLabelToolPath:"Path",shapeLabelToolRectangle:"Rectangle",shapeLabelToolEllipse:"Ellipse",shapeLabelToolArrow:"Arrow",shapeLabelToolLine:"Line",shapeLabelToolText:"Text",shapeLabelToolPreset:"Stickers",shapeIconToolView:'<g stroke-width=".125em" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path d="M10.98 9.703V2.567c0-1.19 1.19-1.785 1.784-1.785.595 0 1.784.595 1.784 1.785v3.568"/><path d="M14.548 9.703V4.35c0-1.19 1.19-1.784 1.784-1.784.595 0 1.784.594 1.784 1.784v2.973"/><path d="M18.116 10.244V7.271c0-1.19 1.19-1.784 1.784-1.784.595 0 1.785.595 1.785 1.784 0 1.19 0 8.92-1.19 12.488-1.19 3.569-10.704 4.758-13.678 0-2.973-4.757-2.973-4.757-4.163-6.541-1.189-1.784-1.153-2.974-.594-3.568.558-.595 1.784-1.19 2.973.594 1.277 1.916 2.07 2.907 2.379 2.974V5.487c0-1.19 1.19-1.784 1.784-1.784.595 0 1.784.595 1.784 1.784V8.46"/></g>',shapeIconToolMove:'<g stroke-width=".125em" stroke="currentColor" fill="none"><path d="M6 2 L6 19 L18 13 Z M13 18 L16 24" stroke="currentColor" stroke-width=".125em" fill="none" fill-rule="evenodd" stroke-linejoin="round"/></g>',shapeIconToolSharpie:'<g stroke-width=".125em" stroke="currentColor" fill="none"><path d="M2.025 5c5.616-2.732 8.833-3.857 9.65-3.374C12.903 2.351.518 12.666 2.026 14 3.534 15.334 16.536.566 17.73 2.566 18.924 4.566 3.98 17.187 4.831 18c.851.813 9.848-6 11.643-6 1.087 0-2.53 5.11-2.92 7-.086.41 3.323-1.498 4.773-1 .494.17.64 2.317 1.319 3 .439.443 1.332.776 2.679 1" stroke="currentColor" stroke-width=".125em" fill="none" fill-rule="evenodd" stroke-linejoin="round"/></g>',shapeIconToolEraser:'<g stroke-width=".125em" stroke="currentColor" stroke-linecap="round" fill="none"><g transform="translate(3, 15) rotate(-45)"><rect x="0" y="0" width="18" height="10" rx="3"/></g><line x1="11" y1="21" x2="18" y2="21"/><line x1="20" y1="21" x2="22" y2="21"/></g>',shapeIconToolPath:'<g stroke-width=".125em" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" fill="none"><circle cx="21" cy="3" r="2"/><circle cx="9" cy="9" r="2"/><circle cx="3" cy="21" r="2"/><path d="M19 4 11 8 M8 11 4 19"/></g>',shapeIconToolRectangle:'<g stroke-width=".125em" stroke="currentColor" fill="none"><rect x="1" y="1" width="22" height="22" rx="4"/></g>',shapeIconToolEllipse:'<g stroke-width=".125em" stroke="currentColor" fill="none"><circle cx="12" cy="12" r="11"/></g>',shapeIconToolArrow:'<g stroke-width=".125em" stroke="currentColor" fill="none"><line x1="20" y1="3" x2="6" y2="21"/><path d="m10 6 L21.5 1 L20 13.5" fill="currentColor" stroke="none"/></g>',shapeIconToolLine:'<g stroke-width=".125em" stroke="currentColor" fill="none"><line x1="20" y1="3" x2="6" y2="21"/></g>',shapeIconToolText:'<g stroke="none" fill="currentColor" transform="translate(6,0)"><path d="M8.14 20.085c.459 0 .901-.034 1.329-.102a8.597 8.597 0 001.015-.21v1.984c-.281.135-.695.247-1.242.336a9.328 9.328 0 01-1.477.133c-3.312 0-4.968-1.745-4.968-5.235V6.804H.344v-1.25l2.453-1.078L3.89.819h1.5v3.97h4.97v2.015H5.39v10.078c0 1.031.245 1.823.735 2.375s1.161.828 2.015.828z"/>',shapeIconToolPreset:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M12 22c2.773 0 1.189-5.177 3-7 1.796-1.808 7-.25 7-3 0-5.523-4.477-10-10-10S2 6.477 2 12s4.477 10 10 10z"></path><path d="M20 17c-3 3-5 5-8 5"></path></g>',shapeTitleSelectionMode:"Selection mode",shapeTitleBrushSize:"Brush size",shapeLabelSelectionModeNew:"New",shapeLabelSelectionModeAdd:"Add",shapeLabelSelectionModeSubtract:"Remove",shapeLabelToolSelectionBrush:"Brush",shapeLabelToolSelectionLassoo:"Lassoo",shapeLabelToolSelectionRectangle:"Rectangle marquee",shapeLabelToolSelectionEllipse:"Ellipse marquee",shapeIconSelectionModeNew:'<g fill="none" fill-rule="evenodd" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="M6.5 17H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v1.5"/><rect width="12" height="12" x="9" y="9" fill="currentColor" fill-opacity=".25" rx="2"/></g>',shapeIconSelectionModeAdd:'<g fill="none" fill-rule="evenodd" stroke="currentColor"><path fill="currentColor" fill-opacity=".25" stroke-linecap="round" stroke-linejoin="round" d="M15 3a2 2 0 0 1 2 2v4h2a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-8a2 2 0 0 1-2-2v-2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h10Z"/><path d="M13 15h4M15 13v4"/></g>',shapeIconSelectionModeSubtract:'<g fill="none" fill-rule="evenodd" stroke="currentColor"><path fill="currentColor" fill-opacity=".25" stroke-linecap="round" stroke-linejoin="round" d="M15 3a2 2 0 0 1 2 2v4h-6a2 2 0 0 0-1.995 1.85L9 11v6H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h10Z"/><rect width="12" height="12" x="9" y="9" stroke-linecap="round" stroke-linejoin="round" rx="2"/><path d="M13 15h4"/></g>',shapeIconToolSelectionBrush:'<g stroke-width=".125em" stroke="currentColor" fill="none"><path d="M2.025 5c5.616-2.732 8.833-3.857 9.65-3.374C12.903 2.351.518 12.666 2.026 14 3.534 15.334 16.536.566 17.73 2.566 18.924 4.566 3.98 17.187 4.831 18c.851.813 9.848-6 11.643-6 1.087 0-2.53 5.11-2.92 7-.086.41 3.323-1.498 4.773-1 .494.17.64 2.317 1.319 3 .439.443 1.332.776 2.679 1" stroke="currentColor" fill-rule="evenodd" stroke-linejoin="round"/></g>',shapeIconToolSelectionLassoo:'<g fill="none" fill-rule="evenodd" stroke-width=".125em" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M11.428 17.702a18.46 18.46 0 0 0 4.085-1.595c5.851-3.112 9.019-8.599 7.074-12.256-1.945-3.657-8.265-4.1-14.116-.988C2.619 5.974-.55 11.46 1.396 15.118c.63 1.186 1.72 2.033 3.105 2.532"/><ellipse cx="8" cy="18.5" rx="3.5" ry="2.833" transform="rotate(-15 8 18.5)"/><path stroke-linecap="round" d="M5 18c3.347 1.048 5.514 1.881 6.5 2.5.859.54 1.517.994 1.5 2.364"/></g>',shapeIconToolSelectionRectangle:'<g stroke-width=".125em" stroke="currentColor"><path d="M9 1 h6 m4 0 h4v4 m0 4 v6 m0 4 v4h-4 m-4 0 h-6 m-4 0 h-4v-4 m0 -4 v-6 m0 -4 v-4h4" fill="none" /></g>',shapeIconToolSelectionEllipse:'<path stroke-width=".125em" stroke="currentColor" d="M1.21 9.853a11.054 11.054 0 0 0 0 4.294m1.643 3.965a11.054 11.054 0 0 0 3.035 3.035m3.965 1.644a11.054 11.054 0 0 0 4.294 0m3.965-1.644a11.054 11.054 0 0 0 3.035-3.035m1.644-3.965a11.054 11.054 0 0 0 0-4.294m-1.644-3.965a11.054 11.054 0 0 0-3.035-3.035m-3.965-1.644a11.054 11.054 0 0 0-4.294 0M5.888 2.853a11.054 11.054 0 0 0-3.035 3.035"/>'};var bv={cropLabel:"Crop",cropIcon:'<g stroke-width=".125em" stroke="currentColor" fill="none"><path d="M23 17H9a2 2 0 0 1-2-2v-5m0-3V1 M1 7h14a2 2 0 0 1 2 2v7m0 4v3"/></g>',cropIconButtonRecenter:'<path stroke="currentColor" fill="none" stroke-width="2" stroke-linejoin="bevel" d="M1.5 7.5v-6h6M1.5 16.5v6h6M22.5 16.5v6h-6M22.5 7.5v-6h-6"/><circle cx="12" cy="12" r="3.5" fill="currentColor" stroke="none"/>',cropIconButtonRotateLeft:'<g stroke="none" fill="currentColor"><path fill="none" d="M-1-1h582v402H-1z"/><rect x="3" rx="1" height="12" width="12" y="9"/><path d="M15 5h-1a5 5 0 015 5 1 1 0 002 0 7 7 0 00-7-7h-1.374l.747-.747A1 1 0 0011.958.84L9.603 3.194a1 1 0 000 1.415l2.355 2.355a1 1 0 001.415-1.414l-.55-.55H15z"/></g>',cropIconButtonRotateRight:'<g stroke="none" fill="currentColor"><path fill="none" d="M-1-1h582v402H-1z"/><path d="M11.177 5H10a5 5 0 00-5 5 1 1 0 01-2 0 7 7 0 017-7h1.374l-.747-.747A1 1 0 0112.042.84l2.355 2.355a1 1 0 010 1.415l-2.355 2.354a1 1 0 01-1.415-1.414l.55-.55z"/><rect rx="1" height="12" width="12" y="9" x="9"/></g>',cropIconButtonFlipVertical:'<g stroke="none" fill="currentColor"><path d="M19.993 12.143H7a1 1 0 0 1-1-1V5.994a1 1 0 0 1 1.368-.93l12.993 5.15a1 1 0 0 1-.368 1.93z"/><path d="M19.993 14a1 1 0 0 1 .368 1.93L7.368 21.078A1 1 0 0 1 6 20.148V15a1 1 0 0 1 1-1h12.993z" opacity=".6"/></g>',cropIconButtonFlipHorizontal:'<g stroke="none" fill="currentColor"><path d="M11.93 7.007V20a1 1 0 0 1-1 1H5.78a1 1 0 0 1-.93-1.368l5.15-12.993a1 1 0 0 1 1.929.368z"/><path d="M14 7.007V20a1 1 0 0 0 1 1h5.149a1 1 0 0 0 .93-1.368l-5.15-12.993A1 1 0 0 0 14 7.007z" opacity=".6"/></g>',cropIconSelectPreset:'<g fill="currentColor">\n <rect opacity="{a}" x="2" y="4" width="10" height="18" rx="1"/>\n <rect opacity="{b}" x="4" y="8" width="14" height="14" rx="1"/>\n <rect opacity="{c}" x="6" y="12" width="17" height="10" rx="1"/>\n </g>',cropIconCropBoundary:'<g fill="currentColor">\n <rect opacity="{a}" x="2" y="3" width="20" height="20" rx="1"/>\n <rect opacity="{b}" x="7" y="8" width="10" height="10" rx="1"/>\n <rect opacity="{c}" x="4" y="8" width="14" height="14" rx="1"/>\n <rect opacity="{d}" x="12" y="4" width="10" height="10" rx="1"/>\n </g>',cropLabelButtonRecenter:"Recenter",cropLabelButtonRotateLeft:"Rotate left",cropLabelButtonRotateRight:"Rotate right",cropLabelButtonFlipHorizontal:"Flip horizontal",cropLabelButtonFlipVertical:"Flip vertical",cropLabelSelectPreset:"Crop shape",cropLabelCropBoundary:"Crop boundary",cropLabelCropBoundaryEdge:"Edge of image",cropLabelCropBoundaryNone:"None",cropLabelTabRotation:"Rotation",cropLabelTabZoom:"Scale"},xv={fillLabel:"Fill",fillIcon:'\n <g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em">\n <g transform="rotate(60, 12, 12)">\n <rect x="4" y="4" width="14" height="16" rx="3"/>\n </g>\n <path d="M21 13 L21 21"></path>\n <path d="M4.5 12.5 L19 12.5"></path>\n </g>\n '},vv={resizeLabel:"Resize",resizeIcon:'<g stroke-width=".125em" stroke="currentColor" fill="none"><rect x="2" y="12" width="10" height="10" rx="2"/><path d="M4 11.5V4a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-5.5"/><path d="M14 10l3.365-3.365M14 6h4v4"/></g>',resizeLabelFormCaption:"Image output size",resizeLabelInputWidth:"w",resizeTitleInputWidth:"Width",resizeLabelInputHeight:"h",resizeTitleInputHeight:"Height",resizeTitleButtonMaintainAspectRatio:"Maintain aspectratio",resizeIconButtonMaintainAspectRatio:'<defs><mask id="mask1" x="-2" y="-2" width="24" height="24"><rect x="0" y="0" width="24" height="10" fill="#fff" stroke="none"/></mask></defs><g fill="none" fill-rule="evenodd"><g mask="url(#mask1)"><path transform="translate(0 {activeFraction})" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" d="M9.401 10.205v-.804a2.599 2.599 0 0 1 5.198 0V17"/></g><rect fill="currentColor" x="7" y="10" width="10" height="7" rx="1.5"/></g>'},wv={frameLabel:"Frame",frameIcon:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em">\n <rect x="2" y="2" width="20" height="20" rx="4"/>\n <rect x="6" y="6" width="12" height="12" rx="1"/>\n </g>',frameLabelMatSharp:"Mat",frameLabelMatRound:"Bevel",frameLabelLineSingle:"Line",frameLabelLineMultiple:"Zebra",frameLabelEdgeSeparate:"Inset",frameLabelEdgeOverlap:"Plus",frameLabelEdgeCross:"Lumber",frameLabelCornerHooks:"Hook",frameLabelPolaroid:"Polaroid"},Sv={redactLabel:"Redact",redactIcon:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M 4 5 l 1 -1"/><path d="M 4 10 l 6 -6"/><path d="M 4 15 l 11 -11"/><path d="M 4 20 l 16 -16"/><path d="M 9 20 l 11 -11"/><path d="M 14 20 l 6 -6"/><path d="M 19 20 l 1 -1"/></g>'},kv={retouchLabel:"Retouch",retouchIcon:'\n <g fill="none" fill-rule="evenodd"><path fill="currentColor" d="m17 6-2-1-2 1 1-2-1-2 2 1 2-1-1 2zM5.5 5.5 3 4 .5 5.5 2 3 .5.5 3 2 5.5.5 4 3zM9 21l-3-1.5L3 21l1.5-3L3 15l3 1.5L9 15l-1.5 3z"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m9.266 6.705 13.529 13.529c-.071.78-.34 1.371-.765 1.796-.425.425-1.015.694-1.796.765h0L6.705 9.266c.071-.78.34-1.371.765-1.796.425-.425 1.015-.694 1.796-.765h0Z"/><path stroke="currentColor" stroke-width="1.5" d="M12 9.5c-.657.323-1.157.657-1.5 1-.343.343-.677.843-1 1.5"/></g>\n '},Cv=(e,t)=>{const o=Object.getOwnPropertyDescriptors(e);Object.keys(o).forEach((i=>{o[i].get?Object.defineProperty(t,i,{get:()=>e[i],set:t=>e[i]=t}):t[i]=e[i]}))},Tv=e=>{const t={},{sub:o,pub:i}=Qo();d()&&null!==document.doctype||console.warn("Browser is in quirks mode, add <!DOCTYPE html> to page to fix render issues");const n=zs();Cv(n,t);const a=((e,t)=>{const o={},i=new Map,n=new Gm({target:e,props:{stores:t,pluginComponents:Array.from(Qm)}});let r=!1;const a=()=>{r||(d()&&window.removeEventListener("pagehide",a),n&&(r=!0,n.$destroy()))};function s(e,t){return i.get(e)===t||(i.set(e,t),!1)}qm||(qm=new Set($d(Gm).filter((e=>!Xm.includes(e))))),qm.forEach((e=>{Object.defineProperty(o,e,{get:()=>n[e],set:Ym.includes(e)?t=>{s(e,t)||(n[e]={...n[e],...t})}:t=>{s(e,t)||(n[e]=t)}})})),Object.defineProperty(o,"previewImageData",{get:()=>n.imagePreviewCurrent}),Km.forEach((e=>{const t=Jm[e],i=t[0];Object.defineProperty(o,e,{get:()=>n.pluginInterface[i][e],set:o=>{if(s(e,o))return;const i=t.reduce(((t,i)=>(t[i]={...n.pluginOptions[i],[e]:o},t)),{});n.pluginOptions={...n.pluginOptions,...i}}})})),Object.defineProperty(o,"element",{get:()=>n.root,set:()=>{}});const l=n.history;return ss(o,{on:(e,t)=>{if(r)return()=>{};if(/undo|redo|revert|writehistory/.test(e))return l.on(e,t);const o=[n.sub(e,t),n.$on(e,(e=>t(e instanceof CustomEvent&&!e.detail?void 0:e)))].filter(Boolean);return()=>o.forEach((e=>e()))},updateImagePreview:e=>{n.imagePreviewSrc=e},close:()=>!r&&n.pub("close"),destroy:a}),Object.defineProperty(o,"history",{get:()=>({undo:()=>l.undo(),redo:()=>l.redo(),revert:()=>l.revert(),get:()=>l.get(),getCollapsed:()=>l.get().splice(0,l.index+1),set:e=>l.set(e),write:e=>l.write(e),get length(){return l.length()},get index(){return l.index},set index(e){l.index=e}})}),d()&&window.addEventListener("pagehide",a),o})(e,n.stores);Cv(a,t);const s=["loadImage","processImage","abortProcessImage","abortLoadImage"].map((e=>a.on(e,(t=>{const o=n[e](t&&t.detail);o instanceof Promise&&o.catch(r)})))),l=(e,t)=>{const i=o(e,t),r=n.on(e,t),s=a.on(e,t);return()=>{i(),r(),s()}};t.handleEvent=r;const c=tg.map((e=>l(e,(o=>t.handleEvent(e,o)))));return ss(t,{on:l,updateImage:e=>new Promise(((o,i)=>{const r=t.history.get(),a=t.history.index,s=t.imageState;n.loadImage(e).then((e=>{t.history.set(r),t.history.index=a,t.imageState=s,o(e)})).catch(i)})),close:()=>{i("close")},destroy:()=>{[...s,...c].forEach((e=>e())),a.destroy(),n.destroy(),i("destroy")}}),setTimeout((()=>i("init",t)),0),t};const Mv="pintura-editor";var Pv=()=>new Promise((e=>{if(!Rv)return e([]);var t;t=Mv,document.createElement(t).constructor===HTMLElement&&customElements.define(Mv,Rv),customElements.whenDefined(Mv).then((()=>e(document.querySelectorAll(Mv))))}));const Rv=d()&&class extends HTMLElement{constructor(){super(),this._editor=void 0,this._unsubs=void 0}static get observedAttributes(){return["src"]}attributeChangedCallback(e,t,o){this[e]=o}connectedCallback(){this._editor=Tv(this),Cv(this._editor,this),this._editor.src=this.getAttribute("src"),this._unsubs=og(this._editor,this)}disconnectedCallback(){this._editor.destroy(),this._unsubs.forEach((e=>e()))}},Iv="pintura-editor";var Ev=(e,t={})=>{const o=m(e)?document.querySelector(e):e;if(!jt(o))return;t.class=t.class?"pintura-editor "+t.class:Iv;const i=Tv(o);return Object.assign(i,t)};const{document:Av,window:Lv}=za;function Fv(e){let t,o,i,n;return ba(e[30]),{c(){t=Or(),o=Fr("div"),Nr(o,"class",e[4]),Nr(o,"aria-modal","true"),Nr(o,"aria-label","Pintura"),Nr(o,"role","dialog"),Nr(o,"tabindex","-1"),Zr(o,"--editor-modal",1),Zr(o,"--viewport-pad-footer",e[5]),Zr(o,"opacity",e[7]),Zr(o,"height",e[6])},m(r,a){Ar(r,t,a),Ar(r,o,a),e[31](o),i||(n=[Wr(Lv,"keydown",e[13]),Wr(Lv,"orientationchange",e[14]),Wr(Lv,"resize",e[30]),Wr(Av.body,"focusin",(function(){sr(!e[1]&&e[10])&&(!e[1]&&e[10]).apply(this,arguments)})),Wr(Av.body,"focusout",(function(){sr(e[2]&&e[11])&&(e[2]&&e[11]).apply(this,arguments)})),Wr(Av.body,"keydown",e[9]),Wr(o,"wheel",e[12],{passive:!1})],i=!0)},p(t,i){e=t,16&i[0]&&Nr(o,"class",e[4]),32&i[0]&&Zr(o,"--viewport-pad-footer",e[5]),128&i[0]&&Zr(o,"opacity",e[7]),64&i[0]&&Zr(o,"height",e[6])},i:tr,o:tr,d(r){r&&Lr(t),r&&Lr(o),e[31](null),i=!1,ar(n)}}}function zv(e,t,o){let i,n,r,a,s,l,c,u,p;const h=sa();let{root:m}=t,{preventZoomViewport:g=!0}=t,{preventScrollBodyIfNeeded:f=!0}=t,{preventFooterOverlapIfNeeded:y=!0}=t,{preventModalAutoFocus:b=!1}=t,{class:x}=t,v=!0,w=!1,S=!1,k=d()&&document.documentElement,C=d()&&document.body,T=d()&&document.head;const M=xc(0,{precision:.001,damping:.5});hr(e,M,(e=>o(29,p=e)));const P=M.subscribe((e=>{S&&e>=1?(o(23,S=!1),o(1,v=!1),h("show")):w&&e<=0&&(o(22,w=!1),o(1,v=!0),h("hide"))}));let R=!1,I=void 0,E=void 0,A=void 0;const L=()=>document.querySelector("meta[name=viewport]"),F=()=>Array.from(document.querySelectorAll("meta[name=theme-color]")),z=e=>"radio"===e.type?Array.from(m.querySelectorAll(`input[name="${e.name}"]`)):[e];let D;const O=(e,t)=>{const o=()=>{e()?t():requestAnimationFrame(o)};requestAnimationFrame(o)};let B,W,_=0,V=void 0;const N=()=>{W||(W=$("div",{style:"position:fixed;height:100vh;top:0"}),C.append(W))};na((()=>{b||m.focus(),y&&vo()&&N()})),ra((()=>{W&&(o(25,V=W.offsetHeight),W.remove(),W=void 0)}));let H=void 0;const j=()=>k.style.setProperty("--pintura-document-height",window.innerHeight+"px");return aa((()=>{k.classList.remove("PinturaModalBodyLock"),P()})),e.$$set=e=>{"root"in e&&o(0,m=e.root),"preventZoomViewport"in e&&o(15,g=e.preventZoomViewport),"preventScrollBodyIfNeeded"in e&&o(16,f=e.preventScrollBodyIfNeeded),"preventFooterOverlapIfNeeded"in e&&o(17,y=e.preventFooterOverlapIfNeeded),"preventModalAutoFocus"in e&&o(18,b=e.preventModalAutoFocus),"class"in e&&o(19,x=e.class)},e.$$.update=()=>{549453826&e.$$.dirty[0]&&o(28,i=S||w?p:v?0:1),32768&e.$$.dirty[0]&&(n="width=device-width,height=device-height,initial-scale=1"+(g?",maximum-scale=1,user-scalable=0":"")),12582914&e.$$.dirty[0]&&o(26,r=!S&&!v&&!w),12&e.$$.dirty[0]&&(R||o(24,B=_)),268435456&e.$$.dirty[0]&&o(7,a=i),16777216&e.$$.dirty[0]&&o(6,s=B+"px"),33554440&e.$$.dirty[0]&&o(5,l=Oo(V)?"--viewport-pad-footer:"+(V>_?0:1):void 0),524288&e.$$.dirty[0]&&o(4,c=Xc(["pintura-editor","PinturaModal",x])),65536&e.$$.dirty[0]&&o(27,u=f&&vo()&&/15_/.test(navigator.userAgent)),201326592&e.$$.dirty[0]&&u&&(e=>{e?(H=window.scrollY,k.classList.add("PinturaDocumentLock"),j(),window.addEventListener("resize",j)):(window.removeEventListener("resize",j),k.classList.remove("PinturaDocumentLock"),Oo(H)&&window.scrollTo(0,H),H=void 0)})(r)},[m,v,R,_,c,l,s,a,M,e=>{if("Tab"!==e.key)return;const t=document.activeElement,o=m.querySelectorAll('button:not([disabled]),textarea:not([disabled]),input:not([disabled]),select:not([disabled]),[tabindex="0"]'),i=z(o[0]),n=z(o[o.length-1]);let r;e.shiftKey&&i.includes(t)?r=n[0]:!e.shiftKey&&n.includes(t)&&(r=i[0]),r&&(r.focus(),e.preventDefault())},e=>{_d(e.target)&&(o(2,R=!0),D=_)},e=>{if(_d(e.target))if(clearTimeout(undefined),D===_)o(2,R=!1);else{const e=_;O((()=>_!==e),(()=>o(2,R=!1)))}},e=>{e.target&&/PinturaStage/.test(e.target.className)&&e.preventDefault()},e=>{const{key:t}=e;if(!/escape/i.test(t))return;const o=e.target;if(o&&/input|textarea/i.test(o.nodeName))return;const i=document.querySelectorAll(".PinturaModal");i[i.length-1]===m&&h("close")},N,g,f,y,b,x,()=>{if(S||!v)return;o(23,S=!0);const e=L()||$("meta",{name:"viewport"});I=!I&&e.getAttribute("content"),e.setAttribute("content",n+(/cover/.test(I)?",viewport-fit=cover":"")),e.parentNode||T.append(e);const t=getComputedStyle(m).getPropertyValue("--color-background"),i=F();if(i.length)E=i.map((e=>e.getAttribute("content")));else{const e=$("meta",{name:"theme-color"});T.append(e),i.push(e)}i.forEach((e=>e.setAttribute("content",`rgb(${t})`))),clearTimeout(A),A=setTimeout((()=>M.set(1)),250)},()=>{if(w||v)return;clearTimeout(A),o(22,w=!0);const e=L();I?e.setAttribute("content",I):e.remove();const t=F();E?t.forEach(((e,t)=>{e.setAttribute("content",E[t])})):t.forEach((e=>e.remove())),M.set(0)},w,S,B,V,r,u,i,p,function(){o(3,_=Lv.innerHeight)},function(e){pa[e?"unshift":"push"]((()=>{m=e,o(0,m)}))}]}class Dv extends Ga{constructor(e){super(),Ua(this,e,zv,Fv,lr,{root:0,preventZoomViewport:15,preventScrollBodyIfNeeded:16,preventFooterOverlapIfNeeded:17,preventModalAutoFocus:18,class:19,show:20,hide:21},null,[-1,-1])}get root(){return this.$$.ctx[0]}set root(e){this.$$set({root:e}),ka()}get preventZoomViewport(){return this.$$.ctx[15]}set preventZoomViewport(e){this.$$set({preventZoomViewport:e}),ka()}get preventScrollBodyIfNeeded(){return this.$$.ctx[16]}set preventScrollBodyIfNeeded(e){this.$$set({preventScrollBodyIfNeeded:e}),ka()}get preventFooterOverlapIfNeeded(){return this.$$.ctx[17]}set preventFooterOverlapIfNeeded(e){this.$$set({preventFooterOverlapIfNeeded:e}),ka()}get preventModalAutoFocus(){return this.$$.ctx[18]}set preventModalAutoFocus(e){this.$$set({preventModalAutoFocus:e}),ka()}get class(){return this.$$.ctx[19]}set class(e){this.$$set({class:e}),ka()}get show(){return this.$$.ctx[20]}get hide(){return this.$$.ctx[21]}}const Ov=(e,t,o,i)=>{const n=me(t.x-e.x,t.y-e.y),r=xe(n),a=5*o;let s;s=i?.5*a:Math.ceil(.5*(a-1));const l=Me($e(r),s);return{anchor:$e(e),offset:l,normal:r,solid:i,size:a,sizeHalf:s}},Bv=(e,t,o)=>{const{strokeWidth:i,strokeColor:n,strokeJoin:r,strokeCap:a,...s}=e,{anchor:l,offset:c,normal:d,solid:u,size:p,sizeHalf:h}=t,m=l.x,g=l.y,$=Me($e(d),p),f=me(m+$.x,g+$.y);if(Me($,.55),u){ke(o,c);const e=Me($e(d),.5*h);return[{...s,points:[me(m-e.x,g-e.y),me(f.x-$.y,f.y+$.x),me(f.x+$.y,f.y-$.x)],pathClose:!0,backgroundColor:n}]}{const e=Me((e=>{const t=e.x;return e.x=-e.y,e.y=t,e})($e(d)),.5),t=me(m-e.x,g-e.y),o=me(m+e.x,g+e.y);return[{...s,points:[me(f.x+$.y,f.y-$.x),t,me(m,g),o,me(f.x-$.y,f.y+$.x)],pathClose:!1,strokeWidth:i,strokeColor:n,strokeJoin:r,strokeCap:a}]}},Wv=(e,t,o)=>{const{strokeWidth:i,strokeColor:n,...r}=e,{anchor:a,solid:s,offset:l,normal:c,sizeHalf:d}=t;return ke(o,l),s&&ke(o,fe($e(c))),[{...r,x:a.x,y:a.y,rx:d,ry:d,backgroundColor:s?n:void 0,strokeWidth:s?void 0:i,strokeColor:s?void 0:n}]},_v=(e,t)=>{const{strokeWidth:o,strokeColor:i,strokeJoin:n,strokeCap:r,...a}=e,{anchor:s,offset:l}=t;return[{...a,points:[me(s.x-l.y,s.y+l.x),me(s.x+l.y,s.y-l.x)],strokeWidth:o,strokeColor:i,strokeJoin:n,strokeCap:r}]},Vv=(e,t,o)=>{const{strokeWidth:i,strokeColor:n,...r}=e,{anchor:a,solid:s,offset:l,normal:c,sizeHalf:d}=t;return ke(o,l),[{...r,x:a.x-d,y:a.y-d,width:2*d,height:2*d,rotation:(u=c,Math.atan2(u.y,u.x)),backgroundColor:s?n:void 0,strokeWidth:s?void 0:i,strokeColor:s?void 0:n}];var u},Nv=(e={})=>t=>{if(!t.lineStart&&!t.lineEnd)return;const o=[],{x1:i,y1:n,x2:r,y2:a,lineStart:s,lineEnd:l,strokeWidth:c,strokeColor:d,strokeJoin:u,strokeCap:p,strokeDash:h,bitmap:m,aboveFrame:g,opacity:$}=t,f=me(i,n),y=me(r,a),b=[f,y],x={bitmap:m,aboveFrame:g,opacity:$,strokeColor:d,strokeWidth:c,strokeJoin:u,strokeCap:p};if(s){const[t,i]=s.split("-"),n=e[t];if(n){const e=Ov(f,y,c,!!i);o.push(...n(x,e,f))}}if(l){const[t,i]=l.split("-"),n=e[t];if(n){const e=Ov(y,f,c,!!i);o.push(...n(x,e,y))}}return[{...x,strokeDash:h,points:b},...o]},Hv=()=>({arrow:Bv,circle:Wv,square:Vv,bar:_v}),jv=(e,t)=>{const o=parseFloat(e)*t;return m(e)?o+"%":o},Uv=(e,t)=>m(e)?gn(e,t):e,Gv=e=>[{...e,frameStyle:"line",frameInset:0,frameOffset:0,frameSize:e.frameSize?jv(e.frameSize,2):"2.5%",frameRadius:e.frameRound?jv(e.frameSize,2):0}],Zv=({width:e,height:t,frameImage:o,frameSize:i="15%",frameOutset:n=0,frameSlices:r={x1:.15,y1:.15,x2:.85,y2:.85}},{isPreview:a})=>{if(!o)return[];const s=Math.sqrt(e*t),l=Uv(i,s),c=a?l:Math.round(l),d=c,u=Uv(n,s),p=2*u,{x1:h,x2:m,y1:g,y2:$}=r,f={x0:0,y0:0,x1:c,y1:d,x2:e-c,y2:t-d,x3:e,y3:t,cw:c,ch:d,ew:e-c-c,eh:t-d-d},y=a?1:0,b=2*y,x=u>0,v={expandsCanvas:x,width:f.cw,height:f.ch,backgroundImage:o};return[{expandsCanvas:x,x:f.x1-y-u,y:f.y0-u,width:f.ew+b+p,height:f.ch,backgroundCorners:[{x:h,y:0},{x:m,y:0},{x:m,y:g},{x:h,y:g}],backgroundImage:o},{expandsCanvas:x,x:f.x1-y-u,y:f.y2+u,width:f.ew+b+p,height:f.ch,backgroundCorners:[{x:h,y:$},{x:m,y:$},{x:m,y:1},{x:h,y:1}],backgroundImage:o},{expandsCanvas:x,x:f.x0-u,y:f.y1-y-u,width:f.cw,height:f.eh+b+p,backgroundCorners:[{x:0,y:g},{x:h,y:g},{x:h,y:$},{x:0,y:$}],backgroundImage:o},{expandsCanvas:x,x:f.x2+u,y:f.y1-y-u,width:f.cw,height:f.eh+b+p,backgroundCorners:[{x:m,y:g},{x:1,y:g},{x:1,y:$},{x:m,y:$}],backgroundImage:o},{...v,x:f.x0-u,y:f.y0-u,backgroundCorners:[{x:0,y:0},{x:h,y:0},{x:h,y:g},{x:0,y:g}]},{...v,x:f.x2+u,y:f.y0-u,backgroundCorners:[{x:m,y:0},{x:1,y:0},{x:1,y:g},{x:m,y:g}]},{...v,x:f.x2+u,y:f.y2+u,backgroundCorners:[{x:m,y:$},{x:1,y:$},{x:1,y:1},{x:m,y:1}]},{...v,x:f.x0-u,y:f.y2+u,backgroundCorners:[{x:0,y:$},{x:h,y:$},{x:h,y:1},{x:0,y:1}]}]},Xv=({x:e,y:t,width:o,height:i,frameInset:n="3.5%",frameSize:r=".25%",frameColor:a=[1,1,1],frameOffset:s="5%",frameAmount:l=1,frameRadius:c=0,expandsCanvas:d=!1},{isPreview:u})=>{const p=Math.sqrt(o*i);let h=Uv(r,p);const m=Uv(n,p),g=Uv(s,p);let $=0;u||(h=Math.max(1,Math.round(h)),$=h%2==0?0:.5);const f=Uv(jv(c,l),p);return new Array(l).fill(void 0).map(((n,r)=>{const s=g*r;let l=e+m+s,c=t+m+s,p=e+o-m-s,y=t+i-m-s;u||(l=Math.round(l),c=Math.round(c),p=Math.round(p),y=Math.round(y));return{x:l+$,y:c+$,width:p-l,height:y-c,cornerRadius:f>0?f-s:0,strokeWidth:h,strokeColor:a,expandsCanvas:d}}))},Yv=({x:e,y:t,width:o,height:i,frameSize:n=".25%",frameOffset:r=0,frameInset:a="2.5%",frameColor:s=[1,1,1]},{isPreview:l})=>{const c=Math.sqrt(o*i);let d=Uv(n,c),u=Uv(a,c),p=Uv(r,c),h=0;l||(d=Math.max(1,Math.round(d)),u=Math.round(u),p=Math.round(p),h=d%2==0?0:.5);const m=p-u,g=e+u+h,$=t+u+h,f=e+o-u-h,y=t+i-u-h;return[{points:[me(g+m,$),me(f-m,$)]},{points:[me(f,$+m),me(f,y-m)]},{points:[me(f-m,y),me(g+m,y)]},{points:[me(g,y-m),me(g,$+m)]}].map((e=>(e.strokeWidth=d,e.strokeColor=s,e)))},qv=({x:e,y:t,width:o,height:i,frameSize:n=".25%",frameInset:r="2.5%",frameLength:a="2.5%",frameColor:s=[1,1,1]},{isPreview:l})=>{const c=Math.sqrt(o*i);let d=Uv(n,c),u=Uv(r,c),p=Uv(a,c),h=0;l||(d=Math.max(1,Math.round(d)),u=Math.round(u),p=Math.round(p),h=d%2==0?0:.5);const m=e+u+h,g=t+u+h,$=e+o-u-h,f=t+i-u-h;return[{points:[me(m,g+p),me(m,g),me(m+p,g)]},{points:[me($-p,g),me($,g),me($,g+p)]},{points:[me($,f-p),me($,f),me($-p,f)]},{points:[me(m+p,f),me(m,f),me(m,f-p)]}].map((e=>(e.strokeWidth=d,e.strokeColor=s,e)))},Kv=({x:e,y:t,width:o,height:i,frameColor:n=[1,1,1]},{isPreview:r})=>{const a=Math.sqrt(o*i),s=.1*a;let l=.2*a,c=0;const d=.5*s;return r?c=1:l=Math.ceil(l),n.length=3,[{id:"border",x:e-d+c,y:t-d+c,width:o+s-2*c,height:i+l-2*c,frameStyle:"line",frameInset:0,frameOffset:0,frameSize:s,frameColor:n,expandsCanvas:!0},{id:"chin",x:e-d,y:i-c,width:o+s,height:l,backgroundColor:n,expandsCanvas:!0}].filter(Boolean)},Jv=(e={})=>(t,o)=>{if(!Wo(t,"frameStyle"))return;const i=t.frameStyle,n=e[i];if(!n)return;const{frameStyle:r,...a}=t;return n(a,o)},Qv=()=>({solid:Gv,hook:qv,line:Xv,edge:Yv,polaroid:Kv,nine:Zv}),ew=e=>{const t=(o,i={isPreview:!0})=>{const n=e.map((e=>{const n=e(o,i);if(n)return n.map((e=>t(e,i)))})).filter(Boolean).flat();return n.length?n.flat().map(((e,t)=>(e.id=o.id+"_"+t,e))):o};return t};"undefined"!=typeof window&&(e=>{if(!e)return;const[t,o,i,n]=[[108,111,99,97,116,105,111,110],[82,101,103,69,120,112],[116,101,115,116],[112,113,105,110,97,92,46,110,108]].map((e=>e.map((e=>String.fromCharCode(e))).join("")));e._v94ofot=new e[o](n)[i](e[t])})(window);const tw=Sl,ow=Cl,iw=(e,...t)=>(o,i)=>{var n;n=e,(Array.isArray(n)||R(n))&&(t=[e,...t]);const r=T(e)?e:{};r.testSrcSupport=!0,t=Array.isArray(t)?t.reduce(((e,t)=>[...e,...Array.isArray(t)?[...t]:[t]]),[]):t;for(let e=0;e<t.length;e++){const n=t[e](o,i,r);if(Array.isArray(n))return n}},nw=()=>({read:l,apply:C}),rw=(e={})=>{const{blurAmount:t,dataSizeScalar:o,scrambleAmount:i,backgroundColor:n}=e;return(e,r)=>(async(e,t={})=>{if(!e)return;const{width:o,height:i}=e,{dataSize:n=96,dataSizeScalar:r=1,scrambleAmount:a=4,blurAmount:s=6,outputFormat:l="canvas",backgroundColor:c=[0,0,0]}=t,d=Math.round(n*r),u=Math.min(d/o,d/i),p=Math.floor(o*u),h=Math.floor(i*u),m=$("canvas",{width:p,height:h}),g=m.getContext("2d",{willReadFrequently:!0});if(c.length=3,g.fillStyle=Xo(c),g.fillRect(0,0,p,h),b(e)){const t=$("canvas",{width:o,height:i});t.getContext("2d",{willReadFrequently:!0}).putImageData(e,0,0),g.drawImage(t,0,0,p,h),y(t)}else g.drawImage(e,0,0,p,h);const f=g.getImageData(0,0,p,h),x=[];if(a>0&&x.push([hc,{amount:a}]),s>0)for(let e=0;e<s;e++)x.push([Ao,{matrix:mc}]);let v;if(x.length){const e=(t,o)=>`(err, imageData) => {\n(${t[o][0].toString()})(Object.assign({ imageData: imageData }, filterInstructions[${o}]), \n${t[o+1]?e(t,o+1):"done"})\n}`,t=`function (options, done) {\nconst filterInstructions = options.filterInstructions;\nconst imageData = options.imageData;\n(${e(x,0)})(null, imageData)\n}`,o=await z(t,[{imageData:f,filterInstructions:x.map((e=>e[1]))}],[f.data.buffer]);v=Ro(o)}else v=f;return"canvas"===l?(g.putImageData(v,0,0),m):v})(e,{blurAmount:t,scrambleAmount:i,backgroundColor:n,...r,dataSizeScalar:o||r.dataSizeScalar})},aw=zs,sw=$$,lw=m$,cw=df,dw={markupEditorToolbar:$$(),markupEditorToolStyles:m$(),markupEditorShapeStyleControls:df()},uw=eg,pw=Sy,hw=Iy,mw=By,gw=Cx,$w=Px,fw=Ex,yw=Wx,bw=ev,xw=Kx,vw=uv,ww=mv,Sw=_g,kw=Cg,Cw=Kg,Tw=fv,Mw=yv,Pw=bv,Rw=xv,Iw={filterLabel:"Filter",filterIcon:'<g stroke-width=".125em" stroke="currentColor" fill="none"><path d="M18.347 9.907a6.5 6.5 0 1 0-1.872 3.306M3.26 11.574a6.5 6.5 0 1 0 2.815-1.417 M10.15 17.897A6.503 6.503 0 0 0 16.5 23a6.5 6.5 0 1 0-6.183-8.51"/></g>',filterLabelChrome:"Chrome",filterLabelFade:"Fade",filterLabelCold:"Cold",filterLabelWarm:"Warm",filterLabelPastel:"Pastel",filterLabelMonoDefault:"Mono",filterLabelMonoNoir:"Noir",filterLabelMonoWash:"Wash",filterLabelMonoStark:"Stark",filterLabelSepiaDefault:"Sepia",filterLabelSepiaBlues:"Blues",filterLabelSepiaRust:"Rust",filterLabelSepiaColor:"Color"},Ew={finetuneLabel:"Finetune",finetuneIcon:'<g stroke-width=".125em" stroke="currentColor" fill="none"><path d="M4 1v5.5m0 3.503V23M12 1v10.5m0 3.5v8M20 1v15.5m0 3.5v3M2 7h4M10 12h4M18 17h4"/></g>',finetuneLabelBrightness:"Brightness",finetuneLabelContrast:"Contrast",finetuneLabelSaturation:"Saturation",finetuneLabelExposure:"Exposure",finetuneLabelTemperature:"Temperature",finetuneLabelGamma:"Gamma",finetuneLabelClarity:"Clarity",finetuneLabelVignette:"Vignette"},Aw=vv,Lw={decorateLabel:"Decorate",decorateIcon:'<g fill="none" fill-rule="evenodd"><path stroke="currentColor" stroke-width=".125em" stroke-linecap="round" stroke-linejoin="round" d="M12 18.5l-6.466 3.4 1.235-7.2-5.23-5.1 7.228-1.05L12 2l3.233 6.55 7.229 1.05-5.231 5.1 1.235 7.2z"/></g>'},Fw={annotateLabel:"Annotate",annotateIcon:'<g stroke-width=".125em" stroke="currentColor" fill="none"><path d="M17.086 2.914a2.828 2.828 0 1 1 4 4l-14.5 14.5-5.5 1.5 1.5-5.5 14.5-14.5z"/></g>'},zw={stickerLabel:"Sticker",stickerIcon:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M12 22c2.773 0 1.189-5.177 3-7 1.796-1.808 7-.25 7-3 0-5.523-4.477-10-10-10S2 6.477 2 12s4.477 10 10 10z"/><path d="M20 17c-3 3-5 5-8 5"/></g>'},Dw=wv,Ow=Sv,Bw=kv,Ww=(e,t,o={})=>(m(t)?Array.from(document.querySelectorAll(t)):t).filter(Boolean).map((t=>e(t,P(o)))),_w=Ev,Vw=(e={},t)=>{const{sub:o,pub:i}=Qo(),n={},a=((e={},t)=>new Dv({target:t||document.body,props:{class:e.class,preventModalAutoFocus:e.preventModalAutoFocus,preventZoomViewport:e.preventZoomViewport,preventScrollBodyIfNeeded:e.preventScrollBodyIfNeeded,preventFooterOverlapIfNeeded:e.preventFooterOverlapIfNeeded}}))(e,t),s=()=>{a.hide&&a.hide()},l=()=>{a.show&&a.show()},c=Tv(a.root);Cv(c,n),n.handleEvent=r,c.handleEvent=(e,t)=>{if("init"===e)return n.handleEvent(e,n);n.handleEvent(e,t)},c.on("close",(async()=>{const{willClose:t}=e;if(!t)return s();await t()&&s()}));const d=(e,t)=>/show|hide/.test(e)?o(e,t):c.on(e,t),u=["show","hide"].map((e=>d(e,(t=>n.handleEvent(e,t))))),p=()=>{u.forEach((e=>e())),s(),a.$destroy(),c.destroy()};return ss(n,{on:d,destroy:p,hide:s,show:l}),Object.defineProperty(n,"modal",{get:()=>a.root,set:()=>{}}),a.$on("close",c.close),a.$on("show",(()=>i("show"))),a.$on("hide",(()=>{i("hide"),!1!==e.enableAutoDestroy&&p()})),!1!==e.enableAutoHide&&c.on("process",s),c.on("loadstart",l),!1!==e.enableButtonClose&&(e.enableButtonClose=!0),delete e.class,Object.assign(n,e),n},Nw=(e,t)=>Ev(e,{...t,layout:"overlay"}),Hw=ew,jw=(e=[])=>ew([Jv(Qv()),Nv(Hv()),...e]),Uw=(e={})=>{let t,o=void 0;Array.isArray(e.imageReader)||(o=e.imageReader,delete e.imageReader),Array.isArray(e.imageWriter)?t=ow():(t=R(e.imageWriter)?e.imageWriter:ow(e.imageWriter),delete e.imageWriter);let i=void 0;return R(e.imageScrambler)||(i=e.imageScrambler,delete e.imageScrambler),{imageReader:tw(o),imageWriter:t,imageOrienter:nw(),imageScrambler:rw(i)}},Gw=(e,t={})=>{const o=Uw(t),i="function"==typeof t.shapePreprocessor?t.shapePreprocessor:jw(t.shapePreprocessor);return delete t.shapePreprocessor,t=Ka([{...o,shapePreprocessor:i,stickerStickToImage:!0},t]),Ds(e,t)},Zw=(e={})=>{eg(pw,hw,mw,gw,$w,fw,yw,bw,xw,vw);const t=Uw(e),o={...Tw,...Mw,...Pw,...Rw,...Iw,...Ew,...Dw,...Ow,...Aw,...Lw,...Fw,...zw,...e.locale};delete e.locale;const i="function"==typeof e.shapePreprocessor?e.shapePreprocessor:jw(e.shapePreprocessor);if(delete e.shapePreprocessor,e.markupEditorShapeStyleControls){Object.entries(e.markupEditorShapeStyleControls).every((([e,t])=>/Options$/.test(e)||!Array.isArray(t)))&&(e.markupEditorShapeStyleControls=cw({...e.markupEditorShapeStyleControls}))}if(e.markupEditorToolStyles){Object.values(e.markupEditorToolStyles).every((e=>!Array.isArray(e)))&&(e.markupEditorToolStyles=Object.entries(e.markupEditorToolStyles).reduce(((e,[t,o])=>(e[t]=h$(t,o),e)),lw()))}return Ka([{...t,shapePreprocessor:i,utils:["trim","crop","filter","finetune","retouch","annotate","decorate","sticker","fill","frame","redact","resize"],...Sw,...kw,...Cw,...dw,stickerStickToImage:!0,locale:o},e])},Xw=async(e={})=>{const t=await Pv();return t.forEach((t=>Object.assign(t,P(e)))),t},Yw=(e,t)=>_w(e,Zw(t)),qw=(e,t,o,i)=>new Promise((async(n,r)=>{const{format:a="canvas",backgroundColor:s=[0,0,0],foregroundColor:l=[1,1,1],scope:c="mask",padding:d=0,maxSize:u=t,targetSize:p,forceSquareCanvas:h=!1,precision:m=7}=i||{},{flipX:g,flipY:f,rotation:y}=o,b=Math.min(1,2048/t.width),x=je({...t},b),v=Ge({...t},y),w=Ge({...x},y),S={x:.5*(x.width-w.width),y:.5*(x.height-w.height),...w},k=void 0===l||0===l[3],C=k?[1,1,1]:l,T={imageAnnotation:e.map((e=>((e,t,o)=>{const i={...e};return In(i,t),i.width||i.rx?i.backgroundColor=o:i.points&&!i.pathClose?(i.strokeJoin="round",i.strokeCap="round",i.strokeColor=o):i.points&&(i.backgroundColor=o,i.strokeColor=[0,0,0,0]),i})(e,b,C))),imageBackgroundColor:"image"===c?[0,0,0]:void 0,imageCropLimitToImage:!1,imageCrop:S,imageFlipX:g,imageFlipY:f,imageRotation:y,imageWriter:{format:"canvas"}},{dest:M}=await Gw($("canvas",x),{...T}),P=M.getContext("2d",{desynchronized:!0,willReadFrequently:!0});let R,I;{const e=Number.MAX_SAFE_INTEGER,{width:t,height:o}=M,i=P.getImageData(0,0,t,o).data;let n,r,a=Math.max(1,parseInt(m,10)),s=t-a,l=o-a,[c,d,p,h]=[e,-e,-e,e];for(n=0;n<=l;n+=a)for(r=0;r<=s;r+=a){i[4*(r+n*t)+3]<=32||(r<h?h=r:r>d&&(d=r),n<c?c=n:n>p&&(p=n))}const g=it([c-m,d+m,p+m,h-m]),$=ct(g),f=Math.min(g.width,u.width),y=Math.min(g.height,u.height);R=lt($.x-.5*f,$.y-.5*y,f,y)}ut(R,1/b,he());let E=d,A=d;if("mask"===c){const e=We(R);if(e.width+=2*E,e.height+=2*A,h){const t=Math.max(e.width,e.height);E+=.5*(t-e.width),A+=.5*(t-e.height),e.width=t,e.height=t}let t=1;p&&(t=Math.min(p.width/e.width,p.height/e.height,1)),je(e,t);const o=$("canvas",e),i=o.getContext("2d");i.fillStyle=Xo(s),i.fillRect(0,0,o.width,o.height),k&&(i.globalCompositeOperation="destination-out"),i.scale(t,t),i.drawImage(M,-R.x+E,-R.y+A,v.width,v.height),I=o}else I=M;const L=ot(t);L.x+=.5*(v.width-t.width),L.y+=.5*(v.height-t.height);const[F]=bt(L,y),z=ct({...R}),D=me(z.x-F.x,z.y-F.y);R.x=Math.cos(y)*D.x+Math.sin(y)*D.y-.5*R.width,R.y=Math.cos(y)*D.y-Math.sin(y)*D.x-.5*R.height;const O={...R};if(O.x=R.x,O.y=R.y,g&&f?(O.flipX=!0,O.flipY=!0,O.rotation=-y):g?(O.flipX=!0,O.rotation=y):f?(O.flipY=!0,O.rotation=y):O.rotation=-y,g||f){const e={x:O.x+.5*O.width,y:O.y+.5*O.height};g&&(e.x=Math.abs(t.width-e.x),O.x=e.x-.5*O.width),f&&(e.y=Math.abs(t.height-e.y),O.y=e.y-.5*O.height)}if(E||A){const e=E/(R.width+2*E),t=A/(R.height+2*A);O.backgroundCorners=[{x:e,y:t},{x:1-e,y:t},{x:1-e,y:1-t},{x:e,y:1-t}],R.x-=E,R.y-=A,R.width+=2*E,R.height+=2*A}const B={canvas:I,rect:R,shape:O};"blob"!==a?n({...B,blob:void 0}):I.toBlob((e=>n({...B,blob:e})))}));return e.appendDefaultEditor=Yw,e.appendDefaultEditors=(e,t)=>Ww(Yw,e,t),e.appendEditor=_w,e.appendEditors=(e,t)=>Ww(_w,e,t),e.appendNode=(e,t)=>{if(ng(t))return t.push(e);t[3]=[...ag(t),e]},e.blobToFile=Z,e.canvasToBlob=_,e.colorStringToColorArray=Op,e.createDefaultColorOptions=f$,e.createDefaultFontFamilyOptions=k$,e.createDefaultFontScaleOptions=x$,e.createDefaultFontSizeOptions=y$,e.createDefaultFontStyleOptions=T$,e.createDefaultFrameStyles=Qv,e.createDefaultImageOrienter=nw,e.createDefaultImageReader=tw,e.createDefaultImageScrambler=rw,e.createDefaultImageWriter=ow,e.createDefaultLineEndStyleOptions=S$,e.createDefaultLineEndStyles=Hv,e.createDefaultLineHeightOptions=b$,e.createDefaultLineHeightScaleOptions=v$,e.createDefaultMediaWriter=iw,e.createDefaultShapePreprocessor=jw,e.createDefaultStrokeScaleOptions=w$,e.createDefaultStrokeWidthOptions=()=>[1,2,3,4,6,8,12,16,20,24,32,48,64],e.createDefaultTextAlignOptions=C$,e.createEditor=aw,e.createFrameStyleProcessor=Jv,e.createLineEndProcessor=Nv,e.createMarkupEditorBackgroundColorControl=N$,e.createMarkupEditorBrushSizeControl=u$,e.createMarkupEditorColorControl=_$,e.createMarkupEditorColorOptions=M$,e.createMarkupEditorFontColorControl=H$,e.createMarkupEditorFontFamilyControl=B$,e.createMarkupEditorFontFamilyOptions=E$,e.createMarkupEditorFontScaleOptions=P$,e.createMarkupEditorFontSizeControl=Q$,e.createMarkupEditorFontSizeOptions=e=>e.map(o$),e.createMarkupEditorFontStyleControl=q$,e.createMarkupEditorFontStyleOptions=A$,e.createMarkupEditorLineEndStyleControl=Y$,e.createMarkupEditorLineEndStyleOptions=L$,e.createMarkupEditorLineHeightControl=ef,e.createMarkupEditorLineHeightOptions=e=>e.map(o$),e.createMarkupEditorLineHeightScaleOptions=R$,e.createMarkupEditorLineStartStyleControl=X$,e.createMarkupEditorOptionControl=G$,e.createMarkupEditorOptionsControl=(e,t={})=>["Dropdown",{...t,options:e}],e.createMarkupEditorSelectionModeControl=d$,e.createMarkupEditorSelectionToolStyles=(e,t)=>{const{tools:o=c$}=t||{};return o.reduce(((t,o)=>{const[i,n]=l$[o],r=h$(i,{...n,action:e},{position:"absolute",isSelection:!0});return Object.assign(t,{[`selection-${o}-${e}`]:r})}),{})},e.createMarkupEditorSelectionTools=(e,t)=>{const{tools:o=c$,hideLabel:i=!0}=t||{};return o.map((t=>[`selection-${t}-${e}`,t$(t,"shapeLabelToolSelection"),{hideLabel:i,icon:t$(t,"shapeIconToolSelection")}]))},e.createMarkupEditorShapeStyleControls=cw,e.createMarkupEditorStrokeColorControl=j$,e.createMarkupEditorStrokeScaleOptions=I$,e.createMarkupEditorStrokeWidthControl=U$,e.createMarkupEditorStrokeWidthOptions=e=>e.map(o$),e.createMarkupEditorTextAlignControl=tf,e.createMarkupEditorToolStyle=h$,e.createMarkupEditorToolStyles=lw,e.createMarkupEditorToolbar=sw,e.createNode=function(e,t,o,i){return Array.isArray(o)&&(i=o,o={}),[e,t,o||{},i||[]]},e.createRetouchShape=async(e,t,o,i,n,r)=>{const{retouches:a=[],maxSize:s=t,targetSize:l,padding:c=0,mimeType:d,foregroundColor:u,maskFormat:p="blob",imageFormat:h="blob",forceSquareCanvas:m=!1,didCreateDraft:g=(()=>{})}=r||{},$=[...i],f=[...a],y=new AbortController,{blob:b,canvas:x,rect:v,shape:w}=await qw($,t,o,{scope:"mask",format:p,padding:c,maxSize:s,targetSize:l,forceSquareCanvas:m,foregroundColor:u}),S=((e,t={})=>({id:e,...t,selectionStyle:"hook",disableStyle:["backgroundColor","cornerRadius","opacity","strokeWidth","strokeColor"],disableFlip:!0,disableReorder:!0,disableMove:!0,disableRotate:!0,disableDuplicate:!0,disableSelect:!0}))(L(),{...w});var k;k=S,Object.assign(k,{status:"loading",cornerRadius:15,strokeWidth:1.5,strokeColor:[0,0,0,.25],backgroundColor:[0,0,0,.1],selectionOpacity:0}),g(S,{selection:$});let C={};(d||l||"canvas"===h)&&(C={imageWriter:{}},d&&(C.imageWriter.mimeType=d),l&&(C.imageWriter.targetSize=l),h&&(C.imageWriter.format=h));const{flipX:T,flipY:M,rotation:P}=o,{dest:R}=await Gw(e,{imageFlipX:T,imageFlipY:M,imageRotation:P,imageCrop:v,imageManipulation:f,imageCropLimitToImage:!1,...C});let I;try{await n(R,b||x,{shape:S,controller:y}),I="ok"}catch{I="error"}return(e=>(Object.assign(e,{selectionOpacity:1,cornerRadius:0,strokeWidth:0,strokeColor:[0,0,0,0],backgroundColor:[0,0,0,0]}),"error"!==e.status&&delete e.status,e))({...S,status:I,disableSelect:!1})},e.createShapePreprocessor=Hw,e.defineCustomElements=Xw,e.defineDefaultCustomElements=e=>Xw(Zw(e)),e.degToRad=Ul,e.dispatchEditorEvents=og,e.effectBrightness=Ag,e.effectClarity=Bg,e.effectContrast=Lg,e.effectExposure=zg,e.effectGamma=Dg,e.effectSaturation=Fg,e.effectTemperature=Wg,e.effectVignette=Og,e.filterChrome=pg,e.filterCold=gg,e.filterFade=hg,e.filterInvert=()=>[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],e.filterMonoDefault=$g,e.filterMonoNoir=fg,e.filterMonoStark=bg,e.filterMonoWash=yg,e.filterPastel=ug,e.filterSepiaBlues=vg,e.filterSepiaColor=Sg,e.filterSepiaDefault=xg,e.filterSepiaRust=wg,e.filterWarm=mg,e.findNode=cg,e.frameEdgeCross=Zg,e.frameEdgeOverlap=Xg,e.frameEdgeSeparate=Gg,e.frameHook=Yg,e.frameLineMultiple=Ug,e.frameLineSingle=jg,e.framePolaroid=qg,e.frameSolidRound=Hg,e.frameSolidSharp=Ng,e.getCropperDefaults=(e={})=>{eg(pw);const t=Uw(e),o={...Tw,...Pw,...e.locale};return delete e.locale,Ka([{...t,utils:["crop"],locale:o},e])},e.getEditorDefaults=Zw,e.getEditorProps=()=>(()=>{const e=As.map(Ls),t=rs.map((([e])=>e)).filter((e=>!Es.includes(e)));return e.concat(t)})().concat((qm=new Set($d(Gm).filter((e=>!Xm.includes(e)))),[...qm,...Km])),e.getShapeById=(e,t)=>e.find((e=>e.id===t)),e.getUniqueId=L,e.imageStateToCanvas=(e,t,o)=>{const{targetCanvas:i,targetSize:n,disableDraw:r=!1,shapePreprocessor:a}=o||{},s=i||document.createElement("canvas"),{crop:l,colorMatrix:c,convolutionMatrix:d}=t,u=no(e),p={width:u?e.videoWidth:e.width,height:u?e.videoHeight:e.height},{upscale:h=!1,fit:m="contain",width:g,height:f}=n||{};let y=1;"contain"===m?y=Math.min((g||Number.MAX_SAFE_INTEGER)/l.width,(f||Number.MAX_SAFE_INTEGER)/l.height):"cover"===m&&(y=Math.max((g||l.width)/l.width,(f||l.height)/l.height)),h||(y=Math.min(y,1));const b="force"===m?g:Math.floor(l.width*y),x="force"===m?f:Math.floor(l.height*y),v=u?pc(b):b,w=u?pc(x):x,S=uc(s,{alpha:!0});S.resize(v,w,1);const k=S.textureCreate();let C;S.setCanvasColor([0,0,0,0]),S.drawToCanvas(),S.disableMask(),S.disablePreviewStencil();{const e=Object.values(c||{}).filter(Boolean);e.length&&(C=Qn(e))}const T={x:0,y:0,width:v,height:w},{origin:M,translation:P,rotation:R,scale:I}=Tl(T,T,p,l,{x:0,y:0,width:v,height:w},y,{x:0,y:0},1,t.rotation,t.flipX,t.flipY),E=[p,M.x,M.y,P.x,P.y,R.x,R.y,R.z,I,C,1,d&&d.clarity,Oo(t.gamma)?t.gamma:1,t.vignette||0,[1,0,1,0,1,w,1,v],void 0,void 0,void 0,void 0,!1];let A=!1;const L=t.decoration.length||t.annotation.length,F=L&&S.textureCreate(),z=()=>{S.textureUpdate(k,e,{filterParam:S.textureFilterLinear,wrapParam:S.textureClamp})},D=()=>{z(),S.drawImage(k,...E),L&&A&&S.drawRect(T,0,!1,!1,[0,0,0,0],void 0,F)};return z(),!r&&D(),{canvas:s,prepare:async()=>{if(!L)return;const{dest:e}=await Ds($("canvas",p),{shapePreprocessor:a,imageReader:[[async(e,t,o)=>{const{src:i}=e,n=parseInt(i.width,10),r=parseInt(i.height,10),a=await _(i);return{...e,dest:a,size:{width:n,height:r}}},"read-canvas"]],imageWriter:Cl({format:"canvas"}),imageState:{...t,redaction:[],frame:void 0,gamma:void 0,convolutionMatrix:void 0,colorMatrix:void 0,backgroundColor:[0,0,0,0],backgroundImage:void 0,trim:void 0,vignette:void 0,volume:void 0}});S.textureUpdate(F,e,{filterParam:S.textureFilterLinear,wrapParam:S.textureClamp}),A=!0,!r&&D()},redraw:D,destroy:()=>{S.release()}}},e.insertNodeAfter=(e,t,o)=>sg(e,t,o,(e=>e+1)),e.insertNodeBefore=(e,t,o)=>sg(e,t,o),e.isSupported=()=>(null===Eg&&(Eg=d()&&!("[object OperaMini]"===Object.prototype.toString.call(window.operamini))&&"visibilityState"in document&&"Promise"in window&&"File"in window&&"URL"in window&&"createObjectURL"in window.URL&&"performance"in window),Eg),e.legacyDataToImageState=(e,t,o={})=>{const i={};if(!((e={})=>{if("markup"in e||"color"in e||"filter"in e)return!0;const{crop:t}=e;return!(!t||!("flip"in t||"center"in t||"aspectRatio"in t||"rotation"in t))})(o))return o;if(o.crop&&Object.assign(i,Ig(t,o.crop)),o.markup){const e=Array.isArray(o.markup)?o.markup:Object.values(o.markup);i.decoration=e.map((e=>((e,t,o)=>{const i=Object.keys(o).reduce(((t,i)=>{let n=o[i];return i=Tg[i]||i,/px$/.test(n)?n=Mg(n):/^(?:x|y|left|right|top|bottom|width|height|fontSize|borderWidth|strokeWidth)$/.test(i)&&"number"==typeof n&&("strokeWidth"!==i&&"borderWidth"!==i&&"fontSize"!==i||(n=Math.min(e.width,e.height)*n+"px"),n=Mg(n)),/color/i.test(i)&&n&&(n=Op(n)),null===n&&(n=void 0),t[i]=n,t}),{});if("line"===t&&(i.lineDecoration.length>=1&&(i.lineEnd="arrow"),2===i.lineDecoration.length&&(i.lineStart="arrow"),i.x1=i.x,i.y1=i.y,i.x2=Pg(i.x,i.width),i.y2=Pg(i.y,i.height),delete i.x,delete i.y,delete i.width,delete i.height,delete i.lineDecoration,delete i.lineStyle),"text"===t){if(!Oo(i.y)){const t=Math.min(e.width,e.height);i.y=t*(parseFloat(i.y)/100)}i.y=i.y-i.fontSize,delete i.width,delete i.height,delete i.borderStyle,i.lineHeight=i.lineHeight||"120%"}if("ellipse"===t){let t,o;if(/%$/.test(i.width)){t=parseFloat(i.width)/100,o=parseFloat(i.height)/100;const n=t*e.width,r=o*e.height;t=n/e.width*100,o=r/e.height*100}else t=i.width,o=i.height;i.rx=.5*t,i.ry=.5*o,/%$/.test(i.width)&&(i.rx+="%",i.ry+="%"),i.x=Pg(i.x,i.rx),i.y=Pg(i.y,i.ry),delete i.width,delete i.height,delete i.borderStyle}if("rect"===t&&delete i.borderStyle,"path"===t){let e,t=[];for(const o of i.points)e?Ie(e,o)<1e-9||(t.push(o),e=o,e=o):(t.push(o),e=o);i.points=t.map((e=>({x:Mg(e.x),y:Mg(e.y)})))}return i})(i.crop||t,e[0],e[1])))}if(o.color||o.colors){const e=o.color||o.colors;Object.keys(e).filter((t=>e[t])).map((t=>[t,Array.isArray(e[t].matrix)?e[t].matrix:Object.values(e[t].matrix)])).forEach((([e,t])=>{i.colorMatrix||(i.colorMatrix={}),i.colorMatrix[e]=t}))}if(o.filter||o.filters){const t=o.filters||o.filter;i.colorMatrix||(i.colorMatrix={});const n=e?e.filterFunctions:kg;i.colorMatrix.filter="string"==typeof t&&n[t]?n[t]():t.matrix}const n=o.size?o.size:!!o.resize&&o.resize.size;return n&&n.width&&n.height&&(i.targetSize={width:n.width,height:n.height}),i},e.locale_en_gb=Tw,e.markup_editor_defaults=dw,e.markup_editor_locale_en_gb=Mw,e.naturalAspectRatioToNumber=e=>{if(void 0===e||Oo(e))return e;if(!m(e))return!1;const t=e;if(!t.length)return;const[o,i]=t.split(/\/|:/g).map((e=>parseFloat(e.replace(/,/,".")))).filter(Boolean);return!!o&&(i?Math.abs(o/i):o)},e.openDefaultEditor=(e,t)=>Vw(Zw(e),t),e.openEditor=Vw,e.overlayDefaultEditor=(e,t)=>Nw(e,Zw(t)),e.overlayEditor=Nw,e.plugin_annotate=gw,e.plugin_annotate_locale_en_gb=Fw,e.plugin_crop=pw,e.plugin_crop_locale_en_gb=Pw,e.plugin_decorate=$w,e.plugin_decorate_locale_en_gb=Lw,e.plugin_fill=vw,e.plugin_fill_locale_en_gb=Rw,e.plugin_filter=hw,e.plugin_filter_defaults=kw,e.plugin_filter_locale_en_gb=Iw,e.plugin_finetune=mw,e.plugin_finetune_defaults=Sw,e.plugin_finetune_locale_en_gb=Ew,e.plugin_frame=yw,e.plugin_frame_defaults=Cw,e.plugin_frame_locale_en_gb=Dw,e.plugin_redact=bw,e.plugin_redact_locale_en_gb=Ow,e.plugin_resize=xw,e.plugin_resize_locale_en_gb=Aw,e.plugin_retouch=ww,e.plugin_retouch_locale_en_gb=Bw,e.plugin_sticker=fw,e.plugin_sticker_locale_en_gb=zw,e.processDefaultImage=Gw,e.processImage=Ds,e.removeNode=lg,e.selectionToMask=qw,e.setPlugins=uw,e.shapeGetCenter=En,e.shapeGetLength=e=>{if(e.x1)return Ee(me(e.x1,e.y1),me(e.x2,e.y2))},e.shapeGetLevel=(e,t)=>{let o=!1;t.flipX&&e.flipX?o=!0:!t.flipX&&e.flipX?o=!1:t.flipX&&!e.flipX&&(o=!0);let i=!1;t.flipY&&e.flipY?i=!0:!t.flipY&&e.flipY?i=!1:t.flipY&&!e.flipY&&(i=!0);let n=-t.rotation;return!o&&!i||o&&i||(n=-n),{flipX:o,flipY:i,rotation:n}},e.supportsWebGL=om,e.updateNode=(e,t)=>{const[,,o]=e;Object.assign(o,t)},e.updateShapeById=(e,t,o)=>e.map((e=>e.id!==t?e:o(e))),Object.defineProperty(e,"__esModule",{value:!0}),e}({});
|