124 lines
265 KiB
JavaScript
124 lines
265 KiB
JavaScript
|
var Oo=Object.defineProperty;var Do=(e,t)=>{for(var i in t)Oo(e,i,{get:t[i],enumerable:!0})};var $i={};Do($i,{FileOrigin:()=>wt,FileStatus:()=>st,OptionTypes:()=>Mi,Status:()=>Wn,create:()=>at,destroy:()=>nt,find:()=>Di,getOptions:()=>xi,parse:()=>Oi,registerPlugin:()=>ge,setOptions:()=>yt,supported:()=>Li});var xo=e=>e instanceof HTMLElement,Po=(e,t=[],i=[])=>{let a={...e},n=[],r=[],o=()=>({...a}),l=()=>{let p=[...n];return n.length=0,p},s=()=>{let p=[...r];r.length=0,p.forEach(({type:m,data:g})=>{u(m,g)})},u=(p,m,g)=>{if(g&&!document.hidden){r.push({type:p,data:m});return}f[p]&&f[p](m),n.push({type:p,data:m})},c=(p,...m)=>h[p]?h[p](...m):null,d={getState:o,processActionQueue:l,processDispatchQueue:s,dispatch:u,query:c},h={};t.forEach(p=>{h={...p(a),...h}});let f={};return i.forEach(p=>{f={...p(u,c,a),...f}}),d},Co=(e,t,i)=>{if(typeof i=="function"){e[t]=i;return}Object.defineProperty(e,t,{...i})},Z=(e,t)=>{for(let i in e)e.hasOwnProperty(i)&&t(i,e[i])},Fe=e=>{let t={};return Z(e,i=>{Co(t,i,e[i])}),t},ee=(e,t,i=null)=>{if(i===null)return e.getAttribute(t)||e.hasAttribute(t);e.setAttribute(t,i)},Fo="http://www.w3.org/2000/svg",zo=["svg","path"],Ea=e=>zo.includes(e),$t=(e,t,i={})=>{typeof t=="object"&&(i=t,t=null);let a=Ea(e)?document.createElementNS(Fo,e):document.createElement(e);return t&&(Ea(e)?ee(a,"class",t):a.className=t),Z(i,(n,r)=>{ee(a,n,r)}),a},No=e=>(t,i)=>{typeof i<"u"&&e.children[i]?e.insertBefore(t,e.children[i]):e.appendChild(t)},Bo=(e,t)=>(i,a)=>(typeof a<"u"?t.splice(a,0,i):t.push(i),i),Go=(e,t)=>i=>(t.splice(t.indexOf(i),1),i.element.parentNode&&e.removeChild(i.element),i),Vo=(()=>typeof window<"u"&&typeof window.document<"u")(),an=()=>Vo,Uo=an()?$t("svg"):{},ko="children"in Uo?e=>e.children.length:e=>e.childNodes.length,nn=(e,t,i,a)=>{let n=i[0]||e.left,r=i[1]||e.top,o=n+e.width,l=r+e.height*(a[1]||1),s={element:{...e},inner:{left:e.left,top:e.top,right:e.right,bottom:e.bottom},outer:{left:n,top:r,right:o,bottom:l}};return t.filter(u=>!u.isRectIgnored()).map(u=>u.rect).forEach(u=>{Ta(s.inner,{...u.inner}),Ta(s.outer,{...u.outer})}),Ia(s.inner),s.outer.bottom+=s.element.marginBottom,s.outer.right+=s.element.marginRight,Ia(s.outer),s},Ta=(e,t)=>{t.top+=e.top,t.right+=e.left,t.bottom+=e.top,t.left+=e.left,t.bottom>e.bottom&&(e.bottom=t.bottom),t.right>e.right&&(e.right=t.right)},Ia=e=>{e.width=e.right-e.left,e.height=e.bottom-e.top},Ve=e=>typeof e=="number",Ho=(e,t,i,a=.001)=>Math.abs(e-t)<a&&Math.abs(i)<a,Wo=({stiffness:e=.5,damping:t=.75,mass:i=10}={})=>{let a=null,n=null,r=0,o=!1,u=Fe({interpolate:(c,d)=>{if(o)return;if(!(Ve(a)&&Ve(n))){o=!0,r=0;return}let h=-(n-a)*e;r+=h/i,n+=r,r*=t,Ho(n,a,r)||d?(n=a,r=0,o=!0,u.onupdate(n),u.oncomplete(n)):u.onupdate(n)},target:{set:c=>{if(Ve(c)&&!Ve(n)&&(n=c),a===null&&(a=c,n=c),a=c,n===a||typeof a>"u"){o=!0,r=0,u.onupdate(n),u.oncomplete(n);return}o=!1},get:()=>a},resting:{get:()=>o},onupdate:c=>{},oncomplete:c=>{}});return u};var Yo=e=>e<.5?2*e*e:-1+(4-2*e)*e,$o=({duration:e=500,easing:t=Yo,delay:i=0}={})=>{let a=null,n,r,o=!0,l=!1,s=null,c=Fe({interpolate:(d,h)=>{o||s===null||(a===null&&(a=d),!(d-a<i)&&(n=d-a-i,n>=e||h?(n=1,r=l?0:1,c.onupdate(r*s),c.oncomplete(r*s),o=!0):(r=n/e,c.onupdate((n>=0?t(l?1-r:r):0)*s))))},target:{get:()=>l?0:s,set:d=>{if(s===null){s=d,c.onupdate(d),c.oncomplete(d);return}d<s?(s=1,l=!0):(l=!1,s=d),o=!1,a=null}},resting:{get:()=>o},onupdate:d=>{},oncomplete:d=>{}});return c},ba={spring:Wo,tween:$o},qo=(e,t,i)=>{let a=e[t]&&typeof e[t][i]=="object"?e[t][i]:e[t]||e,n=typeof a=="string"?a:a.type,r=typeof a=="object"?{...a}:{};return ba[n]?ba[n](r):null},Pi=(e,t,i,a=!1)=>{t=Array.isArray(t)?t:[t],t.forEach(n=>{e.forEach(r=>{let o=r,l=()=>i[r],s=u=>i[r]=u;typeof r=="object"&&(o=r.key,l=r.getter||l,s=r.setter||s),!(n[o]&&!a)&&(n[o]={get:l,set:s})})})},Xo=({mixinConfig:e,viewProps:t,viewInternalAPI:i,viewExternalAPI:a})=>{let n={...t},r=[];return Z(e,(o,l)=>{let s=qo(l);if(!s)return;s.onupdate=c=>{t[o]=c},s.target=n[o],Pi([{key:o,setter:c=>{s.target!==c&&(s.target=c)},getter:()=>t[o]}],[i,a],t,!0),r.push(s)}),{write:o=>{let l=document.hidden,s=!
|
||
|
`);for(let a of i){let n=ql(a);if(n){t.name=n;continue}let r=Xl(a);if(r){t.size=r;continue}let o=jl(a);if(o){t.source=o;continue}}return t},Ql=e=>{let t={source:null,complete:!1,progress:0,size:null,timestamp:null,duration:0,request:null},i=()=>t.progress,a=()=>{t.request&&t.request.abort&&t.request.abort()},n=()=>{let l=t.source;o.fire("init",l),l instanceof File?o.fire("load",l):l instanceof Blob?o.fire("load",rt(l,l.name)):_i(l)?o.fire("load",$l(l)):r(l)},r=l=>{if(!e){o.fire("error",{type:"error",body:"Can't load URL",code:400});return}t.timestamp=Date.now(),t.request=e(l,s=>{t.duration=Date.now()-t.timestamp,t.complete=!0,s instanceof Blob&&(s=rt(s,s.name||St(l))),o.fire("load",s instanceof Blob?s:s?s.body:null)},s=>{o.fire("error",typeof s=="string"?{type:"error",code:0,body:s}:s)},(s,u,c)=>{if(c&&(t.size=c),t.duration=Date.now()-t.timestamp,!s){t.progress=null;return}t.progress=u/c,o.fire("progress",t.progress)},()=>{o.fire("abort")},s=>{let u=Ni(typeof s=="string"?s:s.headers);o.fire("meta",{size:t.size||u.size,filename:u.name,source:u.source})})},o={...Jt(),setSource:l=>t.source=l,getProgress:i,abort:a,load:n};return o},La=e=>/GET|HEAD/.test(e),He=(e,t,i)=>{let a={onheaders:()=>{},onprogress:()=>{},onload:()=>{},ontimeout:()=>{},onerror:()=>{},onabort:()=>{},abort:()=>{n=!0,o.abort()}},n=!1,r=!1;i={method:"POST",headers:{},withCredentials:!1,...i},t=encodeURI(t),La(i.method)&&e&&(t=`${t}${encodeURIComponent(typeof e=="string"?e:JSON.stringify(e))}`);let o=new XMLHttpRequest,l=La(i.method)?o:o.upload;return l.onprogress=s=>{n||a.onprogress(s.lengthComputable,s.loaded,s.total)},o.onreadystatechange=()=>{o.readyState<2||o.readyState===4&&o.status===0||r||(r=!0,a.onheaders(o))},o.onload=()=>{o.status>=200&&o.status<300?a.onload(o):a.onerror(o)},o.onerror=()=>a.onerror(o),o.onabort=()=>{n=!0,a.onabort()},o.ontimeout=()=>a.ontimeout(o),o.open(i.method,t,!0),lt(i.timeout)&&(o.timeout=i.timeout),Object.keys(i.headers).forEach(s=>{let u=unescape(encodeURIComponent(i.headers[s]));o.setRequestHeader(s,u)}),i.responseType&&(o.responseType=i.responseType),i.withCredentials&&(o.withCredentials=!0),o.send(e),a},K=(e,t,i,a)=>({type:e,code:t,body:i,headers:a}),We=e=>t=>{e(K("error",0,"Timeout",t.getAllResponseHeaders()))},Ma=e=>/\?/.test(e),Rt=(...e)=>{let t="";return e.forEach(i=>{t+=Ma(t)&&Ma(i)?i.replace(/\?/,"&"):i}),t},pi=(e="",t)=>{if(typeof t=="function")return t;if(!t||!ce(t.url))return null;let i=t.onload||(n=>n),a=t.onerror||(n=>null);return(n,r,o,l,s,u)=>{let c=He(n,Rt(e,t.url),{...t,responseType:"blob"});return c.onload=d=>{let h=d.getAllResponseHeaders(),f=Ni(h).name||St(n);r(K("load",d.status,t.method==="HEAD"?null:rt(i(d.response),f),h))},c.onerror=d=>{o(K("error",d.status,a(d.response)||d.statusText,d.getAllResponseHeaders()))},c.onheaders=d=>{u(K("headers",d.status,null,d.getAllResponseHeaders()))},c.ontimeout=We(o),c.onprogress=l,c.onabort=s,c}},Ee={QUEUED:0,COMPLETE:1,PROCESSING:2,ERROR:3,WAITING:4},Zl=(e,t,i,a,n,r,o,l,s,u,c)=>{let d=[],{chunkTransferId:h,chunkServer:f,chunkSize:p,chunkRetryDelays:m}=c,g={serverId:h,aborted:!1},b=t.ondata||(v=>v),E=t.onload||((v,P)=>P==="HEAD"?v.getResponseHeader("Upload-Offset"):v.response),T=t.onerror||(v=>null),_=v=>{let P=new FormData;re(n)&&P.append(i,JSON.stringify(n));let w=typeof t.headers=="function"?t.headers(a,n):{...t.headers,"Upload-Length":a.size},L={...t,headers:w},F=He(b(P),Rt(e,t.url),L);F.onload=C=>v(E(C,L.method)),F.onerror=C=>o(K("error",C.status,T(C.response)||C.statusText,C.getAllResponseHeaders())),F.ontimeout=We(o)},y=v=>{let P=Rt(e,f.url,g.serverId),L={headers:typeof t.headers=="function"?t.headers(g.serverId):{...t.headers},method:"HEAD"},F=He(null,P,L);F.onload=C=>v(E(C,L.method)),F.onerror=C=>o(K("error",C.status,T(C.response)||C.statusText,C.getAllResponseHeaders())),F.ontimeout=We(o)},I=Math.floor(a.size/p);for(let v=0;v<=I;v++){let P=v*p,w=a.slice(P,P+p,"application/offset+octet-stream");d[v]={index:v,size:w.size,offset:P,data:w,file:a,progress:0,retries:[...m],status:Ee.QUEUED,error:null,request:null,timeout:null}}let A=()=>r(g.serverId),R=v=>v.
|
||
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wd(e,t){if(typeof e!="object"||e===null)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var a=i.call(e,t||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cr(e){var t=Wd(e,"string");return typeof t=="symbol"?t:String(t)}var oi=typeof window<"u"&&typeof window.document<"u",Le=oi?window:{},ra=oi&&Le.document.documentElement?"ontouchstart"in Le.document.documentElement:!1,oa=oi?"PointerEvent"in Le:!1,j="cropper",la="all",dr="crop",ur="move",hr="zoom",Xe="e",je="w",ct="s",ze="n",At="ne",vt="nw",Lt="se",Mt="sw",Zi="".concat(j,"-crop"),qn="".concat(j,"-disabled"),fe="".concat(j,"-hidden"),Xn="".concat(j,"-hide"),Yd="".concat(j,"-invisible"),ri="".concat(j,"-modal"),Ki="".concat(j,"-move"),Dt="".concat(j,"Action"),ai="".concat(j,"Preview"),sa="crop",fr="move",pr="none",Ji="crop",ea="cropend",ta="cropmove",ia="cropstart",jn="dblclick",$d=ra?"touchstart":"mousedown",qd=ra?"touchmove":"mousemove",Xd=ra?"touchend touchcancel":"mouseup",Qn=oa?"pointerdown":$d,Zn=oa?"pointermove":qd,Kn=oa?"pointerup pointercancel":Xd,Jn="ready",er="resize",tr="wheel",aa="zoom",ir="image/jpeg",jd=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,Qd=/^data:/,Zd=/^data:image\/jpeg;base64,/,Kd=/^img|canvas$/i,mr=200,gr=100,ar={viewMode:0,dragMode:sa,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:mr,minContainerHeight:gr,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},Jd='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',eu=Number.isNaN||Le.isNaN;function Y(e){return typeof e=="number"&&!eu(e)}var nr=function(t){return t>0&&t<1/0};function qi(e){return typeof e>"u"}function Qe(e){return ji(e)==="object"&&e!==null}var tu=Object.prototype.hasOwnProperty;function dt(e){if(!Qe(e))return!1;try{var t=e.constructor,i=t.prototype;return t&&i&&tu.call(i,"isPrototypeOf")}catch{return!1}}function he(e){return typeof e=="function"}var iu=Array.prototype.slice;function Er(e){return Array.from?Array.from(e):iu.call(e)}function ie(e,t){return e&&he(t)&&(Array.isArray(e)||Y(e.length)?Er(e).forEach(function(i,a){t.call(e,i,a,e)}):Qe(e)&&Object.keys(e).forEach(function(i){t.call(e,e[i],i,e)})),e}var Q=Object.assign||function(t){for(var i=arguments.length,a=new Array(i>1?i-1:0),n=1;n<i;n++)a[n-1]=arguments[n];return Qe(t)&&a.length>0&&a.forEach(function(r){Qe(r)&&Object.keys(r).forEach(function(o){t[o]=r[o]})}),t},a
|
||
|
<defs>
|
||
|
<radialGradient id="gradient-__UID__" cx=".5" cy="1.25" r="1.15">
|
||
|
<stop offset='50%' stop-color='#000000'/>
|
||
|
<stop offset='56%' stop-color='#0a0a0a'/>
|
||
|
<stop offset='63%' stop-color='#262626'/>
|
||
|
<stop offset='69%' stop-color='#4f4f4f'/>
|
||
|
<stop offset='75%' stop-color='#808080'/>
|
||
|
<stop offset='81%' stop-color='#b1b1b1'/>
|
||
|
<stop offset='88%' stop-color='#dadada'/>
|
||
|
<stop offset='94%' stop-color='#f6f6f6'/>
|
||
|
<stop offset='100%' stop-color='#ffffff'/>
|
||
|
</radialGradient>
|
||
|
<mask id="mask-__UID__">
|
||
|
<rect x="0" y="0" width="500" height="200" fill="url(#gradient-__UID__)"></rect>
|
||
|
</mask>
|
||
|
</defs>
|
||
|
<rect x="0" width="500" height="200" fill="currentColor" mask="url(#mask-__UID__)"></rect>
|
||
|
</svg>`,Vr=0,Th=e=>e.utils.createView({name:"image-preview-overlay",tag:"div",ignoreRect:!0,create:({root:t,props:i})=>{let a=Eh;if(document.querySelector("base")){let n=new URL(window.location.href.replace(window.location.hash,"")).href;a=a.replace(/url\(\#/g,"url("+n+"#")}Vr++,t.element.classList.add(`filepond--image-preview-overlay-${i.status}`),t.element.innerHTML=a.replace(/__UID__/g,Vr)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}}),Ih=function(){self.onmessage=e=>{createImageBitmap(e.data.message.file).then(t=>{self.postMessage({id:e.data.id,message:t},[t])})}},bh=function(){self.onmessage=e=>{let t=e.data.message.imageData,i=e.data.message.colorMatrix,a=t.data,n=a.length,r=i[0],o=i[1],l=i[2],s=i[3],u=i[4],c=i[5],d=i[6],h=i[7],f=i[8],p=i[9],m=i[10],g=i[11],b=i[12],E=i[13],T=i[14],_=i[15],y=i[16],I=i[17],A=i[18],R=i[19],S=0,x=0,D=0,O=0,z=0;for(;S<n;S+=4)x=a[S]/255,D=a[S+1]/255,O=a[S+2]/255,z=a[S+3]/255,a[S]=Math.max(0,Math.min((x*r+D*o+O*l+z*s+u)*255,255)),a[S+1]=Math.max(0,Math.min((x*c+D*d+O*h+z*f+p)*255,255)),a[S+2]=Math.max(0,Math.min((x*m+D*g+O*b+z*E+T)*255,255)),a[S+3]=Math.max(0,Math.min((x*_+D*y+O*I+z*A+R)*255,255));self.postMessage({id:e.data.id,message:t},[t.data.buffer])}},_h=(e,t)=>{let i=new Image;i.onload=()=>{let a=i.naturalWidth,n=i.naturalHeight;i=null,t(a,n)},i.src=e},Rh={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]},yh=(e,t,i,a)=>{a!==-1&&e.transform.apply(e,Rh[a](t,i))},Sh=(e,t,i,a)=>{t=Math.round(t),i=Math.round(i);let n=document.createElement("canvas");n.width=t,n.height=i;let r=n.getContext("2d");return a>=5&&a<=8&&([t,i]=[i,t]),yh(r,t,i,a),r.drawImage(e,0,0,t,i),n},Hr=e=>/^image/.test(e.type)&&!/svg/.test(e.type),wh=10,Ah=10,vh=e=>{let t=Math.min(wh/e.width,Ah/e.height),i=document.createElement("canvas"),a=i.getContext("2d"),n=i.width=Math.ceil(e.width*t),r=i.height=Math.ceil(e.height*t);a.drawImage(e,0,0,n,r);let o=null;try{o=a.getImageData(0,0,n,r).data}catch{return null}let l=o.length,s=0,u=0,c=0,d=0;for(;d<l;d+=4)s+=o[d]*o[d],u+=o[d+1]*o[d+1],c+=o[d+2]*o[d+2];return s=ha(s,l),u=ha(u,l),c=ha(c,l),{r:s,g:u,b:c}},ha=(e,t)=>Math.floor(Math.sqrt(e/(t/4))),Lh=(e,t)=>(t=t||document.createElement("canvas"),t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0),t),Mh=e=>{let t;try{t=new ImageData(e.width,e.height)}catch{t=document.createElement("canvas").getContext("2d").createImageData(e.width,e.height)}return t.data.set(new Uint8ClampedArray(e.data)),t},Oh=e=>new Promise((t,i)=>{let a=new Image;a.crossOrigin="Anonymous",a.onload=()=>{t(a)},a.onerror=n=>{i(n)},a.src=e}),Dh=e=>{let t=Th(e),i=gh(e),{createWorker:a}=e.utils,n=(E,T,_)=>new Promise(y=>{E.ref.imageData||(E.ref.imageData=_.getContext("2d").getImageData(0,0,_.width,_.height));let I=Mh(E.ref.imageData);if(!T||T.length!==20)return _.getContext("2d").putImageData(I,0,0),y();let A=a(bh);A.post({imageData:I,colorMatrix:T},R=>{_.getContext("2d").putImageData(R,0,0),A.terminate(),y()},[I.data.buffer])}),r=(E,T)=>{E.removeChildView(T),T.image.width=1,T.image.height=1,T._destroy()},o=({root:E})=>{let T=E.ref.images.shift();return T.opacity=0,T.translateY=-15,E.ref.imageViewBin.push(T),T},l=({root:E,props:T,image:_})=>{let y=T.id,I=E.query("GET_ITEM",{id:y});if(!I)return;let A=I.getMetadata("crop")||{center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},zoom:1,rotation:0,aspectRatio:null},R=E.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),S,x,D=!1;E.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(S=I.getMetadata("markup")||[],x=I.getMetadata("resize"),D=!0);let O=E.appendChildView(E.createChildView(i,{id:y,image:_,crop:A,resize:x,markup:S,dirty:D,background:R,opacity:0,scaleX:1.15,scaleY:1.15,translateY:15}),E.childViews.length);E.ref.images.push(O),O.opacity=1,O.scaleX=1,O.scaleY=1,O.translateY=0,setTimeout(()=>{E.dispatch("DID_IMAGE_PREVIEW_SHOW",{id:y})},250)},s=({root:E,props:T})=>{let _=E.query("GET_ITEM",{id:T.id});if(!_)return;let y=E.ref.images[E.ref.images.length-1]
|
||
|
`+W.outerHTML+`
|
||
|
`},""),A=`
|
||
|
|
||
|
<g>${A.replace(/ /g," ")}</g>
|
||
|
|
||
|
`}let R=t.aspectRatio||I/y,S=y,x=S*R,D=typeof t.scaleToFit>"u"||t.scaleToFit,O=t.center?t.center.x:.5,z=t.center?t.center.y:.5,v=Jr({width:y,height:I},eo({width:S,height:x},R),t.rotation,D?{x:O,y:z}:{x:.5,y:.5}),P=t.zoom*v,w=t.rotation*(180/Math.PI),L={x:S*.5,y:x*.5},F={x:L.x-y*O,y:L.y-I*z},C=[`rotate(${w} ${L.x} ${L.y})`,`translate(${L.x} ${L.y})`,`scale(${P})`,`translate(${-L.x} ${-L.y})`,`translate(${F.x} ${F.y})`],V=t.flip&&t.flip.horizontal,G=t.flip&&t.flip.vertical,B=[`scale(${V?-1:1} ${G?-1:1})`,`translate(${V?-y:0} ${G?-I:0})`],N=`<?xml version="1.0" encoding="UTF-8"?>
|
||
|
<svg width="${S}${b}" height="${x}${E}"
|
||
|
viewBox="0 0 ${S} ${x}" ${r?'style="background:'+r+'" ':""}
|
||
|
preserveAspectRatio="xMinYMin"
|
||
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||
|
xmlns="http://www.w3.org/2000/svg">
|
||
|
<!-- Generated by PQINA - https://pqina.nl/ -->
|
||
|
<title>${d?d.textContent:""}</title>
|
||
|
<g transform="${C.join(" ")}">
|
||
|
<g transform="${B.join(" ")}">
|
||
|
${u.outerHTML}${A}
|
||
|
</g>
|
||
|
</g>
|
||
|
</svg>`;n(N)},o.readAsText(e)}),mf=e=>{let t;try{t=new ImageData(e.width,e.height)}catch{t=document.createElement("canvas").getContext("2d").createImageData(e.width,e.height)}return t.data.set(e.data),t},gf=()=>{let e={resize:c,filter:u},t=(d,h)=>(d.forEach(f=>{h=e[f.type](h,f.data)}),h),i=(d,h)=>{let f=d.transforms,p=null;if(f.forEach(m=>{m.type==="filter"&&(p=m)}),p){let m=null;f.forEach(g=>{g.type==="resize"&&(m=g)}),m&&(m.data.matrix=p.data,f=f.filter(g=>g.type!=="filter"))}h(t(f,d.imageData))};self.onmessage=d=>{i(d.data.message,h=>{self.postMessage({id:d.data.id,message:h},[h.data.buffer])})};let a=1,n=1,r=1;function o(d,h,f){let p=h[d]/255,m=h[d+1]/255,g=h[d+2]/255,b=h[d+3]/255,E=p*f[0]+m*f[1]+g*f[2]+b*f[3]+f[4],T=p*f[5]+m*f[6]+g*f[7]+b*f[8]+f[9],_=p*f[10]+m*f[11]+g*f[12]+b*f[13]+f[14],y=p*f[15]+m*f[16]+g*f[17]+b*f[18]+f[19],I=Math.max(0,E*y)+a*(1-y),A=Math.max(0,T*y)+n*(1-y),R=Math.max(0,_*y)+r*(1-y);h[d]=Math.max(0,Math.min(1,I))*255,h[d+1]=Math.max(0,Math.min(1,A))*255,h[d+2]=Math.max(0,Math.min(1,R))*255}let l=self.JSON.stringify([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]);function s(d){return self.JSON.stringify(d||[])===l}function u(d,h){if(!h||s(h))return d;let f=d.data,p=f.length,m=h[0],g=h[1],b=h[2],E=h[3],T=h[4],_=h[5],y=h[6],I=h[7],A=h[8],R=h[9],S=h[10],x=h[11],D=h[12],O=h[13],z=h[14],v=h[15],P=h[16],w=h[17],L=h[18],F=h[19],C=0,V=0,G=0,B=0,N=0,k=0,q=0,U=0,W=0,$=0,ae=0,X=0;for(;C<p;C+=4)V=f[C]/255,G=f[C+1]/255,B=f[C+2]/255,N=f[C+3]/255,k=V*m+G*g+B*b+N*E+T,q=V*_+G*y+B*I+N*A+R,U=V*S+G*x+B*D+N*O+z,W=V*v+G*P+B*w+N*L+F,$=Math.max(0,k*W)+a*(1-W),ae=Math.max(0,q*W)+n*(1-W),X=Math.max(0,U*W)+r*(1-W),f[C]=Math.max(0,Math.min(1,$))*255,f[C+1]=Math.max(0,Math.min(1,ae))*255,f[C+2]=Math.max(0,Math.min(1,X))*255;return d}function c(d,h){let{mode:f="contain",upscale:p=!1,width:m,height:g,matrix:b}=h;if(b=!b||s(b)?null:b,!m&&!g)return u(d,b);if(m===null?m=g:g===null&&(g=m),f!=="force"){let O=m/d.width,z=g/d.height,v=1;if(f==="cover"?v=Math.max(O,z):f==="contain"&&(v=Math.min(O,z)),v>1&&p===!1)return u(d,b);m=d.width*v,g=d.height*v}let E=d.width,T=d.height,_=Math.round(m),y=Math.round(g),I=d.data,A=new Uint8ClampedArray(_*y*4),R=E/_,S=T/y,x=Math.ceil(R*.5),D=Math.ceil(S*.5);for(let O=0;O<y;O++)for(let z=0;z<_;z++){let v=(z+O*_)*4,P=0,w=0,L=0,F=0,C=0,V=0,G=0,B=(O+.5)*S;for(let N=Math.floor(O*S);N<(O+1)*S;N++){let k=Math.abs(B-(N+.5))/D,q=(z+.5)*R,U=k*k;for(let W=Math.floor(z*R);W<(z+1)*R;W++){let $=Math.abs(q-(W+.5))/x,ae=Math.sqrt(U+$*$);if(ae>=-1&&ae<=1&&(P=2*ae*ae*ae-3*ae*ae+1,P>0)){$=4*(W+N*E);let X=I[$+3];G+=P*X,L+=P,X<255&&(P=P*X/250),F+=P*I[$],C+=P*I[$+1],V+=P*I[$+2],w+=P}}}A[v]=F/w,A[v+1]=C/w,A[v+2]=V/w,A[v+3]=G/L,b&&o(v,A,b)}return{data:A,width:_,height:y}}},Ef=(e,t)=>{if(e.getUint32(t+4,!1)!==1165519206)return;t+=4;let i=e.getUint16(t+=6,!1)===18761;t+=e.getUint32(t+4,i);let a=e.getUint16(t,i);t+=2;for(let n=0;n<a;n++)if(e.getUint16(t+n*12,i)===274)return e.setUint16(t+n*12+8,1,i),!0;return!1},Tf=e=>{let t=new DataView(e);if(t.getUint16(0)!==65496)return null;let i=2,a,n,r=!1;for(;i<t.byteLength&&(a=t.getUint16(i,!1),n=t.getUint16(i+2,!1)+2,!(!(a>=65504&&a<=65519||a===65534)||(r||(r=Ef(t,i,n)),i+n>t.byteLength)));)i+=n;return e.slice(0,i)},If=e=>new Promise(t=>{let i=new FileReader;i.onload=()=>t(Tf(i.result)||null),i.readAsArrayBuffer(e.slice(0,256*1024))}),bf=()=>window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,_f=(e,t)=>{let i=bf();if(i){let a=new i;return a.append(e),a.getBlob(t)}return new Blob([e],{type:t})},Rf=()=>Math.random().toString(36).substr(2,9),yf=e=>{let t=new Blob(["(",e.toString(),")()"],{type:"application/javascript"}),i=URL.createObjectURL(t),a=new Worker(i),n=[];return{transfer:()=>{},post:(r,o,l)=>{let s=Rf();n[s]=o,a.onmessage=u=>{let c=n[u.data.id];c&&(c(u.data.message),delete n[u.data.id])},a.postMessage({id:s,message:r},l)},terminate:()=>{a.terminate(),URL.revokeObjectURL(i)}}},Sf=e=>new Promise((t,i)=>{let a=new Image;a.onload=()=>{t(a)},a.onerror=n=>{i(n)},a.src=e}),wf=e=>e.reduce((t,i)=>t.then(a=>i().then(Array.prototype.co
|
||
|
/*! Bundled license information:
|
||
|
|
||
|
filepond/dist/filepond.esm.js:
|
||
|
(*!
|
||
|
* FilePond 4.30.4
|
||
|
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
||
|
* Please visit https://pqina.nl/filepond/ for details.
|
||
|
*)
|
||
|
|
||
|
cropperjs/dist/cropper.esm.js:
|
||
|
(*!
|
||
|
* Cropper.js v1.6.1
|
||
|
* https://fengyuanchen.github.io/cropperjs
|
||
|
*
|
||
|
* Copyright 2015-present Chen Fengyuan
|
||
|
* Released under the MIT license
|
||
|
*
|
||
|
* Date: 2023-09-17T03:44:19.860Z
|
||
|
*)
|
||
|
|
||
|
filepond-plugin-file-validate-size/dist/filepond-plugin-file-validate-size.esm.js:
|
||
|
(*!
|
||
|
* FilePondPluginFileValidateSize 2.2.8
|
||
|
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
||
|
* Please visit https://pqina.nl/filepond/ for details.
|
||
|
*)
|
||
|
|
||
|
filepond-plugin-file-validate-type/dist/filepond-plugin-file-validate-type.esm.js:
|
||
|
(*!
|
||
|
* FilePondPluginFileValidateType 1.2.8
|
||
|
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
||
|
* Please visit https://pqina.nl/filepond/ for details.
|
||
|
*)
|
||
|
|
||
|
filepond-plugin-image-crop/dist/filepond-plugin-image-crop.esm.js:
|
||
|
(*!
|
||
|
* FilePondPluginImageCrop 2.0.6
|
||
|
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
||
|
* Please visit https://pqina.nl/filepond/ for details.
|
||
|
*)
|
||
|
|
||
|
filepond-plugin-image-edit/dist/filepond-plugin-image-edit.esm.js:
|
||
|
(*!
|
||
|
* FilePondPluginImageEdit 1.6.3
|
||
|
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
||
|
* Please visit https://pqina.nl/filepond/ for details.
|
||
|
*)
|
||
|
|
||
|
filepond-plugin-image-exif-orientation/dist/filepond-plugin-image-exif-orientation.esm.js:
|
||
|
(*!
|
||
|
* FilePondPluginImageExifOrientation 1.0.11
|
||
|
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
||
|
* Please visit https://pqina.nl/filepond/ for details.
|
||
|
*)
|
||
|
|
||
|
filepond-plugin-image-preview/dist/filepond-plugin-image-preview.esm.js:
|
||
|
(*!
|
||
|
* FilePondPluginImagePreview 4.6.11
|
||
|
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
||
|
* Please visit https://pqina.nl/filepond/ for details.
|
||
|
*)
|
||
|
|
||
|
filepond-plugin-image-resize/dist/filepond-plugin-image-resize.esm.js:
|
||
|
(*!
|
||
|
* FilePondPluginImageResize 2.0.10
|
||
|
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
||
|
* Please visit https://pqina.nl/filepond/ for details.
|
||
|
*)
|
||
|
|
||
|
filepond-plugin-image-transform/dist/filepond-plugin-image-transform.esm.js:
|
||
|
(*!
|
||
|
* FilePondPluginImageTransform 3.8.7
|
||
|
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
||
|
* Please visit https://pqina.nl/filepond/ for details.
|
||
|
*)
|
||
|
|
||
|
filepond-plugin-media-preview/dist/filepond-plugin-media-preview.esm.js:
|
||
|
(*!
|
||
|
* FilePondPluginMediaPreview 1.0.11
|
||
|
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
||
|
* Please visit undefined for details.
|
||
|
*)
|
||
|
*/
|