@uploadcare/file-uploader 1.3.0-alpha.1 → 1.3.0-alpha.2
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/abstract/Block.d.ts +3 -0
- package/abstract/Block.d.ts.map +1 -1
- package/abstract/Block.js +17 -1
- package/blocks/CloudImageEditor/src/svg-sprite.d.ts +1 -1
- package/blocks/CloudImageEditor/src/svg-sprite.js +1 -1
- package/blocks/themes/uc-basic/svg-sprite.d.ts +1 -1
- package/blocks/themes/uc-basic/svg-sprite.js +1 -1
- package/index.ssr.js +2 -2
- package/package.json +4 -2
- package/web/file-uploader.iife.min.js +4 -4
- package/web/file-uploader.min.js +4 -4
- package/web/uc-cloud-image-editor.min.js +4 -4
- package/web/uc-file-uploader-inline.min.js +4 -4
- package/web/uc-file-uploader-minimal.min.js +3 -3
- package/web/uc-file-uploader-regular.min.js +4 -4
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* SOFTWARE.
|
|
24
24
|
*
|
|
25
25
|
*/
|
|
26
|
-
var sr=Object.defineProperty;var or=Object.getPrototypeOf;var
|
|
27
|
-
`,"\\n"),i=
|
|
28
|
-
`));return}window.customElements.define(e,t?class extends this{}:this)}static get is(){return this.__tag||this.reg(),this.__tag}static bindAttributes(e){this.observedAttributes=[...new Set((this.observedAttributes||[]).concat(Object.keys(e)))],this.__attrDesc=e}attributeChangedCallback(e,t,s){var
|
|
29
|
-
`))}}return i}var x=Object.freeze({CROP:"crop",TUNING:"tuning",FILTERS:"filters"}),I=[x.CROP,x.TUNING,x.FILTERS],ui=["brightness","exposure","gamma","contrast","saturation","vibrance","warmth","enhance"],di=["adaris","briaril","calarel","carris","cynarel","cyren","elmet","elonni","enzana","erydark","fenralan","ferand","galen","gavin","gethriel","iorill","iothari","iselva","jadis","lavra","misiara","namala","nerion","nethari","pamaya","sarnar","sedis","sewen","sorahel","sorlen","tarian","thellassan","varriel","varven","vevera","virkas","yedis","yllara","zatvel","zevcen"],fi=["rotate","mirror","flip"],X=Object.freeze({brightness:{zero:N.brightness,range:[-100,100],keypointsNumber:2},exposure:{zero:N.exposure,range:[-500,500],keypointsNumber:2},gamma:{zero:N.gamma,range:[0,1e3],keypointsNumber:2},contrast:{zero:N.contrast,range:[-100,500],keypointsNumber:2},saturation:{zero:N.saturation,range:[-100,500],keypointsNumber:1},vibrance:{zero:N.vibrance,range:[-100,500],keypointsNumber:1},warmth:{zero:N.warmth,range:[-100,100],keypointsNumber:1},enhance:{zero:N.enhance,range:[0,100],keypointsNumber:1},filter:{zero:N.filter,range:[0,100],keypointsNumber:1}});var pi=r=>r?r.split(",").map(i=>i.trim()):[],rt=r=>r?r.join(","):"";var Tr="https://ucarecdn.com",Er="https://upload.uploadcare.com",Cr="https://social.uploadcare.com",F={pubkey:"",multiple:!0,multipleMin:0,multipleMax:Number.MAX_SAFE_INTEGER,confirmUpload:!1,imgOnly:!1,accept:"",externalSourcesPreferredTypes:"",store:"auto",cameraMirror:!1,cameraCapture:"",sourceList:"local, url, camera, dropbox, gdrive",cloudImageEditorTabs:rt(I),maxLocalFileSizeBytes:0,thumbSize:76,showEmptyList:!1,useLocalImageEditor:!1,useCloudImageEditor:!0,removeCopyright:!1,cropPreset:"",imageShrink:"",modalScrollLock:!0,modalBackdropStrokes:!1,sourceListWrap:!0,remoteTabSessionKey:"",cdnCname:Tr,baseUrl:Er,socialBaseUrl:Cr,secureSignature:"",secureExpire:"",secureDeliveryProxy:"",retryThrottledRequestMaxTimes:1,multipartMinFileSize:26214400,multipartChunkSize:5242880,maxConcurrentRequests:10,multipartMaxConcurrentRequests:4,multipartMaxAttempts:3,checkForUrlDuplicates:!1,saveUrlForRecurrentUploads:!1,groupOutput:!1,userAgentIntegration:"",debug:!1,metadata:null,localeName:"en",localeDefinitionOverride:null,secureUploadsExpireThreshold:10*60*1e3,secureUploadsSignatureResolver:null,secureDeliveryProxyUrlResolver:null,iconHrefResolver:null,fileValidators:[],collectionValidators:[]};var Eo=Object.freeze({FILE_ADDED:"file-added",FILE_REMOVED:"file-removed",FILE_UPLOAD_START:"file-upload-start",FILE_UPLOAD_PROGRESS:"file-upload-progress",FILE_UPLOAD_SUCCESS:"file-upload-success",FILE_UPLOAD_FAILED:"file-upload-failed",FILE_URL_CHANGED:"file-url-changed",MODAL_OPEN:"modal-open",MODAL_CLOSE:"modal-close",DONE_CLICK:"done-click",UPLOAD_CLICK:"upload-click",ACTIVITY_CHANGE:"activity-change",COMMON_UPLOAD_START:"common-upload-start",COMMON_UPLOAD_PROGRESS:"common-upload-progress",COMMON_UPLOAD_SUCCESS:"common-upload-success",COMMON_UPLOAD_FAILED:"common-upload-failed",CHANGE:"change",GROUP_CREATED:"group-created"}),st=class{constructor(i){m(this,"_timeoutStore",new Map);m(this,"_targets",new Set);m(this,"_debugPrint",null);this._debugPrint=i}bindTarget(i){this._targets.add(i)}unbindTarget(i){this._targets.delete(i)}_dispatch(i,e){var t;for(let s of this._targets)s.dispatchEvent(new CustomEvent(i,{detail:e}));(t=this._debugPrint)==null||t.call(this,()=>{let s=e&&typeof e=="object"?{...e}:e;return[`event "${i}"`,s]})}emit(i,e,{debounce:t}={}){if(typeof t!="number"&&!t){this._dispatch(i,typeof e=="function"?e():e);return}this._timeoutStore.has(i)&&window.clearTimeout(this._timeoutStore.get(i));let s=typeof t=="number"?t:20,o=window.setTimeout(()=>{this._dispatch(i,typeof e=="function"?e():e),this._timeoutStore.delete(i)},s);this._timeoutStore.set(i,o)}};function R(r,i){let e,t=(...s)=>{clearTimeout(e),e=setTimeout(()=>r(...s),i)};return t.cancel=()=>{clearTimeout(e)},t}var mi="--uploadcare-blocks-window-height",fe=class{static registerClient(i){this.clientsRegistry.size===0&&this.attachTracker(),this.clientsRegistry.add(i)}static unregisterClient(i){this.clientsRegistry.delete(i),this.clientsRegistry.size===0&&this.detachTracker()}static attachTracker(){window.addEventListener("resize",this.flush,{passive:!0,capture:!0}),this.flush()}static detachTracker(){window.removeEventListener("resize",this.flush,{capture:!0}),document.documentElement.style.removeProperty(mi)}};m(fe,"clientsRegistry",new Set),m(fe,"flush",R(()=>{document.documentElement.style.setProperty(mi,`${window.innerHeight}px`)},100));var gi=r=>{var t;let i=new Intl.Locale(r),e="ltr";return typeof i.getTextInfo=="function"&&i.getTextInfo().direction?e=i.getTextInfo().direction:"textInfo"in i&&((t=i.textInfo)!=null&&t.direction)&&(e=i.textInfo.direction),e};var bi=(r,i)=>new Intl.PluralRules(r).select(i);var Ar=r=>r,Ot="{{",yi="}}",_i="plural:";function Lt(r,i,e={}){var l;let{openToken:t=Ot,closeToken:s=yi,transform:o=Ar}=e;for(let n in i){let a=(l=i[n])==null?void 0:l.toString();r=r.replaceAll(t+n+s,typeof a=="string"?o(a):a)}return r}function wi(r){let i=[],e=r.indexOf(Ot);for(;e!==-1;){let t=r.indexOf(yi,e),s=r.substring(e+2,t);if(s.startsWith(_i)){let o=r.substring(e+2,t).replace(_i,""),l=o.substring(0,o.indexOf("(")),n=o.substring(o.indexOf("(")+1,o.indexOf(")"));i.push({variable:s,pluralKey:l,countVariable:n})}e=r.indexOf(Ot,t)}return i}function vi(){let r,i,e=new Promise((t,s)=>{r=t,i=s});return{resolve:r,reject:i,promise:e}}var kt=async({element:r,attribute:i,timeout:e=300})=>{let{promise:t,resolve:s}=vi(),o=r.getAttribute(i);if(o!==null)return s({success:!0,value:o,attribute:i}),t;let l=new MutationObserver(c=>{let u=c[c.length-1];a(u)});l.observe(r,{attributes:!0,attributeFilter:[i]});let n=setTimeout(()=>{l.disconnect(),s({success:!1,attribute:i})},e),a=c=>{let u=r.getAttribute(i);c.type==="attributes"&&c.attributeName===i&&u!==null&&(clearTimeout(n),l.disconnect(),s({success:!0,value:u,attribute:i}))};return t};var xi=()=>({});var Re={"locale-id":"en","social-source-lang":"en","upload-file":"Upload file","upload-files":"Upload files","choose-file":"Choose file","choose-files":"Choose files","drop-files-here":"Drop files here","select-file-source":"Select file source",selected:"Selected",upload:"Upload","add-more":"Add more",cancel:"Cancel","start-from-cancel":"Cancel",clear:"Clear","camera-shot":"Shot","upload-url":"Import","upload-url-placeholder":"Paste link here","edit-image":"Edit image","edit-detail":"Details",back:"Back",done:"Done",ok:"Ok","remove-from-list":"Remove",no:"No",yes:"Yes","confirm-your-action":"Confirm your action","are-you-sure":"Are you sure?","selected-count":"Selected:","upload-error":"Upload error","validation-error":"Validation error","no-files":"No files selected",browse:"Browse","not-uploaded-yet":"Not uploaded yet...",file__one:"file",file__other:"files",error__one:"error",error__other:"errors","header-uploading":"Uploading {{count}} {{plural:file(count)}}","header-failed":"{{count}} {{plural:error(count)}}","header-succeed":"{{count}} {{plural:file(count)}} uploaded","header-total":"{{count}} {{plural:file(count)}} selected","src-type-local":"From device","src-type-from-url":"From link","src-type-camera":"Camera","src-type-draw":"Draw","src-type-facebook":"Facebook","src-type-dropbox":"Dropbox","src-type-gdrive":"Google Drive","src-type-gphotos":"Google Photos","src-type-instagram":"Instagram","src-type-flickr":"Flickr","src-type-vk":"VK","src-type-evernote":"Evernote","src-type-box":"Box","src-type-onedrive":"Onedrive","src-type-huddle":"Huddle","src-type-other":"Other","caption-from-url":"Import from link","caption-camera":"Camera","caption-draw":"Draw","caption-edit-file":"Edit file","file-no-name":"No name...","toggle-fullscreen":"Toggle fullscreen","toggle-guides":"Toggle guides",rotate:"Rotate","flip-vertical":"Flip vertical","flip-horizontal":"Flip horizontal",apply:"Apply",brightness:"Brightness",contrast:"Contrast",saturation:"Saturation",exposure:"Exposure",gamma:"Gamma",vibrance:"Vibrance",warmth:"Warmth",enhance:"Enhance",original:"Original",resize:"Resize image",crop:"Crop","select-color":"Select color",text:"Text",draw:"Draw","cancel-edit":"Cancel edit","tab-view":"Preview","tab-details":"Details","file-name":"Name","file-size":"Size","cdn-url":"CDN URL","file-size-unknown":"Unknown","camera-permissions-denied":"Camera access denied","camera-permissions-prompt":"Please allow access to the camera","camera-permissions-request":"Request access","files-count-limit-error-title":"Files count limit overflow","files-count-limit-error-too-few":"You\u2019ve chosen {{total}} {{plural:file(total)}}. At least {{min}} {{plural:file(min)}} required.","files-count-limit-error-too-many":"You\u2019ve chosen too many files. {{max}} {{plural:file(max)}} is maximum.","files-max-size-limit-error":"File is too big. Max file size is {{maxFileSize}}.","has-validation-errors":"File validation error ocurred. Please, check your files before upload.","images-only-accepted":"Only image files are accepted.","file-type-not-allowed":"Uploading of these file types is not allowed.","some-files-were-not-uploaded":"Some files were not uploaded.","file-item-edit-button":"Edit button","file-item-remove-button":"Remove button"};var ot=new Map,It=new Map,Ti=(r,i)=>{ot.has(r)&&console.log(`Locale ${r} is already defined. Overwriting...`),ot.set(r,{...Re,...i})},Sr=(r,i)=>{It.set(r,i)},$r=(r,i)=>{typeof i=="function"?Sr(r,i):Ti(r,i)},Ei=async r=>{if(!ot.has(r)){if(!It.has(r))throw new Error(`Locale ${r} is not defined`);let e=await It.get(r)();Ti(r,e)}return ot.get(r)};$r("en",Re);var Q=r=>`*l10n/${r}`,Or="en",lt=class{constructor(i){m(this,"_blockInstance",null);m(this,"_localeName","");m(this,"_callbacks",new Set);m(this,"_boundBlocks",new Map);this._blockInstance=i;for(let[e,t]of Object.entries(Re))this._blockInstance.add(Q(e),t,!1);setTimeout(()=>{i.subConfigValue("localeName",async e=>{var o;if(!this._blockInstance||!e)return;this._localeName=e;let t=await Ei(e);if(e!==Or&&this._localeName!==e)return;let s=(o=this._blockInstance.cfg.localeDefinitionOverride)==null?void 0:o[e];for(let[l,n]of Object.entries(t)){let a=s==null?void 0:s[l];this._blockInstance.add(Q(l),a!=null?a:n,!0);for(let c of this._callbacks)c()}}),i.subConfigValue("localeDefinitionOverride",e=>{var s;if(!e)return;let t=e[this._localeName];if(t)for(let[o,l]of Object.entries(t)){(s=this._blockInstance)==null||s.add(Q(o),l,!0);for(let n of this._callbacks)n()}})})}onLocaleChange(i){let e=R(i,0);return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}bindL10n(i,e,t){var o,l,n;i.$[e]=t(),this._boundBlocks.has(i)||this._boundBlocks.set(i,new Map),(l=(o=this._boundBlocks.get(i))==null?void 0:o.get(e))==null||l();let s=this.onLocaleChange(()=>{i.$[e]=t()});(n=this._boundBlocks.get(i))==null||n.set(e,s)}destroyL10nBindings(i){let e=this._boundBlocks.get(i);if(e){for(let t of e.values())t();this._boundBlocks.delete(i)}}destroy(){this._callbacks.clear()}};var Lr={button:["toolbar"],checkbox:["toolbar"],menuitem:["menu","menubar"],option:["listbox"],tab:["tablist"]};function De(r,i){i.tabIndex=0,i.focus(),r.tabIndex=-1}function Pt(r){let i=r.role||r.type||r.tagName;if(!i)return null;let e=Lr[i.toLowerCase()];if(!e)return null;for(let t of e){let s=r.closest(`[role=${t}]`);if(s)return s}}function Mt(r,i){return i.role==="toolbar"?kr(i):i.querySelectorAll(`[role=${r.role}]`)}function kr(r){return[...r.querySelectorAll("*")].filter(e=>e.role==="button"||e.type==="button"||e.role==="checkbox"||e.type==="checkbox")}function Ir(r){let i=r.getAttribute("aria-orientation");if(i==="vertical")return!1;if(i==="horizontal")return!0;let e=r.role;return e==="menubar"||e==="tablist"||e==="toolbar"}function Ci(r){return i=>{let e=!1,t=(r==null?void 0:r.searchDelayMs)||300,s=0,o="";function l(h){let f=Pt(h.target);if(!f){n();return}let g=Mt(h.target,f),_=Array.from(g).indexOf(h.target),T="ArrowDown",k="ArrowUp";if(Ir(f)&&(i.document.dir==="rtl"?(T="ArrowLeft",k="ArrowRight"):(T="ArrowRight",k="ArrowLeft")),h.key===T)h.preventDefault(),De(h.target,g[_+1]||g[0]);else if(h.key===k)h.preventDefault(),De(h.target,g[_-1]||g[g.length-1]);else if(h.key==="Home")h.preventDefault(),De(h.target,g[0]);else if(h.key==="End")h.preventDefault(),De(h.target,g[g.length-1]);else if(h.key.length===1&&f.role!=="tablist"){let M=Date.now();M-s<=t?o+=h.key.toLowerCase():o=h.key.toLowerCase(),s=M;let ae=Array.from(g).find(rr=>{var Xt,Ht,jt;return(jt=(Ht=(Xt=rr.textContent)==null?void 0:Xt.trim())==null?void 0:Ht.toLowerCase())==null?void 0:jt.startsWith(o)});ae&&(h.preventDefault(),De(h.target,ae))}}function n(){e=!1,i.removeEventListener("keydown",l)}function a(h){let f=Pt(h.target);if(f){e||(e=!0,i.addEventListener("keydown",l));let g=Mt(h.target,f);for(let _ of g)_!==h.target&&_.setAttribute("tabindex",-1)}else e&&n()}function c(h){(!h.relatedTarget||h.relatedTarget===i.document)&&n()}function u(h){let f=Pt(h.target);if(f){let g=Mt(h.target,f);for(let _ of g)_!==h.target&&_.setAttribute("tabindex",-1);h.target.setAttribute("tabindex",0)}}return i.addEventListener("click",u),i.addEventListener("focusin",a),i.addEventListener("focusout",c),()=>{n(),i.removeEventListener("click",u),i.removeEventListener("focusin",a),i.removeEventListener("focusout",c)}}}function Ai(){return r=>{let i,e;function t(o){if(o.target.getAttribute("aria-hidden")==="true"){i=o.target,i.setAttribute("aria-hidden","false"),e=i.hidden,e&&(i.hidden=!1);let l=o.target.querySelector('a, button, select, textarea, input:not([type=radio]), [type=radio]:checked, [tabindex]:not([tabindex="-1"])');l&&(l.tabIndex=0)}}function s(o){i&&i.contains(o.target)&&(!o.relatedTarget||!i.contains(o.relatedTarget))&&(o.target.tabIndex=-1,i.setAttribute("aria-hidden","true"),e&&(i.hidden=!0),i=null)}return r.addEventListener("keyuxJump",t),r.addEventListener("focusout",s),()=>{r.removeEventListener("keyuxJump",t),r.removeEventListener("focusout",s)}}}function Si(){return r=>{let i=[];function e(c){let u=r.document.activeElement;u&&u!==r.document.body&&i.push(new WeakRef(u)),c.focus({focusVisible:!0})}function t(){let c=i.pop();if(!c){r.document.activeElement.blur();return}let u=c.deref();u&&u.isConnected?u.focus():t()}let s=0,o;function l(c){clearInterval(o);let u=c.getAttribute("aria-controls");u&&(o=setInterval(()=>{if(s++>50){clearInterval(o);return}let h=r.document.getElementById(u);if(h){let f=h.querySelector('a, button, select, textarea, input:not([type=radio]), [type=radio]:checked, [tabindex]:not([tabindex="-1"])');f&&(clearInterval(o),h.dispatchEvent(new r.CustomEvent("keyuxJump",{bubbles:!0})),e(f))}},50))}function n(c){c.clientX===0&&c.clientY===0&&l(c.target)}function a(c){c.target.tagName==="INPUT"&&c.key==="Enter"&&l(c.target),c.key==="Escape"&&t()}return r.addEventListener("click",n),r.addEventListener("keydown",a),()=>{r.removeEventListener("click",n),r.removeEventListener("keydown",a)}}}function $i(r){let i,e=r.split(" ");function t(){i&&i.classList.remove(...e)}function s(o){o.clientX===0&&o.clientY===0&&(t(),o.target.classList.add(...e),i=o.target)}return o=>(o.addEventListener("keyup",t),o.addEventListener("click",s),()=>{o.removeEventListener("keyup",t),o.removeEventListener("click",s)})}function Oi(r,i){let e=i.map(t=>t(r));return()=>{e.forEach(t=>t())}}var Nt=class{constructor(){m(this,"_listeners",new Map);m(this,"_scope",[])}addEventListener(i,e){let t=s=>{let o=s.target;o&&this._scope.some(l=>l===s.target||l.contains(o))&&e(s)};this._listeners.set(e,t),window.addEventListener(i,t)}removeEventListener(i,e){let t=this._listeners.get(e);t&&window.removeEventListener(i,t),this._listeners.delete(e)}get CustomEvent(){return window.CustomEvent}get document(){return window.document}get navigator(){return window.navigator}registerScope(i){this._scope.push(i)}destroy(){this._scope=[],this._listeners.forEach((i,e)=>{window.removeEventListener("keydown",i),window.removeEventListener("keyup",i),this._listeners.delete(e)})}},nt=class{constructor(){m(this,"_destroyKeyUX");m(this,"_scopedWindow");this._scopedWindow=new Nt,this._destroyKeyUX=Oi(this._scopedWindow,[Ci(),$i("is-pressed"),Si(),Ai()])}registerBlock(i){this._scopedWindow.registerScope(i)}destroy(){var i;(i=this._destroyKeyUX)==null||i.call(this),this._scopedWindow.destroy()}};function Li(r,i){[...r.querySelectorAll("[l10n]")].forEach(e=>{let t=e.getAttribute("l10n");if(!t)return;let s="textContent",o=!1;if(t.includes(":")){let a=t.split(":");s=a[0],t=a[1],s.startsWith("@")&&(s=s.slice(1),o=!0)}let l=t;i.has(l)&&i.sub(l,a=>{if(!a)return;i.l10nProcessorSubs.has(l)||i.l10nProcessorSubs.set(l,new Set);let c=i.l10nProcessorSubs.get(l);c==null||c.forEach(f=>{f.remove(),c.delete(f),i.allSubs.delete(f)});let u=Q(a).replace("*","");i.sharedCtx.has(u)||i.sharedCtx.add(u,a);let h=i.sharedCtx.sub(u,()=>{e[s]=i.l10n(a)});c==null||c.add(h),i.allSubs.add(h),e.removeAttribute("l10n")});let n=Q(t);i.has(n)||i.add(n,""),i.sub(n,()=>{t=t,o?e.setAttribute(s,i.l10n(t)):e[s]=i.l10n(t)}),e.removeAttribute("l10n")})}var P=r=>`*cfg/${r}`;var Rt="set";function ki(r){[...r.querySelectorAll(`[${Rt}]`)].forEach(i=>{let e=i.getAttribute(Rt);e&&(i.removeAttribute(Rt),i.setAttribute(d.BIND_ATTR,e))})}var Pr="uc-",Dt="ctx-name",y=class extends Ct{constructor(){super();m(this,"requireCtxName",!1);m(this,"activityType",null);m(this,"init$",xi());this.l10nProcessorSubs=new Map,this.addTemplateProcessor(Li),this.addTemplateProcessor(ii),this.tplProcessors=new Set([ki,...this.tplProcessors])}l10n(e,t={}){if(!e)return"";let s=this.$[Q(e)]||e,o=wi(s);for(let n of o)t[n.variable]=this.pluralize(n.pluralKey,Number(t[n.countVariable]));return Lt(s,t)}pluralize(e,t){let s=this.l10n("locale-id")||"en",o=bi(s,t);return this.l10n(`${e}__${o}`)}bindL10n(e,t){var s;(s=this.localeManager)==null||s.bindL10n(this,e,t)}emit(e,t,s){let o=this.has("*eventEmitter")&&this.$["*eventEmitter"];o&&o.emit(e,t,s)}hasBlockInCtx(e){for(let t of this.blocksRegistry)if(e(t))return!0;return!1}setOrAddState(e,t){this.add$({[e]:t},!0)}connectedCallback(){this.constructor.styleAttrs.forEach(t=>{this.setAttribute(t,"")}),this.hasAttribute("retpl")&&(this.constructor.template=null,this.processInnerHtml=!0),this.requireCtxName?Promise.race([kt({element:this,attribute:d.CTX_NAME_ATTR}),kt({element:this,attribute:Dt})]).then(t=>{if(t.success){if(t.attribute===Dt){let s=t.value;this.style.setProperty(d.CSS_CTX_PROP,`'${s}'`)}super.connectedCallback()}else console.error(`Attribute "${d.CTX_NAME_ATTR}" or "${Dt}" is required and it is not set.`)}):super.connectedCallback(),fe.registerClient(this)}disconnectedCallback(){super.disconnectedCallback(),fe.unregisterClient(this)}initCallback(){this.has("*blocksRegistry")||this.add("*blocksRegistry",new Set),this.$["*blocksRegistry"].add(this),this.has("*eventEmitter")||this.add("*eventEmitter",new st(this.debugPrint.bind(this))),this.has("*localeManager")||this.add("*localeManager",new lt(this)),this.has("*a11y")||this.add("*a11y",new nt),this.sub(Q("locale-id"),t=>{let s=gi(t);this.style.direction=s==="ltr"?"":s})}get localeManager(){return this.has("*localeManager")?this.$["*localeManager"]:null}get a11y(){return this.has("*a11y")?this.$["*a11y"]:null}get blocksRegistry(){return this.$["*blocksRegistry"]}destroyCallback(){var t;let e=this.blocksRegistry;e==null||e.delete(this),(t=this.localeManager)==null||t.destroyL10nBindings(this),this.l10nProcessorSubs=new Map,ie.deleteCtx(this.localCtx.uid),(e==null?void 0:e.size)===0&&setTimeout(()=>{this.destroyCtxCallback()},0)}destroyCtxCallback(){var e;ie.deleteCtx(this.ctxName),(e=this.localeManager)==null||e.destroy()}async proxyUrl(e){if(this.cfg.secureDeliveryProxy&&this.cfg.secureDeliveryProxyUrlResolver&&console.warn("Both secureDeliveryProxy and secureDeliveryProxyUrlResolver are set. The secureDeliveryProxyUrlResolver will be used."),this.cfg.secureDeliveryProxyUrlResolver)try{return await this.cfg.secureDeliveryProxyUrlResolver(e,{uuid:tt(e),cdnUrlModifiers:At(e),fileName:et(e)})}catch(t){return console.error("Failed to resolve secure delivery proxy URL. Falling back to the default URL.",t),e}return this.cfg.secureDeliveryProxy?Lt(this.cfg.secureDeliveryProxy,{previewUrl:e},{transform:t=>window.encodeURIComponent(t)}):e}get cfg(){if(!this.__cfgProxy){let e=Object.create(null);this.__cfgProxy=new Proxy(e,{set:(t,s,o)=>{if(typeof s!="string")return!1;let l=P(s);return this.has(l)||this.add(l,F[s]),this.$[l]=o,!0},get:(t,s)=>{let o=P(s);return this.has(o)||this.add(o,F[s]),this.$[P(s)]}})}return this.__cfgProxy}subConfigValue(e,t){let s=P(e);this.has(s)||this.add(s,F[e]),this.sub(s,t)}debugPrint(...e){if(!this.cfg.debug)return;let t=e;if(typeof(e==null?void 0:e[0])=="function"){let s=e[0];t=s()}console.log(`[${this.ctxName}]`,...t)}static reg(e){if(!e){super.reg();return}e.startsWith(Pr)&&super.reg(e)}};m(y,"StateConsumerScope",null),m(y,"styleAttrs",[]);var H="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=";function Ii(...r){return r.reduce((i,e)=>{if(typeof e=="string")return i[e]=!0,i;for(let t of Object.keys(e))i[t]=e[t];return i},{})}function S(...r){let i=Ii(...r);return Object.keys(i).reduce((e,t)=>(i[t]&&e.push(t),e),[]).join(" ")}function Pi(r,...i){let e=Ii(...i);for(let t of Object.keys(e))r.classList.toggle(t,e[t])}var Mi=r=>{if(!r)return[];let[i,e]=r.split(":").map(Number);if(!Number.isFinite(i)||!Number.isFinite(e)){console.error(`Invalid crop preset: ${r}`);return}return[{type:"aspect-ratio",width:i,height:e}]};var Ni=r=>{if(!r)return I;let i=pi(r).filter(e=>I.includes(e));return i.length===0?I:i};function Ri(r){return{"*originalUrl":null,"*faderEl":null,"*cropperEl":null,"*imgEl":null,"*imgContainerEl":null,"*networkProblems":!1,"*imageSize":null,"*editorTransformations":{},"*cropPresetList":[],"*tabList":I,"*tabId":x.CROP,entry:null,extension:null,editorMode:!1,modalCaption:"",isImage:!1,msg:"",src:H,fileType:"",showLoader:!1,uuid:null,cdnUrl:null,cropPreset:"",tabs:rt(I),"presence.networkProblems":!1,"presence.modalCaption":!0,"presence.editorToolbar":!1,"presence.viewerToolbar":!0,"*on.retryNetwork":()=>{let i=r.querySelectorAll("img");for(let e of i){let t=e.src;e.src=H,e.src=t}r.$["*networkProblems"]=!1},"*on.apply":i=>{if(!i)return;let e=r.$["*originalUrl"],t=Z(oe(i),"preview"),s=q(e,t),o={originalUrl:e,cdnUrlModifiers:t,cdnUrl:s,transformations:i};r.dispatchEvent(new CustomEvent("apply",{detail:o,bubbles:!0,composed:!0})),r.remove()},"*on.cancel":()=>{r.remove(),r.dispatchEvent(new CustomEvent("cancel",{bubbles:!0,composed:!0}))}}}var Di="<svg width='0' height='0' style='position:absolute'><symbol viewBox='0 0 24 24' id='uc-icon-about' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.152 14.12v.1h1.523v-.1c.007-.409.053-.752.138-1.028.086-.277.22-.517.405-.72.188-.202.434-.397.735-.586.32-.191.593-.412.82-.66.232-.249.41-.531.533-.847.125-.32.187-.678.187-1.076 0-.579-.137-1.085-.41-1.518a2.717 2.717 0 0 0-1.14-1.018c-.49-.245-1.062-.367-1.715-.367-.597 0-1.142.114-1.636.34-.49.228-.884.564-1.182 1.008-.299.44-.46.98-.485 1.619h1.62c.024-.377.118-.684.282-.922a1.48 1.48 0 0 1 .617-.532c.25-.114.51-.17.784-.17.301 0 .575.063.82.191.248.124.447.302.597.533.149.23.223.504.223.82 0 .263-.05.502-.149.72a1.91 1.91 0 0 1-.405.574 3.48 3.48 0 0 1-.575.453 4.22 4.22 0 0 0-.847.66c-.234.242-.415.558-.543.949-.125.39-.19.916-.197 1.577Zm.053 3.03c.21.206.46.31.75.31.196 0 .374-.049.534-.144a1.1 1.1 0 0 0 .383-.384c.1-.163.15-.343.15-.538a1 1 0 0 0-.32-.746 1.019 1.019 0 0 0-.746-.314c-.291 0-.542.105-.751.314-.21.206-.314.455-.314.746 0 .295.104.547.314.756ZM24 12c0 6.627-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0s12 5.373 12 12Zm-1.5 0c0 5.799-4.701 10.5-10.5 10.5S1.5 17.799 1.5 12 6.201 1.5 12 1.5 22.5 6.201 22.5 12Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-add' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12.75 21a.75.75 0 0 1-1.5 0v-8.25H3a.75.75 0 0 1 0-1.5h8.25V3a.75.75 0 0 1 1.5 0v8.25H21a.75.75 0 0 1 0 1.5h-8.25V21Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-arrow-down' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.5 23.03a.75.75 0 0 0 .999 0l9.29-8.276a.75.75 0 0 0-.998-1.12l-8.042 7.164V1.53a.75.75 0 0 0-1.5 0v19.267l-8.04-7.163a.75.75 0 0 0-.998 1.12z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-back' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M20.251 12a.75.75 0 0 1-.75.75H6.067l5.72 5.85a.75.75 0 1 1-1.072 1.05L4.136 12.92a1.292 1.292 0 0 1 0-1.842l6.579-6.728a.75.75 0 1 1 1.072 1.048l-5.72 5.851H19.5a.75.75 0 0 1 .75.75Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-badge-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13.6 18.4a1.6 1.6 0 1 1-3.2 0 1.6 1.6 0 0 1 3.2 0zM12 4.5A1.5 1.5 0 0 1 13.5 6v7a1.5 1.5 0 0 1-3 0V6A1.5 1.5 0 0 1 12 4.5z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-badge-success' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m10.5 18.204 7.6-8.183a1.5 1.5 0 0 0-2.2-2.042l-5.4 5.817-2.4-2.586a1.5 1.5 0 1 0-2.2 2.041l4.6 4.953Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-box' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M1.01 4.148a.75.75 0 0 1 .75.75v4.348a4.437 4.437 0 0 1 2.988-1.153c1.734 0 3.23.992 3.978 2.438a4.478 4.478 0 0 1 3.978-2.438c2.49 0 4.488 2.044 4.488 4.543 0 2.5-1.999 4.544-4.488 4.544a4.478 4.478 0 0 1-3.978-2.438 4.478 4.478 0 0 1-3.978 2.438C2.26 17.18.26 15.135.26 12.636V4.898a.75.75 0 0 1 .75-.75Zm.75 8.488c0 1.692 1.348 3.044 2.988 3.044s2.989-1.352 2.989-3.044c0-1.691-1.349-3.043-2.989-3.043S1.76 10.945 1.76 12.636Zm10.944-3.043c-1.64 0-2.988 1.352-2.988 3.043 0 1.692 1.348 3.044 2.988 3.044s2.988-1.352 2.988-3.044c0-1.69-1.348-3.043-2.988-3.043Zm4.328-1.23a.75.75 0 0 1 1.052.128l2.333 2.983 2.333-2.983a.75.75 0 0 1 1.181.924l-2.562 3.277 2.562 3.276a.75.75 0 1 1-1.181.924l-2.333-2.983-2.333 2.983a.75.75 0 1 1-1.181-.924l2.562-3.276-2.562-3.277a.75.75 0 0 1 .129-1.052Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-brightness' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M15 10a5 5 0 0 1-5 5m5-5a5 5 0 0 0-5-5m5 5h-5m0 5a5 5 0 0 1 0-10m0 10V5m0 15v-3M2.93 2.929 5.05 5.05M0 10h3m-.07 7.071 2.12-2.121M10 0v3m7.07 14.071-2.12-2.121M20 10h-3m.07-7.071L14.95 5.05m-.626 2.45H10m4.324 5H10'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-camera' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M7.65 2.55a.75.75 0 0 1 .6-.3h7.5a.75.75 0 0 1 .6.3l2.025 2.7H21a3 3 0 0 1 3 3v10.5a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V8.25a3 3 0 0 1 3-3h2.625zm.975 1.2L6.6 6.45a.75.75 0 0 1-.6.3H3a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h18a1.5 1.5 0 0 0 1.5-1.5V8.25a1.5 1.5 0 0 0-1.5-1.5h-3a.75.75 0 0 1-.6-.3l-2.025-2.7zm3.375 6a3.375 3.375 0 1 0 0 6.75 3.375 3.375 0 0 0 0-6.75zm-4.875 3.375a4.875 4.875 0 1 1 9.75 0 4.875 4.875 0 0 1-9.75 0z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-close' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M4.604 4.604a.75.75 0 0 1 1.06 0L12 10.939l6.335-6.335a.75.75 0 1 1 1.061 1.06L13.061 12l6.335 6.335a.75.75 0 1 1-1.06 1.061L12 13.061l-6.335 6.335a.75.75 0 0 1-1.061-1.06L10.939 12 4.604 5.665a.75.75 0 0 1 0-1.061z'/></symbol><symbol fill='currentColor' viewBox='0 0 20 20' id='uc-icon-closeMax' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='M8.232 10 3.585 5.353l1.768-1.768L10 8.232l4.648-4.647 1.767 1.768L11.768 10l4.647 4.648-1.767 1.767L10 11.768l-4.647 4.647-1.768-1.767L8.232 10Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-collapse' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M3.116 12a.75.75 0 0 1 .75-.75h16.268a.75.75 0 0 1 0 1.5H3.866a.75.75 0 0 1-.75-.75Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-contrast' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M2 10a8 8 0 1 0 16 0 8 8 0 1 0-16 0m8-8v16m8-8h-8m7.598 2.5H10m6.24 2.5H10m7.6-7.5H10M16.242 5H10'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-crop' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M20 14H7.005C6.45 14 6 13.55 6 12.995V0M0 6h13.067c.515 0 .933.418.933.933V20M14.5.4 13 2l1.5 1.6M13 2h2a3 3 0 0 1 3 3v2M5.5 19.6 7 18l-1.5-1.6M7 18H5a3 3 0 0 1-3-3v-2'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-default' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.501.392a.75.75 0 0 1 .998 0l6.704 5.972a.75.75 0 0 1-.998 1.12l-5.455-4.86v13.439a.75.75 0 0 1-1.5 0V2.625l-5.454 4.86a.75.75 0 1 1-.998-1.12zM.857 16.73a.75.75 0 0 1 .75.75v4.914h20.786v-4.914a.75.75 0 0 1 1.5 0v5.664a.75.75 0 0 1-.75.75H.857a.75.75 0 0 1-.75-.75v-5.664a.75.75 0 0 1 .75-.75z'/></symbol><symbol fill='currentColor' viewBox='0 0 20 20' id='uc-icon-done' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='m18.057 6.333-9.365 9.125a1.25 1.25 0 0 1-1.768-.023L1.92 10.296l1.791-1.744 4.132 4.243 8.47-8.253 1.744 1.79Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-dropbox' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.019 1.92a.75.75 0 0 1 .806 0L12 5.219l5.176-3.297a.75.75 0 0 1 .806 0l5.577 3.553a.75.75 0 0 1 0 1.265l-4.574 2.914 4.574 2.914a.75.75 0 0 1 0 1.265l-5.577 3.554a.75.75 0 0 1-.806 0L12 14.089l-5.175 3.297a.75.75 0 0 1-.806 0L.44 13.833a.75.75 0 0 1 0-1.266l4.575-2.914L.44 6.74a.75.75 0 0 1 0-1.265zm.403 8.616L2.24 13.2l4.182 2.664 4.181-2.664zm6.975 2.664 4.182 2.664L21.76 13.2l-4.181-2.664zm2.776-3.547L12 12.311 7.828 9.653 12 6.995zm1.406-.882 4.181-2.664-4.181-2.664-4.182 2.664zm-6.976-2.664L6.422 3.443 2.24 6.107 6.422 8.77zM5.791 18.544a.75.75 0 0 1 1.035-.23l5.175 3.297 5.175-3.297a.75.75 0 1 1 .806 1.265l-5.578 3.554a.75.75 0 0 1-.806 0L6.02 19.579a.75.75 0 0 1-.23-1.035z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-edit-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M18.558 2.804a.78.78 0 0 0-.557.235l-.008.007-2.472 2.46 3.847 3.848 2.46-2.473.004-.003a.78.78 0 0 0 0-1.108l-.004-.003-2.712-2.728a.78.78 0 0 0-.558-.235Zm-.248 7.613-3.852-3.852-8.93 8.887-1.516 5.41 5.41-1.515 8.888-8.93Zm-.636-8.934a2.28 2.28 0 0 1 2.512.505l2.702 2.717.002.002a2.278 2.278 0 0 1 0 3.234l-.002.002-12.541 12.602a.75.75 0 0 1-.33.193l-6.884 1.928a.75.75 0 0 1-.925-.924l1.928-6.885a.75.75 0 0 1 .193-.33l12.603-12.54a2.28 2.28 0 0 1 .742-.504Z' clip-rule='evenodd'/></symbol><symbol fill='currentColor' viewBox='0 0 25 24' id='uc-icon-edit-file' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='M18.558 2.804a.78.78 0 0 0-.557.235l-.008.007-2.472 2.46 3.847 3.848 2.46-2.473.004-.003a.78.78 0 0 0 0-1.108l-.004-.003-2.712-2.728a.78.78 0 0 0-.558-.235Zm-.248 7.613-3.852-3.852-8.93 8.887-1.516 5.41 5.41-1.515 8.888-8.93Zm-.636-8.934a2.28 2.28 0 0 1 2.512.505l2.702 2.717.002.002a2.278 2.278 0 0 1 0 3.234l-.002.002-12.541 12.602a.75.75 0 0 1-.33.193l-6.884 1.928a.75.75 0 0 1-.925-.924l1.928-6.885a.75.75 0 0 1 .193-.33l12.603-12.54a2.28 2.28 0 0 1 .742-.504Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-enhance' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M19 13h-2m0 0a4 4 0 0 1-4-4m4 4a4 4 0 0 0-4 4m0-8V7m0 2a4 4 0 0 1-4 4m-2 0h2m0 0a4 4 0 0 1 4 4m0 0v2M8 8.5H6.5m0 0a2 2 0 0 1-2-2m2 2a2 2 0 0 0-2 2m0-4V5m0 1.5a2 2 0 0 1-2 2M1 8.5h1.5m0 0a2 2 0 0 1 2 2m0 0V12M12 3h-1m0 0a1 1 0 0 1-1-1m1 1a1 1 0 0 0-1 1m0-2V1m0 1a1 1 0 0 1-1 1M8 3h1m0 0a1 1 0 0 1 1 1m0 0v1'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13 13h-2V7h2m0 10h-2v-2h2M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-evernote' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M9.804 2.27v-.048c.055-.263.313-.562.85-.562h.44c.142 0 .325.014.526.033.066.009.124.023.267.06l.13.032h.002c.319.079.515.275.644.482a1.461 1.461 0 0 1 .16.356l.004.012a.75.75 0 0 0 .603.577l1.191.207a1988.512 1988.512 0 0 0 2.332.402c.512.083 1.1.178 1.665.442.64.3 1.19.795 1.376 1.77.548 2.931.657 5.829.621 8a39.233 39.233 0 0 1-.125 2.602 17.518 17.518 0 0 1-.092.849.735.735 0 0 0-.024.112c-.378 2.705-1.269 3.796-2.04 4.27-.746.457-1.53.451-2.217.447h-.192c-.46 0-1.073-.23-1.581-.635-.518-.412-.763-.87-.763-1.217 0-.45.188-.688.355-.786.161-.095.436-.137.796.087a.75.75 0 1 0 .792-1.274c-.766-.476-1.64-.52-2.345-.108-.7.409-1.098 1.188-1.098 2.08 0 .996.634 1.84 1.329 2.392.704.56 1.638.96 2.515.96l.185.002c.667.009 1.874.025 3.007-.67 1.283-.786 2.314-2.358 2.733-5.276a4.213 4.213 0 0 0 .056-.335c.023-.184.051-.445.079-.772.055-.655.111-1.585.13-2.704.037-2.234-.074-5.239-.647-8.301v-.002c-.294-1.544-1.233-2.391-2.215-2.85-.777-.363-1.623-.496-2.129-.576a8.872 8.872 0 0 1-.25-.041l-.006-.001-1.99-.345-.761-.132a2.93 2.93 0 0 0-.182-.338A2.532 2.532 0 0 0 12.379.329l-.091-.023a3.967 3.967 0 0 0-.493-.103L11.769.2a7.846 7.846 0 0 0-.675-.04h-.44c-.733 0-1.368.284-1.795.742L2.416 7.431c-.468.428-.751 1.071-.751 1.81 0 .02 0 .041.003.062l.003.034c.017.21.038.468.096.796.107.715.275 1.47.391 1.994.029.13.055.245.075.342l.002.008c.258 1.141.641 1.94.978 2.466.168.263.323.456.444.589a2.808 2.808 0 0 0 .192.194c1.536 1.562 3.713 2.196 5.731 2.08.13-.005.35-.032.537-.073a2.627 2.627 0 0 0 .652-.24c.425-.26.75-.661.992-1.046.184-.294.342-.61.473-.915a3.8 3.8 0 0 0 .627.493 5.022 5.022 0 0 0 1.97.709l.023.002.018.003.11.016c.088.014.205.035.325.058l.056.014c.088.022.164.04.235.061a1.736 1.736 0 0 1 .145.048l.03.014c.765.34 1.302 1.09 1.302 1.871a.75.75 0 0 0 1.5 0c0-1.456-.964-2.69-2.18-3.235a3.595 3.595 0 0 0-.679-.217l-.063-.015a10.616 10.616 0 0 0-.606-.105l-.02-.003-.03-.003h-.002a3.542 3.542 0 0 1-1.331-.485c-.471-.298-.788-.692-.828-1.234a.75.75 0 0 0-1.48-.106l-.001.003-.004.017a8.23 8.23 0 0 1-.092.352 9.963 9.963 0 0 1-.298.892c-.132.34-.29.68-.47.966-.174.276-.339.454-.478.549a1.178 1.178 0 0 1-.221.072 1.949 1.949 0 0 1-.241.036h-.013l-.032.002c-1.684.1-3.423-.437-4.604-1.65a.746.746 0 0 0-.053-.05L4.84 14.6a1.348 1.348 0 0 1-.07-.073 2.99 2.99 0 0 1-.293-.392c-.242-.379-.558-1.014-.778-1.985a54.1 54.1 0 0 0-.083-.376 27.494 27.494 0 0 1-.367-1.872l-.003-.02a6.791 6.791 0 0 1-.08-.67c.004-.277.086-.475.2-.609l.067-.067a.63.63 0 0 1 .292-.145h.05c.18 0 1.095.055 2.013.115l1.207.08.534.037a.747.747 0 0 0 .052.002c.782 0 1.349-.206 1.759-.585l.005-.005c.553-.52.622-1.225.622-1.76V6.24l-.026-.565A774.97 774.97 0 0 1 9.885 4.4c-.042-.961-.081-1.939-.081-2.13ZM4.995 6.953a251.126 251.126 0 0 1 2.102.137l.508.035c.48-.004.646-.122.715-.185.07-.068.146-.209.147-.649l-.024-.548a791.69 791.69 0 0 1-.095-2.187L4.995 6.953Zm16.122 9.996Zm-5.479-5.323a.75.75 0 0 0 1.014.31 2.04 2.04 0 0 1 .304-.089 1.84 1.84 0 0 1 .544-.039c.215.023.321.06.37.085.033.016.039.026.047.04a.75.75 0 0 0 1.289-.767c-.337-.567-.906-.783-1.552-.85a3.334 3.334 0 0 0-1.002.062c-.27.056-.531.14-.705.234a.75.75 0 0 0-.31 1.014Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-expand' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m12 8.337-8.47 8.47a.75.75 0 0 1-1.06-1.06l8.605-8.606a1.29 1.29 0 0 1 1.85 0l8.605 8.605a.75.75 0 1 1-1.06 1.06L12 8.338Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-exposure' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M10 20v-3M2.93 2.929 5.05 5.05M0 10h3m-.07 7.071 2.12-2.121M10 0v3m7.07 14.071-2.12-2.121M20 10h-3m.07-7.071L14.95 5.05M5 10a5 5 0 1 0 10 0 5 5 0 1 0-10 0'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-external-source-placeholder' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.341 3.27a10.5 10.5 0 0 1 5.834-1.77.75.75 0 0 0 0-1.5 12 12 0 1 0 12 12 .75.75 0 0 0-1.5 0A10.5 10.5 0 1 1 6.34 3.27Zm14.145 1.48a.75.75 0 1 0-1.06-1.062L9.925 13.19V7.95a.75.75 0 1 0-1.5 0V15c0 .414.336.75.75.75h7.05a.75.75 0 0 0 0-1.5h-5.24l9.501-9.5Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-facebook' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12 1.5C6.201 1.5 1.5 6.201 1.5 12c0 4.943 3.416 9.089 8.016 10.204v-6.108H7.383a.75.75 0 0 1-.75-.75v-3.281a.75.75 0 0 1 .75-.75h2.133V9.393c0-.958.225-2.511 1.38-3.65 1.194-1.177 3.174-1.718 6.254-1.056a.75.75 0 0 1 .592.733v2.754a.75.75 0 0 1-.75.75c-.692 0-1.203.026-1.584.082-.387.057-.578.137-.675.202-.109.073-.237.205-.237 1.029v1.078h2.39a.75.75 0 0 1 .742.866l-.516 3.281a.75.75 0 0 1-.74.634h-1.876v6.106C19.09 21.082 22.5 16.939 22.5 12c0-5.799-4.701-10.5-10.5-10.5zM0 12C0 5.373 5.373 0 12 0s12 5.373 12 12c0 5.995-4.395 10.961-10.138 11.856a.75.75 0 0 1-.866-.74v-7.77a.75.75 0 0 1 .75-.75h1.984l.28-1.781h-2.264a.75.75 0 0 1-.75-.75v-1.828c0-.829.089-1.729.9-2.274.363-.244.807-.37 1.293-.441a9.623 9.623 0 0 1 1.053-.086V6.04c-2.41-.405-3.645.132-4.293.771-.737.728-.933 1.793-.933 2.582v2.672a.75.75 0 0 1-.75.75H8.133v1.78h2.133a.75.75 0 0 1 .75.75v7.772a.75.75 0 0 1-.865.741C4.4 22.968 0 18 0 12z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M2.895 1.201c0-.473.383-.857.857-.857h8.4c.227 0 .445.09.606.251l8.4 8.4c.16.16.25.379.25.606v13.2a.857.857 0 0 1-.856.857h-16.8a.857.857 0 0 1-.857-.857zm1.714.857v19.886h15.085V10.458h-7.542a.857.857 0 0 1-.858-.857V2.058zm8.4 1.213 5.473 5.473H13.01z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-filters' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M4.5 6.5a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0m-3.5 6a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0m7 0a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-flickr' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M5.959 7.926c-2.298 0-4.14 1.834-4.14 4.073 0 2.241 1.842 4.075 4.14 4.075 2.302 0 4.145-1.834 4.145-4.075 0-2.238-1.843-4.073-4.145-4.073Zm-5.64 4.073c0-3.086 2.533-5.573 5.64-5.573 3.11 0 5.645 2.486 5.645 5.573 0 3.089-2.535 5.575-5.645 5.575-3.107 0-5.64-2.487-5.64-5.575Zm18.07-4.073c-2.301 0-4.144 1.835-4.144 4.073 0 2.24 1.843 4.075 4.145 4.075 2.299 0 4.141-1.834 4.141-4.075 0-2.239-1.842-4.073-4.141-4.073Zm-5.644 4.073c0-3.087 2.535-5.573 5.645-5.573 3.108 0 5.641 2.487 5.641 5.573 0 3.088-2.533 5.575-5.641 5.575-3.11 0-5.645-2.486-5.645-5.575Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-flip' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M19.6 5 18 3.5 16.4 5m3.2 10L18 16.5 16.4 15M18 3.523v12.954M3.3 8.5h10.654c.301 0 .415-.395.159-.554L3.459 1.286A.3.3 0 0 0 3 1.542V8.2a.3.3 0 0 0 .3.3zm0 3h10.654c.301 0 .415.395.159.554l-10.654 6.66A.3.3 0 0 1 3 18.458v-6.66a.3.3 0 0 1 .3-.3z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-gamma' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M17 3C9 6 2.5 11.5 2.5 17.5m0 0h1m-1 0v-1m14 1h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3-14v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-gdrive' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M7.736 1.818a.75.75 0 0 1 .647-.37h7.587a.75.75 0 0 1 .655.383l7.233 12.946a.75.75 0 0 1-.003.737l-3.794 6.66a.75.75 0 0 1-.651.378H4.59a.75.75 0 0 1-.651-.378l-3.794-6.66a.75.75 0 0 1 .005-.75zm.64 1.876L1.663 15.148l2.93 5.145 6.655-11.581zm3.736 6.526-2.398 4.173H14.5zm4.116 4.173h5.697L15.53 2.947H9.677zm5.685 1.5H8.852l-2.966 5.16h13.088z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-gphotos' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12.51 0c-.702 0-1.272.57-1.272 1.273V7.35A6.381 6.381 0 0 0 0 11.489c0 .703.57 1.273 1.273 1.273H7.35A6.381 6.381 0 0 0 11.488 24c.704 0 1.274-.57 1.274-1.273V16.65A6.381 6.381 0 0 0 24 12.51c0-.703-.57-1.273-1.273-1.273H16.65A6.381 6.381 0 0 0 12.511 0Zm.252 11.232V1.53a4.857 4.857 0 0 1 0 9.702Zm-1.53.006H1.53a4.857 4.857 0 0 1 9.702 0Zm1.536 1.524a4.857 4.857 0 0 0 9.702 0h-9.702Zm-6.136 4.857c0-2.598 2.04-4.72 4.606-4.85v9.7a4.857 4.857 0 0 1-4.606-4.85Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-huddle' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.204 2.002c-.252.23-.357.486-.357.67V21.07c0 .15.084.505.313.812.208.28.499.477.929.477.519 0 .796-.174.956-.365.178-.212.286-.535.286-.924v-.013l.117-6.58c.004-1.725 1.419-3.883 3.867-3.883 1.33 0 2.332.581 2.987 1.364.637.762.95 1.717.95 2.526v6.47c0 .392.11.751.305.995.175.22.468.41 1.008.41.52 0 .816-.198 1.002-.437.207-.266.31-.633.31-.969V14.04c0-2.81-1.943-5.108-4.136-5.422a5.971 5.971 0 0 0-3.183.41c-.912.393-1.538.96-1.81 1.489a.75.75 0 0 1-1.417-.344v-7.5c0-.587-.47-1.031-1.242-1.031-.315 0-.638.136-.885.36ZM5.194.892A2.844 2.844 0 0 1 7.09.142c1.328 0 2.742.867 2.742 2.53v5.607a6.358 6.358 0 0 1 1.133-.629 7.47 7.47 0 0 1 3.989-.516c3.056.436 5.425 3.482 5.425 6.906v6.914c0 .602-.177 1.313-.627 1.89-.47.605-1.204 1.016-2.186 1.016-.96 0-1.698-.37-2.179-.973-.46-.575-.633-1.294-.633-1.933v-6.469c0-.456-.19-1.071-.602-1.563-.394-.471-.986-.827-1.836-.827-1.447 0-2.367 1.304-2.367 2.39v.014l-.117 6.58c-.001.64-.177 1.333-.637 1.881-.48.57-1.2.9-2.105.9-.995 0-1.7-.5-2.132-1.081-.41-.552-.61-1.217-.61-1.708V2.672c0-.707.366-1.341.847-1.78Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-info' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11 9h2V7h-2m1 13c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2m-1 15h2v-6h-2v6Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-instagram' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.225 12a5.775 5.775 0 1 1 11.55 0 5.775 5.775 0 0 1-11.55 0zM12 7.725a4.275 4.275 0 1 0 0 8.55 4.275 4.275 0 0 0 0-8.55zm6.425-.75a1.4 1.4 0 1 0 0-2.8 1.4 1.4 0 0 0 0 2.8zm-6.467-6.8h.084c2.152 0 3.823 0 5.152.132 1.35.134 2.427.41 3.362 1.013a7.15 7.15 0 0 1 2.124 2.124c.604.935.88 2.012 1.013 3.362.132 1.329.132 3 .132 5.152v.084c0 2.152 0 3.823-.132 5.152-.134 1.35-.41 2.427-1.013 3.362a7.15 7.15 0 0 1-2.124 2.124c-.935.604-2.012.88-3.362 1.013-1.329.132-3 .132-5.152.132h-.084c-2.152 0-3.824 0-5.153-.132-1.35-.134-2.427-.409-3.36-1.013a7.15 7.15 0 0 1-2.125-2.124C.716 19.62.44 18.544.307 17.194c-.132-1.329-.132-3-.132-5.152v-.084c0-2.152 0-3.823.132-5.152.133-1.35.409-2.427 1.013-3.362A7.15 7.15 0 0 1 3.444 1.32C4.378.716 5.456.44 6.805.307c1.33-.132 3-.132 5.153-.132zM6.953 1.799c-1.234.123-2.043.36-2.695.78A5.65 5.65 0 0 0 2.58 4.26c-.42.65-.657 1.46-.78 2.695C1.676 8.2 1.675 9.797 1.675 12s0 3.8.124 5.046c.123 1.235.36 2.044.78 2.696a5.649 5.649 0 0 0 1.68 1.678c.65.421 1.46.658 2.694.78 1.247.124 2.844.125 5.047.125s3.8 0 5.046-.124c1.235-.123 2.044-.36 2.695-.78a5.648 5.648 0 0 0 1.68-1.68c.42-.65.657-1.46.78-2.694.123-1.247.124-2.844.124-5.047s-.001-3.8-.125-5.046c-.122-1.235-.359-2.044-.78-2.695a5.65 5.65 0 0 0-1.679-1.68c-.651-.42-1.46-.657-2.695-.78-1.246-.123-2.843-.124-5.046-.124-2.203 0-3.8 0-5.047.124z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-local' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M3 3.75a1.5 1.5 0 0 0-1.5 1.5v13.5a1.5 1.5 0 0 0 1.5 1.5h18a1.5 1.5 0 0 0 1.5-1.5V9A1.5 1.5 0 0 0 21 7.5h-9a.75.75 0 0 1-.643-.364L9.325 3.75zm-3 1.5a3 3 0 0 1 3-3h6.75a.75.75 0 0 1 .643.364L12.425 6H21a3 3 0 0 1 3 3v9.75a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-mirror' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M5 .4 3.5 2 5 3.6M15 .4 16.5 2 15 3.6M3.52 2h12.957M8.5 16.7V6.046c0-.301-.394-.415-.554-.159L1.287 16.541a.3.3 0 0 0 .255.459H8.2a.3.3 0 0 0 .3-.3zm3 0V6.046c0-.301.395-.415.555-.159l6.659 10.654a.3.3 0 0 1-.255.459H11.8a.3.3 0 0 1-.3-.3z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-onedrive' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13.616 4.147a7.689 7.689 0 0 0-7.642 3.285A6.299 6.299 0 0 0 1.455 17.3c.684.894 2.473 2.658 5.17 2.658h12.141c.95 0 1.882-.256 2.697-.743.815-.486 1.514-1.247 1.964-2.083a5.26 5.26 0 0 0-3.713-7.612 7.69 7.69 0 0 0-6.098-5.373ZM3.34 17.15c.674.63 1.761 1.308 3.284 1.308h12.142a3.76 3.76 0 0 0 2.915-1.383l-7.494-4.489L3.34 17.15Zm10.875-6.25 2.47-1.038a5.239 5.239 0 0 1 1.427-.389 6.19 6.19 0 0 0-10.3-1.952 6.338 6.338 0 0 1 2.118.813l4.285 2.567Zm4.55.033c-.512 0-1.019.104-1.489.307l-.006.003-1.414.594 6.521 3.906a3.76 3.76 0 0 0-3.357-4.8l-.254-.01ZM4.097 9.617A4.799 4.799 0 0 1 6.558 8.9c.9 0 1.84.25 2.587.713l3.4 2.037-10.17 4.28a4.799 4.799 0 0 1 1.721-6.312Z'/></symbol><symbol viewBox='0 0 40 40' id='uc-icon-original' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.5' d='M0 40 40 0'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-remove-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.955 3.3A2.969 2.969 0 0 0 8.998 6h5.914a2.97 2.97 0 0 0-2.957-2.7zM16.416 6a4.47 4.47 0 0 0-8.922 0h-2.32a.755.755 0 0 0-.111.008H3.075a.75.75 0 1 0 0 1.5h1.35V19.35a2.85 2.85 0 0 0 2.85 2.85h9.45a2.85 2.85 0 0 0 2.85-2.85V7.508h1.35a.75.75 0 0 0 0-1.5h-1.989A.754.754 0 0 0 18.825 6zM5.925 7.508V19.35a1.35 1.35 0 0 0 1.35 1.35h9.45a1.35 1.35 0 0 0 1.35-1.35V7.508z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-rotate' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M13.5.4 12 2l1.5 1.6M12.023 2H14.4A3.6 3.6 0 0 1 18 5.6V8M4 17h9a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-sad' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M2 17c4.418-4 11.582-4 16 0M16.5 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-11 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-saturation' xmlns='http://www.w3.org/2000/svg'><defs><linearGradient id='bwuc-icon-id__a' x1='10.001' y1='1' x2='10.001' y2='19' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient></defs><circle cx='10.001' cy='10' r='9' transform='rotate(90 10 10)' fill='url(#bwuc-icon-id__a)'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-select' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m7 10 5 5 5-5H7Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-slider' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M0 10h11m0 0a2 2 0 1 0 4 0m-4 0a2 2 0 1 1 4 0m0 0h5'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-tuning' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M8 10h11M1 10h4M1 4.5h11m3 0h4m-18 11h11m3 0h4m-7-11a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0M5 10a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0m7 5.5a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-upload' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.501.392a.75.75 0 0 1 .998 0l6.704 5.972a.75.75 0 0 1-.998 1.12l-5.455-4.86v13.439a.75.75 0 0 1-1.5 0V2.625l-5.454 4.86a.75.75 0 1 1-.998-1.12zM.857 16.73a.75.75 0 0 1 .75.75v4.914h20.786v-4.914a.75.75 0 0 1 1.5 0v5.664a.75.75 0 0 1-.75.75H.857a.75.75 0 0 1-.75-.75v-5.664a.75.75 0 0 1 .75-.75z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-upload-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13 13h-2V7h2m0 10h-2v-2h2M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-url' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M19.11 3.67c-1.71-1.709-4.578-1.682-6.408.148l-2.22 2.22a.75.75 0 0 1-1.062-1.06l2.222-2.221C14.018.381 17.836.276 20.17 2.61l1.22 1.22c2.335 2.334 2.23 6.153-.147 8.529l-2.22 2.22a.75.75 0 0 1-1.062-1.06l2.222-2.221c1.83-1.83 1.856-4.698.147-6.408zm-3.36 4.58a.75.75 0 0 1 0 1.06l-6.439 6.44a.75.75 0 0 1-1.06-1.06l6.439-6.44a.75.75 0 0 1 1.06 0zM6.04 9.42a.75.75 0 0 1 0 1.061l-2.222 2.222c-1.83 1.83-1.856 4.698-.147 6.407l1.22 1.22c1.71 1.71 4.578 1.683 6.408-.147l2.221-2.221a.75.75 0 1 1 1.06 1.06l-2.22 2.222c-2.377 2.376-6.195 2.481-8.53.147l-1.22-1.22c-2.334-2.334-2.228-6.153.148-8.53l2.221-2.22a.75.75 0 0 1 1.06 0z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-vibrance' xmlns='http://www.w3.org/2000/svg'><path d='M2.125 5.64A8.96 8.96 0 0 0 1.001 10a8.96 8.96 0 0 0 1.124 4.36V5.64z' fill='url(#bzuc-icon-id__a)'/><path d='M2.875 15.499V4.502a9.053 9.053 0 0 1 1.75-1.72v14.437a9.05 9.05 0 0 1-1.75-1.72z' fill='url(#bzuc-icon-id__b)'/><path d='M5.375 17.722c.548.33 1.134.601 1.75.809V1.469a8.956 8.956 0 0 0-1.75.81v15.443z' fill='url(#bzuc-icon-id__c)'/><path d='M7.875 1.253v17.495c.564.136 1.15.22 1.75.244V1.008a9 9 0 0 0-1.75.245z' fill='url(#bzuc-icon-id__d)'/><path d='M10.375 1.008v17.984a9 9 0 0 0 1.75-.244V1.252a9 9 0 0 0-1.75-.244z' fill='url(#bzuc-icon-id__e)'/><path d='M12.875 1.469V18.53a8.957 8.957 0 0 0 1.75-.808V2.277a8.957 8.957 0 0 0-1.75-.808z' fill='url(#bzuc-icon-id__f)'/><path d='M15.375 2.78v14.44a9.053 9.053 0 0 0 1.75-1.72v-11a9.054 9.054 0 0 0-1.75-1.72z' fill='url(#bzuc-icon-id__g)'/><path d='M17.875 5.638v8.724A8.959 8.959 0 0 0 19.001 10a8.96 8.96 0 0 0-1.126-4.362z' fill='url(#bzuc-icon-id__h)'/><defs><linearGradient id='bzuc-icon-id__a' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='bzuc-icon-id__b' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='bzuc-icon-id__c' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='bzuc-icon-id__d' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='bzuc-icon-id__e' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='bzuc-icon-id__f' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='bzuc-icon-id__g' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='bzuc-icon-id__h' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient></defs></symbol><symbol viewBox='0 0 24 24' id='uc-icon-vk' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.341 3.27a10.5 10.5 0 0 1 5.834-1.77.75.75 0 0 0 0-1.5 12 12 0 1 0 12 12 .75.75 0 0 0-1.5 0A10.5 10.5 0 1 1 6.34 3.27Zm14.145 1.48a.75.75 0 1 0-1.06-1.062L9.925 13.19V7.95a.75.75 0 1 0-1.5 0V15c0 .414.336.75.75.75h7.05a.75.75 0 0 0 0-1.5h-5.24l9.501-9.5Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-warmth' xmlns='http://www.w3.org/2000/svg'><path d='m7.5 13.05.429.42.171-.175v-.244h-.6zm5 0h-.6v.245l.172.175.428-.42zM8.1 3.5c0-1.05.85-1.9 1.9-1.9V.4a3.1 3.1 0 0 0-3.1 3.1h1.2zm0 9.55V3.5H6.9v9.55h1.2zm-1 2.45c0-.79.315-1.506.829-2.03l-.858-.84A4.088 4.088 0 0 0 5.9 15.5h1.2zm2.9 2.9a2.9 2.9 0 0 1-2.9-2.9H5.9a4.1 4.1 0 0 0 4.1 4.1v-1.2zm2.9-2.9a2.9 2.9 0 0 1-2.9 2.9v1.2a4.1 4.1 0 0 0 4.1-4.1h-1.2zm-.829-2.03c.514.524.829 1.24.829 2.03h1.2c0-1.117-.447-2.13-1.171-2.87l-.858.84zM11.9 3.5v9.55h1.2V3.5h-1.2zM10 1.6c1.05 0 1.9.85 1.9 1.9h1.2A3.1 3.1 0 0 0 10 .4v1.2z' fill='currentColor'/><path d='M10 14V8' stroke='currentColor' stroke-width='1.2' stroke-linecap='round'/><path d='M14 3h3m-3 3h3m-3 3h3m-8 6.5a1 1 0 1 0 2 0 1 1 0 1 0-2 0' stroke='currentColor' stroke-width='1.2'/></symbol></svg>";var Ui=w`${Di} <div class="uc-wrapper uc-wrapper_desktop"><uc-presence-toggle class="uc-network_problems_splash" bind="visible: presence.networkProblems;"><div class="uc-network_problems_content"><div class="uc-network_problems_icon"><uc-icon name="sad"></uc-icon></div><div class="uc-network_problems_text">Network error</div></div><div class="uc-network_problems_footer"><uc-btn-ui theme="primary" text="Retry" bind="onclick: *on.retryNetwork"></uc-btn-ui></div></uc-presence-toggle><div class="uc-viewport"><div class="uc-file_type_outer"><div class="uc-file_type">{{fileType}}</div></div><div class="uc-image_container" ref="img-container-el"><img src="${H}" class="uc-image uc-image_visible_from_editor" ref="img-el" /><uc-editor-image-cropper ref="cropper-el"></uc-editor-image-cropper><uc-editor-image-fader ref="fader-el"></uc-editor-image-fader></div><div class="uc-info_pan">{{msg}}</div></div><div class="uc-toolbar"><uc-line-loader-ui bind="active: showLoader"></uc-line-loader-ui><div class="uc-toolbar_content uc-toolbar_content__editor"><uc-editor-toolbar></uc-editor-toolbar></div></div></div>`;var le=class extends y{constructor(){super();m(this,"ctxOwner",!0);m(this,"_debouncedShowLoader",R(this._showLoader.bind(this),300));this.init$={...this.init$,...Ri(this)}}_showLoader(e){this.$.showLoader=e}_waitForSize(){return new Promise((t,s)=>{let o=setTimeout(()=>{s(new Error("[cloud-image-editor] timeout waiting for non-zero container size"))},3e3),l=new ResizeObserver(([n])=>{n.contentRect.width>0&&n.contentRect.height>0&&(t(),clearTimeout(o),l.disconnect())});l.observe(this)})}initCallback(){super.initCallback(),this.$["*faderEl"]=this.ref["fader-el"],this.$["*cropperEl"]=this.ref["cropper-el"],this.$["*imgContainerEl"]=this.ref["img-container-el"],this.initEditor()}async updateImage(){if(this.isConnected){if(await this._waitForSize(),this.$.cdnUrl){let e=tt(this.$.cdnUrl),t=St(this.$.cdnUrl,e);if(t===this.$["*originalUrl"])return;this.$["*originalUrl"]=t;let s=si(this.$.cdnUrl),o=hi(s);this.$["*editorTransformations"]=o}else if(this.$.uuid){let e=St(this.cfg.cdnCname,this.$.uuid);if(e===this.$["*originalUrl"])return;this.$["*originalUrl"]=e,this.$["*editorTransformations"]={}}else throw new Error("No UUID nor CDN URL provided");this.$["*tabId"]===x.CROP?this.$["*cropperEl"].deactivate({reset:!0}):this.$["*faderEl"].deactivate();try{let e=await this.proxyUrl(q(this.$["*originalUrl"],Z("json"))),t=await fetch(e).then(l=>l.json()),{width:s,height:o}=t;this.$["*imageSize"]={width:s,height:o},this.$["*tabId"]===x.CROP?this.$["*cropperEl"].activate(this.$["*imageSize"]):this.$["*faderEl"].activate({url:this.$["*originalUrl"]})}catch(e){e&&console.error("Failed to load image info",e)}}}async initEditor(){try{await this._waitForSize()}catch(e){this.isConnected&&console.error(e.message);return}this.ref["img-el"].addEventListener("load",()=>{this._imgLoading=!1,this._debouncedShowLoader(!1),this.$.src!==H&&(this.$["*networkProblems"]=!1)}),this.ref["img-el"].addEventListener("error",()=>{this._imgLoading=!1,this._debouncedShowLoader(!1),this.$["*networkProblems"]=!0}),this.sub("src",e=>{let t=this.ref["img-el"];t.src!==e&&(this._imgLoading=!0,t.src=e||H)}),this.sub("cropPreset",e=>{this.$["*cropPresetList"]=Mi(e)}),this.sub("tabs",e=>{this.$["*tabList"]=Ni(e)}),this.sub("*tabId",e=>{this.ref["img-el"].className=S("uc-image",{"uc-image_hidden_to_cropper":e===x.CROP,"uc-image_hidden_effects":e!==x.CROP})}),this.classList.add("uc-editor_ON"),this.sub("*networkProblems",e=>{this.$["presence.networkProblems"]=e,this.$["presence.modalCaption"]=!e}),this.sub("*editorTransformations",e=>{if(Object.keys(e).length===0)return;let t=this.$["*originalUrl"],s=Z(oe(e),"preview"),o=q(t,s),l={originalUrl:t,cdnUrlModifiers:s,cdnUrl:o,transformations:e};this.dispatchEvent(new CustomEvent("change",{detail:l,bubbles:!0,composed:!0}))},!1),this.sub("uuid",e=>e&&this.updateImage()),this.sub("cdnUrl",e=>e&&this.updateImage())}};m(le,"styleAttrs",["uc-cloud-image-editor"]);le.template=Ui;le.bindAttributes({uuid:"uuid","cdn-url":"cdnUrl","crop-preset":"cropPreset",tabs:"tabs"});var Ue=33.333333333333336,b=1,Ut=24,zi=6;function pe(r,i){for(let e in i)r.setAttributeNS(null,e,i[e].toString())}function U(r,i={}){let e=document.createElementNS("http://www.w3.org/2000/svg",r);return pe(e,i),e}function Fi(r,i,e){let{x:t,y:s,width:o,height:l}=r,n=i.includes("w")?0:1,a=i.includes("n")?0:1,c=[-1,1][n],u=[-1,1][a],h=[t+n*o+1.5*c,s+a*l+1.5*u-24*e*u],f=[t+n*o+1.5*c,s+a*l+1.5*u],g=[t+n*o-24*e*c+1.5*c,s+a*l+1.5*u];return{d:`M ${h[0]} ${h[1]} L ${f[0]} ${f[1]} L ${g[0]} ${g[1]}`,center:f}}function Bi(r,i,e){let{x:t,y:s,width:o,height:l}=r,n=["n","s"].includes(i)?.5:{w:0,e:1}[i],a=["w","e"].includes(i)?.5:{n:0,s:1}[i],c=[-1,1][n],u=[-1,1][a],h,f;["n","s"].includes(i)?(h=[t+n*o-34*e/2,s+a*l+1.5*u],f=[t+n*o+34*e/2,s+a*l+1.5*u]):(h=[t+n*o+1.5*c,s+a*l-34*e/2],f=[t+n*o+1.5*c,s+a*l+34*e/2]);let g=`M ${h[0]} ${h[1]} L ${f[0]} ${f[1]}`,_=[f[0]-(f[0]-h[0])/2,f[1]-(f[1]-h[1])/2];return{d:g,center:_}}function Vi(r){return r===""?"move":["e","w"].includes(r)?"ew-resize":["n","s"].includes(r)?"ns-resize":["nw","se"].includes(r)?"nwse-resize":"nesw-resize"}function Xi({rect:r,delta:[i,e],imageBox:t}){return xe({...r,x:r.x+i,y:r.y+e},t)}function xe(r,i){let{x:e}=r,{y:t}=r;return r.x<i.x?e=i.x:r.x+r.width>i.x+i.width&&(e=i.x+i.width-r.width),r.y<i.y?t=i.y:r.y+r.height>i.y+i.height&&(t=i.y+i.height-r.height),{...r,x:e,y:t}}function Mr({rect:r,delta:i,aspectRatio:e,imageBox:t}){let[,s]=i,{y:o,width:l,height:n}=r;o+=s,n-=s,e&&(l=n*e);let a=r.x+r.width/2-l/2;return o<=t.y&&(o=t.y,n=r.y+r.height-o,e&&(l=n*e,a=r.x+r.width/2-l/2)),a<=t.x&&(a=t.x,o=r.y+r.height-n),a+l>=t.x+t.width&&(a=Math.max(t.x,t.x+t.width-l),l=t.x+t.width-a,e&&(n=l/e),o=r.y+r.height-n),n<b&&(n=b,e&&(l=n*e,a=r.x+r.width/2-l/2),o=r.y+r.height-n),l<b&&(l=b,e&&(n=l/e,a=r.x+r.width/2-l/2),o=r.y+r.height-n),{x:a,y:o,width:l,height:n}}function Nr({rect:r,delta:i,aspectRatio:e,imageBox:t}){let[s]=i,{x:o,width:l,height:n}=r;o+=s,l-=s,e&&(n=l/e);let a=r.y+r.height/2-n/2;return o<=t.x&&(o=t.x,l=r.x+r.width-o,e&&(n=l/e,a=r.y+r.height/2-n/2)),a<=t.y&&(a=t.y,o=r.x+r.width-l),a+n>=t.y+t.height&&(a=Math.max(t.y,t.y+t.height-n),n=t.y+t.height-a,e&&(l=n*e),o=r.x+r.width-l),n<b&&(n=b,e&&(l=n*e),a=r.y+r.height/2-n/2,o=r.x+r.width-l),l<b&&(l=b,e&&(n=l/e),a=r.y+r.height/2-n/2,o=r.x+r.width-l),{x:o,y:a,width:l,height:n}}function Rr({rect:r,delta:i,aspectRatio:e,imageBox:t}){let[,s]=i,{y:o,width:l,height:n}=r;n+=s,e&&(l=n*e);let a=r.x+r.width/2-l/2;return o+n>=t.y+t.height&&(n=t.y+t.height-o,e&&(l=n*e),a=r.x+r.width/2-l/2),a<=t.x&&(a=t.x,o=r.y),a+l>=t.x+t.width&&(a=Math.max(t.x,t.x+t.width-l),l=t.x+t.width-a,e&&(n=l/e),o=r.y),n<b&&(n=b,e&&(l=n*e),a=r.x+r.width/2-l/2),l<b&&(l=b,e&&(n=l/e),a=r.x+r.width/2-l/2),{x:a,y:o,width:l,height:n}}function Dr({rect:r,delta:i,aspectRatio:e,imageBox:t}){let[s]=i,{x:o,width:l,height:n}=r;l+=s,e&&(n=l/e);let a=r.y+r.height/2-n/2;return o+l>=t.x+t.width&&(l=t.x+t.width-o,e&&(n=l/e),a=r.y+r.height/2-n/2),a<=t.y&&(a=t.y,o=r.x),a+n>=t.y+t.height&&(a=Math.max(t.y,t.y+t.height-n),n=t.y+t.height-a,e&&(l=n*e),o=r.x),n<b&&(n=b,e&&(l=n*e),a=r.y+r.height/2-n/2),l<b&&(l=b,e&&(n=l/e),a=r.y+r.height/2-n/2),{x:o,y:a,width:l,height:n}}function Ur({rect:r,delta:i,aspectRatio:e,imageBox:t}){let[s,o]=i,{x:l,y:n,width:a,height:c}=r;return l+s<t.x&&(s=t.x-l),n+o<t.y&&(o=t.y-n),l+=s,a-=s,n+=o,c-=o,e&&Math.abs(a/c)>e?(o=a/e-c,c+=o,n-=o,n<=t.y&&(c=c-(t.y-n),a=c*e,l=r.x+r.width-a,n=t.y)):e&&(s=c*e-a,a=a+s,l-=s,l<=t.x&&(a=a-(t.x-l),c=a/e,l=t.x,n=r.y+r.height-c)),c<b&&(c=b,e&&(a=c*e),l=r.x+r.width-a,n=r.y+r.height-c),a<b&&(a=b,e&&(c=a/e),l=r.x+r.width-a,n=r.y+r.height-c),{x:l,y:n,width:a,height:c}}function zr({rect:r,delta:i,aspectRatio:e,imageBox:t}){let[s,o]=i,{x:l,y:n,width:a,height:c}=r;return l+a+s>t.x+t.width&&(s=t.x+t.width-l-a),n+o<t.y&&(o=t.y-n),a+=s,n+=o,c-=o,e&&Math.abs(a/c)>e?(o=a/e-c,c+=o,n-=o,n<=t.y&&(c=c-(t.y-n),a=c*e,l=r.x,n=t.y)):e&&(s=c*e-a,a+=s,l+a>=t.x+t.width&&(a=t.x+t.width-l,c=a/e,l=t.x+t.width-a,n=r.y+r.height-c)),c<b&&(c=b,e&&(a=c*e),n=r.y+r.height-c),a<b&&(a=b,e&&(c=a/e),n=r.y+r.height-c),{x:l,y:n,width:a,height:c}}function Fr({rect:r,delta:i,aspectRatio:e,imageBox:t}){let[s,o]=i,{x:l,y:n,width:a,height:c}=r;return l+s<t.x&&(s=t.x-l),n+c+o>t.y+t.height&&(o=t.y+t.height-n-c),l+=s,a-=s,c+=o,e&&Math.abs(a/c)>e?(o=a/e-c,c+=o,n+c>=t.y+t.height&&(c=t.y+t.height-n,a=c*e,l=r.x+r.width-a,n=t.y+t.height-c)):e&&(s=c*e-a,a+=s,l-=s,l<=t.x&&(a=a-(t.x-l),c=a/e,l=t.x,n=r.y)),c<b&&(c=b,e&&(a=c*e),l=r.x+r.width-a),a<b&&(a=b,e&&(c=a/e),l=r.x+r.width-a),{x:l,y:n,width:a,height:c}}function Br({rect:r,delta:i,aspectRatio:e,imageBox:t}){let[s,o]=i,{x:l,y:n,width:a,height:c}=r;return l+a+s>t.x+t.width&&(s=t.x+t.width-l-a),n+c+o>t.y+t.height&&(o=t.y+t.height-n-c),a+=s,c+=o,e&&Math.abs(a/c)>e?(o=a/e-c,c+=o,n+c>=t.y+t.height&&(c=t.y+t.height-n,a=c*e,l=r.x,n=t.y+t.height-c)):e&&(s=c*e-a,a+=s,l+a>=t.x+t.width&&(a=t.x+t.width-l,c=a/e,l=t.x+t.width-a,n=r.y)),c<b&&(c=b,e&&(a=c*e)),a<b&&(a=b,e&&(c=a/e)),{x:l,y:n,width:a,height:c}}function Hi({direction:r,...i}){switch(r){case"n":return Mr(i);case"w":return Nr(i);case"s":return Rr(i);case"e":return Dr(i);case"nw":return Ur(i);case"ne":return zr(i);case"sw":return Fr(i);case"se":return Br(i);default:return i.rect}}function ji(r,[i,e]){return r.x<=i&&i<=r.x+r.width&&r.y<=e&&e<=r.y+r.height}function Ki(r,i){return r.x>=i.x&&r.y>=i.y&&r.x+r.width<=i.x+i.width&&r.y+r.height<=i.y+i.height}function Gi(r,i){return Math.abs(r.width/r.height-i)<.1}function Te({width:r,height:i},e){let t=e/90%2!==0;return{width:t?i:r,height:t?r:i}}function Ee(r){return{x:Math.round(r.x),y:Math.round(r.y),width:Math.round(r.width),height:Math.round(r.height)}}function ne(r,i,e){return Math.min(Math.max(r,i),e)}var ct=class extends y{constructor(){super(),this.init$={...this.init$,dragging:!1},this._handlePointerUp=this._handlePointerUp_.bind(this),this._handlePointerMove=this._handlePointerMove_.bind(this),this._handleSvgPointerMove=this._handleSvgPointerMove_.bind(this)}_shouldThumbBeDisabled(i){let e=this.$["*imageBox"];if(!e)return;if(i===""&&e.height<=b&&e.width<=b)return!0;let t=e.height<=b&&(i.includes("n")||i.includes("s")),s=e.width<=b&&(i.includes("e")||i.includes("w"));return t||s}_createBackdrop(){let i=this.$["*cropBox"];if(!i)return;let{x:e,y:t,width:s,height:o}=i,l=this.ref["svg-el"],n=U("mask",{id:"backdrop-mask"}),a=U("rect",{x:0,y:0,width:"100%",height:"100%",fill:"white"}),c=U("rect",{x:e,y:t,width:s,height:o,fill:"black"});n.appendChild(a),n.appendChild(c);let u=U("rect",{x:0,y:0,width:"100%",height:"100%",fill:"var(--color-image-background)","fill-opacity":.85,mask:"url(#backdrop-mask)"});l.appendChild(u),l.appendChild(n),this._backdropMask=n,this._backdropMaskInner=c}_resizeBackdrop(){this._backdropMask&&(this._backdropMask.style.display="none",window.requestAnimationFrame(()=>{this._backdropMask&&(this._backdropMask.style.display="block")}))}_updateBackdrop(){let i=this.$["*cropBox"];if(!i)return;let{x:e,y:t,width:s,height:o}=i;this._backdropMaskInner&&pe(this._backdropMaskInner,{x:e,y:t,width:s,height:o})}_updateFrame(){let i=this.$["*cropBox"];if(!(!i||!this._frameGuides||!this._frameThumbs)){for(let e of Object.values(this._frameThumbs)){let{direction:t,pathNode:s,interactionNode:o,groupNode:l}=e,n=t==="",a=t.length===2,{x:c,y:u,width:h,height:f}=i;if(n){let _={x:c+h/3,y:u+f/3,width:h/3,height:f/3};pe(o,_)}else{let _=ne(Math.min(h,f)/(24*2+34)/2,0,1),{d:T,center:k}=a?Fi(i,t,_):Bi(i,t,_),M=Math.max(Ut*ne(Math.min(h,f)/Ut/3,0,1),zi);pe(o,{x:k[0]-M,y:k[1]-M,width:M*2,height:M*2}),pe(s,{d:T})}let g=this._shouldThumbBeDisabled(t);l.setAttribute("class",S("uc-thumb",{"uc-thumb--hidden":g,"uc-thumb--visible":!g}))}pe(this._frameGuides,{x:i.x-1*.5,y:i.y-1*.5,width:i.width+1,height:i.height+1})}}_createThumbs(){let i={};for(let e=0;e<3;e++)for(let t=0;t<3;t++){let s=`${["n","","s"][e]}${["w","","e"][t]}`,o=U("g");o.classList.add("uc-thumb"),o.setAttribute("with-effects","");let l=U("rect",{fill:"transparent"}),n=U("path",{stroke:"currentColor",fill:"none","stroke-width":3});o.appendChild(n),o.appendChild(l),i[s]={direction:s,pathNode:n,interactionNode:l,groupNode:o},l.addEventListener("pointerdown",this._handlePointerDown.bind(this,s))}return i}_createGuides(){let i=U("svg"),e=U("rect",{x:0,y:0,width:"100%",height:"100%",fill:"none",stroke:"currentColor","stroke-width":1,"stroke-opacity":.5});i.appendChild(e);for(let t=1;t<=2;t++){let s=U("line",{x1:`${Ue*t}%`,y1:"0%",x2:`${Ue*t}%`,y2:"100%",stroke:"currentColor","stroke-width":1,"stroke-opacity":.3});i.appendChild(s)}for(let t=1;t<=2;t++){let s=U("line",{x1:"0%",y1:`${Ue*t}%`,x2:"100%",y2:`${Ue*t}%`,stroke:"currentColor","stroke-width":1,"stroke-opacity":.3});i.appendChild(s)}return i.classList.add("uc-guides","uc-guides--semi-hidden"),i}_createFrame(){let i=this.ref["svg-el"],e=document.createDocumentFragment(),t=this._createGuides();e.appendChild(t);let s=this._createThumbs();for(let{groupNode:o}of Object.values(s))e.appendChild(o);i.appendChild(e),this._frameThumbs=s,this._frameGuides=t}_handlePointerDown(i,e){if(!this._frameThumbs)return;let t=this._frameThumbs[i];if(this._shouldThumbBeDisabled(i))return;let s=this.$["*cropBox"],{x:o,y:l}=this.ref["svg-el"].getBoundingClientRect(),n=e.x-o,a=e.y-l;this.$.dragging=!0,this._draggingThumb=t,this._dragStartPoint=[n,a],this._dragStartCrop={...s}}_handlePointerUp_(i){this._updateCursor(),this.$.dragging&&(i.stopPropagation(),i.preventDefault(),this.$.dragging=!1)}_handlePointerMove_(i){if(!this.$.dragging||!this._dragStartPoint||!this._draggingThumb)return;i.stopPropagation(),i.preventDefault();let e=this.ref["svg-el"],{x:t,y:s}=e.getBoundingClientRect(),o=i.x-t,l=i.y-s,n=o-this._dragStartPoint[0],a=l-this._dragStartPoint[1],{direction:c}=this._draggingThumb,u=this._calcCropBox(c,[n,a]);u&&(this.$["*cropBox"]=u)}_calcCropBox(i,e){var c,u;let[t,s]=e,o=this.$["*imageBox"],l=(c=this._dragStartCrop)!=null?c:this.$["*cropBox"],n=(u=this.$["*cropPresetList"])==null?void 0:u[0],a=n?n.width/n.height:void 0;if(i===""?l=Xi({rect:l,delta:[t,s],imageBox:o}):l=Hi({rect:l,delta:[t,s],direction:i,aspectRatio:a,imageBox:o}),!Object.values(l).every(h=>Number.isFinite(h)&&h>=0)){console.error("CropFrame is trying to create invalid rectangle",{payload:l});return}return xe(Ee(l),this.$["*imageBox"])}_handleSvgPointerMove_(i){if(!this._frameThumbs)return;let e=Object.values(this._frameThumbs).find(t=>{if(this._shouldThumbBeDisabled(t.direction))return!1;let o=t.interactionNode.getBoundingClientRect(),l={x:o.x,y:o.y,width:o.width,height:o.height};return ji(l,[i.x,i.y])});this._hoverThumb=e,this._updateCursor()}_updateCursor(){let i=this._hoverThumb;this.ref["svg-el"].style.cursor=i?Vi(i.direction):"initial"}_render(){this._updateBackdrop(),this._updateFrame()}toggleThumbs(i){this._frameThumbs&&Object.values(this._frameThumbs).map(({groupNode:e})=>e).forEach(e=>{e.setAttribute("class",S("uc-thumb",{"uc-thumb--hidden":!i,"uc-thumb--visible":i}))})}initCallback(){super.initCallback(),this._createBackdrop(),this._createFrame(),this.sub("*imageBox",()=>{this._resizeBackdrop(),window.requestAnimationFrame(()=>{this._render()})}),this.sub("*cropBox",i=>{i&&(this._guidesHidden=i.height<=b||i.width<=b,window.requestAnimationFrame(()=>{this._render()}))}),this.sub("dragging",i=>{this._frameGuides&&this._frameGuides.setAttribute("class",S({"uc-guides--hidden":this._guidesHidden,"uc-guides--visible":!this._guidesHidden&&i,"uc-guides--semi-hidden":!this._guidesHidden&&!i}))}),this.ref["svg-el"].addEventListener("pointermove",this._handleSvgPointerMove,!0),document.addEventListener("pointermove",this._handlePointerMove,!0),document.addEventListener("pointerup",this._handlePointerUp,!0)}destroyCallback(){super.destroyCallback(),document.removeEventListener("pointermove",this._handlePointerMove),document.removeEventListener("pointerup",this._handlePointerUp)}};ct.template=w`<svg class="uc-svg" ref="svg-el" xmlns="http://www.w3.org/2000/svg"></svg>`;var J=class extends y{constructor(){super(...arguments);m(this,"init$",{...this.init$,active:!1,title:"",icon:"","on.click":null})}initCallback(){super.initCallback(),this._titleEl=this.ref["title-el"],this._iconEl=this.ref["icon-el"],this.sub("title",e=>{this._titleEl&&(this._titleEl.style.display=e?"block":"none")}),this.sub("active",e=>{this.className=S({"uc-active":e,"uc-not_active":!e})}),this.sub("on.click",e=>{this.onclick=e})}};J.template=w`<button type="button" role="option"><uc-icon bind="@name: icon;"></uc-icon><div class="uc-title" ref="title-el">{{title}}</div></button>`;function Xr(r){let i=r+90;return i=i>=360?0:i,i}function Hr(r,i){return r==="rotate"?Xr(i):["mirror","flip"].includes(r)?!i:null}var ze=class extends J{initCallback(){super.initCallback(),this.defineAccessor("operation",i=>{i&&(this._operation=i,this.$.icon=i)}),this.$["on.click"]=()=>{let i=this.$["*cropperEl"].getValue(this._operation),e=Hr(this._operation,i);this.$["*cropperEl"].setValue(this._operation,e)}}};var Fe={FILTER:"filter",COLOR_OPERATION:"color_operation"},K="original",ht=class extends y{constructor(){super(...arguments);m(this,"init$",{...this.init$,disabled:!1,min:0,max:100,value:0,defaultValue:0,zero:0,"on.input":e=>{this.$["*faderEl"].set(e),this.$.value=e}})}setOperation(e,t){this._controlType=e==="filter"?Fe.FILTER:Fe.COLOR_OPERATION,this._operation=e,this._iconName=e,this._title=e.toUpperCase(),this._filter=t,this._initializeValues(),this.$["*faderEl"].activate({url:this.$["*originalUrl"],operation:this._operation,value:this._filter===K?void 0:this.$.value,filter:this._filter===K?void 0:this._filter,fromViewer:!1})}_initializeValues(){let{range:e,zero:t}=X[this._operation],[s,o]=e;this.$.min=s,this.$.max=o,this.$.zero=t;let l=this.$["*editorTransformations"][this._operation];if(this._controlType===Fe.FILTER){let n=o;if(l){let{name:a,amount:c}=l;n=a===this._filter?c:o}this.$.value=n,this.$.defaultValue=n}if(this._controlType===Fe.COLOR_OPERATION){let n=typeof l!="undefined"?l:t;this.$.value=n,this.$.defaultValue=n}}apply(){let e;this._controlType===Fe.FILTER?this._filter===K?e=null:e={name:this._filter,amount:this.$.value}:e=this.$.value;let t={...this.$["*editorTransformations"],[this._operation]:e};this.$["*editorTransformations"]=t}cancel(){this.$["*faderEl"].deactivate({hide:!1})}initCallback(){super.initCallback(),this.sub("*originalUrl",e=>{this._originalUrl=e}),this.sub("value",e=>{let t=`${this._filter||this._operation} ${e}`;this.$["*operationTooltip"]=t})}};ht.template=w`<uc-slider-ui ref="slider-el" bind="disabled: disabled; min: min; max: max; defaultValue: defaultValue; zero: zero; onInput: on.input;" ></uc-slider-ui>`;function Be(r){let i=new Image;return{promise:new Promise((s,o)=>{i.src=r,i.onload=s,i.onerror=o}),image:i,cancel:()=>{i.naturalWidth===0&&(i.src=H)}}}function Ve(r){let i=[];for(let o of r){let l=Be(o);i.push(l)}let e=i.map(o=>o.image);return{promise:Promise.allSettled(i.map(o=>o.promise)),images:e,cancel:()=>{i.forEach(o=>{o.cancel()})}}}var Ce=class extends J{constructor(){super(),this.init$={...this.init$,active:!1,title:"",icon:"",isOriginal:!1,"on.click":null}}_previewSrc(){let i=parseInt(window.getComputedStyle(this).getPropertyValue("--l-base-min-width"),10),e=window.devicePixelRatio,t=Math.ceil(e*i),s=e>=2?"lightest":"normal",o=100,l={...this.$["*editorTransformations"]};return l[this._operation]=this._filter!==K?{name:this._filter,amount:o}:void 0,q(this._originalUrl,Z(it,oe(l),`quality/${s}`,`scale_crop/${t}x${t}/center`))}async _observerCallback(i,e){var s;if(i[0].isIntersecting){let o=await this.proxyUrl(this._previewSrc()),l=this.ref["preview-el"],{promise:n,cancel:a}=Be(o);this._cancelPreload=a,n.catch(c=>{this.$["*networkProblems"]=!0,console.error("Failed to load image",{error:c})}).finally(()=>{l.style.backgroundImage=`url(${o})`,l.setAttribute("loaded",""),e.unobserve(this)})}else(s=this._cancelPreload)==null||s.call(this)}initCallback(){super.initCallback(),this.$["on.click"]=()=>{this.$.active?this.$.isOriginal||(this.$["*sliderEl"].setOperation(this._operation,this._filter),this.$["*showSlider"]=!0):(this.$["*sliderEl"].setOperation(this._operation,this._filter),this.$["*sliderEl"].apply()),this.$["*currentFilter"]=this._filter},this.defineAccessor("filter",e=>{this._operation="filter",this._filter=e,this.$.isOriginal=e===K,this.$.icon=this.$.isOriginal?"original":"slider"}),this._observer=new window.IntersectionObserver(this._observerCallback.bind(this),{threshold:[0,1]});let i=this.$["*originalUrl"];this._originalUrl=i,this.$.isOriginal?this.ref["icon-el"].classList.add("uc-original-icon"):this._observer.observe(this),this.sub("*currentFilter",e=>{this.$.active=e&&e===this._filter}),this.sub("active",e=>{if(this.$.isOriginal)return;let t=this.ref["icon-el"];t.style.opacity=e?"1":"0";let s=this.ref["preview-el"];e?s.style.opacity="0":s.style.backgroundImage&&(s.style.opacity="1")}),this.sub("*networkProblems",async e=>{if(!e){let t=await this.proxyUrl(this._previewSrc()),s=this.ref["preview-el"];s.style.backgroundImage&&(s.style.backgroundImage="none",s.style.backgroundImage=`url(${t})`)}})}destroyCallback(){var i,e;super.destroyCallback(),(i=this._observer)==null||i.disconnect(),(e=this._cancelPreload)==null||e.call(this)}};Ce.template=w`<button type="button" role="option"><div class="uc-preview" ref="preview-el"></div><uc-icon ref="icon-el" bind="@name: icon;"></uc-icon></button>`;var Xe=class extends J{constructor(){super(...arguments);m(this,"_operation","")}initCallback(){super.initCallback(),this.$["on.click"]=()=>{this.$["*sliderEl"].setOperation(this._operation),this.$["*showSlider"]=!0,this.$["*currentOperation"]=this._operation},this.defineAccessor("operation",e=>{e&&(this._operation=e,this.$.icon=e,this.bindL10n("title",()=>this.l10n(e)))}),this.sub("*editorTransformations",e=>{if(!this._operation)return;let{zero:t}=X[this._operation],s=e[this._operation],o=typeof s!="undefined"?s!==t:!1;this.$.active=o})}};var Wi=(r,i)=>{let e,t,s,o=(...l)=>{e?(clearTimeout(t),t=setTimeout(()=>{Date.now()-s>=i&&(r(...l),s=Date.now())},Math.max(i-(Date.now()-s),0))):(r(...l),s=Date.now(),e=!0)};return Object.defineProperty(o,"cancel",{configurable:!1,writable:!1,enumerable:!1,value:()=>{clearTimeout(t)}}),o};function Zi(r,i){let e={};for(let t of i){let s=r[t];(r.hasOwnProperty(t)||s!==void 0)&&(e[t]=s)}return e}var qi="blocks",Yi="1.2.0";function Ae(r,i,e){let s=window.devicePixelRatio,o=Math.min(Math.ceil(i*s),3e3),l=s>=2?"lightest":"normal";return q(r,Z(it,oe(e),`quality/${l}`,`stretch/off/-/resize/${o}x`,`@clib/${qi}/${Yi}/uc-cloud-image-editor/`))}function jr(r){return r?[({dimensions:e,coords:t})=>[...e,...t].every(s=>Number.isInteger(s)&&Number.isFinite(s)),({dimensions:e,coords:t})=>e.every(s=>s>0)&&t.every(s=>s>=0)].every(e=>e(r)):!0}var ut=class extends y{constructor(){super();m(this,"ctxOwner",!0);this.init$={...this.init$,image:null,"*padding":20,"*operations":{rotate:0,mirror:!1,flip:!1},"*imageBox":{x:0,y:0,width:0,height:0},"*cropBox":{x:0,y:0,width:0,height:0}},this._commitDebounced=R(this._commit.bind(this),300),this._handleResizeThrottled=Wi(this._handleResize.bind(this),100),this._imageSize={width:0,height:0}}_handleResize(){!this.isConnected||!this._isActive||(this._initCanvas(),this._syncTransformations(),this._alignImage(),this._alignCrop(),this._draw())}_syncTransformations(){let e=this.$["*editorTransformations"],t=Zi(e,Object.keys(this.$["*operations"])),s={...this.$["*operations"],...t};this.$["*operations"]=s}_initCanvas(){let e=this.ref["canvas-el"],t=e.getContext("2d"),s=this.offsetWidth,o=this.offsetHeight,l=window.devicePixelRatio;e.style.width=`${s}px`,e.style.height=`${o}px`,e.width=s*l,e.height=o*l,t==null||t.scale(l,l),this._canvas=e,this._ctx=t}_alignImage(){if(!this._isActive||!this.$.image)return;let e=this.$.image,t=this.$["*padding"],s=this.$["*operations"],{rotate:o}=s,l={width:this.offsetWidth,height:this.offsetHeight},n=Te({width:e.naturalWidth,height:e.naturalHeight},o),a;if(n.width>l.width-t*2||n.height>l.height-t*2){let c=n.width/n.height,u=l.width/l.height;if(c>u){let h=l.width-t*2,f=h/c,g=0+t,_=t+(l.height-t*2)/2-f/2;a={x:g,y:_,width:h,height:f}}else{let h=l.height-t*2,f=h*c,g=t+(l.width-t*2)/2-f/2,_=0+t;a={x:g,y:_,width:f,height:h}}}else{let{width:c,height:u}=n,h=t+(l.width-t*2)/2-c/2,f=t+(l.height-t*2)/2-u/2;a={x:h,y:f,width:c,height:u}}this.$["*imageBox"]=Ee(a)}_alignCrop(){var f;let e=this.$["*cropBox"],t=this.$["*imageBox"],s=this.$["*operations"],{rotate:o}=s,l=this.$["*editorTransformations"].crop,{width:n,x:a,y:c}=this.$["*imageBox"];if(l){let{dimensions:[g,_],coords:[T,k]}=l,{width:M}=Te(this._imageSize,o),ae=n/M;e=xe(Ee({x:a+T*ae,y:c+k*ae,width:g*ae,height:_*ae}),this.$["*imageBox"])}let u=(f=this.$["*cropPresetList"])==null?void 0:f[0],h=u?u.width/u.height:void 0;if(!Ki(e,t)||h&&!Gi(e,h)){let g=t.width/t.height,_=t.width,T=t.height;h&&(g>h?_=Math.min(t.height*h,t.width):T=Math.min(t.width/h,t.height)),e={x:t.x+t.width/2-_/2,y:t.y+t.height/2-T/2,width:_,height:T}}this.$["*cropBox"]=xe(Ee(e),this.$["*imageBox"])}_drawImage(){let e=this._ctx;if(!e)return;let t=this.$.image,s=this.$["*imageBox"],o=this.$["*operations"],{mirror:l,flip:n,rotate:a}=o,c=Te({width:s.width,height:s.height},a);e.save(),e.translate(s.x+s.width/2,s.y+s.height/2),e.rotate(a*Math.PI*-1/180),e.scale(l?-1:1,n?-1:1),e.drawImage(t,-c.width/2,-c.height/2,c.width,c.height),e.restore()}_draw(){if(!this._isActive||!this.$.image||!this._canvas||!this._ctx)return;let e=this._canvas;this._ctx.clearRect(0,0,e.width,e.height),this._drawImage()}_animateIn({fromViewer:e}){this.$.image&&(this.ref["frame-el"].toggleThumbs(!0),this._transitionToImage(),setTimeout(()=>{this.className=S({"uc-active_from_viewer":e,"uc-active_from_editor":!e,"uc-inactive_to_editor":!1})}))}_getCropDimensions(){let e=this.$["*cropBox"],t=this.$["*imageBox"],s=this.$["*operations"],{rotate:o}=s,{width:l,height:n}=t,{width:a,height:c}=Te(this._imageSize,o),{width:u,height:h}=e,f=l/a,g=n/c;return[ne(Math.round(u/f),1,a),ne(Math.round(h/g),1,c)]}_getCropTransformation(){let e=this.$["*cropBox"],t=this.$["*imageBox"],s=this.$["*operations"],{rotate:o}=s,{width:l,height:n,x:a,y:c}=t,{width:u,height:h}=Te(this._imageSize,o),{x:f,y:g}=e,_=l/u,T=n/h,k=this._getCropDimensions(),M={dimensions:k,coords:[ne(Math.round((f-a)/_),0,u-k[0]),ne(Math.round((g-c)/T),0,h-k[1])]};if(!jr(M)){console.error("Cropper is trying to create invalid crop object",{payload:M});return}if(!(k[0]===u&&k[1]===h))return M}_commit(){if(!this.isConnected||!this._imageSize)return;let e=this.$["*operations"],{rotate:t,mirror:s,flip:o}=e,l=this._getCropTransformation(),a={...this.$["*editorTransformations"],crop:l,rotate:t,mirror:s,flip:o};this.$["*editorTransformations"]=a}setValue(e,t){this.$["*operations"]={...this.$["*operations"],[e]:t},this._isActive&&(this._alignImage(),this._alignCrop(),this._draw())}getValue(e){return this.$["*operations"][e]}async activate(e,{fromViewer:t}={}){if(!this._isActive){this._isActive=!0,this._imageSize=e,this.removeEventListener("transitionend",this._reset);try{this.$.image=await this._waitForImage(this.$["*originalUrl"],this.$["*editorTransformations"]),this._syncTransformations(),this._animateIn({fromViewer:t})}catch(s){console.error("Failed to activate cropper",{error:s})}this._observer=new ResizeObserver(([s])=>{s.contentRect.width>0&&s.contentRect.height>0&&this._isActive&&this.$.image&&this._handleResizeThrottled()}),this._observer.observe(this)}}deactivate({reset:e=!1}={}){var t;this._isActive&&(!e&&this._commit(),this._isActive=!1,this._transitionToCrop(),this.className=S({"uc-active_from_viewer":!1,"uc-active_from_editor":!1,"uc-inactive_to_editor":!0}),this.ref["frame-el"].toggleThumbs(!1),this.addEventListener("transitionend",this._reset,{once:!0}),(t=this._observer)==null||t.disconnect())}_transitionToCrop(){let e=this._getCropDimensions(),t=Math.min(this.offsetWidth,e[0])/this.$["*cropBox"].width,s=Math.min(this.offsetHeight,e[1])/this.$["*cropBox"].height,o=Math.min(t,s),l=this.$["*cropBox"].x+this.$["*cropBox"].width/2,n=this.$["*cropBox"].y+this.$["*cropBox"].height/2;this.style.transform=`scale(${o}) translate(${(this.offsetWidth/2-l)/o}px, ${(this.offsetHeight/2-n)/o}px)`,this.style.transformOrigin=`${l}px ${n}px`}_transitionToImage(){let e=this.$["*cropBox"].x+this.$["*cropBox"].width/2,t=this.$["*cropBox"].y+this.$["*cropBox"].height/2;this.style.transform="scale(1)",this.style.transformOrigin=`${e}px ${t}px`}_reset(){this._isActive||(this.$.image=null)}async _waitForImage(e,t){var u;let s=this.offsetWidth;t={...t,crop:void 0,rotate:void 0,flip:void 0,mirror:void 0};let o=await this.proxyUrl(Ae(e,s,t)),{promise:l,cancel:n,image:a}=Be(o),c=this._handleImageLoading(o);return a.addEventListener("load",c,{once:!0}),a.addEventListener("error",c,{once:!0}),(u=this._cancelPreload)==null||u.call(this),this._cancelPreload=n,l.then(()=>a).catch(h=>(console.error("Failed to load image",{error:h}),this.$["*networkProblems"]=!0,Promise.resolve(a)))}_handleImageLoading(e){let t="crop",s=this.$["*loadingOperations"];return s.get(t)||s.set(t,new Map),s.get(t).get(e)||(s.set(t,s.get(t).set(e,!0)),this.$["*loadingOperations"]=s),()=>{var o;(o=s==null?void 0:s.get(t))!=null&&o.has(e)&&(s.get(t).delete(e),this.$["*loadingOperations"]=s)}}initCallback(){super.initCallback(),this.sub("*imageBox",()=>{this._draw()}),this.sub("*cropBox",()=>{this.$.image&&this._commitDebounced()}),this.sub("*cropPresetList",()=>{this._alignCrop()}),setTimeout(()=>{this.sub("*networkProblems",e=>{e||this._isActive&&this.activate(this._imageSize,{fromViewer:!1})})},0)}destroyCallback(){var e;super.destroyCallback(),(e=this._observer)==null||e.disconnect()}};ut.template=w`<canvas class="uc-canvas" ref="canvas-el"></canvas><uc-crop-frame ref="frame-el"></uc-crop-frame>`;function zt(r,i,e){let t=Array(e);e--;for(let s=e;s>=0;s--)t[s]=Math.ceil((s*i+(e-s)*r)/e);return t}function Kr(r){return r.reduce((i,e,t)=>t<r.length-1?[...i,[e,r[t+1]]]:i,[])}function Gr(r,i,e){let t=Kr(r).find(([s,o])=>s<=i&&i<=o);return r.map(s=>{let o=Math.abs(t[0]-t[1]),l=Math.abs(i-t[0])/o;return t[0]===s?i>e?1:1-l:t[1]===s?i>=e?l:1:0})}function Wr(r,i){return r.map((e,t)=>e<i?r.length-t:t)}function Qi(r,i){let e=X[r].keypointsNumber,{range:t,zero:s}=X[r];return[...new Set([...zt(t[0],s,e+1),...zt(s,t[1],e+1),s,i])].sort((o,l)=>o-l)}var Ft=class extends y{constructor(){super(),this._isActive=!1,this._hidden=!0,this._addKeypointDebounced=R(this._addKeypoint.bind(this),600),this.classList.add("uc-inactive_to_cropper")}_handleImageLoading(i){let e=this._operation,t=this.$["*loadingOperations"];return t.get(e)||t.set(e,new Map),t.get(e).get(i)||(t.set(e,t.get(e).set(i,!0)),this.$["*loadingOperations"]=t),()=>{var s;(s=t==null?void 0:t.get(e))!=null&&s.has(i)&&(t.get(e).delete(i),this.$["*loadingOperations"]=t)}}_flush(){window.cancelAnimationFrame(this._raf),this._raf=window.requestAnimationFrame(()=>{for(let i of this._keypoints){let{image:e}=i;e&&(e.style.opacity=i.opacity.toString(),e.style.zIndex=i.zIndex.toString())}})}async _imageSrc({url:i=this._url,filter:e=this._filter,operation:t,value:s}={}){let o={...this._transformations};t&&(o[t]=e?{name:e,amount:s}:s);let l=this.offsetWidth;return await this.proxyUrl(Ae(i,l,o))}async _constructKeypoint(i,e){return{src:await this._imageSrc({operation:i,value:e}),image:null,opacity:0,zIndex:0,value:e}}_isSame(i,e){return this._operation===i&&this._filter===e}async _addKeypoint(i,e,t){let s=()=>!this._isSame(i,e)||this._value!==t||!!this._keypoints.find(a=>a.value===t);if(s())return;let o=await this._constructKeypoint(i,t),l=new Image;l.src=o.src;let n=this._handleImageLoading(o.src);l.addEventListener("load",n,{once:!0}),l.addEventListener("error",n,{once:!0}),o.image=l,l.classList.add("uc-fader-image"),l.addEventListener("load",()=>{if(s())return;let a=this._keypoints,c=a.findIndex(h=>h.value>t),u=c<a.length?a[c].image:null;!this._container||u&&!this._container.contains(u)||(a.splice(c,0,o),this._container.insertBefore(l,u),this._update(i,t))},{once:!0}),l.addEventListener("error",()=>{this.$["*networkProblems"]=!0},{once:!0})}set(i){i=typeof i=="string"?parseInt(i,10):i,this._update(this._operation,i),this._addKeypointDebounced(this._operation,this._filter,i)}_update(i,e){this._operation=i,this._value=e;let{zero:t}=X[i],s=this._keypoints.map(n=>n.value),o=Gr(s,e,t),l=Wr(s,t);for(let[n,a]of Object.entries(this._keypoints))a.opacity=o[n],a.zIndex=l[n];this._flush()}_createPreviewImage(){let i=new Image;return i.classList.add("uc-fader-image","uc-fader-image--preview"),i.style.opacity="0",i}async _initNodes(){let i=document.createDocumentFragment();this._previewImage=this._previewImage||this._createPreviewImage(),!this.contains(this._previewImage)&&i.appendChild(this._previewImage);let e=document.createElement("div");i.appendChild(e);let t=this._keypoints.map(c=>c.src),{images:s,promise:o,cancel:l}=Ve(t);s.forEach(c=>{let u=this._handleImageLoading(c.src);c.addEventListener("load",u),c.addEventListener("error",u)}),this._cancelLastImages=()=>{l(),this._cancelLastImages=void 0};let n=this._operation,a=this._filter;await o,this._isActive&&this._isSame(n,a)&&(this._container&&this._container.remove(),this._container=e,this._keypoints.forEach((c,u)=>{let h=s[u];h.classList.add("uc-fader-image"),c.image=h,this._container.appendChild(h)}),this.appendChild(i),this._flush())}async setTransformations(i){if(this._transformations=i,this._previewImage){let e=await this._imageSrc(),t=this._handleImageLoading(e);this._previewImage.src=e,this._previewImage.addEventListener("load",t,{once:!0}),this._previewImage.addEventListener("error",t,{once:!0}),this._previewImage.style.opacity="1",this._previewImage.addEventListener("error",()=>{this.$["*networkProblems"]=!0},{once:!0})}}async preload({url:i,filter:e,operation:t,value:s}){this._cancelBatchPreload&&this._cancelBatchPreload();let o=Qi(t,s),l=await Promise.all(o.map(a=>this._imageSrc({url:i,filter:e,operation:t,value:a}))),{cancel:n}=Ve(l);this._cancelBatchPreload=n}_setOriginalSrc(i){let e=this._previewImage||this._createPreviewImage();if(!this.contains(e)&&this.appendChild(e),this._previewImage=e,e.src===i){e.style.opacity="1",e.style.transform="scale(1)",this.className=S({"uc-active_from_viewer":this._fromViewer,"uc-active_from_cropper":!this._fromViewer,"uc-inactive_to_cropper":!1});return}e.style.opacity="0";let t=this._handleImageLoading(i);e.addEventListener("error",t,{once:!0}),e.src=i,e.addEventListener("load",()=>{t(),e&&(e.style.opacity="1",e.style.transform="scale(1)",this.className=S({"uc-active_from_viewer":this._fromViewer,"uc-active_from_cropper":!this._fromViewer,"uc-inactive_to_cropper":!1}))},{once:!0}),e.addEventListener("error",()=>{this.$["*networkProblems"]=!0},{once:!0})}async activate({url:i,operation:e,value:t,filter:s,fromViewer:o}){if(this._isActive=!0,this._hidden=!1,this._url=i,this._operation=e||"initial",this._value=t,this._filter=s,this._fromViewer=o,typeof t!="number"&&!s){let n=await this._imageSrc({operation:e,value:t});this._setOriginalSrc(n),this._container&&this._container.remove();return}this._keypoints=await Promise.all(Qi(e,t).map(n=>this._constructKeypoint(e,n))),this._update(e,t),this._initNodes()}deactivate({hide:i=!0}={}){this._isActive=!1,this._cancelLastImages&&this._cancelLastImages(),this._cancelBatchPreload&&this._cancelBatchPreload(),i&&!this._hidden?(this._hidden=!0,this._previewImage&&(this._previewImage.style.transform="scale(1)"),this.className=S({"uc-active_from_viewer":!1,"uc-active_from_cropper":!1,"uc-inactive_to_cropper":!0}),this.addEventListener("transitionend",()=>{this._container&&this._container.remove()},{once:!0})):this._container&&this._container.remove()}};var Zr=1,dt=class extends y{initCallback(){super.initCallback(),this.addEventListener("wheel",i=>{i.preventDefault();let{deltaY:e,deltaX:t}=i;Math.abs(t)>Zr?this.scrollLeft+=t:this.scrollLeft+=e},{passive:!1}),this.addEventListener("scroll",()=>{},{passive:!0})}};dt.template=w`<slot></slot>`;function qr(r){return`<uc-presence-toggle class="uc-tab-toggle" bind="visible: presence.tabToggle.${r}; styles: presence.tabToggleStyles;" ><uc-btn-ui theme="tab" ref="tab-toggle-${r}" data-id="${r}" icon="${r}" bind="onclick: on.clickTab; aria-role:tab_role; aria-controls:tab_${r}" ></uc-btn-ui></uc-presence-toggle>`}function Yr(r){return w`<uc-presence-toggle id="tab_${r}" class="uc-tab-content" bind="visible: presence.tabContent.${r}; styles: presence.tabContentStyles" ><uc-editor-scroller hidden-scrollbar><div class="uc-controls-list_align"><div role="listbox" aria-orientation="horizontal" class="uc-controls-list_inner" ref="controls-list-${r}" ></div></div></uc-editor-scroller></uc-presence-toggle>`}var ft=class extends y{constructor(){super();m(this,"_updateInfoTooltip",R(()=>{var l,n;let e=this.$["*editorTransformations"],t=this.$["*currentOperation"],s="",o=!1;if(this.$["*tabId"]===x.FILTERS)if(o=!0,this.$["*currentFilter"]&&((l=e==null?void 0:e.filter)==null?void 0:l.name)===this.$["*currentFilter"]){let a=((n=e==null?void 0:e.filter)==null?void 0:n.amount)||100;s=this.$["*currentFilter"]+" "+a}else s=this.l10n(K);else if(this.$["*tabId"]===x.TUNING&&t){o=!0;let a=(e==null?void 0:e[t])||X[t].zero;s=this.l10n(t)+" "+a}o&&(this.$["*operationTooltip"]=s),this.ref["tooltip-el"].classList.toggle("uc-info-tooltip_visible",o)},0));this.init$={...this.init$,"*sliderEl":null,"*loadingOperations":new Map,"*showSlider":!1,"*currentFilter":K,"*currentOperation":null,showLoader:!1,filters:di,colorOperations:ui,cropOperations:fi,"*operationTooltip":null,"presence.mainToolbar":!0,"presence.subToolbar":!1,"presence.tabToggles":!0,"presence.tabContent.crop":!1,"presence.tabContent.tuning":!1,"presence.tabContent.filters":!1,"presence.tabToggle.crop":!0,"presence.tabToggle.tuning":!0,"presence.tabToggle.filters":!0,"presence.subTopToolbarStyles":{hidden:"uc-sub-toolbar--top-hidden",visible:"uc-sub-toolbar--visible"},"presence.subBottomToolbarStyles":{hidden:"uc-sub-toolbar--bottom-hidden",visible:"uc-sub-toolbar--visible"},"presence.tabContentStyles":{hidden:"uc-tab-content--hidden",visible:"uc-tab-content--visible"},"presence.tabToggleStyles":{hidden:"uc-tab-toggle--hidden",visible:"uc-tab-toggle--visible"},"presence.tabTogglesStyles":{hidden:"uc-tab-toggles--hidden",visible:"uc-tab-toggles--visible"},"on.cancel":()=>{var e;(e=this._cancelPreload)==null||e.call(this),this.$["*on.cancel"]()},"on.apply":()=>{this.$["*on.apply"](this.$["*editorTransformations"])},"on.applySlider":()=>{this.ref["slider-el"].apply(),this._onSliderClose()},"on.cancelSlider":()=>{this.ref["slider-el"].cancel(),this._onSliderClose()},"on.clickTab":e=>{let t=e.currentTarget.getAttribute("data-id");t&&this._activateTab(t,{fromViewer:!1})},tab_role:"tab",[`tab_${x.TUNING}`]:`tab_${x.TUNING}`,[`tab_${x.CROP}`]:`tab_${x.CROP}`,[`tab_${x.FILTERS}`]:`tab_${x.FILTERS}`},this._debouncedShowLoader=R(this._showLoader.bind(this),500)}_onSliderClose(){this.$["*showSlider"]=!1,this.$["*tabId"]===x.TUNING&&this.ref["tooltip-el"].classList.toggle("uc-info-tooltip_visible",!1)}_createOperationControl(e){let t=new Xe;return t.operation=e,t}_createFilterControl(e){let t=new Ce;return t.filter=e,t}_createToggleControl(e){let t=new ze;return t.operation=e,t}_renderControlsList(e){let t=this.ref[`controls-list-${e}`],s=document.createDocumentFragment();e===x.CROP?this.$.cropOperations.forEach(o=>{let l=this._createToggleControl(o);s.appendChild(l)}):e===x.FILTERS?[K,...this.$.filters].forEach(o=>{let l=this._createFilterControl(o);s.appendChild(l)}):e===x.TUNING&&this.$.colorOperations.forEach(o=>{let l=this._createOperationControl(o);s.appendChild(l)}),[...s.children].forEach((o,l)=>{l===s.childNodes.length-1&&o.classList.add("uc-controls-list_last-item")}),t.innerHTML="",t.appendChild(s)}_activateTab(e,{fromViewer:t}){this.$["*tabId"]=e,e===x.CROP?(this.$["*faderEl"].deactivate(),this.$["*cropperEl"].activate(this.$["*imageSize"],{fromViewer:t})):(this.$["*faderEl"].activate({url:this.$["*originalUrl"],fromViewer:t}),this.$["*cropperEl"].deactivate());for(let s of I){let o=s===e,l=this.ref[`tab-toggle-${s}`];l.active=o,o?(this._renderControlsList(e),this._syncTabIndicator()):this._unmountTabControls(s),this.$[`presence.tabContent.${s}`]=o}}_unmountTabControls(e){let t=this.ref[`controls-list-${e}`];t&&(t.innerHTML="")}_syncTabIndicator(){let e=this.ref[`tab-toggle-${this.$["*tabId"]}`],t=this.ref["tabs-indicator"];t.style.transform=`translateX(${e.offsetLeft}px)`}async _preloadEditedImage(){var e;if(this.$["*imgContainerEl"]&&this.$["*originalUrl"]){let t=this.$["*imgContainerEl"].offsetWidth,s=await this.proxyUrl(Ae(this.$["*originalUrl"],t,this.$["*editorTransformations"]));(e=this._cancelPreload)==null||e.call(this);let{cancel:o}=Ve([s]);this._cancelPreload=()=>{o(),this._cancelPreload=void 0}}}_showLoader(e){this.$.showLoader=e}initCallback(){super.initCallback(),this.$["*sliderEl"]=this.ref["slider-el"],this.sub("*imageSize",e=>{e&&setTimeout(()=>{this._activateTab(this.$["*tabId"],{fromViewer:!0})},0)}),this.sub("*editorTransformations",e=>{var s;let t=(s=e==null?void 0:e.filter)==null?void 0:s.name;this.$["*currentFilter"]!==t&&(this.$["*currentFilter"]=t!=null?t:null)}),this.sub("*currentFilter",()=>{this._updateInfoTooltip()}),this.sub("*currentOperation",()=>{this._updateInfoTooltip()}),this.sub("*tabId",()=>{this._updateInfoTooltip()}),this.sub("*originalUrl",()=>{this.$["*faderEl"]&&this.$["*faderEl"].deactivate()}),this.sub("*editorTransformations",e=>{this._preloadEditedImage(),this.$["*faderEl"]&&this.$["*faderEl"].setTransformations(e)}),this.sub("*loadingOperations",e=>{let t=!1;for(let[,s]of e.entries()){if(t)break;for(let[,o]of s.entries())if(o){t=!0;break}}this._debouncedShowLoader(t)}),this.sub("*showSlider",e=>{this.$["presence.subToolbar"]=e,this.$["presence.mainToolbar"]=!e}),this.sub("*tabList",e=>{this.$["presence.tabToggles"]=e.length>1;for(let t of I){this.$[`presence.tabToggle.${t}`]=e.includes(t);let s=this.ref[`tab-toggle-${t}`];s.style.gridColumn=e.indexOf(t)+1}e.includes(this.$["*tabId"])||this._activateTab(e[0],{fromViewer:!1})}),this._updateInfoTooltip()}};ft.template=w`<uc-line-loader-ui bind="active: showLoader"></uc-line-loader-ui><div class="uc-info-tooltip_container"><div class="uc-info-tooltip_wrapper"><div ref="tooltip-el" class="uc-info-tooltip uc-info-tooltip_hidden">{{*operationTooltip}}</div></div></div><div class="uc-toolbar-container"><uc-presence-toggle role="tablist" class="uc-sub-toolbar" bind="visible: presence.mainToolbar; styles: presence.subTopToolbarStyles" ><div class="uc-tab-content-row">${I.map(Yr).join("")}</div><div class="uc-controls-row"><uc-presence-toggle class="uc-tab-toggles" bind="visible: presence.tabToggles; styles: presence.tabTogglesStyles" ><div ref="tabs-indicator" class="uc-tab-toggles_indicator"></div> ${I.map(qr).join("")} </uc-presence-toggle><uc-btn-ui style="order: -1" theme="secondary-icon" icon="closeMax" bind="onclick: on.cancel"></uc-btn-ui><uc-btn-ui theme="primary-icon" icon="done" bind="onclick: on.apply"></uc-btn-ui></div></uc-presence-toggle><uc-presence-toggle class="uc-sub-toolbar" bind="visible: presence.subToolbar; styles: presence.subBottomToolbarStyles" ><div class="uc-slider"><uc-editor-slider ref="slider-el"></uc-editor-slider></div><div class="uc-controls-row"><uc-btn-ui theme="secondary" bind="onclick: on.cancelSlider;" l10n="@text:cancel"></uc-btn-ui><uc-btn-ui theme="primary" bind="onclick: on.applySlider;" l10n="@text:apply"></uc-btn-ui></div></uc-presence-toggle></div>`;var He=class extends y{constructor(){super(),this._iconReversed=!1,this._iconSingle=!1,this._iconHidden=!1,this.init$={...this.init$,text:"",icon:"",iconCss:this._iconCss(),theme:null,"aria-role":"","aria-controls":""},this.defineAccessor("active",i=>{i?this.setAttribute("active",""):this.removeAttribute("active")})}_iconCss(){return S("uc-icon",{"uc-icon_left":!this._iconReversed,"uc-icon_right":this._iconReversed,"uc-icon_hidden":this._iconHidden,"uc-icon_single":this._iconSingle})}initCallback(){super.initCallback(),this.sub("icon",i=>{this._iconSingle=!this.$.text,this._iconHidden=!i,this.$.iconCss=this._iconCss()}),this.sub("theme",i=>{i!=="custom"&&(this.className=`uc-${i}`)}),this.sub("text",()=>{this._iconSingle=!1}),this.hasAttribute("theme")||this.setAttribute("theme","default"),this.defineAccessor("aria-role",i=>{this.$["aria-role"]=i||""}),this.defineAccessor("aria-controls",i=>{this.$["aria-controls"]=i||""})}set reverse(i){this.hasAttribute("reverse")?(this.style.flexDirection="row-reverse",this._iconReversed=!0):(this._iconReversed=!1,this.style.flexDirection=null)}};He.bindAttributes({text:"text",icon:"icon",reverse:"reverse",theme:"theme"});He.template=w`<button type="button" bind="@role:aria-role; @aria-controls: aria-controls"><uc-icon bind="className: iconCss; @name: icon; @hidden: !icon"></uc-icon><div class="uc-text">{{text}}</div></button>`;var pt=class extends y{constructor(){super(),this._active=!1,this._handleTransitionEndRight=()=>{let i=this.ref["line-el"];i.style.transition="initial",i.style.opacity="0",i.style.transform="translateX(-101%)",this._active&&this._start()}}initCallback(){super.initCallback(),this.defineAccessor("active",i=>{typeof i=="boolean"&&(i?this._start():this._stop())})}_start(){this._active=!0;let{width:i}=this.getBoundingClientRect(),e=this.ref["line-el"];e.style.transition="transform 1s",e.style.opacity="1",e.style.transform=`translateX(${i}px)`,e.addEventListener("transitionend",this._handleTransitionEndRight,{once:!0})}_stop(){this._active=!1}};pt.template=w`<div class="uc-inner"><div class="uc-line" ref="line-el"></div></div>`;var mt={transition:"uc-transition",visible:"uc-visible",hidden:"uc-hidden"},gt=class extends y{constructor(){super(),this._visible=!1,this._visibleStyle=mt.visible,this._hiddenStyle=mt.hidden,this._externalTransitions=!1,this.defineAccessor("styles",i=>{i&&(this._externalTransitions=!0,this._visibleStyle=i.visible,this._hiddenStyle=i.hidden)}),this.defineAccessor("visible",i=>{typeof i=="boolean"&&(this._visible=i,this._handleVisible())})}_handleVisible(){this.style.visibility=this._visible?"inherit":"hidden",Pi(this,{[mt.transition]:!this._externalTransitions,[this._visibleStyle]:this._visible,[this._hiddenStyle]:!this._visible}),this.setAttribute("aria-hidden",this._visible?"false":"true")}initCallback(){super.initCallback(),this.classList.toggle("uc-initial",!0),this._externalTransitions||this.classList.add(mt.transition),this._handleVisible(),setTimeout(()=>{this.classList.toggle("uc-initial",!1)},0)}};gt.template=w`<slot></slot>`;var bt=class extends y{constructor(){super();m(this,"init$",{...this.init$,disabled:!1,min:0,max:100,onInput:null,onChange:null,defaultValue:null,"on.sliderInput":()=>{let e=parseInt(this.ref["input-el"].value,10);this._updateValue(e),this.$.onInput&&this.$.onInput(e)},"on.sliderChange":()=>{let e=parseInt(this.ref["input-el"].value,10);this.$.onChange&&this.$.onChange(e)}});this.setAttribute("with-effects","")}initCallback(){super.initCallback(),this.defineAccessor("disabled",t=>{this.$.disabled=t}),this.defineAccessor("min",t=>{this.$.min=t}),this.defineAccessor("max",t=>{this.$.max=t}),this.defineAccessor("defaultValue",t=>{this.$.defaultValue=t,this.ref["input-el"].value=t,this._updateValue(t)}),this.defineAccessor("zero",t=>{this._zero=t}),this.defineAccessor("onInput",t=>{t&&(this.$.onInput=t)}),this.defineAccessor("onChange",t=>{t&&(this.$.onChange=t)}),this._updateSteps(),this._observer=new ResizeObserver(()=>{this._updateSteps();let t=parseInt(this.ref["input-el"].value,10);this._updateValue(t)}),this._observer.observe(this),this._thumbSize=parseInt(window.getComputedStyle(this).getPropertyValue("--l-thumb-size"),10),setTimeout(()=>{let t=parseInt(this.ref["input-el"].value,10);this._updateValue(t)},0),this.sub("disabled",t=>{let s=this.ref["input-el"];t?s.setAttribute("disabled","disabled"):s.removeAttribute("disabled")});let e=this.ref["input-el"];e.addEventListener("focus",()=>{this.style.setProperty("--color-effect","var(--hover-color-rgb)")}),e.addEventListener("blur",()=>{this.style.setProperty("--color-effect","var(--idle-color-rgb)")})}_updateValue(e){this._updateZeroDot(e);let{width:t}=this.getBoundingClientRect(),l=100/(this.$.max-this.$.min)*(e-this.$.min)*(t-this._thumbSize)/100;window.requestAnimationFrame(()=>{this.ref["thumb-el"].style.transform=`translateX(${l}px)`})}_updateZeroDot(e){if(!this._zeroDotEl)return;e===this._zero?this._zeroDotEl.style.opacity="0":this._zeroDotEl.style.opacity="0.2";let{width:t}=this.getBoundingClientRect(),l=100/(this.$.max-this.$.min)*(this._zero-this.$.min)*(t-this._thumbSize)/100;window.requestAnimationFrame(()=>{this._zeroDotEl.style.transform=`translateX(${l}px)`})}_updateSteps(){let t=this.ref["steps-el"],{width:s}=t.getBoundingClientRect(),o=Math.ceil(s/2),l=Math.ceil(o/15)-2;if(this._stepsCount===l)return;let n=document.createDocumentFragment(),a=document.createElement("div"),c=document.createElement("div");a.className="uc-minor-step",c.className="uc-border-step",n.appendChild(c);for(let h=0;h<l;h++)n.appendChild(a.cloneNode());n.appendChild(c.cloneNode());for(let h=0;h<l;h++)n.appendChild(a.cloneNode());n.appendChild(c.cloneNode());let u=document.createElement("div");u.className="uc-zero-dot",n.appendChild(u),this._zeroDotEl=u,t.innerHTML="",t.appendChild(n),this._stepsCount=l}destroyCallback(){var e;(e=this._observer)==null||e.disconnect()}};bt.template=w`<div class="uc-steps" ref="steps-el"></div><div ref="thumb-el" class="uc-thumb"></div><input class="uc-input" type="range" ref="input-el" bind="oninput: on.sliderInput; onchange: on.sliderChange; @min: min; @max: max; @value: defaultValue;" />`;var je=class je extends le{initCallback(){var i;super.initCallback(),(i=this.a11y)==null||i.registerBlock(this)}};m(je,"styleAttrs",[...Kt(je,je,"styleAttrs"),"uc-wgt-common"]);var Ji=je;var Ke=class extends y{constructor(){super(),this.init$={...this.init$,name:"",href:""}}initCallback(){super.initCallback(),this.sub("name",i=>{if(!i)return;let e=`#uc-icon-${i}`;this.subConfigValue("iconHrefResolver",t=>{if(t){let s=t(i);e=s!=null?s:e}this.$.href=e})})}};Ke.template=w`<svg ref="svg" xmlns="http://www.w3.org/2000/svg"><use bind="@href: href;"></use></svg>`;Ke.bindAttributes({name:"name"});var Qr=["Symbiote","BaseComponent","UploaderBlock","ActivityBlock","Block","SolutionBlock"];function Jr(r){for(let i in r){if(Qr.includes(i))continue;let e=[...i].reduce((t,s)=>(s.toUpperCase()===s&&(s="-"+s.toLowerCase()),t+=s),"");e.startsWith("-")&&(e=e.replace("-","")),e.startsWith("uc-")||(e="uc-"+e),r[i].reg&&r[i].reg(e)}}var _t=r=>{var i;return(i=r.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))==null?void 0:i.map(e=>e.toLowerCase()).join("-")};var $=r=>String(r),B=r=>{let i=Number(r);if(Number.isNaN(i))throw new Error(`Invalid number: "${r}"`);return i},O=r=>{if(typeof r=="undefined"||r===null)return!1;if(typeof r=="boolean")return r;if(r==="true"||r==="")return!0;if(r==="false")return!1;throw new Error(`Invalid boolean: "${r}"`)},es=r=>r==="auto"?r:O(r),ts=r=>{let i=$(r);if(i!=="user"&&i!=="environment"&&i!=="")throw new Error(`Invalid "cameraCapture" value: "${i}"`);return i},is=r=>{if(typeof r=="object"&&!Array.isArray(r)||typeof r=="function")return r;throw new Error("Invalid metadata value. Must be an object or function.")},rs=r=>{if(typeof r=="object")return r;throw new Error("Invalid value. Must be an object.")},Bt=r=>{if(typeof r=="function")return r;throw new Error("Invalid value. Must be a function.")},er=r=>{if(Array.isArray(r))return r;throw new Error("Must be an array.")},ss={pubkey:$,multiple:O,multipleMin:B,multipleMax:B,confirmUpload:O,imgOnly:O,accept:$,externalSourcesPreferredTypes:$,store:es,cameraMirror:O,cameraCapture:ts,sourceList:$,maxLocalFileSizeBytes:B,thumbSize:B,showEmptyList:O,useLocalImageEditor:O,useCloudImageEditor:O,cloudImageEditorTabs:$,removeCopyright:O,cropPreset:$,imageShrink:$,modalScrollLock:O,modalBackdropStrokes:O,sourceListWrap:O,remoteTabSessionKey:$,cdnCname:$,baseUrl:$,socialBaseUrl:$,secureSignature:$,secureExpire:$,secureDeliveryProxy:$,retryThrottledRequestMaxTimes:B,multipartMinFileSize:B,multipartChunkSize:B,maxConcurrentRequests:B,multipartMaxConcurrentRequests:B,multipartMaxAttempts:B,checkForUrlDuplicates:O,saveUrlForRecurrentUploads:O,groupOutput:O,userAgentIntegration:$,debug:O,localeName:$,metadata:is,secureUploadsExpireThreshold:B,localeDefinitionOverride:rs,secureUploadsSignatureResolver:Bt,secureDeliveryProxyUrlResolver:Bt,iconHrefResolver:Bt,fileValidators:er,collectionValidators:er},tr=(r,i)=>{if(!(typeof i=="undefined"||i===null))try{return ss[r](i)}catch(e){return console.error(`Invalid value for config key "${r}".`,e),F[r]}};var Vt=[...new Set(["debug",...Object.keys(F)])],os=["metadata","localeDefinitionOverride","secureUploadsSignatureResolver","secureDeliveryProxyUrlResolver","iconHrefResolver","fileValidators","collectionValidators"],ls=r=>os.includes(r),Se=Vt.filter(r=>!ls(r)),ns={...Object.fromEntries(Se.map(r=>[_t(r),r])),...Object.fromEntries(Se.map(r=>[r.toLowerCase(),r]))},as={...Object.fromEntries(Se.map(r=>[_t(r),P(r)])),...Object.fromEntries(Se.map(r=>[r.toLowerCase(),P(r)]))},ir=r=>"__"+r,Ge=class extends y{constructor(){super();m(this,"requireCtxName",!0);this.init$={...this.init$,...Object.fromEntries(Object.entries(F).map(([e,t])=>[P(e),t]))}}_flushValueToAttribute(e,t){if(Se.includes(e)){let s=[...new Set([_t(e),e.toLowerCase()])];for(let o of s)typeof t=="undefined"||t===null?this.removeAttribute(o):this.getAttribute(o)!==t.toString()&&this.setAttribute(o,t.toString())}}_flushValueToState(e,t){this.$[P(e)]!==t&&(typeof t=="undefined"||t===null?this.$[P(e)]=F[e]:this.$[P(e)]=t)}_setValue(e,t){let s=this,o=tr(e,t),l=ir(e);s[l]!==o&&(this._assertSameValueDifferentReference(e,s[l],o),s[l]=o,this._flushValueToAttribute(e,o),this._flushValueToState(e,o),this.debugPrint(`[uc-config] "${e}"`,o))}_getValue(e){let t=this,s=ir(e);return t[s]}_assertSameValueDifferentReference(e,t,s){this.cfg.debug&&s!==t&&typeof s=="object"&&typeof t=="object"&&JSON.stringify(s)===JSON.stringify(t)&&(console.warn(`[uc-config] Option "${e}" value is the same as the previous one but the reference is different`),console.warn("[uc-config] You should avoid changing the reference of the object to prevent unnecessary calculations"),console.warn(`[uc-config] "${e}" previous value:`,t),console.warn(`[uc-config] "${e}" new value:`,s))}initCallback(){var t;super.initCallback();let e=this;for(let s of Se)this.sub(P(s),o=>{this._setValue(s,o)},!1);for(let s of Vt){let o=(t=e[s])!=null?t:this.$[P(s)];o!==F[s]&&this._setValue(s,o),Object.defineProperty(this,s,{set:l=>{this._setValue(s,l)},get:()=>this._getValue(s)})}}attributeChangedCallback(e,t,s){if(t===s)return;let o=this,l=ns[e];o[l]=s}};Ge.bindAttributes(as);for(let r of Vt)Ge.prototype[r]=void 0;var cs=Ge;export{He as BtnUi,Ji as CloudImageEditor,le as CloudImageEditorBlock,cs as Config,ct as CropFrame,ze as EditorCropButtonControl,Ce as EditorFilterControl,ut as EditorImageCropper,Ft as EditorImageFader,Xe as EditorOperationControl,dt as EditorScroller,ht as EditorSlider,ft as EditorToolbar,Ke as Icon,pt as LineLoaderUi,gt as PresenceToggle,bt as SliderUi,Jr as defineComponents};
|
|
26
|
+
var sr=Object.defineProperty;var or=Object.getPrototypeOf;var nr=Reflect.get;var lr=(r,i,e)=>i in r?sr(r,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[i]=e;var m=(r,i,e)=>(lr(r,typeof i!="symbol"?i+"":i,e),e),wt=(r,i,e)=>{if(!i.has(r))throw TypeError("Cannot "+e)};var p=(r,i,e)=>(wt(r,i,"read from private field"),e?e.call(r):i.get(r)),v=(r,i,e)=>{if(i.has(r))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(r):i.set(r,e)},C=(r,i,e,t)=>(wt(r,i,"write to private field"),t?t.call(r,e):i.set(r,e),e);var x=(r,i,e)=>(wt(r,i,"access private method"),e),Gt=(r,i,e)=>nr(or(r),e,i);var d=Object.freeze({BIND_ATTR:"bind",ATTR_BIND_PX:"@",SHARED_CTX_PX:"*",PARENT_CTX_PX:"^",NAMED_CTX_SPLTR:"/",COMPUTED_PX:"+",CSS_DATA_PX:"--",CTX_NAME_ATTR:"ctx",CTX_OWNER_ATTR:"ctx-owner",CSS_CTX_PROP:"--ctx",EL_REF_ATTR:"ref",AUTO_TAG_PX:"sym",LIST_ATTR:"itemize",LIST_ITEM_TAG_ATTR:"item-tag",SET_LATER_KEY:"__toSetLater__",USE_TPL_ATTR:"use-template",DEFAULT_SLOT_KEY:"__default__",TEXT_NODE_SKIP_ATTR:"skip-text-nodes",TEXT_NODE_OPEN_TOKEN:"{{",TEXT_NODE_CLOSE_TOKEN:"}}"});function ar(r){let i=e=>{var t;for(let s in e)((t=e[s])==null?void 0:t.constructor)===Object&&(e[s]=i(e[s]));return{...e}};return i(r)}var ge,be,ee,te,_e,We,Wt,k=class k{constructor(i){v(this,ge,void 0);v(this,be,void 0);v(this,ee,void 0);i.constructor===Object?this.store=ar(i):(C(this,ee,!0),this.store=i),this.callbackMap=Object.create(null)}read(i){var e,t;if(!p(this,ee)&&!this.store.hasOwnProperty(i))return x(e=k,te,_e).call(e,"read",i),null;if(typeof i=="string"&&i.startsWith(d.COMPUTED_PX)){let s=this.store[i];if((s==null?void 0:s.constructor)!==Function){x(t=k,te,_e).call(t,"compute",i);return}this.__computedMap||(this.__computedMap={});let o=s();return Object.keys(this.__computedMap).includes(i)||(this.__computedMap[i]=o,this.notify(i)),o}else return this.store[i]}has(i){return p(this,ee)?this.store[i]!==void 0:this.store.hasOwnProperty(i)}add(i,e,t=!1){!t&&Object.keys(this.store).includes(i)||(this.store[i]=e,this.notify(i))}pub(i,e){var t,s;if(!p(this,ee)&&!this.store.hasOwnProperty(i)){x(t=k,te,_e).call(t,"publish",i);return}if(i!=null&&i.startsWith(d.COMPUTED_PX)&&e.constructor!==Function){x(s=k,te,_e).call(s,"publish computed",i);return}!(this.store[i]===null||e===null)&&typeof this.store[i]!=typeof e&&console.warn(`Symbiote PubSub: type warning for "${i}" [${typeof this.store[i]} -> ${typeof e}]`),this.store[i]=e,this.notify(i)}get proxy(){if(!p(this,be)){let i=Object.create(null);C(this,be,new Proxy(i,{set:(e,t,s)=>(this.pub(t,s),!0),get:(e,t)=>{this.read(t)}}))}return p(this,be)}multiPub(i){for(let e in i)this.pub(e,i[e])}notify(i){var t;let e=i==null?void 0:i.startsWith(d.COMPUTED_PX);if(this.callbackMap[i]){let s=this.read(i);this.callbackMap[i].forEach(o=>{o(s)}),e&&(this.__computedMap[i]=s)}!e&&x(t=k,We,Wt).call(t,this,i)}sub(i,e,t=!0){var s;return!p(this,ee)&&!this.store.hasOwnProperty(i)?(x(s=k,te,_e).call(s,"subscribe",i),null):(this.callbackMap[i]||(this.callbackMap[i]=new Set),this.callbackMap[i].add(e),t&&e(this.read(i)),{remove:()=>{this.callbackMap[i].delete(e),this.callbackMap[i].size||delete this.callbackMap[i]},callback:e})}set uid(i){!p(this,ge)&&C(this,ge,i)}get uid(){return p(this,ge)}static registerCtx(i,e=Symbol()){let t=k.globalStore.get(e);return t?console.warn('PubSub: context UID "'+e+'" is already in use'):(t=new k(i),t.uid=e,k.globalStore.set(e,t)),t}static deleteCtx(i){k.globalStore.delete(i)}static getCtx(i,e=!0){return k.globalStore.get(i)||(e&&console.warn('PubSub: wrong context UID - "'+i+'"'),null)}};ge=new WeakMap,be=new WeakMap,ee=new WeakMap,te=new WeakSet,_e=function(i,e){console.warn(`Symbiote PubSub: cannot ${i}. Prop name: `+e)},We=new WeakSet,Wt=function(i,e){this.globalStore.forEach(t=>{t.__computedMap&&Object.keys(t.__computedMap).forEach(s=>{if(t===i&&e===s)return;let o=`__${s}_timeout`;t[o]&&window.clearTimeout(t[o]),t[o]=window.setTimeout(()=>{let n=t.read(s);n!==t.__computedMap[s]&&(t.__computedMap[s]=n,t.notify(s))})})})},v(k,te),v(k,We);var ie=k;ie.globalStore=new Map;var G=ie;var qt="1234567890QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm",cr=qt.length-1,$e=class{static generate(i="XXXXXXXXX-XXX"){let e="";for(let t=0;t<i.length;t++)e+=i[t]==="-"?i[t]:qt.charAt(Math.random()*cr);return e}};function Oe(r,i,e){let t=!0,s,o=i.split(".");return o.forEach((n,l)=>{l<o.length-1?r=r[n]:s=n}),r?r[s]=e:t=!1,t}function vt(r){let i;return r.constructor===CSSStyleSheet?i=r:r.constructor===String&&(i=new CSSStyleSheet,i.replaceSync(r)),i}function Yt(r,i){[...r.querySelectorAll(`[${d.LIST_ATTR}]`)].filter(e=>!e.matches(`[${d.LIST_ATTR}] [${d.LIST_ATTR}]`)).forEach(e=>{var n;let t=e.getAttribute(d.LIST_ITEM_TAG_ATTR),s;for(t&&(s=window.customElements.get(t)),s||(s=class extends i.Symbiote{constructor(){super(),t||(this.style.display="contents")}},s.template=((n=e.querySelector("template"))==null?void 0:n.innerHTML)||e.innerHTML,s.reg(t));e.firstChild;)e.firstChild.remove();let o=e.getAttribute(d.LIST_ATTR);i.sub(o,l=>{if(!l){for(;e.firstChild;)e.firstChild.remove();return}let a=[...e.children],c,u=h=>{h.forEach((_,b)=>{if(a[b])if(a[b].set$)a[b].set$(_);else for(let E in _)a[b][E]=_[E];else{c||(c=new DocumentFragment);let E=new s;Object.assign((E==null?void 0:E.init$)||E,_),c.appendChild(E)}}),c&&e.appendChild(c);let f=a.slice(h.length,a.length);for(let _ of f)_.remove()};if(l.constructor===Array)u(l);else if(l.constructor===Object){let h=[];for(let f in l){let _=l[f];Object.defineProperty(_,"_KEY_",{value:f,enumerable:!0}),h.push(_)}u(h)}else console.warn("Symbiote list data type error:"),console.log(l)}),e.removeAttribute(d.LIST_ATTR),e.removeAttribute(d.LIST_ITEM_TAG_ATTR)})}function hr(r,i){[...r.querySelectorAll(`[${d.EL_REF_ATTR}]`)].forEach(e=>{let t=e.getAttribute(d.EL_REF_ATTR);i.ref[t]=e,e.removeAttribute(d.EL_REF_ATTR)})}function ur(r,i){[...r.querySelectorAll(`[${d.BIND_ATTR}]`)].forEach(e=>{e.getAttribute(d.BIND_ATTR).split(";").forEach(o=>{if(!o)return;let n=o.split(":").map(u=>u.trim()),l=n[0],a;l.indexOf(d.ATTR_BIND_PX)===0&&(a=!0,l=l.replace(d.ATTR_BIND_PX,""));let c=n[1].split(",").map(u=>u.trim());for(let u of c){let h;u.startsWith("!!")?(h="double",u=u.replace("!!","")):u.startsWith("!")&&(h="single",u=u.replace("!","")),!i.has(u)&&i.allowTemplateInits&&(u.startsWith(d.ATTR_BIND_PX)?i.add(u,i.getAttribute(u.replace(d.ATTR_BIND_PX,""))):i.add(u,null)),i.sub(u,f=>{h==="double"?f=!!f:h==="single"&&(f=!f),a?(f==null?void 0:f.constructor)===Boolean?f?e.setAttribute(l,""):e.removeAttribute(l):e.setAttribute(l,f):Oe(e,l,f)||(e[d.SET_LATER_KEY]||(e[d.SET_LATER_KEY]=Object.create(null)),e[d.SET_LATER_KEY][l]=f)},!(i.ssrMode&&(l==="textContent"||a)))}}),e.removeAttribute(d.BIND_ATTR)})}function dr(r){let i,e=[],t=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,{acceptNode:s=>{var o;return!((o=s.parentElement)!=null&&o.hasAttribute(d.TEXT_NODE_SKIP_ATTR))&&s.textContent.includes(d.TEXT_NODE_OPEN_TOKEN)&&s.textContent.includes(d.TEXT_NODE_CLOSE_TOKEN)&&1}});for(;i=t.nextNode();)e.push(i);return e}var fr=function(r,i){dr(r).forEach(t=>{let s=[],o;for(;t.textContent.includes(d.TEXT_NODE_CLOSE_TOKEN);)t.textContent.startsWith(d.TEXT_NODE_OPEN_TOKEN)?(o=t.textContent.indexOf(d.TEXT_NODE_CLOSE_TOKEN)+d.TEXT_NODE_CLOSE_TOKEN.length,t.splitText(o),s.push(t)):(o=t.textContent.indexOf(d.TEXT_NODE_OPEN_TOKEN),t.splitText(o)),t=t.nextSibling;s.forEach(n=>{let l=n.textContent.replace(d.TEXT_NODE_OPEN_TOKEN,"").replace(d.TEXT_NODE_CLOSE_TOKEN,"");n.textContent="",!i.has(l)&&i.allowTemplateInits&&(l.startsWith(d.ATTR_BIND_PX)?(i.add(l,i.getAttribute(l.replace(d.ATTR_BIND_PX,""))),i.initAttributeObserver()):i.add(l,null)),i.sub(l,a=>{n.textContent=a})})})},Zt=[Yt,hr,ur,fr];var qe="'",ye='"',pr=/\\([0-9a-fA-F]{1,6} ?)/g;function mr(r){return(r[0]===ye||r[0]===qe)&&(r[r.length-1]===ye||r[r.length-1]===qe)}function _r(r){return(r[0]===ye||r[0]===qe)&&(r=r.slice(1)),(r[r.length-1]===ye||r[r.length-1]===qe)&&(r=r.slice(0,-1)),r}function gr(r){let i="",e="";for(var t=0;t<r.length;t++){let s=r[t+1];r[t]==="\\"&&s==='"'?(i+='\\"',t++):r[t]==='"'&&e!=="\\"?i+='\\"':i+=r[t],e=r[t]}return i}function Qt(r){let i=r;mr(r)&&(i=_r(i),i=i.replace(pr,(e,t)=>String.fromCodePoint(parseInt(t.trim(),16))),i=i.replaceAll(`\\
|
|
27
|
+
`,"\\n"),i=gr(i),i=ye+i+ye);try{return JSON.parse(i)}catch{throw new Error(`Failed to parse CSS property value: ${i}. Original input: ${r}`)}}var br=[d.LIST_ATTR,d.LIST_ITEM_TAG_ATTR,d.EL_REF_ATTR,d.USE_TPL_ATTR,d.CTX_NAME_ATTR,d.CTX_OWNER_ATTR];function w(r,...i){let e="";return r.forEach((t,s)=>{var o;if(e+=t,((o=i[s])==null?void 0:o.constructor)===Object){let n="";for(let l in i[s])br.includes(l)?e+=` ${l}="${i[s][l]}"`:n+=`${l}:${i[s][l]};`;n&&(e+=` ${d.BIND_ATTR}="${n}"`)}else i[s]&&(e+=i[s])}),e}function F(r,...i){let e="",t=new CSSStyleSheet;return r.forEach((s,o)=>{e+=s+i[o]}),F.processors.forEach(s=>{e=s(e)}),F.clearProcessors(),t.replaceSync(e),t}F.processors=[];F.clearProcessors=function(){F.processors=[]};F.useProcessor=function(...r){return F.processors=[...F.processors,...r],F};var Jt=0,ke,he,Ie,re,we,Le,se,j,ue,de,S,Pe,Et,W,ce,Ye,ei,Ze,ti,Ne,xt,Qe,ii,Me,Ct,D=class D extends HTMLElement{constructor(){super();v(this,Pe);v(this,Ye);v(this,Ze);v(this,Ne);v(this,Qe);v(this,Me);v(this,ke,void 0);v(this,he,void 0);v(this,Ie,void 0);v(this,re,void 0);v(this,we,void 0);v(this,Le,void 0);v(this,se,void 0);v(this,j,void 0);v(this,ue,void 0);v(this,de,void 0);v(this,S,this.constructor);m(this,"updateCssData",()=>{var e;this.dropCssDataCache(),(e=p(this,de))==null||e.forEach(t=>{let s=this.getCssData(x(this,Me,Ct).call(this,t),!0);s!==null&&this.$[t]!==s&&(this.$[t]=s)})});this.init$=Object.create(null),this.cssInit$=Object.create(null),this.tplProcessors=new Set,this.ref=Object.create(null),this.allSubs=new Set,this.pauseRender=!1,this.renderShadow=!1,this.readyToDestroy=!0,this.processInnerHtml=!1,this.ssrMode=!1,this.allowCustomTemplate=!1,this.ctxOwner=!1,this.isVirtual=!1,this.allowTemplateInits=!0}get Symbiote(){return D}initCallback(){}renderCallback(){}render(e,t=this.renderShadow){let s;if((t||p(this,S).shadowStyleSheets)&&!this.shadowRoot&&this.attachShadow({mode:"open"}),this.allowCustomTemplate){let n=this.getAttribute(d.USE_TPL_ATTR);if(n){let l=this.getRootNode(),a=(l==null?void 0:l.querySelector(n))||document.querySelector(n);a?e=a.content.cloneNode(!0):console.warn(`Symbiote template "${n}" is not found...`)}}if(this.processInnerHtml||this.ssrMode)for(let n of this.tplProcessors)n(this,this);if(e||p(this,S).template){if(p(this,S).template&&!p(this,S).__tpl&&(p(this,S).__tpl=document.createElement("template"),p(this,S).__tpl.innerHTML=p(this,S).template),(e==null?void 0:e.constructor)===DocumentFragment)s=e;else if((e==null?void 0:e.constructor)===String){let n=document.createElement("template");n.innerHTML=e,s=n.content.cloneNode(!0)}else p(this,S).__tpl&&(s=p(this,S).__tpl.content.cloneNode(!0));for(let n of this.tplProcessors)n(s,this)}let o=()=>{var n;s&&this.isVirtual?this.replaceWith(s):s&&(t&&this.shadowRoot.appendChild(s)||this.appendChild(s)),x(this,Pe,Et).call(this),(n=this.renderCallback)==null||n.call(this)};p(this,S).shadowStyleSheets&&(t=!0,this.shadowRoot.adoptedStyleSheets=[...p(this,S).shadowStyleSheets]),o()}addTemplateProcessor(e){this.tplProcessors.add(e)}get autoCtxName(){return p(this,he)||(C(this,he,$e.generate()),this.style.setProperty(d.CSS_CTX_PROP,`'${p(this,he)}'`)),p(this,he)}get cssCtxName(){return this.getCssData(d.CSS_CTX_PROP,!0)}get ctxName(){var t;let e=((t=this.getAttribute(d.CTX_NAME_ATTR))==null?void 0:t.trim())||this.cssCtxName||p(this,Ie)||this.autoCtxName;return C(this,Ie,e),e}get localCtx(){return p(this,re)||C(this,re,G.registerCtx({})),p(this,re)}get sharedCtx(){return G.getCtx(this.ctxName,!1)||G.registerCtx({},this.ctxName)}sub(e,t,s=!0){var l;let o=a=>{p(this,Ne,xt)||t(a)},n=x(l=D,W,ce).call(l,e,this);n.ctx.has(n.name)?this.allSubs.add(n.ctx.sub(n.name,o,s)):window.setTimeout(()=>{this.allSubs.add(n.ctx.sub(n.name,o,s))})}notify(e){var s;let t=x(s=D,W,ce).call(s,e,this);t.ctx.notify(t.name)}has(e){var s;let t=x(s=D,W,ce).call(s,e,this);return t.ctx.has(t.name)}add(e,t,s=!1){var n;let o=x(n=D,W,ce).call(n,e,this);o.ctx.add(o.name,t,s)}add$(e,t=!1){for(let s in e)this.add(s,e[s],t)}get $(){if(!p(this,we)){let e=Object.create(null);C(this,we,new Proxy(e,{set:(t,s,o)=>{var l;let n=x(l=D,W,ce).call(l,s,this);return n.ctx.pub(n.name,o),!0},get:(t,s)=>{var n;let o=x(n=D,W,ce).call(n,s,this);return o.ctx.read(o.name)}}))}return p(this,we)}set$(e,t=!1){for(let s in e){let o=e[s];t||![String,Number,Boolean].includes(o==null?void 0:o.constructor)?this.$[s]=o:this.$[s]!==o&&(this.$[s]=o)}}initAttributeObserver(){this.attributeMutationObserver||(this.attributeMutationObserver=new MutationObserver(e=>{for(let t of e)if(t.type==="attributes"){let s=d.ATTR_BIND_PX+t.attributeName;this.has(s)&&(this.$[s]=this.getAttribute(t.attributeName))}}),this.attributeMutationObserver.observe(this,{attributes:!0}))}connectedCallback(){x(this,Qe,ii).call(this)}destroyCallback(){}disconnectedCallback(){this.connectedOnce&&(this.dropCssDataCache(),this.readyToDestroy&&(p(this,se)&&window.clearTimeout(p(this,se)),C(this,se,window.setTimeout(()=>{this.destroyCallback(),this.attributeMutationObserver&&this.attributeMutationObserver.disconnect();for(let e of this.allSubs)e.remove(),this.allSubs.delete(e);p(this,re)&&G.deleteCtx(p(this,re).uid);for(let e of this.tplProcessors)this.tplProcessors.delete(e)},100))))}static reg(e,t=!1){e||(Jt++,e=`${d.AUTO_TAG_PX}-${Jt}`),this.__tag=e;let s=window.customElements.get(e);if(s){!t&&s!==this&&console.warn([`Element with tag name "${e}" already registered.`,`You're trying to override it with another class "${this.name}".`,"This is most likely a mistake.","New element will not be registered."].join(`
|
|
28
|
+
`));return}window.customElements.define(e,t?class extends this{}:this)}static get is(){return this.__tag||this.reg(),this.__tag}static bindAttributes(e){this.observedAttributes=[...new Set((this.observedAttributes||[]).concat(Object.keys(e)))],this.__attrDesc=e}attributeChangedCallback(e,t,s){var n;if(t===s)return;let o=(n=p(this,S).__attrDesc)==null?void 0:n[e];o?p(this,Le)?this.$[o]=s:this.init$[o]=s:this[e]=s}getCssData(e,t=!1){if(p(this,j)||C(this,j,Object.create(null)),!Object.keys(p(this,j)).includes(e)){p(this,ue)||C(this,ue,window.getComputedStyle(this));let s=p(this,ue).getPropertyValue(e).trim();try{p(this,j)[e]=Qt(s)}catch{!t&&console.warn(`CSS Data error: ${e}`),p(this,j)[e]=null}}return p(this,j)[e]}bindCssData(e,t=""){p(this,de)||C(this,de,new Set),p(this,de).add(e);let s=this.getCssData(x(this,Me,Ct).call(this,e),!0);s===null&&(s=t),e.startsWith(d.CSS_DATA_PX)?this.localCtx.add(e,s):this.add(e,s)}dropCssDataCache(){C(this,j,null),C(this,ue,null)}defineAccessor(e,t,s){let o="#"+e;this[o]=this[e],Object.defineProperty(this,e,{set:n=>{this[o]=n,s?window.setTimeout(()=>{t==null||t(n)}):t==null||t(n)},get:()=>this[o]}),this[e]=this[o]}static addRootStyles(e){this.rootStyleSheets||(this.rootStyleSheets=[]),this.rootStyleSheets.push(vt(e))}static addShadowStyles(e){this.shadowStyleSheets||(this.shadowStyleSheets=[]),this.shadowStyleSheets.push(vt(e))}static set rootStyles(e){this.rootStyleSheets=[],this.addRootStyles(e)}static set shadowStyles(e){this.shadowStyleSheets=[],this.addShadowStyles(e)}};ke=new WeakMap,he=new WeakMap,Ie=new WeakMap,re=new WeakMap,we=new WeakMap,Le=new WeakMap,se=new WeakMap,j=new WeakMap,ue=new WeakMap,de=new WeakMap,S=new WeakMap,Pe=new WeakSet,Et=function(){var e;p(this,ke)||(C(this,ke,!0),(e=this.initCallback)==null||e.call(this))},W=new WeakSet,ce=function(e,t){var n;let s,o;if(e.startsWith(d.SHARED_CTX_PX))s=t.sharedCtx,o=e.replace(d.SHARED_CTX_PX,"");else if(e.startsWith(d.PARENT_CTX_PX)){o=e.replace(d.PARENT_CTX_PX,"");let l=t;for(;l&&!((n=l==null?void 0:l.has)!=null&&n.call(l,o));)l=l.parentElement||l.parentNode||l.host;s=(l==null?void 0:l.localCtx)||t.localCtx}else if(e.includes(d.NAMED_CTX_SPLTR)){let l=e.split(d.NAMED_CTX_SPLTR);s=G.getCtx(l[0]),o=l[1]}else e.startsWith(d.CSS_DATA_PX)?(s=t.localCtx,o=e,s.has(o)||t.bindCssData(o)):(s=t.localCtx,o=e);return{ctx:s,name:o}},Ye=new WeakSet,ei=function(){return this.ctxOwner||this.hasAttribute(d.CTX_OWNER_ATTR)&&this.getAttribute(d.CTX_OWNER_ATTR)!=="false"},Ze=new WeakSet,ti=function(){let e=p(this,S).__attrDesc;if(e)for(let t of Object.values(e))Object.keys(this.init$).includes(t)||(this.init$[t]="");for(let t in this.init$)if(t.startsWith(d.SHARED_CTX_PX))this.sharedCtx.add(t.replace(d.SHARED_CTX_PX,""),this.init$[t],p(this,Ye,ei));else if(t.startsWith(d.ATTR_BIND_PX))this.localCtx.add(t,this.getAttribute(t.replace(d.ATTR_BIND_PX,""))||this.init$[t]),this.initAttributeObserver();else if(t.includes(d.NAMED_CTX_SPLTR)){let s=t.split(d.NAMED_CTX_SPLTR),o=s[0].trim(),n=s[1].trim();if(o&&n){let l=G.getCtx(o,!1);l||(l=G.registerCtx({},o)),l.add(n,this.init$[t])}}else this.localCtx.add(t,this.init$[t]);for(let t in this.cssInit$)this.bindCssData(t,this.cssInit$[t]);C(this,Le,!0)},Ne=new WeakSet,xt=function(){return!this.isVirtual&&!this.isConnected},Qe=new WeakSet,ii=function(){var e;if(!p(this,Ne,xt)){if(p(this,se)&&window.clearTimeout(p(this,se)),!this.connectedOnce){let t=(e=this.getAttribute(d.CTX_NAME_ATTR))==null?void 0:e.trim();if(t&&this.style.setProperty(d.CSS_CTX_PROP,`'${t}'`),x(this,Ze,ti).call(this),this[d.SET_LATER_KEY]){for(let s in this[d.SET_LATER_KEY])Oe(this,s,this[d.SET_LATER_KEY][s]);delete this[d.SET_LATER_KEY]}this.initChildren=[...this.childNodes];for(let s of Zt)this.addTemplateProcessor(s);if(this.pauseRender)x(this,Pe,Et).call(this);else{if(p(this,S).rootStyleSheets){let s=this.getRootNode();if(!s)return;let o=new Set([...s.adoptedStyleSheets,...p(this,S).rootStyleSheets]);s.adoptedStyleSheets=[...o]}this.render()}}this.connectedOnce=!0}},Me=new WeakSet,Ct=function(e){return e.split("--").map((t,s)=>s===0?"":t).join("--")},v(D,W),m(D,"__tpl"),m(D,"template");var Tt=D,St=Tt;function ri(r,i){if(i.shadowRoot)return;let e=[...r.querySelectorAll("slot")];if(!e.length)return;let t={};e.forEach(s=>{let o=s.getAttribute("name")||d.DEFAULT_SLOT_KEY;t[o]={slot:s,fr:document.createDocumentFragment()}}),i.initChildren.forEach(s=>{var n;let o=d.DEFAULT_SLOT_KEY;s instanceof Element&&s.hasAttribute("slot")&&(o=s.getAttribute("slot"),s.removeAttribute("slot")),(n=t[o])==null||n.fr.appendChild(s)}),Object.values(t).forEach(s=>{if(s.fr.childNodes.length)s.slot.parentNode.replaceChild(s.fr,s.slot);else if(s.slot.childNodes.length){let o=document.createDocumentFragment();o.append(...s.slot.childNodes),s.slot.parentNode.replaceChild(o,s.slot)}else s.slot.remove()})}var si=r=>{if(typeof r!="string"||!r)return"";let i=r.trim();return i.startsWith("-/")?i=i.slice(2):i.startsWith("/")&&(i=i.slice(1)),i.endsWith("/")&&(i=i.slice(0,i.length-1)),i},Je=(...r)=>r.filter(i=>typeof i=="string"&&i).map(i=>si(i)).join("/-/"),q=(...r)=>{let i=Je(...r);return i?`-/${i}/`:""};function et(r){let i=new URL(r),e=i.pathname+i.search+i.hash,t=e.lastIndexOf("http"),s=e.lastIndexOf("/"),o="";return t>=0?o=e.slice(t):s>=0&&(o=e.slice(s+1)),o}function tt(r){let i=new URL(r),{pathname:e}=i,t=e.indexOf("/"),s=e.indexOf("/",t+1);return e.substring(t+1,s)}function At(r){let i=ni(r),e=new URL(i),t=e.pathname.indexOf("/-/");return t===-1?"":e.pathname.substring(t).slice(1)}function oi(r){return At(r).split("/-/").filter(Boolean).map(e=>si(e))}function ni(r){let i=new URL(r),e=et(r),t=li(e)?ai(e).pathname:e;return i.pathname=i.pathname.replace(t,""),i.search="",i.hash="",i.toString()}function li(r){return r.startsWith("http")}function ai(r){let i=new URL(r);return{pathname:i.origin+i.pathname||"",search:i.search||"",hash:i.hash||""}}var Y=(r,i,e)=>{let t=new URL(ni(r));if(e=e||et(r),t.pathname.startsWith("//")&&(t.pathname=t.pathname.replace("//","/")),li(e)){let s=ai(e);t.pathname=t.pathname+(i||"")+(s.pathname||""),t.search=s.search,t.hash=s.hash}else t.pathname=t.pathname+(i||"")+(e||"");return t.toString()},$t=(r,i)=>{let e=new URL(r);return e.pathname=i+"/",e.toString()};var Ot=(r,i=",")=>r.trim().split(i).map(e=>e.trim()).filter(e=>e.length>0);var M=Object.freeze({brightness:0,exposure:0,gamma:100,contrast:0,saturation:0,vibrance:0,warmth:0,enhance:0,filter:0,rotate:0,mirror:!1,flip:!1,crop:void 0}),hi=["enhance","brightness","exposure","gamma","contrast","saturation","vibrance","warmth","filter","mirror","flip","rotate","crop"];function yr(r,i){if(typeof i=="number"){let e=i;return M[r]!==e?`${r}/${e}`:""}if(typeof i=="boolean"){let e=i;return M[r]!==e?`${r}`:""}if(r==="filter"&&i){let{name:e,amount:t}=i;return M.filter===t?"":`${r}/${e}/${t}`}if(r==="crop"&&i){let{dimensions:e,coords:t}=i;return`${r}/${e.join("x")}/${t.join(",")}`}return""}function oe(r){return Je(...hi.filter(i=>typeof r[i]!="undefined"&&r[i]!==null).map(i=>{let e=r[i];return yr(i,e)}).filter(i=>!!i))}var it=Je("format/auto","progressive/yes"),Z=([r])=>typeof r!="undefined"?Number(r):void 0,ci=()=>!0,wr=([r,i])=>({name:r,amount:typeof i!="undefined"?Number(i):100}),vr=([r,i])=>{if(!/\d+x\d+/.test(r)||!/\d+,\d+/.test(i))throw new Error("Crop by aspect ratio, percentage or alignment shortcuts is not supported.");return{dimensions:Ot(r,"x").map(Number),coords:Ot(i).map(Number)}},Tr=Object.freeze({enhance:Z,brightness:Z,exposure:Z,gamma:Z,contrast:Z,saturation:Z,vibrance:Z,warmth:Z,filter:wr,mirror:ci,flip:ci,rotate:Z,crop:vr});function ui(r){let i={};for(let e of r){let[t,...s]=e.split("/");if(!hi.includes(t))continue;let o=t,n=Tr[o];try{let l=n(s);i[o]=l}catch(l){console.warn([`Failed to parse URL operation "${e}". It will be ignored.`,l instanceof Error?`Error message: "${l.message}"`:l,"If you need this functionality, please feel free to open an issue at https://github.com/uploadcare/blocks/issues/new"].join(`
|
|
29
|
+
`))}}return i}var T=Object.freeze({CROP:"crop",TUNING:"tuning",FILTERS:"filters"}),L=[T.CROP,T.TUNING,T.FILTERS],di=["brightness","exposure","gamma","contrast","saturation","vibrance","warmth","enhance"],fi=["adaris","briaril","calarel","carris","cynarel","cyren","elmet","elonni","enzana","erydark","fenralan","ferand","galen","gavin","gethriel","iorill","iothari","iselva","jadis","lavra","misiara","namala","nerion","nethari","pamaya","sarnar","sedis","sewen","sorahel","sorlen","tarian","thellassan","varriel","varven","vevera","virkas","yedis","yllara","zatvel","zevcen"],pi=["rotate","mirror","flip"],B=Object.freeze({brightness:{zero:M.brightness,range:[-100,100],keypointsNumber:2},exposure:{zero:M.exposure,range:[-500,500],keypointsNumber:2},gamma:{zero:M.gamma,range:[0,1e3],keypointsNumber:2},contrast:{zero:M.contrast,range:[-100,500],keypointsNumber:2},saturation:{zero:M.saturation,range:[-100,500],keypointsNumber:1},vibrance:{zero:M.vibrance,range:[-100,500],keypointsNumber:1},warmth:{zero:M.warmth,range:[-100,100],keypointsNumber:1},enhance:{zero:M.enhance,range:[0,100],keypointsNumber:1},filter:{zero:M.filter,range:[0,100],keypointsNumber:1}});var mi=r=>r?r.split(",").map(i=>i.trim()):[],rt=r=>r?r.join(","):"";var Er="https://ucarecdn.com",xr="https://upload.uploadcare.com",Cr="https://social.uploadcare.com",z={pubkey:"",multiple:!0,multipleMin:0,multipleMax:Number.MAX_SAFE_INTEGER,confirmUpload:!1,imgOnly:!1,accept:"",externalSourcesPreferredTypes:"",store:"auto",cameraMirror:!1,cameraCapture:"",sourceList:"local, url, camera, dropbox, gdrive",cloudImageEditorTabs:rt(L),maxLocalFileSizeBytes:0,thumbSize:76,showEmptyList:!1,useLocalImageEditor:!1,useCloudImageEditor:!0,removeCopyright:!1,cropPreset:"",imageShrink:"",modalScrollLock:!0,modalBackdropStrokes:!1,sourceListWrap:!0,remoteTabSessionKey:"",cdnCname:Er,baseUrl:xr,socialBaseUrl:Cr,secureSignature:"",secureExpire:"",secureDeliveryProxy:"",retryThrottledRequestMaxTimes:1,multipartMinFileSize:26214400,multipartChunkSize:5242880,maxConcurrentRequests:10,multipartMaxConcurrentRequests:4,multipartMaxAttempts:3,checkForUrlDuplicates:!1,saveUrlForRecurrentUploads:!1,groupOutput:!1,userAgentIntegration:"",debug:!1,metadata:null,localeName:"en",localeDefinitionOverride:null,secureUploadsExpireThreshold:10*60*1e3,secureUploadsSignatureResolver:null,secureDeliveryProxyUrlResolver:null,iconHrefResolver:null,fileValidators:[],collectionValidators:[]};var xo=Object.freeze({FILE_ADDED:"file-added",FILE_REMOVED:"file-removed",FILE_UPLOAD_START:"file-upload-start",FILE_UPLOAD_PROGRESS:"file-upload-progress",FILE_UPLOAD_SUCCESS:"file-upload-success",FILE_UPLOAD_FAILED:"file-upload-failed",FILE_URL_CHANGED:"file-url-changed",MODAL_OPEN:"modal-open",MODAL_CLOSE:"modal-close",DONE_CLICK:"done-click",UPLOAD_CLICK:"upload-click",ACTIVITY_CHANGE:"activity-change",COMMON_UPLOAD_START:"common-upload-start",COMMON_UPLOAD_PROGRESS:"common-upload-progress",COMMON_UPLOAD_SUCCESS:"common-upload-success",COMMON_UPLOAD_FAILED:"common-upload-failed",CHANGE:"change",GROUP_CREATED:"group-created"}),st=class{constructor(i){m(this,"_timeoutStore",new Map);m(this,"_targets",new Set);m(this,"_debugPrint",null);this._debugPrint=i}bindTarget(i){this._targets.add(i)}unbindTarget(i){this._targets.delete(i)}_dispatch(i,e){var t;for(let s of this._targets)s.dispatchEvent(new CustomEvent(i,{detail:e}));(t=this._debugPrint)==null||t.call(this,()=>{let s=e&&typeof e=="object"?{...e}:e;return[`event "${i}"`,s]})}emit(i,e,{debounce:t}={}){if(typeof t!="number"&&!t){this._dispatch(i,typeof e=="function"?e():e);return}this._timeoutStore.has(i)&&window.clearTimeout(this._timeoutStore.get(i));let s=typeof t=="number"?t:20,o=window.setTimeout(()=>{this._dispatch(i,typeof e=="function"?e():e),this._timeoutStore.delete(i)},s);this._timeoutStore.set(i,o)}};function R(r,i){let e,t=(...s)=>{clearTimeout(e),e=setTimeout(()=>r(...s),i)};return t.cancel=()=>{clearTimeout(e)},t}var _i="--uploadcare-blocks-window-height",fe=class{static registerClient(i){this.clientsRegistry.size===0&&this.attachTracker(),this.clientsRegistry.add(i)}static unregisterClient(i){this.clientsRegistry.delete(i),this.clientsRegistry.size===0&&this.detachTracker()}static attachTracker(){window.addEventListener("resize",this.flush,{passive:!0,capture:!0}),this.flush()}static detachTracker(){window.removeEventListener("resize",this.flush,{capture:!0}),document.documentElement.style.removeProperty(_i)}};m(fe,"clientsRegistry",new Set),m(fe,"flush",R(()=>{document.documentElement.style.setProperty(_i,`${window.innerHeight}px`)},100));var gi=r=>{var t;let i=new Intl.Locale(r),e="ltr";return typeof i.getTextInfo=="function"&&i.getTextInfo().direction?e=i.getTextInfo().direction:"textInfo"in i&&((t=i.textInfo)!=null&&t.direction)&&(e=i.textInfo.direction),e};var bi=(r,i)=>new Intl.PluralRules(r).select(i);var Sr=r=>r,kt="{{",wi="}}",yi="plural:";function It(r,i,e={}){var n;let{openToken:t=kt,closeToken:s=wi,transform:o=Sr}=e;for(let l in i){let a=(n=i[l])==null?void 0:n.toString();r=r.replaceAll(t+l+s,typeof a=="string"?o(a):a)}return r}function vi(r){let i=[],e=r.indexOf(kt);for(;e!==-1;){let t=r.indexOf(wi,e),s=r.substring(e+2,t);if(s.startsWith(yi)){let o=r.substring(e+2,t).replace(yi,""),n=o.substring(0,o.indexOf("(")),l=o.substring(o.indexOf("(")+1,o.indexOf(")"));i.push({variable:s,pluralKey:n,countVariable:l})}e=r.indexOf(kt,t)}return i}function ot(){let r,i,e=new Promise((t,s)=>{r=t,i=s});return{resolve:r,reject:i,promise:e}}var Lt=async({element:r,attribute:i,timeout:e=300})=>{let{promise:t,resolve:s}=ot(),o=r.getAttribute(i);if(o!==null)return s({success:!0,value:o,attribute:i}),t;let n=new MutationObserver(c=>{let u=c[c.length-1];a(u)});n.observe(r,{attributes:!0,attributeFilter:[i]});let l=setTimeout(()=>{n.disconnect(),s({success:!1,attribute:i})},e),a=c=>{let u=r.getAttribute(i);c.type==="attributes"&&c.attributeName===i&&u!==null&&(clearTimeout(l),n.disconnect(),s({success:!0,value:u,attribute:i}))};return t};var Ti=()=>({});var Re={"locale-id":"en","social-source-lang":"en","upload-file":"Upload file","upload-files":"Upload files","choose-file":"Choose file","choose-files":"Choose files","drop-files-here":"Drop files here","select-file-source":"Select file source",selected:"Selected",upload:"Upload","add-more":"Add more",cancel:"Cancel","start-from-cancel":"Cancel",clear:"Clear","camera-shot":"Shot","upload-url":"Import","upload-url-placeholder":"Paste link here","edit-image":"Edit image","edit-detail":"Details",back:"Back",done:"Done",ok:"Ok","remove-from-list":"Remove",no:"No",yes:"Yes","confirm-your-action":"Confirm your action","are-you-sure":"Are you sure?","selected-count":"Selected:","upload-error":"Upload error","validation-error":"Validation error","no-files":"No files selected",browse:"Browse","not-uploaded-yet":"Not uploaded yet...",file__one:"file",file__other:"files",error__one:"error",error__other:"errors","header-uploading":"Uploading {{count}} {{plural:file(count)}}","header-failed":"{{count}} {{plural:error(count)}}","header-succeed":"{{count}} {{plural:file(count)}} uploaded","header-total":"{{count}} {{plural:file(count)}} selected","src-type-local":"From device","src-type-from-url":"From link","src-type-camera":"Camera","src-type-draw":"Draw","src-type-facebook":"Facebook","src-type-dropbox":"Dropbox","src-type-gdrive":"Google Drive","src-type-gphotos":"Google Photos","src-type-instagram":"Instagram","src-type-flickr":"Flickr","src-type-vk":"VK","src-type-evernote":"Evernote","src-type-box":"Box","src-type-onedrive":"Onedrive","src-type-huddle":"Huddle","src-type-other":"Other","caption-from-url":"Import from link","caption-camera":"Camera","caption-draw":"Draw","caption-edit-file":"Edit file","file-no-name":"No name...","toggle-fullscreen":"Toggle fullscreen","toggle-guides":"Toggle guides",rotate:"Rotate","flip-vertical":"Flip vertical","flip-horizontal":"Flip horizontal",apply:"Apply",brightness:"Brightness",contrast:"Contrast",saturation:"Saturation",exposure:"Exposure",gamma:"Gamma",vibrance:"Vibrance",warmth:"Warmth",enhance:"Enhance",original:"Original",resize:"Resize image",crop:"Crop","select-color":"Select color",text:"Text",draw:"Draw","cancel-edit":"Cancel edit","tab-view":"Preview","tab-details":"Details","file-name":"Name","file-size":"Size","cdn-url":"CDN URL","file-size-unknown":"Unknown","camera-permissions-denied":"Camera access denied","camera-permissions-prompt":"Please allow access to the camera","camera-permissions-request":"Request access","files-count-limit-error-title":"Files count limit overflow","files-count-limit-error-too-few":"You\u2019ve chosen {{total}} {{plural:file(total)}}. At least {{min}} {{plural:file(min)}} required.","files-count-limit-error-too-many":"You\u2019ve chosen too many files. {{max}} {{plural:file(max)}} is maximum.","files-max-size-limit-error":"File is too big. Max file size is {{maxFileSize}}.","has-validation-errors":"File validation error ocurred. Please, check your files before upload.","images-only-accepted":"Only image files are accepted.","file-type-not-allowed":"Uploading of these file types is not allowed.","some-files-were-not-uploaded":"Some files were not uploaded.","file-item-edit-button":"Edit button","file-item-remove-button":"Remove button"};var nt=new Map,Pt=new Map,Ei=(r,i)=>{nt.has(r)&&console.log(`Locale ${r} is already defined. Overwriting...`),nt.set(r,{...Re,...i})},Ar=(r,i)=>{Pt.set(r,i)},$r=(r,i)=>{typeof i=="function"?Ar(r,i):Ei(r,i)},xi=async r=>{if(!nt.has(r)){if(!Pt.has(r))throw new Error(`Locale ${r} is not defined`);let e=await Pt.get(r)();Ei(r,e)}return nt.get(r)};$r("en",Re);var Q=r=>`*l10n/${r}`,Or="en",lt=class{constructor(i){m(this,"_blockInstance",null);m(this,"_localeName","");m(this,"_callbacks",new Set);m(this,"_boundBlocks",new Map);this._blockInstance=i;for(let[e,t]of Object.entries(Re))this._blockInstance.add(Q(e),t,!1);setTimeout(()=>{i.subConfigValue("localeName",async e=>{var o;if(!this._blockInstance||!e)return;this._localeName=e;let t=await xi(e);if(e!==Or&&this._localeName!==e)return;let s=(o=this._blockInstance.cfg.localeDefinitionOverride)==null?void 0:o[e];for(let[n,l]of Object.entries(t)){let a=s==null?void 0:s[n];this._blockInstance.add(Q(n),a!=null?a:l,!0);for(let c of this._callbacks)c()}}),i.subConfigValue("localeDefinitionOverride",e=>{var s;if(!e)return;let t=e[this._localeName];if(t)for(let[o,n]of Object.entries(t)){(s=this._blockInstance)==null||s.add(Q(o),n,!0);for(let l of this._callbacks)l()}})})}onLocaleChange(i){let e=R(i,0);return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}bindL10n(i,e,t){var o,n,l;i.$[e]=t(),this._boundBlocks.has(i)||this._boundBlocks.set(i,new Map),(n=(o=this._boundBlocks.get(i))==null?void 0:o.get(e))==null||n();let s=this.onLocaleChange(()=>{i.$[e]=t()});(l=this._boundBlocks.get(i))==null||l.set(e,s)}destroyL10nBindings(i){let e=this._boundBlocks.get(i);if(e){for(let t of e.values())t();this._boundBlocks.delete(i)}}destroy(){this._callbacks.clear()}};var kr={button:["toolbar"],checkbox:["toolbar"],menuitem:["menu","menubar"],option:["listbox"],tab:["tablist"]};function De(r,i){i.tabIndex=0,i.focus(),r.tabIndex=-1}function Nt(r){let i=r.role||r.type||r.tagName;if(!i)return null;let e=kr[i.toLowerCase()];if(!e)return null;for(let t of e){let s=r.closest(`[role=${t}]`);if(s)return s}}function Mt(r,i){return i.role==="toolbar"?Ir(i):i.querySelectorAll(`[role=${r.role}]`)}function Ir(r){return[...r.querySelectorAll("*")].filter(e=>e.role==="button"||e.type==="button"||e.role==="checkbox"||e.type==="checkbox")}function Lr(r){let i=r.getAttribute("aria-orientation");if(i==="vertical")return!1;if(i==="horizontal")return!0;let e=r.role;return e==="menubar"||e==="tablist"||e==="toolbar"}function Ci(r){return i=>{let e=!1,t=(r==null?void 0:r.searchDelayMs)||300,s=0,o="";function n(h){let f=Nt(h.target);if(!f){l();return}let _=Mt(h.target,f),b=Array.from(_).indexOf(h.target),E="ArrowDown",I="ArrowUp";if(Lr(f)&&(i.document.dir==="rtl"?(E="ArrowLeft",I="ArrowRight"):(E="ArrowRight",I="ArrowLeft")),h.key===E)h.preventDefault(),De(h.target,_[b+1]||_[0]);else if(h.key===I)h.preventDefault(),De(h.target,_[b-1]||_[_.length-1]);else if(h.key==="Home")h.preventDefault(),De(h.target,_[0]);else if(h.key==="End")h.preventDefault(),De(h.target,_[_.length-1]);else if(h.key.length===1&&f.role!=="tablist"){let N=Date.now();N-s<=t?o+=h.key.toLowerCase():o=h.key.toLowerCase(),s=N;let ae=Array.from(_).find(rr=>{var Vt,Ht,Kt;return(Kt=(Ht=(Vt=rr.textContent)==null?void 0:Vt.trim())==null?void 0:Ht.toLowerCase())==null?void 0:Kt.startsWith(o)});ae&&(h.preventDefault(),De(h.target,ae))}}function l(){e=!1,i.removeEventListener("keydown",n)}function a(h){let f=Nt(h.target);if(f){e||(e=!0,i.addEventListener("keydown",n));let _=Mt(h.target,f);for(let b of _)b!==h.target&&b.setAttribute("tabindex",-1)}else e&&l()}function c(h){(!h.relatedTarget||h.relatedTarget===i.document)&&l()}function u(h){let f=Nt(h.target);if(f){let _=Mt(h.target,f);for(let b of _)b!==h.target&&b.setAttribute("tabindex",-1);h.target.setAttribute("tabindex",0)}}return i.addEventListener("click",u),i.addEventListener("focusin",a),i.addEventListener("focusout",c),()=>{l(),i.removeEventListener("click",u),i.removeEventListener("focusin",a),i.removeEventListener("focusout",c)}}}function Si(){return r=>{let i,e;function t(o){if(o.target.getAttribute("aria-hidden")==="true"){i=o.target,i.setAttribute("aria-hidden","false"),e=i.hidden,e&&(i.hidden=!1);let n=o.target.querySelector('a, button, select, textarea, input:not([type=radio]), [type=radio]:checked, [tabindex]:not([tabindex="-1"])');n&&(n.tabIndex=0)}}function s(o){i&&i.contains(o.target)&&(!o.relatedTarget||!i.contains(o.relatedTarget))&&(o.target.tabIndex=-1,i.setAttribute("aria-hidden","true"),e&&(i.hidden=!0),i=null)}return r.addEventListener("keyuxJump",t),r.addEventListener("focusout",s),()=>{r.removeEventListener("keyuxJump",t),r.removeEventListener("focusout",s)}}}function Ai(){return r=>{let i=[];function e(c){let u=r.document.activeElement;u&&u!==r.document.body&&i.push(new WeakRef(u)),c.focus({focusVisible:!0})}function t(){let c=i.pop();if(!c){r.document.activeElement.blur();return}let u=c.deref();u&&u.isConnected?u.focus():t()}let s=0,o;function n(c){clearInterval(o);let u=c.getAttribute("aria-controls");u&&(o=setInterval(()=>{if(s++>50){clearInterval(o);return}let h=r.document.getElementById(u);if(h){let f=h.querySelector('a, button, select, textarea, input:not([type=radio]), [type=radio]:checked, [tabindex]:not([tabindex="-1"])');f&&(clearInterval(o),h.dispatchEvent(new r.CustomEvent("keyuxJump",{bubbles:!0})),e(f))}},50))}function l(c){c.clientX===0&&c.clientY===0&&n(c.target)}function a(c){c.target.tagName==="INPUT"&&c.key==="Enter"&&n(c.target),c.key==="Escape"&&t()}return r.addEventListener("click",l),r.addEventListener("keydown",a),()=>{r.removeEventListener("click",l),r.removeEventListener("keydown",a)}}}function $i(r){let i,e=r.split(" ");function t(){i&&i.classList.remove(...e)}function s(o){o.clientX===0&&o.clientY===0&&(t(),o.target.classList.add(...e),i=o.target)}return o=>(o.addEventListener("keyup",t),o.addEventListener("click",s),()=>{o.removeEventListener("keyup",t),o.removeEventListener("click",s)})}function Oi(r,i){let e=i.map(t=>t(r));return()=>{e.forEach(t=>t())}}var Rt=class{constructor(){m(this,"_listeners",new Map);m(this,"_scope",[])}addEventListener(i,e){let t=s=>{let o=s.target;o&&this._scope.some(n=>n===s.target||n.contains(o))&&e(s)};this._listeners.set(e,t),window.addEventListener(i,t)}removeEventListener(i,e){let t=this._listeners.get(e);t&&window.removeEventListener(i,t),this._listeners.delete(e)}get CustomEvent(){return window.CustomEvent}get document(){return window.document}get navigator(){return window.navigator}registerScope(i){this._scope.push(i)}destroy(){this._scope=[],this._listeners.forEach((i,e)=>{window.removeEventListener("keydown",i),window.removeEventListener("keyup",i),this._listeners.delete(e)})}},at=class{constructor(){m(this,"_destroyKeyUX");m(this,"_scopedWindow");this._scopedWindow=new Rt,this._destroyKeyUX=Oi(this._scopedWindow,[Ci(),$i("is-pressed"),Ai(),Si()])}registerBlock(i){this._scopedWindow.registerScope(i)}destroy(){var i;(i=this._destroyKeyUX)==null||i.call(this),this._scopedWindow.destroy()}};function ki(r,i){[...r.querySelectorAll("[l10n]")].forEach(e=>{let t=e.getAttribute("l10n");if(!t)return;let s="textContent",o=!1;if(t.includes(":")){let a=t.split(":");s=a[0],t=a[1],s.startsWith("@")&&(s=s.slice(1),o=!0)}let n=t;i.has(n)&&i.sub(n,a=>{if(!a)return;i.l10nProcessorSubs.has(n)||i.l10nProcessorSubs.set(n,new Set);let c=i.l10nProcessorSubs.get(n);c==null||c.forEach(f=>{f.remove(),c.delete(f),i.allSubs.delete(f)});let u=Q(a).replace("*","");i.sharedCtx.has(u)||i.sharedCtx.add(u,a);let h=i.sharedCtx.sub(u,()=>{e[s]=i.l10n(a)});c==null||c.add(h),i.allSubs.add(h),e.removeAttribute("l10n")});let l=Q(t);i.has(l)||i.add(l,""),i.sub(l,()=>{t=t,o?e.setAttribute(s,i.l10n(t)):e[s]=i.l10n(t)}),e.removeAttribute("l10n")})}var P=r=>`*cfg/${r}`;var Dt="set";function Ii(r){[...r.querySelectorAll(`[${Dt}]`)].forEach(i=>{let e=i.getAttribute(Dt);e&&(i.removeAttribute(Dt),i.setAttribute(d.BIND_ATTR,e))})}var Pr="uc-",Ut="ctx-name",y=class extends St{constructor(){super();m(this,"requireCtxName",!1);m(this,"activityType",null);m(this,"init$",Ti());m(this,"_readyResolvers",ot());this.l10nProcessorSubs=new Map,this.addTemplateProcessor(ki),this.addTemplateProcessor(ri),this.tplProcessors=new Set([Ii,...this.tplProcessors])}l10n(e,t={}){if(!e)return"";let s=this.$[Q(e)]||e,o=vi(s);for(let l of o)t[l.variable]=this.pluralize(l.pluralKey,Number(t[l.countVariable]));return It(s,t)}pluralize(e,t){let s=this.l10n("locale-id")||"en",o=bi(s,t);return this.l10n(`${e}__${o}`)}bindL10n(e,t){var s;(s=this.localeManager)==null||s.bindL10n(this,e,t)}emit(e,t,s){let o=this.has("*eventEmitter")&&this.$["*eventEmitter"];o&&o.emit(e,t,s)}hasBlockInCtx(e){for(let t of this.blocksRegistry)if(e(t))return!0;return!1}setOrAddState(e,t){this.add$({[e]:t},!0)}connectedCallback(){this.constructor.styleAttrs.forEach(t=>{this.setAttribute(t,"")}),this.hasAttribute("retpl")&&(this.constructor.template=null,this.processInnerHtml=!0),this.requireCtxName?Promise.race([Lt({element:this,attribute:d.CTX_NAME_ATTR}),Lt({element:this,attribute:Ut})]).then(t=>{if(t.success){if(t.attribute===Ut){let s=t.value;this.setAttribute(d.CTX_NAME_ATTR,s)}super.connectedCallback(),this.removeAttribute(d.CTX_NAME_ATTR)}else console.error(`Attribute "${d.CTX_NAME_ATTR}" or "${Ut}" is required and it is not set.`)}):super.connectedCallback(),fe.registerClient(this)}disconnectedCallback(){super.disconnectedCallback(),fe.unregisterClient(this)}initCallback(){this.has("*blocksRegistry")||this.add("*blocksRegistry",new Set),this.$["*blocksRegistry"].add(this),this.has("*eventEmitter")||this.add("*eventEmitter",new st(this.debugPrint.bind(this))),this.has("*localeManager")||this.add("*localeManager",new lt(this)),this.has("*a11y")||this.add("*a11y",new at),this.sub(Q("locale-id"),t=>{let s=gi(t);this.style.direction=s==="ltr"?"":s}),setTimeout(()=>{this._readyResolvers.resolve()},0)}get ready(){return this._readyResolvers.promise}get localeManager(){return this.has("*localeManager")?this.$["*localeManager"]:null}get a11y(){return this.has("*a11y")?this.$["*a11y"]:null}get blocksRegistry(){return this.$["*blocksRegistry"]}destroyCallback(){var t;let e=this.blocksRegistry;e==null||e.delete(this),(t=this.localeManager)==null||t.destroyL10nBindings(this),this.l10nProcessorSubs=new Map,ie.deleteCtx(this.localCtx.uid),(e==null?void 0:e.size)===0&&setTimeout(()=>{this.destroyCtxCallback()},0)}destroyCtxCallback(){var e;ie.deleteCtx(this.ctxName),(e=this.localeManager)==null||e.destroy()}async proxyUrl(e){if(this.cfg.secureDeliveryProxy&&this.cfg.secureDeliveryProxyUrlResolver&&console.warn("Both secureDeliveryProxy and secureDeliveryProxyUrlResolver are set. The secureDeliveryProxyUrlResolver will be used."),this.cfg.secureDeliveryProxyUrlResolver)try{return await this.cfg.secureDeliveryProxyUrlResolver(e,{uuid:tt(e),cdnUrlModifiers:At(e),fileName:et(e)})}catch(t){return console.error("Failed to resolve secure delivery proxy URL. Falling back to the default URL.",t),e}return this.cfg.secureDeliveryProxy?It(this.cfg.secureDeliveryProxy,{previewUrl:e},{transform:t=>window.encodeURIComponent(t)}):e}get cfg(){if(!this.__cfgProxy){let e=Object.create(null);this.__cfgProxy=new Proxy(e,{set:(t,s,o)=>{if(typeof s!="string")return!1;let n=P(s);return this.has(n)||this.add(n,z[s]),this.$[n]=o,!0},get:(t,s)=>{let o=P(s);return this.has(o)||this.add(o,z[s]),this.$[P(s)]}})}return this.__cfgProxy}subConfigValue(e,t){let s=P(e);this.has(s)||this.add(s,z[e]),this.sub(s,t)}debugPrint(...e){if(!this.cfg.debug)return;let t=e;if(typeof(e==null?void 0:e[0])=="function"){let s=e[0];t=s()}console.log(`[${this.ctxName}]`,...t)}static reg(e){if(!e){super.reg();return}e.startsWith(Pr)&&super.reg(e)}};m(y,"StateConsumerScope",null),m(y,"styleAttrs",[]);var V="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=";function Li(...r){return r.reduce((i,e)=>{if(typeof e=="string")return i[e]=!0,i;for(let t of Object.keys(e))i[t]=e[t];return i},{})}function A(...r){let i=Li(...r);return Object.keys(i).reduce((e,t)=>(i[t]&&e.push(t),e),[]).join(" ")}function Pi(r,...i){let e=Li(...i);for(let t of Object.keys(e))r.classList.toggle(t,e[t])}var Ni=r=>{if(!r)return[];let[i,e]=r.split(":").map(Number);if(!Number.isFinite(i)||!Number.isFinite(e)){console.error(`Invalid crop preset: ${r}`);return}return[{type:"aspect-ratio",width:i,height:e}]};var Mi=r=>{if(!r)return L;let i=mi(r).filter(e=>L.includes(e));return i.length===0?L:i};function Ri(r){return{"*originalUrl":null,"*faderEl":null,"*cropperEl":null,"*imgEl":null,"*imgContainerEl":null,"*networkProblems":!1,"*imageSize":null,"*editorTransformations":{},"*cropPresetList":[],"*tabList":L,"*tabId":T.CROP,entry:null,extension:null,editorMode:!1,modalCaption:"",isImage:!1,msg:"",src:V,fileType:"",showLoader:!1,uuid:null,cdnUrl:null,cropPreset:"",tabs:rt(L),"presence.networkProblems":!1,"presence.modalCaption":!0,"presence.editorToolbar":!1,"presence.viewerToolbar":!0,"*on.retryNetwork":()=>{let i=r.querySelectorAll("img");for(let e of i){let t=e.src;e.src=V,e.src=t}r.$["*networkProblems"]=!1},"*on.apply":i=>{if(!i)return;let e=r.$["*originalUrl"],t=q(oe(i),"preview"),s=Y(e,t),o={originalUrl:e,cdnUrlModifiers:t,cdnUrl:s,transformations:i};r.dispatchEvent(new CustomEvent("apply",{detail:o,bubbles:!0,composed:!0})),r.remove()},"*on.cancel":()=>{r.remove(),r.dispatchEvent(new CustomEvent("cancel",{bubbles:!0,composed:!0}))}}}var Di="<svg width='0' height='0' style='position:absolute'><symbol viewBox='0 0 20 20' id='uc-icon-brightness' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M15 10a5 5 0 0 1-5 5m5-5a5 5 0 0 0-5-5m5 5h-5m0 5a5 5 0 0 1 0-10m0 10V5m0 15v-3M2.93 2.929 5.05 5.05M0 10h3m-.07 7.071 2.12-2.121M10 0v3m7.07 14.071-2.12-2.121M20 10h-3m.07-7.071L14.95 5.05m-.626 2.45H10m4.324 5H10'/></symbol><symbol fill='currentColor' viewBox='0 0 20 20' id='uc-icon-closeMax' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='M8.232 10 3.585 5.353l1.768-1.768L10 8.232l4.648-4.647 1.767 1.768L11.768 10l4.647 4.648-1.767 1.767L10 11.768l-4.647 4.647-1.768-1.767L8.232 10Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-contrast' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M2 10a8 8 0 1 0 16 0 8 8 0 1 0-16 0m8-8v16m8-8h-8m7.598 2.5H10m6.24 2.5H10m7.6-7.5H10M16.242 5H10'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-crop' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M20 14H7.005C6.45 14 6 13.55 6 12.995V0M0 6h13.067c.515 0 .933.418.933.933V20M14.5.4 13 2l1.5 1.6M13 2h2a3 3 0 0 1 3 3v2M5.5 19.6 7 18l-1.5-1.6M7 18H5a3 3 0 0 1-3-3v-2'/></symbol><symbol fill='currentColor' viewBox='0 0 20 20' id='uc-icon-done' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='m18.057 6.333-9.365 9.125a1.25 1.25 0 0 1-1.768-.023L1.92 10.296l1.791-1.744 4.132 4.243 8.47-8.253 1.744 1.79Z' clip-rule='evenodd'/></symbol><symbol fill='currentColor' viewBox='0 0 25 24' id='uc-icon-edit-file' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='M18.558 2.804a.78.78 0 0 0-.557.235l-.008.007-2.472 2.46 3.847 3.848 2.46-2.473.004-.003a.78.78 0 0 0 0-1.108l-.004-.003-2.712-2.728a.78.78 0 0 0-.558-.235Zm-.248 7.613-3.852-3.852-8.93 8.887-1.516 5.41 5.41-1.515 8.888-8.93Zm-.636-8.934a2.28 2.28 0 0 1 2.512.505l2.702 2.717.002.002a2.278 2.278 0 0 1 0 3.234l-.002.002-12.541 12.602a.75.75 0 0 1-.33.193l-6.884 1.928a.75.75 0 0 1-.925-.924l1.928-6.885a.75.75 0 0 1 .193-.33l12.603-12.54a2.28 2.28 0 0 1 .742-.504Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-enhance' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M19 13h-2m0 0a4 4 0 0 1-4-4m4 4a4 4 0 0 0-4 4m0-8V7m0 2a4 4 0 0 1-4 4m-2 0h2m0 0a4 4 0 0 1 4 4m0 0v2M8 8.5H6.5m0 0a2 2 0 0 1-2-2m2 2a2 2 0 0 0-2 2m0-4V5m0 1.5a2 2 0 0 1-2 2M1 8.5h1.5m0 0a2 2 0 0 1 2 2m0 0V12M12 3h-1m0 0a1 1 0 0 1-1-1m1 1a1 1 0 0 0-1 1m0-2V1m0 1a1 1 0 0 1-1 1M8 3h1m0 0a1 1 0 0 1 1 1m0 0v1'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-exposure' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M10 20v-3M2.93 2.929 5.05 5.05M0 10h3m-.07 7.071 2.12-2.121M10 0v3m7.07 14.071-2.12-2.121M20 10h-3m.07-7.071L14.95 5.05M5 10a5 5 0 1 0 10 0 5 5 0 1 0-10 0'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-filters' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M4.5 6.5a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0m-3.5 6a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0m7 0a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-flip' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M19.6 5 18 3.5 16.4 5m3.2 10L18 16.5 16.4 15M18 3.523v12.954M3.3 8.5h10.654c.301 0 .415-.395.159-.554L3.459 1.286A.3.3 0 0 0 3 1.542V8.2a.3.3 0 0 0 .3.3zm0 3h10.654c.301 0 .415.395.159.554l-10.654 6.66A.3.3 0 0 1 3 18.458v-6.66a.3.3 0 0 1 .3-.3z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-gamma' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M17 3C9 6 2.5 11.5 2.5 17.5m0 0h1m-1 0v-1m14 1h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3-14v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-mirror' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M5 .4 3.5 2 5 3.6M15 .4 16.5 2 15 3.6M3.52 2h12.957M8.5 16.7V6.046c0-.301-.394-.415-.554-.159L1.287 16.541a.3.3 0 0 0 .255.459H8.2a.3.3 0 0 0 .3-.3zm3 0V6.046c0-.301.395-.415.555-.159l6.659 10.654a.3.3 0 0 1-.255.459H11.8a.3.3 0 0 1-.3-.3z'/></symbol><symbol viewBox='0 0 40 40' id='uc-icon-original' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.5' d='M0 40 40 0'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-rotate' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M13.5.4 12 2l1.5 1.6M12.023 2H14.4A3.6 3.6 0 0 1 18 5.6V8M4 17h9a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-sad' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M2 17c4.418-4 11.582-4 16 0M16.5 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-11 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-saturation' xmlns='http://www.w3.org/2000/svg'><defs><linearGradient id='puc-icon-id__a' x1='10.001' y1='1' x2='10.001' y2='19' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient></defs><circle cx='10.001' cy='10' r='9' transform='rotate(90 10 10)' fill='url(#puc-icon-id__a)'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-slider' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M0 10h11m0 0a2 2 0 1 0 4 0m-4 0a2 2 0 1 1 4 0m0 0h5'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-tuning' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M8 10h11M1 10h4M1 4.5h11m3 0h4m-18 11h11m3 0h4m-7-11a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0M5 10a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0m7 5.5a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-vibrance' xmlns='http://www.w3.org/2000/svg'><path d='M2.125 5.64A8.96 8.96 0 0 0 1.001 10a8.96 8.96 0 0 0 1.124 4.36V5.64z' fill='url(#suc-icon-id__a)'/><path d='M2.875 15.499V4.502a9.053 9.053 0 0 1 1.75-1.72v14.437a9.05 9.05 0 0 1-1.75-1.72z' fill='url(#suc-icon-id__b)'/><path d='M5.375 17.722c.548.33 1.134.601 1.75.809V1.469a8.956 8.956 0 0 0-1.75.81v15.443z' fill='url(#suc-icon-id__c)'/><path d='M7.875 1.253v17.495c.564.136 1.15.22 1.75.244V1.008a9 9 0 0 0-1.75.245z' fill='url(#suc-icon-id__d)'/><path d='M10.375 1.008v17.984a9 9 0 0 0 1.75-.244V1.252a9 9 0 0 0-1.75-.244z' fill='url(#suc-icon-id__e)'/><path d='M12.875 1.469V18.53a8.957 8.957 0 0 0 1.75-.808V2.277a8.957 8.957 0 0 0-1.75-.808z' fill='url(#suc-icon-id__f)'/><path d='M15.375 2.78v14.44a9.053 9.053 0 0 0 1.75-1.72v-11a9.054 9.054 0 0 0-1.75-1.72z' fill='url(#suc-icon-id__g)'/><path d='M17.875 5.638v8.724A8.959 8.959 0 0 0 19.001 10a8.96 8.96 0 0 0-1.126-4.362z' fill='url(#suc-icon-id__h)'/><defs><linearGradient id='suc-icon-id__a' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='suc-icon-id__b' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='suc-icon-id__c' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='suc-icon-id__d' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='suc-icon-id__e' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='suc-icon-id__f' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='suc-icon-id__g' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='suc-icon-id__h' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient></defs></symbol><symbol viewBox='0 0 20 20' id='uc-icon-warmth' xmlns='http://www.w3.org/2000/svg'><path d='m7.5 13.05.429.42.171-.175v-.244h-.6zm5 0h-.6v.245l.172.175.428-.42zM8.1 3.5c0-1.05.85-1.9 1.9-1.9V.4a3.1 3.1 0 0 0-3.1 3.1h1.2zm0 9.55V3.5H6.9v9.55h1.2zm-1 2.45c0-.79.315-1.506.829-2.03l-.858-.84A4.088 4.088 0 0 0 5.9 15.5h1.2zm2.9 2.9a2.9 2.9 0 0 1-2.9-2.9H5.9a4.1 4.1 0 0 0 4.1 4.1v-1.2zm2.9-2.9a2.9 2.9 0 0 1-2.9 2.9v1.2a4.1 4.1 0 0 0 4.1-4.1h-1.2zm-.829-2.03c.514.524.829 1.24.829 2.03h1.2c0-1.117-.447-2.13-1.171-2.87l-.858.84zM11.9 3.5v9.55h1.2V3.5h-1.2zM10 1.6c1.05 0 1.9.85 1.9 1.9h1.2A3.1 3.1 0 0 0 10 .4v1.2z' fill='currentColor'/><path d='M10 14V8' stroke='currentColor' stroke-width='1.2' stroke-linecap='round'/><path d='M14 3h3m-3 3h3m-3 3h3m-8 6.5a1 1 0 1 0 2 0 1 1 0 1 0-2 0' stroke='currentColor' stroke-width='1.2'/></symbol></svg>";var Ui=w`${Di} <div class="uc-wrapper uc-wrapper_desktop"><uc-presence-toggle class="uc-network_problems_splash" bind="visible: presence.networkProblems;"><div class="uc-network_problems_content"><div class="uc-network_problems_icon"><uc-icon name="sad"></uc-icon></div><div class="uc-network_problems_text">Network error</div></div><div class="uc-network_problems_footer"><uc-btn-ui theme="primary" text="Retry" bind="onclick: *on.retryNetwork"></uc-btn-ui></div></uc-presence-toggle><div class="uc-viewport"><div class="uc-file_type_outer"><div class="uc-file_type">{{fileType}}</div></div><div class="uc-image_container" ref="img-container-el"><img src="${V}" class="uc-image uc-image_visible_from_editor" ref="img-el" /><uc-editor-image-cropper ref="cropper-el"></uc-editor-image-cropper><uc-editor-image-fader ref="fader-el"></uc-editor-image-fader></div><div class="uc-info_pan">{{msg}}</div></div><div class="uc-toolbar"><uc-line-loader-ui bind="active: showLoader"></uc-line-loader-ui><div class="uc-toolbar_content uc-toolbar_content__editor"><uc-editor-toolbar></uc-editor-toolbar></div></div></div>`;var ne=class extends y{constructor(){super();m(this,"ctxOwner",!0);m(this,"_debouncedShowLoader",R(this._showLoader.bind(this),300));this.init$={...this.init$,...Ri(this)}}_showLoader(e){this.$.showLoader=e}_waitForSize(){return new Promise((t,s)=>{let o=setTimeout(()=>{s(new Error("[cloud-image-editor] timeout waiting for non-zero container size"))},3e3),n=new ResizeObserver(([l])=>{l.contentRect.width>0&&l.contentRect.height>0&&(t(),clearTimeout(o),n.disconnect())});n.observe(this)})}initCallback(){super.initCallback(),this.$["*faderEl"]=this.ref["fader-el"],this.$["*cropperEl"]=this.ref["cropper-el"],this.$["*imgContainerEl"]=this.ref["img-container-el"],this.initEditor()}async updateImage(){if(this.isConnected){if(await this._waitForSize(),this.$.cdnUrl){let e=tt(this.$.cdnUrl),t=$t(this.$.cdnUrl,e);if(t===this.$["*originalUrl"])return;this.$["*originalUrl"]=t;let s=oi(this.$.cdnUrl),o=ui(s);this.$["*editorTransformations"]=o}else if(this.$.uuid){let e=$t(this.cfg.cdnCname,this.$.uuid);if(e===this.$["*originalUrl"])return;this.$["*originalUrl"]=e,this.$["*editorTransformations"]={}}else throw new Error("No UUID nor CDN URL provided");this.$["*tabId"]===T.CROP?this.$["*cropperEl"].deactivate({reset:!0}):this.$["*faderEl"].deactivate();try{let e=await this.proxyUrl(Y(this.$["*originalUrl"],q("json"))),t=await fetch(e).then(n=>n.json()),{width:s,height:o}=t;this.$["*imageSize"]={width:s,height:o},this.$["*tabId"]===T.CROP?this.$["*cropperEl"].activate(this.$["*imageSize"]):this.$["*faderEl"].activate({url:this.$["*originalUrl"]})}catch(e){e&&console.error("Failed to load image info",e)}}}async initEditor(){try{await this._waitForSize()}catch(e){this.isConnected&&console.error(e.message);return}this.ref["img-el"].addEventListener("load",()=>{this._imgLoading=!1,this._debouncedShowLoader(!1),this.$.src!==V&&(this.$["*networkProblems"]=!1)}),this.ref["img-el"].addEventListener("error",()=>{this._imgLoading=!1,this._debouncedShowLoader(!1),this.$["*networkProblems"]=!0}),this.sub("src",e=>{let t=this.ref["img-el"];t.src!==e&&(this._imgLoading=!0,t.src=e||V)}),this.sub("cropPreset",e=>{this.$["*cropPresetList"]=Ni(e)}),this.sub("tabs",e=>{this.$["*tabList"]=Mi(e)}),this.sub("*tabId",e=>{this.ref["img-el"].className=A("uc-image",{"uc-image_hidden_to_cropper":e===T.CROP,"uc-image_hidden_effects":e!==T.CROP})}),this.classList.add("uc-editor_ON"),this.sub("*networkProblems",e=>{this.$["presence.networkProblems"]=e,this.$["presence.modalCaption"]=!e}),this.sub("*editorTransformations",e=>{if(Object.keys(e).length===0)return;let t=this.$["*originalUrl"],s=q(oe(e),"preview"),o=Y(t,s),n={originalUrl:t,cdnUrlModifiers:s,cdnUrl:o,transformations:e};this.dispatchEvent(new CustomEvent("change",{detail:n,bubbles:!0,composed:!0}))},!1),this.sub("uuid",e=>e&&this.updateImage()),this.sub("cdnUrl",e=>e&&this.updateImage())}};m(ne,"styleAttrs",["uc-cloud-image-editor"]);ne.template=Ui;ne.bindAttributes({uuid:"uuid","cdn-url":"cdnUrl","crop-preset":"cropPreset",tabs:"tabs"});var Ue=33.333333333333336,g=1,Ft=24,Fi=6;function pe(r,i){for(let e in i)r.setAttributeNS(null,e,i[e].toString())}function U(r,i={}){let e=document.createElementNS("http://www.w3.org/2000/svg",r);return pe(e,i),e}function zi(r,i,e){let{x:t,y:s,width:o,height:n}=r,l=i.includes("w")?0:1,a=i.includes("n")?0:1,c=[-1,1][l],u=[-1,1][a],h=[t+l*o+1.5*c,s+a*n+1.5*u-24*e*u],f=[t+l*o+1.5*c,s+a*n+1.5*u],_=[t+l*o-24*e*c+1.5*c,s+a*n+1.5*u];return{d:`M ${h[0]} ${h[1]} L ${f[0]} ${f[1]} L ${_[0]} ${_[1]}`,center:f}}function Xi(r,i,e){let{x:t,y:s,width:o,height:n}=r,l=["n","s"].includes(i)?.5:{w:0,e:1}[i],a=["w","e"].includes(i)?.5:{n:0,s:1}[i],c=[-1,1][l],u=[-1,1][a],h,f;["n","s"].includes(i)?(h=[t+l*o-34*e/2,s+a*n+1.5*u],f=[t+l*o+34*e/2,s+a*n+1.5*u]):(h=[t+l*o+1.5*c,s+a*n-34*e/2],f=[t+l*o+1.5*c,s+a*n+34*e/2]);let _=`M ${h[0]} ${h[1]} L ${f[0]} ${f[1]}`,b=[f[0]-(f[0]-h[0])/2,f[1]-(f[1]-h[1])/2];return{d:_,center:b}}function ji(r){return r===""?"move":["e","w"].includes(r)?"ew-resize":["n","s"].includes(r)?"ns-resize":["nw","se"].includes(r)?"nwse-resize":"nesw-resize"}function Bi({rect:r,delta:[i,e],imageBox:t}){return Te({...r,x:r.x+i,y:r.y+e},t)}function Te(r,i){let{x:e}=r,{y:t}=r;return r.x<i.x?e=i.x:r.x+r.width>i.x+i.width&&(e=i.x+i.width-r.width),r.y<i.y?t=i.y:r.y+r.height>i.y+i.height&&(t=i.y+i.height-r.height),{...r,x:e,y:t}}function Nr({rect:r,delta:i,aspectRatio:e,imageBox:t}){let[,s]=i,{y:o,width:n,height:l}=r;o+=s,l-=s,e&&(n=l*e);let a=r.x+r.width/2-n/2;return o<=t.y&&(o=t.y,l=r.y+r.height-o,e&&(n=l*e,a=r.x+r.width/2-n/2)),a<=t.x&&(a=t.x,o=r.y+r.height-l),a+n>=t.x+t.width&&(a=Math.max(t.x,t.x+t.width-n),n=t.x+t.width-a,e&&(l=n/e),o=r.y+r.height-l),l<g&&(l=g,e&&(n=l*e,a=r.x+r.width/2-n/2),o=r.y+r.height-l),n<g&&(n=g,e&&(l=n/e,a=r.x+r.width/2-n/2),o=r.y+r.height-l),{x:a,y:o,width:n,height:l}}function Mr({rect:r,delta:i,aspectRatio:e,imageBox:t}){let[s]=i,{x:o,width:n,height:l}=r;o+=s,n-=s,e&&(l=n/e);let a=r.y+r.height/2-l/2;return o<=t.x&&(o=t.x,n=r.x+r.width-o,e&&(l=n/e,a=r.y+r.height/2-l/2)),a<=t.y&&(a=t.y,o=r.x+r.width-n),a+l>=t.y+t.height&&(a=Math.max(t.y,t.y+t.height-l),l=t.y+t.height-a,e&&(n=l*e),o=r.x+r.width-n),l<g&&(l=g,e&&(n=l*e),a=r.y+r.height/2-l/2,o=r.x+r.width-n),n<g&&(n=g,e&&(l=n/e),a=r.y+r.height/2-l/2,o=r.x+r.width-n),{x:o,y:a,width:n,height:l}}function Rr({rect:r,delta:i,aspectRatio:e,imageBox:t}){let[,s]=i,{y:o,width:n,height:l}=r;l+=s,e&&(n=l*e);let a=r.x+r.width/2-n/2;return o+l>=t.y+t.height&&(l=t.y+t.height-o,e&&(n=l*e),a=r.x+r.width/2-n/2),a<=t.x&&(a=t.x,o=r.y),a+n>=t.x+t.width&&(a=Math.max(t.x,t.x+t.width-n),n=t.x+t.width-a,e&&(l=n/e),o=r.y),l<g&&(l=g,e&&(n=l*e),a=r.x+r.width/2-n/2),n<g&&(n=g,e&&(l=n/e),a=r.x+r.width/2-n/2),{x:a,y:o,width:n,height:l}}function Dr({rect:r,delta:i,aspectRatio:e,imageBox:t}){let[s]=i,{x:o,width:n,height:l}=r;n+=s,e&&(l=n/e);let a=r.y+r.height/2-l/2;return o+n>=t.x+t.width&&(n=t.x+t.width-o,e&&(l=n/e),a=r.y+r.height/2-l/2),a<=t.y&&(a=t.y,o=r.x),a+l>=t.y+t.height&&(a=Math.max(t.y,t.y+t.height-l),l=t.y+t.height-a,e&&(n=l*e),o=r.x),l<g&&(l=g,e&&(n=l*e),a=r.y+r.height/2-l/2),n<g&&(n=g,e&&(l=n/e),a=r.y+r.height/2-l/2),{x:o,y:a,width:n,height:l}}function Ur({rect:r,delta:i,aspectRatio:e,imageBox:t}){let[s,o]=i,{x:n,y:l,width:a,height:c}=r;return n+s<t.x&&(s=t.x-n),l+o<t.y&&(o=t.y-l),n+=s,a-=s,l+=o,c-=o,e&&Math.abs(a/c)>e?(o=a/e-c,c+=o,l-=o,l<=t.y&&(c=c-(t.y-l),a=c*e,n=r.x+r.width-a,l=t.y)):e&&(s=c*e-a,a=a+s,n-=s,n<=t.x&&(a=a-(t.x-n),c=a/e,n=t.x,l=r.y+r.height-c)),c<g&&(c=g,e&&(a=c*e),n=r.x+r.width-a,l=r.y+r.height-c),a<g&&(a=g,e&&(c=a/e),n=r.x+r.width-a,l=r.y+r.height-c),{x:n,y:l,width:a,height:c}}function Fr({rect:r,delta:i,aspectRatio:e,imageBox:t}){let[s,o]=i,{x:n,y:l,width:a,height:c}=r;return n+a+s>t.x+t.width&&(s=t.x+t.width-n-a),l+o<t.y&&(o=t.y-l),a+=s,l+=o,c-=o,e&&Math.abs(a/c)>e?(o=a/e-c,c+=o,l-=o,l<=t.y&&(c=c-(t.y-l),a=c*e,n=r.x,l=t.y)):e&&(s=c*e-a,a+=s,n+a>=t.x+t.width&&(a=t.x+t.width-n,c=a/e,n=t.x+t.width-a,l=r.y+r.height-c)),c<g&&(c=g,e&&(a=c*e),l=r.y+r.height-c),a<g&&(a=g,e&&(c=a/e),l=r.y+r.height-c),{x:n,y:l,width:a,height:c}}function zr({rect:r,delta:i,aspectRatio:e,imageBox:t}){let[s,o]=i,{x:n,y:l,width:a,height:c}=r;return n+s<t.x&&(s=t.x-n),l+c+o>t.y+t.height&&(o=t.y+t.height-l-c),n+=s,a-=s,c+=o,e&&Math.abs(a/c)>e?(o=a/e-c,c+=o,l+c>=t.y+t.height&&(c=t.y+t.height-l,a=c*e,n=r.x+r.width-a,l=t.y+t.height-c)):e&&(s=c*e-a,a+=s,n-=s,n<=t.x&&(a=a-(t.x-n),c=a/e,n=t.x,l=r.y)),c<g&&(c=g,e&&(a=c*e),n=r.x+r.width-a),a<g&&(a=g,e&&(c=a/e),n=r.x+r.width-a),{x:n,y:l,width:a,height:c}}function Xr({rect:r,delta:i,aspectRatio:e,imageBox:t}){let[s,o]=i,{x:n,y:l,width:a,height:c}=r;return n+a+s>t.x+t.width&&(s=t.x+t.width-n-a),l+c+o>t.y+t.height&&(o=t.y+t.height-l-c),a+=s,c+=o,e&&Math.abs(a/c)>e?(o=a/e-c,c+=o,l+c>=t.y+t.height&&(c=t.y+t.height-l,a=c*e,n=r.x,l=t.y+t.height-c)):e&&(s=c*e-a,a+=s,n+a>=t.x+t.width&&(a=t.x+t.width-n,c=a/e,n=t.x+t.width-a,l=r.y)),c<g&&(c=g,e&&(a=c*e)),a<g&&(a=g,e&&(c=a/e)),{x:n,y:l,width:a,height:c}}function Vi({direction:r,...i}){switch(r){case"n":return Nr(i);case"w":return Mr(i);case"s":return Rr(i);case"e":return Dr(i);case"nw":return Ur(i);case"ne":return Fr(i);case"sw":return zr(i);case"se":return Xr(i);default:return i.rect}}function Hi(r,[i,e]){return r.x<=i&&i<=r.x+r.width&&r.y<=e&&e<=r.y+r.height}function Ki(r,i){return r.x>=i.x&&r.y>=i.y&&r.x+r.width<=i.x+i.width&&r.y+r.height<=i.y+i.height}function Gi(r,i){return Math.abs(r.width/r.height-i)<.1}function Ee({width:r,height:i},e){let t=e/90%2!==0;return{width:t?i:r,height:t?r:i}}function xe(r){return{x:Math.round(r.x),y:Math.round(r.y),width:Math.round(r.width),height:Math.round(r.height)}}function le(r,i,e){return Math.min(Math.max(r,i),e)}var ht=class extends y{constructor(){super(),this.init$={...this.init$,dragging:!1},this._handlePointerUp=this._handlePointerUp_.bind(this),this._handlePointerMove=this._handlePointerMove_.bind(this),this._handleSvgPointerMove=this._handleSvgPointerMove_.bind(this)}_shouldThumbBeDisabled(i){let e=this.$["*imageBox"];if(!e)return;if(i===""&&e.height<=g&&e.width<=g)return!0;let t=e.height<=g&&(i.includes("n")||i.includes("s")),s=e.width<=g&&(i.includes("e")||i.includes("w"));return t||s}_createBackdrop(){let i=this.$["*cropBox"];if(!i)return;let{x:e,y:t,width:s,height:o}=i,n=this.ref["svg-el"],l=U("mask",{id:"backdrop-mask"}),a=U("rect",{x:0,y:0,width:"100%",height:"100%",fill:"white"}),c=U("rect",{x:e,y:t,width:s,height:o,fill:"black"});l.appendChild(a),l.appendChild(c);let u=U("rect",{x:0,y:0,width:"100%",height:"100%",fill:"var(--color-image-background)","fill-opacity":.85,mask:"url(#backdrop-mask)"});n.appendChild(u),n.appendChild(l),this._backdropMask=l,this._backdropMaskInner=c}_resizeBackdrop(){this._backdropMask&&(this._backdropMask.style.display="none",window.requestAnimationFrame(()=>{this._backdropMask&&(this._backdropMask.style.display="block")}))}_updateBackdrop(){let i=this.$["*cropBox"];if(!i)return;let{x:e,y:t,width:s,height:o}=i;this._backdropMaskInner&&pe(this._backdropMaskInner,{x:e,y:t,width:s,height:o})}_updateFrame(){let i=this.$["*cropBox"];if(!(!i||!this._frameGuides||!this._frameThumbs)){for(let e of Object.values(this._frameThumbs)){let{direction:t,pathNode:s,interactionNode:o,groupNode:n}=e,l=t==="",a=t.length===2,{x:c,y:u,width:h,height:f}=i;if(l){let b={x:c+h/3,y:u+f/3,width:h/3,height:f/3};pe(o,b)}else{let b=le(Math.min(h,f)/(24*2+34)/2,0,1),{d:E,center:I}=a?zi(i,t,b):Xi(i,t,b),N=Math.max(Ft*le(Math.min(h,f)/Ft/3,0,1),Fi);pe(o,{x:I[0]-N,y:I[1]-N,width:N*2,height:N*2}),pe(s,{d:E})}let _=this._shouldThumbBeDisabled(t);n.setAttribute("class",A("uc-thumb",{"uc-thumb--hidden":_,"uc-thumb--visible":!_}))}pe(this._frameGuides,{x:i.x-1*.5,y:i.y-1*.5,width:i.width+1,height:i.height+1})}}_createThumbs(){let i={};for(let e=0;e<3;e++)for(let t=0;t<3;t++){let s=`${["n","","s"][e]}${["w","","e"][t]}`,o=U("g");o.classList.add("uc-thumb"),o.setAttribute("with-effects","");let n=U("rect",{fill:"transparent"}),l=U("path",{stroke:"currentColor",fill:"none","stroke-width":3});o.appendChild(l),o.appendChild(n),i[s]={direction:s,pathNode:l,interactionNode:n,groupNode:o},n.addEventListener("pointerdown",this._handlePointerDown.bind(this,s))}return i}_createGuides(){let i=U("svg"),e=U("rect",{x:0,y:0,width:"100%",height:"100%",fill:"none",stroke:"currentColor","stroke-width":1,"stroke-opacity":.5});i.appendChild(e);for(let t=1;t<=2;t++){let s=U("line",{x1:`${Ue*t}%`,y1:"0%",x2:`${Ue*t}%`,y2:"100%",stroke:"currentColor","stroke-width":1,"stroke-opacity":.3});i.appendChild(s)}for(let t=1;t<=2;t++){let s=U("line",{x1:"0%",y1:`${Ue*t}%`,x2:"100%",y2:`${Ue*t}%`,stroke:"currentColor","stroke-width":1,"stroke-opacity":.3});i.appendChild(s)}return i.classList.add("uc-guides","uc-guides--semi-hidden"),i}_createFrame(){let i=this.ref["svg-el"],e=document.createDocumentFragment(),t=this._createGuides();e.appendChild(t);let s=this._createThumbs();for(let{groupNode:o}of Object.values(s))e.appendChild(o);i.appendChild(e),this._frameThumbs=s,this._frameGuides=t}_handlePointerDown(i,e){if(!this._frameThumbs)return;let t=this._frameThumbs[i];if(this._shouldThumbBeDisabled(i))return;let s=this.$["*cropBox"],{x:o,y:n}=this.ref["svg-el"].getBoundingClientRect(),l=e.x-o,a=e.y-n;this.$.dragging=!0,this._draggingThumb=t,this._dragStartPoint=[l,a],this._dragStartCrop={...s}}_handlePointerUp_(i){this._updateCursor(),this.$.dragging&&(i.stopPropagation(),i.preventDefault(),this.$.dragging=!1)}_handlePointerMove_(i){if(!this.$.dragging||!this._dragStartPoint||!this._draggingThumb)return;i.stopPropagation(),i.preventDefault();let e=this.ref["svg-el"],{x:t,y:s}=e.getBoundingClientRect(),o=i.x-t,n=i.y-s,l=o-this._dragStartPoint[0],a=n-this._dragStartPoint[1],{direction:c}=this._draggingThumb,u=this._calcCropBox(c,[l,a]);u&&(this.$["*cropBox"]=u)}_calcCropBox(i,e){var c,u;let[t,s]=e,o=this.$["*imageBox"],n=(c=this._dragStartCrop)!=null?c:this.$["*cropBox"],l=(u=this.$["*cropPresetList"])==null?void 0:u[0],a=l?l.width/l.height:void 0;if(i===""?n=Bi({rect:n,delta:[t,s],imageBox:o}):n=Vi({rect:n,delta:[t,s],direction:i,aspectRatio:a,imageBox:o}),!Object.values(n).every(h=>Number.isFinite(h)&&h>=0)){console.error("CropFrame is trying to create invalid rectangle",{payload:n});return}return Te(xe(n),this.$["*imageBox"])}_handleSvgPointerMove_(i){if(!this._frameThumbs)return;let e=Object.values(this._frameThumbs).find(t=>{if(this._shouldThumbBeDisabled(t.direction))return!1;let o=t.interactionNode.getBoundingClientRect(),n={x:o.x,y:o.y,width:o.width,height:o.height};return Hi(n,[i.x,i.y])});this._hoverThumb=e,this._updateCursor()}_updateCursor(){let i=this._hoverThumb;this.ref["svg-el"].style.cursor=i?ji(i.direction):"initial"}_render(){this._updateBackdrop(),this._updateFrame()}toggleThumbs(i){this._frameThumbs&&Object.values(this._frameThumbs).map(({groupNode:e})=>e).forEach(e=>{e.setAttribute("class",A("uc-thumb",{"uc-thumb--hidden":!i,"uc-thumb--visible":i}))})}initCallback(){super.initCallback(),this._createBackdrop(),this._createFrame(),this.sub("*imageBox",()=>{this._resizeBackdrop(),window.requestAnimationFrame(()=>{this._render()})}),this.sub("*cropBox",i=>{i&&(this._guidesHidden=i.height<=g||i.width<=g,window.requestAnimationFrame(()=>{this._render()}))}),this.sub("dragging",i=>{this._frameGuides&&this._frameGuides.setAttribute("class",A({"uc-guides--hidden":this._guidesHidden,"uc-guides--visible":!this._guidesHidden&&i,"uc-guides--semi-hidden":!this._guidesHidden&&!i}))}),this.ref["svg-el"].addEventListener("pointermove",this._handleSvgPointerMove,!0),document.addEventListener("pointermove",this._handlePointerMove,!0),document.addEventListener("pointerup",this._handlePointerUp,!0)}destroyCallback(){super.destroyCallback(),document.removeEventListener("pointermove",this._handlePointerMove),document.removeEventListener("pointerup",this._handlePointerUp)}};ht.template=w`<svg class="uc-svg" ref="svg-el" xmlns="http://www.w3.org/2000/svg"></svg>`;var J=class extends y{constructor(){super(...arguments);m(this,"init$",{...this.init$,active:!1,title:"",icon:"","on.click":null})}initCallback(){super.initCallback(),this._titleEl=this.ref["title-el"],this._iconEl=this.ref["icon-el"],this.sub("title",e=>{this._titleEl&&(this._titleEl.style.display=e?"block":"none")}),this.sub("active",e=>{this.className=A({"uc-active":e,"uc-not_active":!e})}),this.sub("on.click",e=>{this.onclick=e})}};J.template=w`<button type="button" role="option"><uc-icon bind="@name: icon;"></uc-icon><div class="uc-title" ref="title-el">{{title}}</div></button>`;function Br(r){let i=r+90;return i=i>=360?0:i,i}function Vr(r,i){return r==="rotate"?Br(i):["mirror","flip"].includes(r)?!i:null}var Fe=class extends J{initCallback(){super.initCallback(),this.defineAccessor("operation",i=>{i&&(this._operation=i,this.$.icon=i)}),this.$["on.click"]=()=>{let i=this.$["*cropperEl"].getValue(this._operation),e=Vr(this._operation,i);this.$["*cropperEl"].setValue(this._operation,e)}}};var ze={FILTER:"filter",COLOR_OPERATION:"color_operation"},K="original",ut=class extends y{constructor(){super(...arguments);m(this,"init$",{...this.init$,disabled:!1,min:0,max:100,value:0,defaultValue:0,zero:0,"on.input":e=>{this.$["*faderEl"].set(e),this.$.value=e}})}setOperation(e,t){this._controlType=e==="filter"?ze.FILTER:ze.COLOR_OPERATION,this._operation=e,this._iconName=e,this._title=e.toUpperCase(),this._filter=t,this._initializeValues(),this.$["*faderEl"].activate({url:this.$["*originalUrl"],operation:this._operation,value:this._filter===K?void 0:this.$.value,filter:this._filter===K?void 0:this._filter,fromViewer:!1})}_initializeValues(){let{range:e,zero:t}=B[this._operation],[s,o]=e;this.$.min=s,this.$.max=o,this.$.zero=t;let n=this.$["*editorTransformations"][this._operation];if(this._controlType===ze.FILTER){let l=o;if(n){let{name:a,amount:c}=n;l=a===this._filter?c:o}this.$.value=l,this.$.defaultValue=l}if(this._controlType===ze.COLOR_OPERATION){let l=typeof n!="undefined"?n:t;this.$.value=l,this.$.defaultValue=l}}apply(){let e;this._controlType===ze.FILTER?this._filter===K?e=null:e={name:this._filter,amount:this.$.value}:e=this.$.value;let t={...this.$["*editorTransformations"],[this._operation]:e};this.$["*editorTransformations"]=t}cancel(){this.$["*faderEl"].deactivate({hide:!1})}initCallback(){super.initCallback(),this.sub("*originalUrl",e=>{this._originalUrl=e}),this.sub("value",e=>{let t=`${this._filter||this._operation} ${e}`;this.$["*operationTooltip"]=t})}};ut.template=w`<uc-slider-ui ref="slider-el" bind="disabled: disabled; min: min; max: max; defaultValue: defaultValue; zero: zero; onInput: on.input;" ></uc-slider-ui>`;function Xe(r){let i=new Image;return{promise:new Promise((s,o)=>{i.src=r,i.onload=s,i.onerror=o}),image:i,cancel:()=>{i.naturalWidth===0&&(i.src=V)}}}function je(r){let i=[];for(let o of r){let n=Xe(o);i.push(n)}let e=i.map(o=>o.image);return{promise:Promise.allSettled(i.map(o=>o.promise)),images:e,cancel:()=>{i.forEach(o=>{o.cancel()})}}}var Ce=class extends J{constructor(){super(),this.init$={...this.init$,active:!1,title:"",icon:"",isOriginal:!1,"on.click":null}}_previewSrc(){let i=parseInt(window.getComputedStyle(this).getPropertyValue("--l-base-min-width"),10),e=window.devicePixelRatio,t=Math.ceil(e*i),s=e>=2?"lightest":"normal",o=100,n={...this.$["*editorTransformations"]};return n[this._operation]=this._filter!==K?{name:this._filter,amount:o}:void 0,Y(this._originalUrl,q(it,oe(n),`quality/${s}`,`scale_crop/${t}x${t}/center`))}async _observerCallback(i,e){var s;if(i[0].isIntersecting){let o=await this.proxyUrl(this._previewSrc()),n=this.ref["preview-el"],{promise:l,cancel:a}=Xe(o);this._cancelPreload=a,l.catch(c=>{this.$["*networkProblems"]=!0,console.error("Failed to load image",{error:c})}).finally(()=>{n.style.backgroundImage=`url(${o})`,n.setAttribute("loaded",""),e.unobserve(this)})}else(s=this._cancelPreload)==null||s.call(this)}initCallback(){super.initCallback(),this.$["on.click"]=()=>{this.$.active?this.$.isOriginal||(this.$["*sliderEl"].setOperation(this._operation,this._filter),this.$["*showSlider"]=!0):(this.$["*sliderEl"].setOperation(this._operation,this._filter),this.$["*sliderEl"].apply()),this.$["*currentFilter"]=this._filter},this.defineAccessor("filter",e=>{this._operation="filter",this._filter=e,this.$.isOriginal=e===K,this.$.icon=this.$.isOriginal?"original":"slider"}),this._observer=new window.IntersectionObserver(this._observerCallback.bind(this),{threshold:[0,1]});let i=this.$["*originalUrl"];this._originalUrl=i,this.$.isOriginal?this.ref["icon-el"].classList.add("uc-original-icon"):this._observer.observe(this),this.sub("*currentFilter",e=>{this.$.active=e&&e===this._filter}),this.sub("active",e=>{if(this.$.isOriginal)return;let t=this.ref["icon-el"];t.style.opacity=e?"1":"0";let s=this.ref["preview-el"];e?s.style.opacity="0":s.style.backgroundImage&&(s.style.opacity="1")}),this.sub("*networkProblems",async e=>{if(!e){let t=await this.proxyUrl(this._previewSrc()),s=this.ref["preview-el"];s.style.backgroundImage&&(s.style.backgroundImage="none",s.style.backgroundImage=`url(${t})`)}})}destroyCallback(){var i,e;super.destroyCallback(),(i=this._observer)==null||i.disconnect(),(e=this._cancelPreload)==null||e.call(this)}};Ce.template=w`<button type="button" role="option"><div class="uc-preview" ref="preview-el"></div><uc-icon ref="icon-el" bind="@name: icon;"></uc-icon></button>`;var Be=class extends J{constructor(){super(...arguments);m(this,"_operation","")}initCallback(){super.initCallback(),this.$["on.click"]=()=>{this.$["*sliderEl"].setOperation(this._operation),this.$["*showSlider"]=!0,this.$["*currentOperation"]=this._operation},this.defineAccessor("operation",e=>{e&&(this._operation=e,this.$.icon=e,this.bindL10n("title",()=>this.l10n(e)))}),this.sub("*editorTransformations",e=>{if(!this._operation)return;let{zero:t}=B[this._operation],s=e[this._operation],o=typeof s!="undefined"?s!==t:!1;this.$.active=o})}};var Wi=(r,i)=>{let e,t,s,o=(...n)=>{e?(clearTimeout(t),t=setTimeout(()=>{Date.now()-s>=i&&(r(...n),s=Date.now())},Math.max(i-(Date.now()-s),0))):(r(...n),s=Date.now(),e=!0)};return Object.defineProperty(o,"cancel",{configurable:!1,writable:!1,enumerable:!1,value:()=>{clearTimeout(t)}}),o};function qi(r,i){let e={};for(let t of i){let s=r[t];(r.hasOwnProperty(t)||s!==void 0)&&(e[t]=s)}return e}var Yi="blocks",Zi="1.2.0";function Se(r,i,e){let s=window.devicePixelRatio,o=Math.min(Math.ceil(i*s),3e3),n=s>=2?"lightest":"normal";return Y(r,q(it,oe(e),`quality/${n}`,`stretch/off/-/resize/${o}x`,`@clib/${Yi}/${Zi}/uc-cloud-image-editor/`))}function Hr(r){return r?[({dimensions:e,coords:t})=>[...e,...t].every(s=>Number.isInteger(s)&&Number.isFinite(s)),({dimensions:e,coords:t})=>e.every(s=>s>0)&&t.every(s=>s>=0)].every(e=>e(r)):!0}var dt=class extends y{constructor(){super();m(this,"ctxOwner",!0);this.init$={...this.init$,image:null,"*padding":20,"*operations":{rotate:0,mirror:!1,flip:!1},"*imageBox":{x:0,y:0,width:0,height:0},"*cropBox":{x:0,y:0,width:0,height:0}},this._commitDebounced=R(this._commit.bind(this),300),this._handleResizeThrottled=Wi(this._handleResize.bind(this),100),this._imageSize={width:0,height:0}}_handleResize(){!this.isConnected||!this._isActive||(this._initCanvas(),this._syncTransformations(),this._alignImage(),this._alignCrop(),this._draw())}_syncTransformations(){let e=this.$["*editorTransformations"],t=qi(e,Object.keys(this.$["*operations"])),s={...this.$["*operations"],...t};this.$["*operations"]=s}_initCanvas(){let e=this.ref["canvas-el"],t=e.getContext("2d"),s=this.offsetWidth,o=this.offsetHeight,n=window.devicePixelRatio;e.style.width=`${s}px`,e.style.height=`${o}px`,e.width=s*n,e.height=o*n,t==null||t.scale(n,n),this._canvas=e,this._ctx=t}_alignImage(){if(!this._isActive||!this.$.image)return;let e=this.$.image,t=this.$["*padding"],s=this.$["*operations"],{rotate:o}=s,n={width:this.offsetWidth,height:this.offsetHeight},l=Ee({width:e.naturalWidth,height:e.naturalHeight},o),a;if(l.width>n.width-t*2||l.height>n.height-t*2){let c=l.width/l.height,u=n.width/n.height;if(c>u){let h=n.width-t*2,f=h/c,_=0+t,b=t+(n.height-t*2)/2-f/2;a={x:_,y:b,width:h,height:f}}else{let h=n.height-t*2,f=h*c,_=t+(n.width-t*2)/2-f/2,b=0+t;a={x:_,y:b,width:f,height:h}}}else{let{width:c,height:u}=l,h=t+(n.width-t*2)/2-c/2,f=t+(n.height-t*2)/2-u/2;a={x:h,y:f,width:c,height:u}}this.$["*imageBox"]=xe(a)}_alignCrop(){var f;let e=this.$["*cropBox"],t=this.$["*imageBox"],s=this.$["*operations"],{rotate:o}=s,n=this.$["*editorTransformations"].crop,{width:l,x:a,y:c}=this.$["*imageBox"];if(n){let{dimensions:[_,b],coords:[E,I]}=n,{width:N}=Ee(this._imageSize,o),ae=l/N;e=Te(xe({x:a+E*ae,y:c+I*ae,width:_*ae,height:b*ae}),this.$["*imageBox"])}let u=(f=this.$["*cropPresetList"])==null?void 0:f[0],h=u?u.width/u.height:void 0;if(!Ki(e,t)||h&&!Gi(e,h)){let _=t.width/t.height,b=t.width,E=t.height;h&&(_>h?b=Math.min(t.height*h,t.width):E=Math.min(t.width/h,t.height)),e={x:t.x+t.width/2-b/2,y:t.y+t.height/2-E/2,width:b,height:E}}this.$["*cropBox"]=Te(xe(e),this.$["*imageBox"])}_drawImage(){let e=this._ctx;if(!e)return;let t=this.$.image,s=this.$["*imageBox"],o=this.$["*operations"],{mirror:n,flip:l,rotate:a}=o,c=Ee({width:s.width,height:s.height},a);e.save(),e.translate(s.x+s.width/2,s.y+s.height/2),e.rotate(a*Math.PI*-1/180),e.scale(n?-1:1,l?-1:1),e.drawImage(t,-c.width/2,-c.height/2,c.width,c.height),e.restore()}_draw(){if(!this._isActive||!this.$.image||!this._canvas||!this._ctx)return;let e=this._canvas;this._ctx.clearRect(0,0,e.width,e.height),this._drawImage()}_animateIn({fromViewer:e}){this.$.image&&(this.ref["frame-el"].toggleThumbs(!0),this._transitionToImage(),setTimeout(()=>{this.className=A({"uc-active_from_viewer":e,"uc-active_from_editor":!e,"uc-inactive_to_editor":!1})}))}_getCropDimensions(){let e=this.$["*cropBox"],t=this.$["*imageBox"],s=this.$["*operations"],{rotate:o}=s,{width:n,height:l}=t,{width:a,height:c}=Ee(this._imageSize,o),{width:u,height:h}=e,f=n/a,_=l/c;return[le(Math.round(u/f),1,a),le(Math.round(h/_),1,c)]}_getCropTransformation(){let e=this.$["*cropBox"],t=this.$["*imageBox"],s=this.$["*operations"],{rotate:o}=s,{width:n,height:l,x:a,y:c}=t,{width:u,height:h}=Ee(this._imageSize,o),{x:f,y:_}=e,b=n/u,E=l/h,I=this._getCropDimensions(),N={dimensions:I,coords:[le(Math.round((f-a)/b),0,u-I[0]),le(Math.round((_-c)/E),0,h-I[1])]};if(!Hr(N)){console.error("Cropper is trying to create invalid crop object",{payload:N});return}if(!(I[0]===u&&I[1]===h))return N}_commit(){if(!this.isConnected||!this._imageSize)return;let e=this.$["*operations"],{rotate:t,mirror:s,flip:o}=e,n=this._getCropTransformation(),a={...this.$["*editorTransformations"],crop:n,rotate:t,mirror:s,flip:o};this.$["*editorTransformations"]=a}setValue(e,t){this.$["*operations"]={...this.$["*operations"],[e]:t},this._isActive&&(this._alignImage(),this._alignCrop(),this._draw())}getValue(e){return this.$["*operations"][e]}async activate(e,{fromViewer:t}={}){if(!this._isActive){this._isActive=!0,this._imageSize=e,this.removeEventListener("transitionend",this._reset);try{this.$.image=await this._waitForImage(this.$["*originalUrl"],this.$["*editorTransformations"]),this._syncTransformations(),this._animateIn({fromViewer:t})}catch(s){console.error("Failed to activate cropper",{error:s})}this._observer=new ResizeObserver(([s])=>{s.contentRect.width>0&&s.contentRect.height>0&&this._isActive&&this.$.image&&this._handleResizeThrottled()}),this._observer.observe(this)}}deactivate({reset:e=!1}={}){var t;this._isActive&&(!e&&this._commit(),this._isActive=!1,this._transitionToCrop(),this.className=A({"uc-active_from_viewer":!1,"uc-active_from_editor":!1,"uc-inactive_to_editor":!0}),this.ref["frame-el"].toggleThumbs(!1),this.addEventListener("transitionend",this._reset,{once:!0}),(t=this._observer)==null||t.disconnect())}_transitionToCrop(){let e=this._getCropDimensions(),t=Math.min(this.offsetWidth,e[0])/this.$["*cropBox"].width,s=Math.min(this.offsetHeight,e[1])/this.$["*cropBox"].height,o=Math.min(t,s),n=this.$["*cropBox"].x+this.$["*cropBox"].width/2,l=this.$["*cropBox"].y+this.$["*cropBox"].height/2;this.style.transform=`scale(${o}) translate(${(this.offsetWidth/2-n)/o}px, ${(this.offsetHeight/2-l)/o}px)`,this.style.transformOrigin=`${n}px ${l}px`}_transitionToImage(){let e=this.$["*cropBox"].x+this.$["*cropBox"].width/2,t=this.$["*cropBox"].y+this.$["*cropBox"].height/2;this.style.transform="scale(1)",this.style.transformOrigin=`${e}px ${t}px`}_reset(){this._isActive||(this.$.image=null)}async _waitForImage(e,t){var u;let s=this.offsetWidth;t={...t,crop:void 0,rotate:void 0,flip:void 0,mirror:void 0};let o=await this.proxyUrl(Se(e,s,t)),{promise:n,cancel:l,image:a}=Xe(o),c=this._handleImageLoading(o);return a.addEventListener("load",c,{once:!0}),a.addEventListener("error",c,{once:!0}),(u=this._cancelPreload)==null||u.call(this),this._cancelPreload=l,n.then(()=>a).catch(h=>(console.error("Failed to load image",{error:h}),this.$["*networkProblems"]=!0,Promise.resolve(a)))}_handleImageLoading(e){let t="crop",s=this.$["*loadingOperations"];return s.get(t)||s.set(t,new Map),s.get(t).get(e)||(s.set(t,s.get(t).set(e,!0)),this.$["*loadingOperations"]=s),()=>{var o;(o=s==null?void 0:s.get(t))!=null&&o.has(e)&&(s.get(t).delete(e),this.$["*loadingOperations"]=s)}}initCallback(){super.initCallback(),this.sub("*imageBox",()=>{this._draw()}),this.sub("*cropBox",()=>{this.$.image&&this._commitDebounced()}),this.sub("*cropPresetList",()=>{this._alignCrop()}),setTimeout(()=>{this.sub("*networkProblems",e=>{e||this._isActive&&this.activate(this._imageSize,{fromViewer:!1})})},0)}destroyCallback(){var e;super.destroyCallback(),(e=this._observer)==null||e.disconnect()}};dt.template=w`<canvas class="uc-canvas" ref="canvas-el"></canvas><uc-crop-frame ref="frame-el"></uc-crop-frame>`;function zt(r,i,e){let t=Array(e);e--;for(let s=e;s>=0;s--)t[s]=Math.ceil((s*i+(e-s)*r)/e);return t}function Kr(r){return r.reduce((i,e,t)=>t<r.length-1?[...i,[e,r[t+1]]]:i,[])}function Gr(r,i,e){let t=Kr(r).find(([s,o])=>s<=i&&i<=o);return r.map(s=>{let o=Math.abs(t[0]-t[1]),n=Math.abs(i-t[0])/o;return t[0]===s?i>e?1:1-n:t[1]===s?i>=e?n:1:0})}function Wr(r,i){return r.map((e,t)=>e<i?r.length-t:t)}function Qi(r,i){let e=B[r].keypointsNumber,{range:t,zero:s}=B[r];return[...new Set([...zt(t[0],s,e+1),...zt(s,t[1],e+1),s,i])].sort((o,n)=>o-n)}var Xt=class extends y{constructor(){super(),this._isActive=!1,this._hidden=!0,this._addKeypointDebounced=R(this._addKeypoint.bind(this),600),this.classList.add("uc-inactive_to_cropper")}_handleImageLoading(i){let e=this._operation,t=this.$["*loadingOperations"];return t.get(e)||t.set(e,new Map),t.get(e).get(i)||(t.set(e,t.get(e).set(i,!0)),this.$["*loadingOperations"]=t),()=>{var s;(s=t==null?void 0:t.get(e))!=null&&s.has(i)&&(t.get(e).delete(i),this.$["*loadingOperations"]=t)}}_flush(){window.cancelAnimationFrame(this._raf),this._raf=window.requestAnimationFrame(()=>{for(let i of this._keypoints){let{image:e}=i;e&&(e.style.opacity=i.opacity.toString(),e.style.zIndex=i.zIndex.toString())}})}async _imageSrc({url:i=this._url,filter:e=this._filter,operation:t,value:s}={}){let o={...this._transformations};t&&(o[t]=e?{name:e,amount:s}:s);let n=this.offsetWidth;return await this.proxyUrl(Se(i,n,o))}async _constructKeypoint(i,e){return{src:await this._imageSrc({operation:i,value:e}),image:null,opacity:0,zIndex:0,value:e}}_isSame(i,e){return this._operation===i&&this._filter===e}async _addKeypoint(i,e,t){let s=()=>!this._isSame(i,e)||this._value!==t||!!this._keypoints.find(a=>a.value===t);if(s())return;let o=await this._constructKeypoint(i,t),n=new Image;n.src=o.src;let l=this._handleImageLoading(o.src);n.addEventListener("load",l,{once:!0}),n.addEventListener("error",l,{once:!0}),o.image=n,n.classList.add("uc-fader-image"),n.addEventListener("load",()=>{if(s())return;let a=this._keypoints,c=a.findIndex(h=>h.value>t),u=c<a.length?a[c].image:null;!this._container||u&&!this._container.contains(u)||(a.splice(c,0,o),this._container.insertBefore(n,u),this._update(i,t))},{once:!0}),n.addEventListener("error",()=>{this.$["*networkProblems"]=!0},{once:!0})}set(i){i=typeof i=="string"?parseInt(i,10):i,this._update(this._operation,i),this._addKeypointDebounced(this._operation,this._filter,i)}_update(i,e){this._operation=i,this._value=e;let{zero:t}=B[i],s=this._keypoints.map(l=>l.value),o=Gr(s,e,t),n=Wr(s,t);for(let[l,a]of Object.entries(this._keypoints))a.opacity=o[l],a.zIndex=n[l];this._flush()}_createPreviewImage(){let i=new Image;return i.classList.add("uc-fader-image","uc-fader-image--preview"),i.style.opacity="0",i}async _initNodes(){let i=document.createDocumentFragment();this._previewImage=this._previewImage||this._createPreviewImage(),!this.contains(this._previewImage)&&i.appendChild(this._previewImage);let e=document.createElement("div");i.appendChild(e);let t=this._keypoints.map(c=>c.src),{images:s,promise:o,cancel:n}=je(t);s.forEach(c=>{let u=this._handleImageLoading(c.src);c.addEventListener("load",u),c.addEventListener("error",u)}),this._cancelLastImages=()=>{n(),this._cancelLastImages=void 0};let l=this._operation,a=this._filter;await o,this._isActive&&this._isSame(l,a)&&(this._container&&this._container.remove(),this._container=e,this._keypoints.forEach((c,u)=>{let h=s[u];h.classList.add("uc-fader-image"),c.image=h,this._container.appendChild(h)}),this.appendChild(i),this._flush())}async setTransformations(i){if(this._transformations=i,this._previewImage){let e=await this._imageSrc(),t=this._handleImageLoading(e);this._previewImage.src=e,this._previewImage.addEventListener("load",t,{once:!0}),this._previewImage.addEventListener("error",t,{once:!0}),this._previewImage.style.opacity="1",this._previewImage.addEventListener("error",()=>{this.$["*networkProblems"]=!0},{once:!0})}}async preload({url:i,filter:e,operation:t,value:s}){this._cancelBatchPreload&&this._cancelBatchPreload();let o=Qi(t,s),n=await Promise.all(o.map(a=>this._imageSrc({url:i,filter:e,operation:t,value:a}))),{cancel:l}=je(n);this._cancelBatchPreload=l}_setOriginalSrc(i){let e=this._previewImage||this._createPreviewImage();if(!this.contains(e)&&this.appendChild(e),this._previewImage=e,e.src===i){e.style.opacity="1",e.style.transform="scale(1)",this.className=A({"uc-active_from_viewer":this._fromViewer,"uc-active_from_cropper":!this._fromViewer,"uc-inactive_to_cropper":!1});return}e.style.opacity="0";let t=this._handleImageLoading(i);e.addEventListener("error",t,{once:!0}),e.src=i,e.addEventListener("load",()=>{t(),e&&(e.style.opacity="1",e.style.transform="scale(1)",this.className=A({"uc-active_from_viewer":this._fromViewer,"uc-active_from_cropper":!this._fromViewer,"uc-inactive_to_cropper":!1}))},{once:!0}),e.addEventListener("error",()=>{this.$["*networkProblems"]=!0},{once:!0})}async activate({url:i,operation:e,value:t,filter:s,fromViewer:o}){if(this._isActive=!0,this._hidden=!1,this._url=i,this._operation=e||"initial",this._value=t,this._filter=s,this._fromViewer=o,typeof t!="number"&&!s){let l=await this._imageSrc({operation:e,value:t});this._setOriginalSrc(l),this._container&&this._container.remove();return}this._keypoints=await Promise.all(Qi(e,t).map(l=>this._constructKeypoint(e,l))),this._update(e,t),this._initNodes()}deactivate({hide:i=!0}={}){this._isActive=!1,this._cancelLastImages&&this._cancelLastImages(),this._cancelBatchPreload&&this._cancelBatchPreload(),i&&!this._hidden?(this._hidden=!0,this._previewImage&&(this._previewImage.style.transform="scale(1)"),this.className=A({"uc-active_from_viewer":!1,"uc-active_from_cropper":!1,"uc-inactive_to_cropper":!0}),this.addEventListener("transitionend",()=>{this._container&&this._container.remove()},{once:!0})):this._container&&this._container.remove()}};var qr=1,ft=class extends y{initCallback(){super.initCallback(),this.addEventListener("wheel",i=>{i.preventDefault();let{deltaY:e,deltaX:t}=i;Math.abs(t)>qr?this.scrollLeft+=t:this.scrollLeft+=e},{passive:!1}),this.addEventListener("scroll",()=>{},{passive:!0})}};ft.template=w`<slot></slot>`;function Yr(r){return`<uc-presence-toggle class="uc-tab-toggle" bind="visible: presence.tabToggle.${r}; styles: presence.tabToggleStyles;" ><uc-btn-ui theme="tab" ref="tab-toggle-${r}" data-id="${r}" icon="${r}" bind="onclick: on.clickTab; aria-role:tab_role; aria-controls:tab_${r}" ></uc-btn-ui></uc-presence-toggle>`}function Zr(r){return w`<uc-presence-toggle id="tab_${r}" class="uc-tab-content" bind="visible: presence.tabContent.${r}; styles: presence.tabContentStyles" ><uc-editor-scroller hidden-scrollbar><div class="uc-controls-list_align"><div role="listbox" aria-orientation="horizontal" class="uc-controls-list_inner" ref="controls-list-${r}" ></div></div></uc-editor-scroller></uc-presence-toggle>`}var pt=class extends y{constructor(){super();m(this,"_updateInfoTooltip",R(()=>{var n,l;let e=this.$["*editorTransformations"],t=this.$["*currentOperation"],s="",o=!1;if(this.$["*tabId"]===T.FILTERS)if(o=!0,this.$["*currentFilter"]&&((n=e==null?void 0:e.filter)==null?void 0:n.name)===this.$["*currentFilter"]){let a=((l=e==null?void 0:e.filter)==null?void 0:l.amount)||100;s=this.$["*currentFilter"]+" "+a}else s=this.l10n(K);else if(this.$["*tabId"]===T.TUNING&&t){o=!0;let a=(e==null?void 0:e[t])||B[t].zero;s=this.l10n(t)+" "+a}o&&(this.$["*operationTooltip"]=s),this.ref["tooltip-el"].classList.toggle("uc-info-tooltip_visible",o)},0));this.init$={...this.init$,"*sliderEl":null,"*loadingOperations":new Map,"*showSlider":!1,"*currentFilter":K,"*currentOperation":null,showLoader:!1,filters:fi,colorOperations:di,cropOperations:pi,"*operationTooltip":null,"presence.mainToolbar":!0,"presence.subToolbar":!1,"presence.tabToggles":!0,"presence.tabContent.crop":!1,"presence.tabContent.tuning":!1,"presence.tabContent.filters":!1,"presence.tabToggle.crop":!0,"presence.tabToggle.tuning":!0,"presence.tabToggle.filters":!0,"presence.subTopToolbarStyles":{hidden:"uc-sub-toolbar--top-hidden",visible:"uc-sub-toolbar--visible"},"presence.subBottomToolbarStyles":{hidden:"uc-sub-toolbar--bottom-hidden",visible:"uc-sub-toolbar--visible"},"presence.tabContentStyles":{hidden:"uc-tab-content--hidden",visible:"uc-tab-content--visible"},"presence.tabToggleStyles":{hidden:"uc-tab-toggle--hidden",visible:"uc-tab-toggle--visible"},"presence.tabTogglesStyles":{hidden:"uc-tab-toggles--hidden",visible:"uc-tab-toggles--visible"},"on.cancel":()=>{var e;(e=this._cancelPreload)==null||e.call(this),this.$["*on.cancel"]()},"on.apply":()=>{this.$["*on.apply"](this.$["*editorTransformations"])},"on.applySlider":()=>{this.ref["slider-el"].apply(),this._onSliderClose()},"on.cancelSlider":()=>{this.ref["slider-el"].cancel(),this._onSliderClose()},"on.clickTab":e=>{let t=e.currentTarget.getAttribute("data-id");t&&this._activateTab(t,{fromViewer:!1})},tab_role:"tab",[`tab_${T.TUNING}`]:`tab_${T.TUNING}`,[`tab_${T.CROP}`]:`tab_${T.CROP}`,[`tab_${T.FILTERS}`]:`tab_${T.FILTERS}`},this._debouncedShowLoader=R(this._showLoader.bind(this),500)}_onSliderClose(){this.$["*showSlider"]=!1,this.$["*tabId"]===T.TUNING&&this.ref["tooltip-el"].classList.toggle("uc-info-tooltip_visible",!1)}_createOperationControl(e){let t=new Be;return t.operation=e,t}_createFilterControl(e){let t=new Ce;return t.filter=e,t}_createToggleControl(e){let t=new Fe;return t.operation=e,t}_renderControlsList(e){let t=this.ref[`controls-list-${e}`],s=document.createDocumentFragment();e===T.CROP?this.$.cropOperations.forEach(o=>{let n=this._createToggleControl(o);s.appendChild(n)}):e===T.FILTERS?[K,...this.$.filters].forEach(o=>{let n=this._createFilterControl(o);s.appendChild(n)}):e===T.TUNING&&this.$.colorOperations.forEach(o=>{let n=this._createOperationControl(o);s.appendChild(n)}),[...s.children].forEach((o,n)=>{n===s.childNodes.length-1&&o.classList.add("uc-controls-list_last-item")}),t.innerHTML="",t.appendChild(s)}_activateTab(e,{fromViewer:t}){this.$["*tabId"]=e,e===T.CROP?(this.$["*faderEl"].deactivate(),this.$["*cropperEl"].activate(this.$["*imageSize"],{fromViewer:t})):(this.$["*faderEl"].activate({url:this.$["*originalUrl"],fromViewer:t}),this.$["*cropperEl"].deactivate());for(let s of L){let o=s===e,n=this.ref[`tab-toggle-${s}`];n.active=o,o?(this._renderControlsList(e),this._syncTabIndicator()):this._unmountTabControls(s),this.$[`presence.tabContent.${s}`]=o}}_unmountTabControls(e){let t=this.ref[`controls-list-${e}`];t&&(t.innerHTML="")}_syncTabIndicator(){let e=this.ref[`tab-toggle-${this.$["*tabId"]}`],t=this.ref["tabs-indicator"];t.style.transform=`translateX(${e.offsetLeft}px)`}async _preloadEditedImage(){var e;if(this.$["*imgContainerEl"]&&this.$["*originalUrl"]){let t=this.$["*imgContainerEl"].offsetWidth,s=await this.proxyUrl(Se(this.$["*originalUrl"],t,this.$["*editorTransformations"]));(e=this._cancelPreload)==null||e.call(this);let{cancel:o}=je([s]);this._cancelPreload=()=>{o(),this._cancelPreload=void 0}}}_showLoader(e){this.$.showLoader=e}initCallback(){super.initCallback(),this.$["*sliderEl"]=this.ref["slider-el"],this.sub("*imageSize",e=>{e&&setTimeout(()=>{this._activateTab(this.$["*tabId"],{fromViewer:!0})},0)}),this.sub("*editorTransformations",e=>{var s;let t=(s=e==null?void 0:e.filter)==null?void 0:s.name;this.$["*currentFilter"]!==t&&(this.$["*currentFilter"]=t!=null?t:null)}),this.sub("*currentFilter",()=>{this._updateInfoTooltip()}),this.sub("*currentOperation",()=>{this._updateInfoTooltip()}),this.sub("*tabId",()=>{this._updateInfoTooltip()}),this.sub("*originalUrl",()=>{this.$["*faderEl"]&&this.$["*faderEl"].deactivate()}),this.sub("*editorTransformations",e=>{this._preloadEditedImage(),this.$["*faderEl"]&&this.$["*faderEl"].setTransformations(e)}),this.sub("*loadingOperations",e=>{let t=!1;for(let[,s]of e.entries()){if(t)break;for(let[,o]of s.entries())if(o){t=!0;break}}this._debouncedShowLoader(t)}),this.sub("*showSlider",e=>{this.$["presence.subToolbar"]=e,this.$["presence.mainToolbar"]=!e}),this.sub("*tabList",e=>{this.$["presence.tabToggles"]=e.length>1;for(let t of L){this.$[`presence.tabToggle.${t}`]=e.includes(t);let s=this.ref[`tab-toggle-${t}`];s.style.gridColumn=e.indexOf(t)+1}e.includes(this.$["*tabId"])||this._activateTab(e[0],{fromViewer:!1})}),this._updateInfoTooltip()}};pt.template=w`<uc-line-loader-ui bind="active: showLoader"></uc-line-loader-ui><div class="uc-info-tooltip_container"><div class="uc-info-tooltip_wrapper"><div ref="tooltip-el" class="uc-info-tooltip uc-info-tooltip_hidden">{{*operationTooltip}}</div></div></div><div class="uc-toolbar-container"><uc-presence-toggle role="tablist" class="uc-sub-toolbar" bind="visible: presence.mainToolbar; styles: presence.subTopToolbarStyles" ><div class="uc-tab-content-row">${L.map(Zr).join("")}</div><div class="uc-controls-row"><uc-presence-toggle class="uc-tab-toggles" bind="visible: presence.tabToggles; styles: presence.tabTogglesStyles" ><div ref="tabs-indicator" class="uc-tab-toggles_indicator"></div> ${L.map(Yr).join("")} </uc-presence-toggle><uc-btn-ui style="order: -1" theme="secondary-icon" icon="closeMax" bind="onclick: on.cancel"></uc-btn-ui><uc-btn-ui theme="primary-icon" icon="done" bind="onclick: on.apply"></uc-btn-ui></div></uc-presence-toggle><uc-presence-toggle class="uc-sub-toolbar" bind="visible: presence.subToolbar; styles: presence.subBottomToolbarStyles" ><div class="uc-slider"><uc-editor-slider ref="slider-el"></uc-editor-slider></div><div class="uc-controls-row"><uc-btn-ui theme="secondary" bind="onclick: on.cancelSlider;" l10n="@text:cancel"></uc-btn-ui><uc-btn-ui theme="primary" bind="onclick: on.applySlider;" l10n="@text:apply"></uc-btn-ui></div></uc-presence-toggle></div>`;var Ve=class extends y{constructor(){super(),this._iconReversed=!1,this._iconSingle=!1,this._iconHidden=!1,this.init$={...this.init$,text:"",icon:"",iconCss:this._iconCss(),theme:null,"aria-role":"","aria-controls":""},this.defineAccessor("active",i=>{i?this.setAttribute("active",""):this.removeAttribute("active")})}_iconCss(){return A("uc-icon",{"uc-icon_left":!this._iconReversed,"uc-icon_right":this._iconReversed,"uc-icon_hidden":this._iconHidden,"uc-icon_single":this._iconSingle})}initCallback(){super.initCallback(),this.sub("icon",i=>{this._iconSingle=!this.$.text,this._iconHidden=!i,this.$.iconCss=this._iconCss()}),this.sub("theme",i=>{i!=="custom"&&(this.className=`uc-${i}`)}),this.sub("text",()=>{this._iconSingle=!1}),this.hasAttribute("theme")||this.setAttribute("theme","default"),this.defineAccessor("aria-role",i=>{this.$["aria-role"]=i||""}),this.defineAccessor("aria-controls",i=>{this.$["aria-controls"]=i||""})}set reverse(i){this.hasAttribute("reverse")?(this.style.flexDirection="row-reverse",this._iconReversed=!0):(this._iconReversed=!1,this.style.flexDirection=null)}};Ve.bindAttributes({text:"text",icon:"icon",reverse:"reverse",theme:"theme"});Ve.template=w`<button type="button" bind="@role:aria-role; @aria-controls: aria-controls"><uc-icon bind="className: iconCss; @name: icon; @hidden: !icon"></uc-icon><div class="uc-text">{{text}}</div></button>`;var mt=class extends y{constructor(){super(),this._active=!1,this._handleTransitionEndRight=()=>{let i=this.ref["line-el"];i.style.transition="initial",i.style.opacity="0",i.style.transform="translateX(-101%)",this._active&&this._start()}}initCallback(){super.initCallback(),this.defineAccessor("active",i=>{typeof i=="boolean"&&(i?this._start():this._stop())})}_start(){this._active=!0;let{width:i}=this.getBoundingClientRect(),e=this.ref["line-el"];e.style.transition="transform 1s",e.style.opacity="1",e.style.transform=`translateX(${i}px)`,e.addEventListener("transitionend",this._handleTransitionEndRight,{once:!0})}_stop(){this._active=!1}};mt.template=w`<div class="uc-inner"><div class="uc-line" ref="line-el"></div></div>`;var _t={transition:"uc-transition",visible:"uc-visible",hidden:"uc-hidden"},gt=class extends y{constructor(){super(),this._visible=!1,this._visibleStyle=_t.visible,this._hiddenStyle=_t.hidden,this._externalTransitions=!1,this.defineAccessor("styles",i=>{i&&(this._externalTransitions=!0,this._visibleStyle=i.visible,this._hiddenStyle=i.hidden)}),this.defineAccessor("visible",i=>{typeof i=="boolean"&&(this._visible=i,this._handleVisible())})}_handleVisible(){this.style.visibility=this._visible?"inherit":"hidden",Pi(this,{[_t.transition]:!this._externalTransitions,[this._visibleStyle]:this._visible,[this._hiddenStyle]:!this._visible}),this.setAttribute("aria-hidden",this._visible?"false":"true")}initCallback(){super.initCallback(),this.classList.toggle("uc-initial",!0),this._externalTransitions||this.classList.add(_t.transition),this._handleVisible(),setTimeout(()=>{this.classList.toggle("uc-initial",!1)},0)}};gt.template=w`<slot></slot>`;var bt=class extends y{constructor(){super();m(this,"init$",{...this.init$,disabled:!1,min:0,max:100,onInput:null,onChange:null,defaultValue:null,"on.sliderInput":()=>{let e=parseInt(this.ref["input-el"].value,10);this._updateValue(e),this.$.onInput&&this.$.onInput(e)},"on.sliderChange":()=>{let e=parseInt(this.ref["input-el"].value,10);this.$.onChange&&this.$.onChange(e)}});this.setAttribute("with-effects","")}initCallback(){super.initCallback(),this.defineAccessor("disabled",t=>{this.$.disabled=t}),this.defineAccessor("min",t=>{this.$.min=t}),this.defineAccessor("max",t=>{this.$.max=t}),this.defineAccessor("defaultValue",t=>{this.$.defaultValue=t,this.ref["input-el"].value=t,this._updateValue(t)}),this.defineAccessor("zero",t=>{this._zero=t}),this.defineAccessor("onInput",t=>{t&&(this.$.onInput=t)}),this.defineAccessor("onChange",t=>{t&&(this.$.onChange=t)}),this._updateSteps(),this._observer=new ResizeObserver(()=>{this._updateSteps();let t=parseInt(this.ref["input-el"].value,10);this._updateValue(t)}),this._observer.observe(this),this._thumbSize=parseInt(window.getComputedStyle(this).getPropertyValue("--l-thumb-size"),10),setTimeout(()=>{let t=parseInt(this.ref["input-el"].value,10);this._updateValue(t)},0),this.sub("disabled",t=>{let s=this.ref["input-el"];t?s.setAttribute("disabled","disabled"):s.removeAttribute("disabled")});let e=this.ref["input-el"];e.addEventListener("focus",()=>{this.style.setProperty("--color-effect","var(--hover-color-rgb)")}),e.addEventListener("blur",()=>{this.style.setProperty("--color-effect","var(--idle-color-rgb)")})}_updateValue(e){this._updateZeroDot(e);let{width:t}=this.getBoundingClientRect(),n=100/(this.$.max-this.$.min)*(e-this.$.min)*(t-this._thumbSize)/100;window.requestAnimationFrame(()=>{this.ref["thumb-el"].style.transform=`translateX(${n}px)`})}_updateZeroDot(e){if(!this._zeroDotEl)return;e===this._zero?this._zeroDotEl.style.opacity="0":this._zeroDotEl.style.opacity="0.2";let{width:t}=this.getBoundingClientRect(),n=100/(this.$.max-this.$.min)*(this._zero-this.$.min)*(t-this._thumbSize)/100;window.requestAnimationFrame(()=>{this._zeroDotEl.style.transform=`translateX(${n}px)`})}_updateSteps(){let t=this.ref["steps-el"],{width:s}=t.getBoundingClientRect(),o=Math.ceil(s/2),n=Math.ceil(o/15)-2;if(this._stepsCount===n)return;let l=document.createDocumentFragment(),a=document.createElement("div"),c=document.createElement("div");a.className="uc-minor-step",c.className="uc-border-step",l.appendChild(c);for(let h=0;h<n;h++)l.appendChild(a.cloneNode());l.appendChild(c.cloneNode());for(let h=0;h<n;h++)l.appendChild(a.cloneNode());l.appendChild(c.cloneNode());let u=document.createElement("div");u.className="uc-zero-dot",l.appendChild(u),this._zeroDotEl=u,t.innerHTML="",t.appendChild(l),this._stepsCount=n}destroyCallback(){var e;(e=this._observer)==null||e.disconnect()}};bt.template=w`<div class="uc-steps" ref="steps-el"></div><div ref="thumb-el" class="uc-thumb"></div><input class="uc-input" type="range" ref="input-el" bind="oninput: on.sliderInput; onchange: on.sliderChange; @min: min; @max: max; @value: defaultValue;" />`;var He=class He extends ne{initCallback(){var i;super.initCallback(),(i=this.a11y)==null||i.registerBlock(this)}};m(He,"styleAttrs",[...Gt(He,He,"styleAttrs"),"uc-wgt-common"]);var Ji=He;var Ke=class extends y{constructor(){super(),this.init$={...this.init$,name:"",href:""}}initCallback(){super.initCallback(),this.sub("name",i=>{if(!i)return;let e=`#uc-icon-${i}`;this.subConfigValue("iconHrefResolver",t=>{if(t){let s=t(i);e=s!=null?s:e}this.$.href=e})})}};Ke.template=w`<svg ref="svg" xmlns="http://www.w3.org/2000/svg"><use bind="@href: href;"></use></svg>`;Ke.bindAttributes({name:"name"});var Qr=["Symbiote","BaseComponent","UploaderBlock","ActivityBlock","Block","SolutionBlock"];function Jr(r){for(let i in r){if(Qr.includes(i))continue;let e=[...i].reduce((t,s)=>(s.toUpperCase()===s&&(s="-"+s.toLowerCase()),t+=s),"");e.startsWith("-")&&(e=e.replace("-","")),e.startsWith("uc-")||(e="uc-"+e),r[i].reg&&r[i].reg(e)}}var yt=r=>{var i;return(i=r.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))==null?void 0:i.map(e=>e.toLowerCase()).join("-")};var $=r=>String(r),X=r=>{let i=Number(r);if(Number.isNaN(i))throw new Error(`Invalid number: "${r}"`);return i},O=r=>{if(typeof r=="undefined"||r===null)return!1;if(typeof r=="boolean")return r;if(r==="true"||r==="")return!0;if(r==="false")return!1;throw new Error(`Invalid boolean: "${r}"`)},es=r=>r==="auto"?r:O(r),ts=r=>{let i=$(r);if(i!=="user"&&i!=="environment"&&i!=="")throw new Error(`Invalid "cameraCapture" value: "${i}"`);return i},is=r=>{if(typeof r=="object"&&!Array.isArray(r)||typeof r=="function")return r;throw new Error("Invalid metadata value. Must be an object or function.")},rs=r=>{if(typeof r=="object")return r;throw new Error("Invalid value. Must be an object.")},jt=r=>{if(typeof r=="function")return r;throw new Error("Invalid value. Must be a function.")},er=r=>{if(Array.isArray(r))return r;throw new Error("Must be an array.")},ss={pubkey:$,multiple:O,multipleMin:X,multipleMax:X,confirmUpload:O,imgOnly:O,accept:$,externalSourcesPreferredTypes:$,store:es,cameraMirror:O,cameraCapture:ts,sourceList:$,maxLocalFileSizeBytes:X,thumbSize:X,showEmptyList:O,useLocalImageEditor:O,useCloudImageEditor:O,cloudImageEditorTabs:$,removeCopyright:O,cropPreset:$,imageShrink:$,modalScrollLock:O,modalBackdropStrokes:O,sourceListWrap:O,remoteTabSessionKey:$,cdnCname:$,baseUrl:$,socialBaseUrl:$,secureSignature:$,secureExpire:$,secureDeliveryProxy:$,retryThrottledRequestMaxTimes:X,multipartMinFileSize:X,multipartChunkSize:X,maxConcurrentRequests:X,multipartMaxConcurrentRequests:X,multipartMaxAttempts:X,checkForUrlDuplicates:O,saveUrlForRecurrentUploads:O,groupOutput:O,userAgentIntegration:$,debug:O,localeName:$,metadata:is,secureUploadsExpireThreshold:X,localeDefinitionOverride:rs,secureUploadsSignatureResolver:jt,secureDeliveryProxyUrlResolver:jt,iconHrefResolver:jt,fileValidators:er,collectionValidators:er},tr=(r,i)=>{if(!(typeof i=="undefined"||i===null))try{return ss[r](i)}catch(e){return console.error(`Invalid value for config key "${r}".`,e),z[r]}};var Bt=[...new Set(["debug",...Object.keys(z)])],os=["metadata","localeDefinitionOverride","secureUploadsSignatureResolver","secureDeliveryProxyUrlResolver","iconHrefResolver","fileValidators","collectionValidators"],ns=r=>os.includes(r),Ae=Bt.filter(r=>!ns(r)),ls={...Object.fromEntries(Ae.map(r=>[yt(r),r])),...Object.fromEntries(Ae.map(r=>[r.toLowerCase(),r]))},as={...Object.fromEntries(Ae.map(r=>[yt(r),P(r)])),...Object.fromEntries(Ae.map(r=>[r.toLowerCase(),P(r)]))},ir=r=>"__"+r,Ge=class extends y{constructor(){super();m(this,"requireCtxName",!0);this.init$={...this.init$,...Object.fromEntries(Object.entries(z).map(([e,t])=>[P(e),t]))}}_flushValueToAttribute(e,t){if(Ae.includes(e)){let s=[...new Set([yt(e),e.toLowerCase()])];for(let o of s)typeof t=="undefined"||t===null?this.removeAttribute(o):this.getAttribute(o)!==t.toString()&&this.setAttribute(o,t.toString())}}_flushValueToState(e,t){this.$[P(e)]!==t&&(typeof t=="undefined"||t===null?this.$[P(e)]=z[e]:this.$[P(e)]=t)}_setValue(e,t){let s=this,o=tr(e,t),n=ir(e);s[n]!==o&&(this._assertSameValueDifferentReference(e,s[n],o),s[n]=o,this._flushValueToAttribute(e,o),this._flushValueToState(e,o),this.debugPrint(`[uc-config] "${e}"`,o))}_getValue(e){let t=this,s=ir(e);return t[s]}_assertSameValueDifferentReference(e,t,s){this.cfg.debug&&s!==t&&typeof s=="object"&&typeof t=="object"&&JSON.stringify(s)===JSON.stringify(t)&&(console.warn(`[uc-config] Option "${e}" value is the same as the previous one but the reference is different`),console.warn("[uc-config] You should avoid changing the reference of the object to prevent unnecessary calculations"),console.warn(`[uc-config] "${e}" previous value:`,t),console.warn(`[uc-config] "${e}" new value:`,s))}initCallback(){var t;super.initCallback();let e=this;for(let s of Ae)this.sub(P(s),o=>{this._setValue(s,o)},!1);for(let s of Bt){let o=(t=e[s])!=null?t:this.$[P(s)];o!==z[s]&&this._setValue(s,o),Object.defineProperty(this,s,{set:n=>{this._setValue(s,n)},get:()=>this._getValue(s)})}}attributeChangedCallback(e,t,s){if(t===s)return;let o=this,n=ls[e];o[n]=s}};Ge.bindAttributes(as);for(let r of Bt)Ge.prototype[r]=void 0;var cs=Ge;export{Ve as BtnUi,Ji as CloudImageEditor,ne as CloudImageEditorBlock,cs as Config,ht as CropFrame,Fe as EditorCropButtonControl,Ce as EditorFilterControl,dt as EditorImageCropper,Xt as EditorImageFader,Be as EditorOperationControl,ft as EditorScroller,ut as EditorSlider,pt as EditorToolbar,Ke as Icon,mt as LineLoaderUi,gt as PresenceToggle,bt as SliderUi,Jr as defineComponents};
|