(()=>{var Dg=Object.create;var Kn=Object.defineProperty,Ag=Object.defineProperties,jg=Object.getOwnPropertyDescriptor,Ig=Object.getOwnPropertyDescriptors,Mg=Object.getOwnPropertyNames,Ec=Object.getOwnPropertySymbols,Lg=Object.getPrototypeOf,Sc=Object.prototype.hasOwnProperty,Fg=Object.prototype.propertyIsEnumerable;var Cc=(e,t,r)=>t in e?Kn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,F=(e,t)=>{for(var r in t||(t={}))Sc.call(t,r)&&Cc(e,r,t[r]);if(Ec)for(var r of Ec(t))Fg.call(t,r)&&Cc(e,r,t[r]);return e},re=(e,t)=>Ag(e,Ig(t)),kc=e=>Kn(e,"__esModule",{value:!0});var qw=typeof require!="undefined"?require:e=>{throw new Error('Dynamic require of "'+e+'" is not supported')};var Y=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Rg=(e,t)=>{kc(e);for(var r in t)Kn(e,r,{get:t[r],enumerable:!0})},Ug=(e,t,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Mg(t))!Sc.call(e,n)&&n!=="default"&&Kn(e,n,{get:()=>t[n],enumerable:!(r=jg(t,n))||r.enumerable});return e},P=e=>Ug(kc(Kn(e!=null?Dg(Lg(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var Oc=Y((Tc,vi)=>{(function(){var e=this;(function(){(function(){this.Rails={linkClickSelector:"a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]",buttonClickSelector:{selector:"button[data-remote]:not([form]), button[data-confirm]:not([form])",exclude:"form button"},inputChangeSelector:"select[data-remote], input[data-remote], textarea[data-remote]",formSubmitSelector:"form:not([data-turbo=true])",formInputClickSelector:"form:not([data-turbo=true]) input[type=submit], form:not([data-turbo=true]) input[type=image], form:not([data-turbo=true]) button[type=submit], form:not([data-turbo=true]) button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])",formDisableSelector:"input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled",formEnableSelector:"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled",fileInputSelector:"input[name][type=file]:not([disabled])",linkDisableSelector:"a[data-disable-with], a[data-disable]",buttonDisableSelector:"button[data-remote][data-disable-with], button[data-remote][data-disable]"}}).call(this)}).call(e);var t=e.Rails;(function(){(function(){var r;r=null,t.loadCSPNonce=function(){var n;return r=(n=document.querySelector("meta[name=csp-nonce]"))!=null?n.content:void 0},t.cspNonce=function(){return r!=null?r:t.loadCSPNonce()}}).call(this),function(){var r,n;n=Element.prototype.matches||Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector,t.matches=function(o,i){return i.exclude!=null?n.call(o,i.selector)&&!n.call(o,i.exclude):n.call(o,i)},r="_ujsData",t.getData=function(o,i){var a;return(a=o[r])!=null?a[i]:void 0},t.setData=function(o,i,a){return o[r]==null&&(o[r]={}),o[r][i]=a},t.$=function(o){return Array.prototype.slice.call(document.querySelectorAll(o))}}.call(this),function(){var r,n,o;r=t.$,o=t.csrfToken=function(){var i;return i=document.querySelector("meta[name=csrf-token]"),i&&i.content},n=t.csrfParam=function(){var i;return i=document.querySelector("meta[name=csrf-param]"),i&&i.content},t.CSRFProtection=function(i){var a;if(a=o(),a!=null)return i.setRequestHeader("X-CSRF-Token",a)},t.refreshCSRFTokens=function(){var i,a;if(a=o(),i=n(),a!=null&&i!=null)return r('form input[name="'+i+'"]').forEach(function(l){return l.value=a})}}.call(this),function(){var r,n,o,i;o=t.matches,r=window.CustomEvent,typeof r!="function"&&(r=function(a,l){var s;return s=document.createEvent("CustomEvent"),s.initCustomEvent(a,l.bubbles,l.cancelable,l.detail),s},r.prototype=window.Event.prototype,i=r.prototype.preventDefault,r.prototype.preventDefault=function(){var a;return a=i.call(this),this.cancelable&&!this.defaultPrevented&&Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}}),a}),n=t.fire=function(a,l,s){var u;return u=new r(l,{bubbles:!0,cancelable:!0,detail:s}),a.dispatchEvent(u),!u.defaultPrevented},t.stopEverything=function(a){return n(a.target,"ujs:everythingStopped"),a.preventDefault(),a.stopPropagation(),a.stopImmediatePropagation()},t.delegate=function(a,l,s,u){return a.addEventListener(s,function(p){var m;for(m=p.target;!(!(m instanceof Element)||o(m,l));)m=m.parentNode;if(m instanceof Element&&u.call(m,p)===!1)return p.preventDefault(),p.stopPropagation()})}}.call(this),function(){var r,n,o,i,a,l,s;i=t.cspNonce,n=t.CSRFProtection,a=t.fire,r={"*":"*/*",text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript",script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},t.ajax=function(u){var p;if(u=l(u),p=o(u,function(){var m,h;return h=s((m=p.response)!=null?m:p.responseText,p.getResponseHeader("Content-Type")),Math.floor(p.status/100)===2?typeof u.success=="function"&&u.success(h,p.statusText,p):typeof u.error=="function"&&u.error(h,p.statusText,p),typeof u.complete=="function"?u.complete(p,p.statusText):void 0}),u.beforeSend!=null&&!u.beforeSend(p,u))return!1;if(p.readyState===XMLHttpRequest.OPENED)return p.send(u.data)},l=function(u){return u.url=u.url||location.href,u.type=u.type.toUpperCase(),u.type==="GET"&&u.data&&(u.url.indexOf("?")<0?u.url+="?"+u.data:u.url+="&"+u.data),r[u.dataType]==null&&(u.dataType="*"),u.accept=r[u.dataType],u.dataType!=="*"&&(u.accept+=", */*; q=0.01"),u},o=function(u,p){var m;return m=new XMLHttpRequest,m.open(u.type,u.url,!0),m.setRequestHeader("Accept",u.accept),typeof u.data=="string"&&m.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),u.crossDomain||(m.setRequestHeader("X-Requested-With","XMLHttpRequest"),n(m)),m.withCredentials=!!u.withCredentials,m.onreadystatechange=function(){if(m.readyState===XMLHttpRequest.DONE)return p(m)},m},s=function(u,p){var m,h;if(typeof u=="string"&&typeof p=="string"){if(p.match(/\bjson\b/))try{u=JSON.parse(u)}catch(w){}else if(p.match(/\b(?:java|ecma)script\b/))h=document.createElement("script"),h.setAttribute("nonce",i()),h.text=u,document.head.appendChild(h).parentNode.removeChild(h);else if(p.match(/\b(xml|html|svg)\b/)){m=new DOMParser,p=p.replace(/;.+/,"");try{u=m.parseFromString(u,p)}catch(w){}}}return u},t.href=function(u){return u.href},t.isCrossDomain=function(u){var p,m,h;m=document.createElement("a"),m.href=location.href,h=document.createElement("a");try{return h.href=u,!((!h.protocol||h.protocol===":")&&!h.host||m.protocol+"//"+m.host==h.protocol+"//"+h.host)}catch(w){return p=w,!0}}}.call(this),function(){var r,n;r=t.matches,n=function(o){return Array.prototype.slice.call(o)},t.serializeElement=function(o,i){var a,l;return a=[o],r(o,"form")&&(a=n(o.elements)),l=[],a.forEach(function(s){if(!(!s.name||s.disabled)&&!r(s,"fieldset[disabled] *")){if(r(s,"select"))return n(s.options).forEach(function(u){if(u.selected)return l.push({name:s.name,value:u.value})});if(s.checked||["radio","checkbox","submit"].indexOf(s.type)===-1)return l.push({name:s.name,value:s.value})}}),i&&l.push(i),l.map(function(s){return s.name!=null?encodeURIComponent(s.name)+"="+encodeURIComponent(s.value):s}).join("&")},t.formElements=function(o,i){return r(o,"form")?n(o.elements).filter(function(a){return r(a,i)}):n(o.querySelectorAll(i))}}.call(this),function(){var r,n,o;n=t.fire,o=t.stopEverything,t.handleConfirm=function(i){if(!r(this))return o(i)},t.confirm=function(i,a){return confirm(i)},r=function(i){var a,l,s;if(s=i.getAttribute("data-confirm"),!s)return!0;if(a=!1,n(i,"confirm")){try{a=t.confirm(s,i)}catch(u){}l=n(i,"confirm:complete",[a])}return a&&l}}.call(this),function(){var r,n,o,i,a,l,s,u,p,m,h,w;m=t.matches,u=t.getData,h=t.setData,w=t.stopEverything,s=t.formElements,t.handleDisabledElement=function(g){var x;if(x=this,x.disabled)return w(g)},t.enableElement=function(g){var x;if(g instanceof Event){if(p(g))return;x=g.target}else x=g;if(m(x,t.linkDisableSelector))return l(x);if(m(x,t.buttonDisableSelector)||m(x,t.formEnableSelector))return i(x);if(m(x,t.formSubmitSelector))return a(x)},t.disableElement=function(g){var x;if(x=g instanceof Event?g.target:g,m(x,t.linkDisableSelector))return o(x);if(m(x,t.buttonDisableSelector)||m(x,t.formDisableSelector))return r(x);if(m(x,t.formSubmitSelector))return n(x)},o=function(g){var x;if(!u(g,"ujs:disabled"))return x=g.getAttribute("data-disable-with"),x!=null&&(h(g,"ujs:enable-with",g.innerHTML),g.innerHTML=x),g.addEventListener("click",w),h(g,"ujs:disabled",!0)},l=function(g){var x;return x=u(g,"ujs:enable-with"),x!=null&&(g.innerHTML=x,h(g,"ujs:enable-with",null)),g.removeEventListener("click",w),h(g,"ujs:disabled",null)},n=function(g){return s(g,t.formDisableSelector).forEach(r)},r=function(g){var x;if(!u(g,"ujs:disabled"))return x=g.getAttribute("data-disable-with"),x!=null&&(m(g,"button")?(h(g,"ujs:enable-with",g.innerHTML),g.innerHTML=x):(h(g,"ujs:enable-with",g.value),g.value=x)),g.disabled=!0,h(g,"ujs:disabled",!0)},a=function(g){return s(g,t.formEnableSelector).forEach(i)},i=function(g){var x;return x=u(g,"ujs:enable-with"),x!=null&&(m(g,"button")?g.innerHTML=x:g.value=x,h(g,"ujs:enable-with",null)),g.disabled=!1,h(g,"ujs:disabled",null)},p=function(g){var x,d;return d=(x=g.detail)!=null?x[0]:void 0,(d!=null?d.getResponseHeader("X-Xhr-Redirect"):void 0)!=null}}.call(this),function(){var r;r=t.stopEverything,t.handleMethod=function(n){var o,i,a,l,s,u,p;if(u=this,p=u.getAttribute("data-method"),!!p)return s=t.href(u),i=t.csrfToken(),o=t.csrfParam(),a=document.createElement("form"),l="",o!=null&&i!=null&&!t.isCrossDomain(s)&&(l+=""),l+='',a.method="post",a.action=s,a.target=u.target,a.innerHTML=l,a.style.display="none",document.body.appendChild(a),a.querySelector('[type="submit"]').click(),r(n)}}.call(this),function(){var r,n,o,i,a,l,s,u,p,m=[].slice;l=t.matches,o=t.getData,u=t.setData,n=t.fire,p=t.stopEverything,r=t.ajax,i=t.isCrossDomain,s=t.serializeElement,a=function(h){var w;return w=h.getAttribute("data-remote"),w!=null&&w!=="false"},t.handleRemote=function(h){var w,g,x,d,f,c,v;return d=this,a(d)?n(d,"ajax:before")?(v=d.getAttribute("data-with-credentials"),x=d.getAttribute("data-type")||"script",l(d,t.formSubmitSelector)?(w=o(d,"ujs:submit-button"),f=o(d,"ujs:submit-button-formmethod")||d.method,c=o(d,"ujs:submit-button-formaction")||d.getAttribute("action")||location.href,f.toUpperCase()==="GET"&&(c=c.replace(/\?.*$/,"")),d.enctype==="multipart/form-data"?(g=new FormData(d),w!=null&&g.append(w.name,w.value)):g=s(d,w),u(d,"ujs:submit-button",null),u(d,"ujs:submit-button-formmethod",null),u(d,"ujs:submit-button-formaction",null)):l(d,t.buttonClickSelector)||l(d,t.inputChangeSelector)?(f=d.getAttribute("data-method"),c=d.getAttribute("data-url"),g=s(d,d.getAttribute("data-params"))):(f=d.getAttribute("data-method"),c=t.href(d),g=d.getAttribute("data-params")),r({type:f||"GET",url:c,data:g,dataType:x,beforeSend:function(y,I){return n(d,"ajax:beforeSend",[y,I])?n(d,"ajax:send",[y]):(n(d,"ajax:stopped"),!1)},success:function(){var y;return y=1<=arguments.length?m.call(arguments,0):[],n(d,"ajax:success",y)},error:function(){var y;return y=1<=arguments.length?m.call(arguments,0):[],n(d,"ajax:error",y)},complete:function(){var y;return y=1<=arguments.length?m.call(arguments,0):[],n(d,"ajax:complete",y)},crossDomain:i(c),withCredentials:v!=null&&v!=="false"}),p(h)):(n(d,"ajax:stopped"),!1):!0},t.formSubmitButtonClick=function(h){var w,g;if(w=this,g=w.form,!!g)return w.name&&u(g,"ujs:submit-button",{name:w.name,value:w.value}),u(g,"ujs:formnovalidate-button",w.formNoValidate),u(g,"ujs:submit-button-formaction",w.getAttribute("formaction")),u(g,"ujs:submit-button-formmethod",w.getAttribute("formmethod"))},t.preventInsignificantClick=function(h){var w,g,x,d,f,c;if(x=this,f=(x.getAttribute("data-method")||"GET").toUpperCase(),w=x.getAttribute("data-params"),d=h.metaKey||h.ctrlKey,g=d&&f==="GET"&&!w,c=h.button!=null&&h.button!==0,c||g)return h.stopImmediatePropagation()}}.call(this),function(){var r,n,o,i,a,l,s,u,p,m,h,w,g,x,d;if(l=t.fire,o=t.delegate,u=t.getData,r=t.$,d=t.refreshCSRFTokens,n=t.CSRFProtection,g=t.loadCSPNonce,a=t.enableElement,i=t.disableElement,m=t.handleDisabledElement,p=t.handleConfirm,x=t.preventInsignificantClick,w=t.handleRemote,s=t.formSubmitButtonClick,h=t.handleMethod,typeof jQuery!="undefined"&&jQuery!==null&&jQuery.ajax!=null){if(jQuery.rails)throw new Error("If you load both jquery_ujs and rails-ujs, use rails-ujs only.");jQuery.rails=t,jQuery.ajaxPrefilter(function(f,c,v){if(!f.crossDomain)return n(v)})}t.start=function(){if(window._rails_loaded)throw new Error("rails-ujs has already been loaded!");return window.addEventListener("pageshow",function(){return r(t.formEnableSelector).forEach(function(f){if(u(f,"ujs:disabled"))return a(f)}),r(t.linkDisableSelector).forEach(function(f){if(u(f,"ujs:disabled"))return a(f)})}),o(document,t.linkDisableSelector,"ajax:complete",a),o(document,t.linkDisableSelector,"ajax:stopped",a),o(document,t.buttonDisableSelector,"ajax:complete",a),o(document,t.buttonDisableSelector,"ajax:stopped",a),o(document,t.linkClickSelector,"click",x),o(document,t.linkClickSelector,"click",m),o(document,t.linkClickSelector,"click",p),o(document,t.linkClickSelector,"click",i),o(document,t.linkClickSelector,"click",w),o(document,t.linkClickSelector,"click",h),o(document,t.buttonClickSelector,"click",x),o(document,t.buttonClickSelector,"click",m),o(document,t.buttonClickSelector,"click",p),o(document,t.buttonClickSelector,"click",i),o(document,t.buttonClickSelector,"click",w),o(document,t.inputChangeSelector,"change",m),o(document,t.inputChangeSelector,"change",p),o(document,t.inputChangeSelector,"change",w),o(document,t.formSubmitSelector,"submit",m),o(document,t.formSubmitSelector,"submit",p),o(document,t.formSubmitSelector,"submit",w),o(document,t.formSubmitSelector,"submit",function(f){return setTimeout(function(){return i(f)},13)}),o(document,t.formSubmitSelector,"ajax:send",i),o(document,t.formSubmitSelector,"ajax:complete",a),o(document,t.formInputClickSelector,"click",x),o(document,t.formInputClickSelector,"click",m),o(document,t.formInputClickSelector,"click",p),o(document,t.formInputClickSelector,"click",s),document.addEventListener("DOMContentLoaded",d),document.addEventListener("DOMContentLoaded",g),window._rails_loaded=!0},window.Rails===t&&l(document,"rails:attachBindings")&&t.start()}.call(this)}).call(this),typeof vi=="object"&&vi.exports?vi.exports=t:typeof define=="function"&&define.amd&&define(t)}).call(Tc)});var Ei=Y((Lx,cf)=>{"use strict";var uf=Object.getOwnPropertySymbols,wv=Object.prototype.hasOwnProperty,xv=Object.prototype.propertyIsEnumerable;function bv(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function Ev(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(t).map(function(i){return t[i]});if(n.join("")!=="0123456789")return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(i){o[i]=i}),Object.keys(Object.assign({},o)).join("")==="abcdefghijklmnopqrst"}catch(i){return!1}}cf.exports=Ev()?Object.assign:function(e,t){for(var r,n=bv(e),o,i=1;i{"use strict";var Dl=Ei(),Wr=60103,ff=60106;G.Fragment=60107;G.StrictMode=60108;G.Profiler=60114;var df=60109,pf=60110,hf=60112;G.Suspense=60113;var mf=60115,gf=60116;typeof Symbol=="function"&&Symbol.for&&(Ze=Symbol.for,Wr=Ze("react.element"),ff=Ze("react.portal"),G.Fragment=Ze("react.fragment"),G.StrictMode=Ze("react.strict_mode"),G.Profiler=Ze("react.profiler"),df=Ze("react.provider"),pf=Ze("react.context"),hf=Ze("react.forward_ref"),G.Suspense=Ze("react.suspense"),mf=Ze("react.memo"),gf=Ze("react.lazy"));var Ze,vf=typeof Symbol=="function"&&Symbol.iterator;function Sv(e){return e===null||typeof e!="object"?null:(e=vf&&e[vf]||e["@@iterator"],typeof e=="function"?e:null)}function Xn(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r{"use strict";Of.exports=Tf()});var Nf=Y((Ux,_f)=>{"use strict";var _v="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";_f.exports=_v});var jf=Y((zx,Af)=>{"use strict";var Nv=Nf();function Pf(){}function Df(){}Df.resetWarningCache=Pf;Af.exports=function(){function e(n,o,i,a,l,s){if(s!==Nv){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Df,resetWarningCache:Pf};return r.PropTypes=r,r}});var J=Y((Wx,If)=>{If.exports=jf()();var Bx,Vx});var Bf=Y((sb,zf)=>{var Dv=typeof global=="object"&&global&&global.Object===Object&&global;zf.exports=Dv});var Wf=Y((ub,Vf)=>{var Av=Bf(),jv=typeof self=="object"&&self&&self.Object===Object&&self,Iv=Av||jv||Function("return this")();Vf.exports=Iv});var Ti=Y((cb,$f)=>{var Mv=Wf(),Lv=Mv.Symbol;$f.exports=Lv});var qf=Y((fb,Hf)=>{function Fv(e,t){for(var r=-1,n=e==null?0:e.length,o=Array(n);++r{var Rv=Array.isArray;Kf.exports=Rv});var Zf=Y((pb,Gf)=>{var Xf=Ti(),Qf=Object.prototype,Uv=Qf.hasOwnProperty,zv=Qf.toString,Jn=Xf?Xf.toStringTag:void 0;function Bv(e){var t=Uv.call(e,Jn),r=e[Jn];try{e[Jn]=void 0;var n=!0}catch(i){}var o=zv.call(e);return n&&(t?e[Jn]=r:delete e[Jn]),o}Gf.exports=Bv});var ed=Y((hb,Jf)=>{var Vv=Object.prototype,Wv=Vv.toString;function $v(e){return Wv.call(e)}Jf.exports=$v});var od=Y((mb,nd)=>{var td=Ti(),Hv=Zf(),qv=ed(),Kv="[object Null]",Yv="[object Undefined]",rd=td?td.toStringTag:void 0;function Xv(e){return e==null?e===void 0?Yv:Kv:rd&&rd in Object(e)?Hv(e):qv(e)}nd.exports=Xv});var ad=Y((gb,id)=>{function Qv(e){return e!=null&&typeof e=="object"}id.exports=Qv});var sd=Y((vb,ld)=>{var Gv=od(),Zv=ad(),Jv="[object Symbol]";function ey(e){return typeof e=="symbol"||Zv(e)&&Gv(e)==Jv}ld.exports=ey});var hd=Y((yb,pd)=>{var ud=Ti(),ty=qf(),ry=Yf(),ny=sd(),oy=1/0,cd=ud?ud.prototype:void 0,fd=cd?cd.toString:void 0;function dd(e){if(typeof e=="string")return e;if(ry(e))return ty(e,dd)+"";if(ny(e))return fd?fd.call(e):"";var t=e+"";return t=="0"&&1/e==-oy?"-0":t}pd.exports=dd});var gd=Y((wb,md)=>{var iy=hd();function ay(e){return e==null?"":iy(e)}md.exports=ay});var yd=Y((xb,vd)=>{var ly=gd(),sy=0;function uy(e){var t=++sy;return ly(e)+t}vd.exports=uy});var Sd=Y((no,Ul)=>{(function(t,r){typeof no=="object"&&typeof Ul=="object"?Ul.exports=r(H()):typeof define=="function"&&define.amd?define(["react"],r):typeof no=="object"?no.ReactCrop=r(H()):t.ReactCrop=r(t.React)})(typeof self!="undefined"?self:no,function(e){return function(t){var r={};function n(o){if(r[o])return r[o].exports;var i=r[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=r,n.d=function(o,i,a){n.o(o,i)||Object.defineProperty(o,i,{configurable:!1,enumerable:!0,get:a})},n.n=function(o){var i=o&&o.__esModule?function(){return o.default}:function(){return o};return n.d(i,"a",i),i},n.o=function(o,i){return Object.prototype.hasOwnProperty.call(o,i)},n.p="",n(n.s=2)}([function(t,r){var n=t.exports={},o,i;function a(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?o=setTimeout:o=a}catch(c){o=a}try{typeof clearTimeout=="function"?i=clearTimeout:i=l}catch(c){i=l}})();function s(c){if(o===setTimeout)return setTimeout(c,0);if((o===a||!o)&&setTimeout)return o=setTimeout,setTimeout(c,0);try{return o(c,0)}catch(v){try{return o.call(null,c,0)}catch(y){return o.call(this,c,0)}}}function u(c){if(i===clearTimeout)return clearTimeout(c);if((i===l||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(c);try{return i(c)}catch(v){try{return i.call(null,c)}catch(y){return i.call(this,c)}}}var p=[],m=!1,h,w=-1;function g(){!m||!h||(m=!1,h.length?p=h.concat(p):w=-1,p.length&&x())}function x(){if(!m){var c=s(g);m=!0;for(var v=p.length;v;){for(h=p,p=[];++w1)for(var y=1;y100&&(M.height=100-k.y,M.width=M.height*k.aspect/C),k.x+(M.width||k.width)>100&&(M.width=100-k.x,M.height=M.width/k.aspect*C),M}function R(k,C){return k&&k.aspect&&(!k.width&&k.height||k.width&&!k.height)?O(k,C.naturalWidth/C.naturalHeight):k}function T(k,C){if(!k||!C)return null;var M=Math.round(k.naturalWidth*(C.x/100)),b=Math.round(k.naturalHeight*(C.y/100)),E=Math.round(k.naturalWidth*(C.width/100)),Z=Math.round(k.naturalHeight*(C.height/100));return{x:M,y:b,width:v(E,0,k.naturalWidth-M),height:v(Z,0,k.naturalHeight-b)}}function D(k,C,M){var b=i({},C),E=!1;b.x+b.width>100?(b.width=C.width+(100-(C.x+C.width)),b.x=C.x+(100-(C.x+b.width)),E=!0):b.x<0&&(b.width=C.x+C.width,b.x=0,E=!0),E&&C.aspect&&(b.height=b.width/C.aspect*M,k.y>b.y&&(b.y=C.y+(C.height-b.height)));var Z=!1;return b.y+b.height>100?(b.height=C.height+(100-(C.y+C.height)),b.y=C.y+(100-(C.y+b.height)),Z=!0):b.y<0&&(b.height=C.y+C.height,b.y=0,Z=!0),Z&&C.aspect&&(b.width=b.height*C.aspect/M,b.x-1?(b.x=S.x,b.y=S.y,b.width=S.width,b.height=S.height):C.xOrds.indexOf(Z)>-1?(b.x=S.x,b.width=S.width):C.yOrds.indexOf(Z)>-1&&(b.y=S.y,b.height=S.height),E.lastYCrossover=E.yCrossOver,this.crossOverCheck(),b}},{key:"straightenYPath",value:function(b){var E=this.evData,Z=E.ord,fe=E.cropOffset,ve=E.cropStartWidth/100*this.imageRef.width,me=E.cropStartHeight/100*this.imageRef.height,q=void 0,S=void 0;return Z==="nw"||Z==="se"?(q=me/ve,S=fe.top-fe.left*q):(q=-me/ve,S=fe.top+(me-fe.left*q)),q*b+S}},{key:"createCropSelection",value:function(){var b=this,E=this.props.disabled,Z=this.getCropStyle();return l.default.createElement("div",{ref:function(ve){b.cropSelectRef=ve},style:Z,className:"ReactCrop__crop-selection",onMouseDown:this.onCropMouseTouchDown,onTouchStart:this.onCropMouseTouchDown,role:"presentation"},!E&&l.default.createElement("div",{className:"ReactCrop__drag-elements"},l.default.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),l.default.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),l.default.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),l.default.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),l.default.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw"}),l.default.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n"}),l.default.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne"}),l.default.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e"}),l.default.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se"}),l.default.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s"}),l.default.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw"}),l.default.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w"})))}},{key:"makeNewCrop",value:function(){return i({},C.defaultCrop,this.props.crop)}},{key:"crossOverCheck",value:function(){var b=this.evData;(!b.xCrossOver&&-Math.abs(b.cropStartWidth)-b.xDiffPc>=0||b.xCrossOver&&-Math.abs(b.cropStartWidth)-b.xDiffPc<=0)&&(b.xCrossOver=!b.xCrossOver),(!b.yCrossOver&&-Math.abs(b.cropStartHeight)-b.yDiffPc>=0||b.yCrossOver&&-Math.abs(b.cropStartHeight)-b.yDiffPc<=0)&&(b.yCrossOver=!b.yCrossOver);var E=b.xCrossOver!==b.startXCrossOver,Z=b.yCrossOver!==b.startYCrossOver;b.inversedXOrd=E?I(b.ord):!1,b.inversedYOrd=Z?I(b.ord):!1}},{key:"render",value:function(){var b=this,E=this.props,Z=E.children,fe=E.className,ve=E.crossorigin,me=E.crop,q=E.disabled,S=E.imageAlt,N=E.onImageError,U=E.src,W=E.style,z=E.imageStyle,B=this.state.cropIsActive,L=void 0;y(me)&&(L=this.createCropSelection());var A=["ReactCrop"];return B&&A.push("ReactCrop--active"),me&&(me.aspect&&A.push("ReactCrop--fixed-aspect"),B&&(!me.width||!me.height)&&A.push("ReactCrop--crop-invisible")),q&&A.push("ReactCrop--disabled"),fe&&A.push.apply(A,m(fe.split(" "))),l.default.createElement("div",{ref:function(K){b.componentRef=K},className:A.join(" "),style:W,onTouchStart:this.onComponentMouseTouchDown,onMouseDown:this.onComponentMouseTouchDown,role:"presentation",tabIndex:"1",onKeyDown:this.onComponentKeyDown},l.default.createElement("img",{ref:function(K){b.imageRef=K},crossOrigin:ve,className:"ReactCrop__image",style:z,src:U,onLoad:function(K){return b.onImageLoad(K.target)},onError:N,alt:S}),L,Z)}}]),C}(a.PureComponent);Q.xOrds=["e","w"],Q.yOrds=["n","s"],Q.xyOrds=["nw","ne","se","sw"],Q.arrowKey={left:37,up:38,right:39,down:40},Q.nudgeStep=.2,Q.defaultCrop={x:0,y:0,width:0,height:0},Q.propTypes={className:u.default.string,crossorigin:u.default.string,children:u.default.oneOfType([u.default.arrayOf(u.default.node),u.default.node]),crop:u.default.shape({aspect:u.default.number,x:u.default.number,y:u.default.number,width:u.default.number,height:u.default.number}),disabled:u.default.bool,imageAlt:u.default.string,imageStyle:u.default.shape({}),keepSelection:u.default.bool,minWidth:u.default.number,minHeight:u.default.number,maxWidth:u.default.number,maxHeight:u.default.number,onChange:u.default.func.isRequired,onImageError:u.default.func,onComplete:u.default.func,onImageLoaded:u.default.func,onDragStart:u.default.func,onDragEnd:u.default.func,src:u.default.string.isRequired,style:u.default.shape({})},Q.defaultProps={className:void 0,crop:void 0,crossorigin:void 0,disabled:!1,imageAlt:"",maxWidth:100,maxHeight:100,minWidth:0,minHeight:0,keepSelection:!1,onComplete:function(){},onImageError:function(){},onImageLoaded:function(){},onDragStart:function(){},onDragEnd:function(){},children:void 0,style:void 0,imageStyle:void 0},t.exports=Q,t.exports.getPixelCrop=T,t.exports.makeAspectCrop=O,t.exports.containCrop=D},function(t,r){t.exports=e},function(t,r,n){(function(o){if(o.env.NODE_ENV!=="production"){var i=typeof Symbol=="function"&&Symbol.for&&Symbol.for("react.element")||60103,a=function(s){return typeof s=="object"&&s!==null&&s.$$typeof===i},l=!0;t.exports=n(5)(a,l)}else t.exports=n(8)()}).call(r,n(0))},function(t,r,n){"use strict";(function(o){var i=n(6),a=n(1),l=n(7),s=function(){};o.env.NODE_ENV!=="production"&&(s=function(p){var m="Warning: "+p;typeof console!="undefined"&&console.error(m);try{throw new Error(m)}catch(h){}});function u(){return null}t.exports=function(p,m){var h=typeof Symbol=="function"&&Symbol.iterator,w="@@iterator";function g(S){var N=S&&(h&&S[h]||S[w]);if(typeof N=="function")return N}var x="<>",d={array:y("array"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:I(),arrayOf:O,element:R(),instanceOf:T,node:C(),objectOf:Q,oneOf:D,oneOfType:k,shape:M,exact:b};function f(S,N){return S===N?S!==0||1/S==1/N:S!==S&&N!==N}function c(S){this.message=S,this.stack=""}c.prototype=Error.prototype;function v(S){if(o.env.NODE_ENV!=="production")var N={},U=0;function W(B,L,A,X,K,te,hr){if(X=X||x,te=te||A,hr!==a){if(m){var qn=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw qn.name="Invariant Violation",qn}else if(o.env.NODE_ENV!=="production"&&typeof console!="undefined"){var bc=X+":"+A;!N[bc]&&U<3&&(s("You are manually calling a React.PropTypes validation function for the `"+te+"` prop on `"+X+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),N[bc]=!0,U++)}}return L[A]==null?B?L[A]===null?new c("The "+K+" `"+te+"` is marked as required "+("in `"+X+"`, but its value is `null`.")):new c("The "+K+" `"+te+"` is marked as required in "+("`"+X+"`, but its value is `undefined`.")):null:S(L,A,X,K,te)}var z=W.bind(null,!1);return z.isRequired=W.bind(null,!0),z}function y(S){function N(U,W,z,B,L,A){var X=U[W],K=fe(X);if(K!==S){var te=ve(X);return new c("Invalid "+B+" `"+L+"` of type "+("`"+te+"` supplied to `"+z+"`, expected ")+("`"+S+"`."))}return null}return v(N)}function I(){return v(u)}function O(S){function N(U,W,z,B,L){if(typeof S!="function")return new c("Property `"+L+"` of component `"+z+"` has invalid PropType notation inside arrayOf.");var A=U[W];if(!Array.isArray(A)){var X=fe(A);return new c("Invalid "+B+" `"+L+"` of type "+("`"+X+"` supplied to `"+z+"`, expected an array."))}for(var K=0;K{Cd.exports=Sd()});var Fd=Y(ee=>{"use strict";var hn,ho,sa,Kl;typeof performance=="object"&&typeof performance.now=="function"?(Ad=performance,ee.unstable_now=function(){return Ad.now()}):(Yl=Date,jd=Yl.now(),ee.unstable_now=function(){return Yl.now()-jd});var Ad,Yl,jd;typeof window=="undefined"||typeof MessageChannel!="function"?(mn=null,Xl=null,Ql=function(){if(mn!==null)try{var e=ee.unstable_now();mn(!0,e),mn=null}catch(t){throw setTimeout(Ql,0),t}},hn=function(e){mn!==null?setTimeout(hn,0,e):(mn=e,setTimeout(Ql,0))},ho=function(e,t){Xl=setTimeout(e,t)},sa=function(){clearTimeout(Xl)},ee.unstable_shouldYield=function(){return!1},Kl=ee.unstable_forceFrameRate=function(){}):(Id=window.setTimeout,Md=window.clearTimeout,typeof console!="undefined"&&(Ld=window.cancelAnimationFrame,typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof Ld!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")),mo=!1,go=null,ua=-1,Gl=5,Zl=0,ee.unstable_shouldYield=function(){return ee.unstable_now()>=Zl},Kl=function(){},ee.unstable_forceFrameRate=function(e){0>e||125>>1,o=e[n];if(o!==void 0&&0da(a,r))s!==void 0&&0>da(s,a)?(e[n]=s,e[l]=r,n=l):(e[n]=a,e[i]=r,n=i);else if(s!==void 0&&0>da(s,r))e[n]=s,e[l]=r,n=l;else break e}}return t}return null}function da(e,t){var r=e.sortIndex-t.sortIndex;return r!==0?r:e.id-t.id}var vt=[],Ht=[],Ey=1,tt=null,De=3,pa=!1,Er=!1,vo=!1;function ts(e){for(var t=ct(Ht);t!==null;){if(t.callback===null)fa(Ht);else if(t.startTime<=e)fa(Ht),t.sortIndex=t.expirationTime,es(vt,t);else break;t=ct(Ht)}}function rs(e){if(vo=!1,ts(e),!Er)if(ct(vt)!==null)Er=!0,hn(ns);else{var t=ct(Ht);t!==null&&ho(rs,t.startTime-e)}}function ns(e,t){Er=!1,vo&&(vo=!1,sa()),pa=!0;var r=De;try{for(ts(t),tt=ct(vt);tt!==null&&(!(tt.expirationTime>t)||e&&!ee.unstable_shouldYield());){var n=tt.callback;if(typeof n=="function"){tt.callback=null,De=tt.priorityLevel;var o=n(tt.expirationTime<=t);t=ee.unstable_now(),typeof o=="function"?tt.callback=o:tt===ct(vt)&&fa(vt),ts(t)}else fa(vt);tt=ct(vt)}if(tt!==null)var i=!0;else{var a=ct(Ht);a!==null&&ho(rs,a.startTime-t),i=!1}return i}finally{tt=null,De=r,pa=!1}}var Sy=Kl;ee.unstable_IdlePriority=5;ee.unstable_ImmediatePriority=1;ee.unstable_LowPriority=4;ee.unstable_NormalPriority=3;ee.unstable_Profiling=null;ee.unstable_UserBlockingPriority=2;ee.unstable_cancelCallback=function(e){e.callback=null};ee.unstable_continueExecution=function(){Er||pa||(Er=!0,hn(ns))};ee.unstable_getCurrentPriorityLevel=function(){return De};ee.unstable_getFirstCallbackNode=function(){return ct(vt)};ee.unstable_next=function(e){switch(De){case 1:case 2:case 3:var t=3;break;default:t=De}var r=De;De=t;try{return e()}finally{De=r}};ee.unstable_pauseExecution=function(){};ee.unstable_requestPaint=Sy;ee.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=De;De=e;try{return t()}finally{De=r}};ee.unstable_scheduleCallback=function(e,t,r){var n=ee.unstable_now();switch(typeof r=="object"&&r!==null?(r=r.delay,r=typeof r=="number"&&0n?(e.sortIndex=r,es(Ht,e),ct(vt)===null&&e===ct(Ht)&&(vo?sa():vo=!0,ho(rs,r-n))):(e.sortIndex=o,es(vt,e),Er||pa||(Er=!0,hn(ns))),e};ee.unstable_wrapCallback=function(e){var t=De;return function(){var r=De;De=t;try{return e.apply(this,arguments)}finally{De=r}}}});var Ud=Y((DS,Rd)=>{"use strict";Rd.exports=Fd()});var km=Y(lt=>{"use strict";var ha=H(),ce=Ei(),be=Ud();function _(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;rt}return!1}function Fe(e,t,r,n,o,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=o,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var ke={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ke[e]=new Fe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ke[t]=new Fe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ke[e]=new Fe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ke[e]=new Fe(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ke[e]=new Fe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ke[e]=new Fe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ke[e]=new Fe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ke[e]=new Fe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ke[e]=new Fe(e,5,!1,e.toLowerCase(),null,!1,!1)});var os=/[\-:]([a-z])/g;function is(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(os,is);ke[t]=new Fe(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(os,is);ke[t]=new Fe(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(os,is);ke[t]=new Fe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ke[e]=new Fe(e,1,!1,e.toLowerCase(),null,!1,!1)});ke.xlinkHref=new Fe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ke[e]=new Fe(e,1,!1,e.toLowerCase(),null,!0,!0)});function as(e,t,r,n){var o=ke.hasOwnProperty(t)?ke[t]:null,i=o!==null?o.type===0:n?!1:!(!(2l||o[a]!==i[l])return` `+o[a].replace(" at new "," at ");while(1<=a&&0<=l);break}}}finally{gs=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?So(e):""}function _y(e){switch(e.tag){case 5:return So(e.type);case 16:return So("Lazy");case 13:return So("Suspense");case 19:return So("SuspenseList");case 0:case 2:case 15:return e=ya(e.type,!1),e;case 11:return e=ya(e.type.render,!1),e;case 22:return e=ya(e.type._render,!1),e;case 1:return e=ya(e.type,!0),e;default:return""}}function vn(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case qt:return"Fragment";case kr:return"Portal";case xo:return"Profiler";case ls:return"StrictMode";case bo:return"Suspense";case ga:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case us:return(e.displayName||"Context")+".Consumer";case ss:return(e._context.displayName||"Context")+".Provider";case ma:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case va:return vn(e.type);case fs:return vn(e._render);case cs:t=e._payload,e=e._init;try{return vn(e(t))}catch(r){}}return null}function Kt(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function qd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ny(e){var t=qd(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r!="undefined"&&typeof r.get=="function"&&typeof r.set=="function"){var o=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){n=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function wa(e){e._valueTracker||(e._valueTracker=Ny(e))}function Kd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=qd(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function xa(e){if(e=e||(typeof document!="undefined"?document:void 0),typeof e=="undefined")return null;try{return e.activeElement||e.body}catch(t){return e.body}}function vs(e,t){var r=t.checked;return ce({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r!=null?r:e._wrapperState.initialChecked})}function Yd(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Kt(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Xd(e,t){t=t.checked,t!=null&&as(e,"checked",t,!1)}function ys(e,t){Xd(e,t);var r=Kt(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ws(e,t.type,r):t.hasOwnProperty("defaultValue")&&ws(e,t.type,Kt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Qd(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function ws(e,t,r){(t!=="number"||xa(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}function Py(e){var t="";return ha.Children.forEach(e,function(r){r!=null&&(t+=r)}),t}function xs(e,t){return e=ce({children:void 0},t),(t=Py(t.children))&&(e.children=t),e}function yn(e,t,r,n){if(e=e.options,t){t={};for(var o=0;o=r.length))throw Error(_(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Kt(r)}}function Zd(e,t){var r=Kt(t.value),n=Kt(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function Jd(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}var Es={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function ep(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ss(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?ep(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ba,tp=function(e){return typeof MSApp!="undefined"&&MSApp.execUnsafeLocalFunction?function(t,r,n,o){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,o)})}:e}(function(e,t){if(e.namespaceURI!==Es.svg||"innerHTML"in e)e.innerHTML=t;else{for(ba=ba||document.createElement("div"),ba.innerHTML=""+t.valueOf().toString()+"",t=ba.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Co(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var ko={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Dy=["Webkit","ms","Moz","O"];Object.keys(ko).forEach(function(e){Dy.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ko[t]=ko[e]})});function rp(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||ko.hasOwnProperty(e)&&ko[e]?(""+t).trim():t+"px"}function np(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,o=rp(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,o):e[r]=o}}var Ay=ce({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Cs(e,t){if(t){if(Ay[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(_(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(_(60));if(!(typeof t.dangerouslySetInnerHTML=="object"&&"__html"in t.dangerouslySetInnerHTML))throw Error(_(61))}if(t.style!=null&&typeof t.style!="object")throw Error(_(62))}}function ks(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function Ts(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Os=null,wn=null,xn=null;function op(e){if(e=Wo(e)){if(typeof Os!="function")throw Error(_(280));var t=e.stateNode;t&&(t=Va(t),Os(e.stateNode,e.type,t))}}function ip(e){wn?xn?xn.push(e):xn=[e]:wn=e}function ap(){if(wn){var e=wn,t=xn;if(xn=wn=null,op(e),t)for(e=0;en?0:1<r;r++)t.push(e);return t}function _a(e,t,r){e.pendingLanes|=t;var n=t-1;e.suspendedLanes&=n,e.pingedLanes&=n,e=e.eventTimes,t=31-Gt(t),e[t]=r}var Gt=Math.clz32?Math.clz32:Yy,qy=Math.log,Ky=Math.LN2;function Yy(e){return e===0?32:31-(qy(e)/Ky|0)|0}var Xy=be.unstable_UserBlockingPriority,Qy=be.unstable_runWithPriority,Na=!0;function Gy(e,t,r,n){Tr||Ns();var o=Bs,i=Tr;Tr=!0;try{lp(o,e,t,r,n)}finally{(Tr=i)||Ds()}}function Zy(e,t,r,n){Qy(Xy,Bs.bind(null,e,t,r,n))}function Bs(e,t,r,n){if(Na){var o;if((o=(t&4)==0)&&0=Lo),jp=String.fromCharCode(32),Ip=!1;function Mp(e,t){switch(e){case"keyup":return b0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Tn=!1;function S0(e,t){switch(e){case"compositionend":return Lp(t);case"keypress":return t.which!==32?null:(Ip=!0,jp);case"textInput":return e=t.data,e===jp&&Ip?null:e;default:return null}}function C0(e,t){if(Tn)return e==="compositionend"||!Xs&&Mp(e,t)?(e=Op(),Pa=Ws=Zt=null,Tn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Vp(r)}}function $p(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?$p(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Hp(){for(var e=window,t=xa();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch(n){r=!1}if(r)e=t.contentWindow;else break;t=xa(e.document)}return t}function Gs(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var I0=Pt&&"documentMode"in document&&11>=document.documentMode,On=null,Zs=null,zo=null,Js=!1;function qp(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Js||On==null||On!==xa(n)||(n=On,"selectionStart"in n&&Gs(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),zo&&Uo(zo,n)||(zo=n,n=Ra(Zs,"onSelect"),0An||(e.current=au[An],au[An]=null,An--)}function pe(e,t){An++,au[An]=e.current,e.current=t}var tr={},Ae=er(tr),$e=er(!1),Nr=tr;function jn(e,t){var r=e.type.contextTypes;if(!r)return tr;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in r)o[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function He(e){return e=e.childContextTypes,e!=null}function Wa(){ue($e),ue(Ae)}function lh(e,t,r){if(Ae.current!==tr)throw Error(_(168));pe(Ae,t),pe($e,r)}function sh(e,t,r){var n=e.stateNode;if(e=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var o in n)if(!(o in e))throw Error(_(108,vn(t)||"Unknown",o));return ce({},r,n)}function $a(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||tr,Nr=Ae.current,pe(Ae,e),pe($e,$e.current),!0}function uh(e,t,r){var n=e.stateNode;if(!n)throw Error(_(169));r?(e=sh(e,t,Nr),n.__reactInternalMemoizedMergedChildContext=e,ue($e),ue(Ae),pe(Ae,e)):ue($e),pe($e,r)}var lu=null,Pr=null,F0=be.unstable_runWithPriority,su=be.unstable_scheduleCallback,uu=be.unstable_cancelCallback,R0=be.unstable_shouldYield,ch=be.unstable_requestPaint,cu=be.unstable_now,U0=be.unstable_getCurrentPriorityLevel,Ha=be.unstable_ImmediatePriority,fh=be.unstable_UserBlockingPriority,dh=be.unstable_NormalPriority,ph=be.unstable_LowPriority,hh=be.unstable_IdlePriority,fu={},z0=ch!==void 0?ch:function(){},Dt=null,qa=null,du=!1,mh=cu(),je=1e4>mh?cu:function(){return cu()-mh};function In(){switch(U0()){case Ha:return 99;case fh:return 98;case dh:return 97;case ph:return 96;case hh:return 95;default:throw Error(_(332))}}function gh(e){switch(e){case 99:return Ha;case 98:return fh;case 97:return dh;case 96:return ph;case 95:return hh;default:throw Error(_(332))}}function Dr(e,t){return e=gh(e),F0(e,t)}function $o(e,t,r){return e=gh(e),su(e,t,r)}function wt(){if(qa!==null){var e=qa;qa=null,uu(e)}vh()}function vh(){if(!du&&Dt!==null){du=!0;var e=0;try{var t=Dt;Dr(99,function(){for(;eR?(T=O,O=null):T=O.sibling;var D=h(d,O,c[R],v);if(D===null){O===null&&(O=T);break}e&&O&&D.alternate===null&&t(d,O),f=i(D,f,R),I===null?y=D:I.sibling=D,I=D,O=T}if(R===c.length)return r(d,O),y;if(O===null){for(;RR?(T=O,O=null):T=O.sibling;var Q=h(d,O,D.value,v);if(Q===null){O===null&&(O=T);break}e&&O&&Q.alternate===null&&t(d,O),f=i(Q,f,R),I===null?y=Q:I.sibling=Q,I=Q,O=T}if(D.done)return r(d,O),y;if(O===null){for(;!D.done;R++,D=c.next())D=m(d,D.value,v),D!==null&&(f=i(D,f,R),I===null?y=D:I.sibling=D,I=D);return y}for(O=n(d,O);!D.done;R++,D=c.next())D=w(O,d,R,D.value,v),D!==null&&(e&&D.alternate!==null&&O.delete(D.key===null?R:D.key),f=i(D,f,R),I===null?y=D:I.sibling=D,I=D);return e&&O.forEach(function(k){return t(d,k)}),y}return function(d,f,c,v){var y=typeof c=="object"&&c!==null&&c.type===qt&&c.key===null;y&&(c=c.props.children);var I=typeof c=="object"&&c!==null;if(I)switch(c.$$typeof){case wo:e:{for(I=c.key,y=f;y!==null;){if(y.key===I){switch(y.tag){case 7:if(c.type===qt){r(d,y.sibling),f=o(y,c.props.children),f.return=d,d=f;break e}break;default:if(y.elementType===c.type){r(d,y.sibling),f=o(y,c.props),f.ref=qo(d,y,c),f.return=d,d=f;break e}}r(d,y);break}else t(d,y);y=y.sibling}c.type===qt?(f=$n(c.props.children,d.mode,v,c.key),f.return=d,d=f):(v=vl(c.type,c.key,c.props,null,d.mode,v),v.ref=qo(d,f,c),v.return=d,d=v)}return a(d);case kr:e:{for(y=c.key;f!==null;){if(f.key===y)if(f.tag===4&&f.stateNode.containerInfo===c.containerInfo&&f.stateNode.implementation===c.implementation){r(d,f.sibling),f=o(f,c.children||[]),f.return=d,d=f;break e}else{r(d,f);break}else t(d,f);f=f.sibling}f=Ju(c,d.mode,v),f.return=d,d=f}return a(d)}if(typeof c=="string"||typeof c=="number")return c=""+c,f!==null&&f.tag===6?(r(d,f.sibling),f=o(f,c),f.return=d,d=f):(r(d,f),f=Zu(c,d.mode,v),f.return=d,d=f),a(d);if(Za(c))return g(d,f,c,v);if(Eo(c))return x(d,f,c,v);if(I&&Ja(d,c),typeof c=="undefined"&&!y)switch(d.tag){case 1:case 22:case 0:case 11:case 15:throw Error(_(152,vn(d.type)||"Component"))}return r(d,f)}}var el=Th(!0),Oh=Th(!1),Ko={},xt=er(Ko),Yo=er(Ko),Xo=er(Ko);function Ar(e){if(e===Ko)throw Error(_(174));return e}function vu(e,t){switch(pe(Xo,t),pe(Yo,e),pe(xt,Ko),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ss(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ss(t,e)}ue(xt),pe(xt,t)}function Fn(){ue(xt),ue(Yo),ue(Xo)}function _h(e){Ar(Xo.current);var t=Ar(xt.current),r=Ss(t,e.type);t!==r&&(pe(Yo,e),pe(xt,r))}function yu(e){Yo.current===e&&(ue(xt),ue(Yo))}var he=er(0);function tl(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&64)!=0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var At=null,ir=null,bt=!1;function Nh(e,t){var r=at(5,null,null,0);r.elementType="DELETED",r.type="DELETED",r.stateNode=t,r.return=e,r.flags=8,e.lastEffect!==null?(e.lastEffect.nextEffect=r,e.lastEffect=r):e.firstEffect=e.lastEffect=r}function Ph(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,!0):!1;case 13:return!1;default:return!1}}function wu(e){if(bt){var t=ir;if(t){var r=t;if(!Ph(e,t)){if(t=Nn(r.nextSibling),!t||!Ph(e,t)){e.flags=e.flags&-1025|2,bt=!1,At=e;return}Nh(At,r)}At=e,ir=Nn(t.firstChild)}else e.flags=e.flags&-1025|2,bt=!1,At=e}}function Dh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;At=e}function rl(e){if(e!==At)return!1;if(!bt)return Dh(e),bt=!0,!1;var t=e.type;if(e.tag!==5||t!=="head"&&t!=="body"&&!nu(t,e.memoizedProps))for(t=ir;t;)Nh(e,t),t=Nn(t.nextSibling);if(Dh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(_(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){ir=Nn(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}ir=null}}else ir=At?Nn(e.stateNode.nextSibling):null;return!0}function xu(){ir=At=null,bt=!1}var Rn=[];function bu(){for(var e=0;ei))throw Error(_(301));i+=1,Te=Ie=null,t.updateQueue=null,Qo.current=H0,e=r(n,o)}while(Zo)}if(Qo.current=ll,t=Ie!==null&&Ie.next!==null,Go=0,Te=Ie=ge=null,nl=!1,t)throw Error(_(300));return e}function jr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Te===null?ge.memoizedState=Te=e:Te=Te.next=e,Te}function Ir(){if(Ie===null){var e=ge.alternate;e=e!==null?e.memoizedState:null}else e=Ie.next;var t=Te===null?ge.memoizedState:Te.next;if(t!==null)Te=t,Ie=e;else{if(e===null)throw Error(_(310));Ie=e,e={memoizedState:Ie.memoizedState,baseState:Ie.baseState,baseQueue:Ie.baseQueue,queue:Ie.queue,next:null},Te===null?ge.memoizedState=Te=e:Te=Te.next=e}return Te}function Et(e,t){return typeof t=="function"?t(e):t}function Jo(e){var t=Ir(),r=t.queue;if(r===null)throw Error(_(311));r.lastRenderedReducer=e;var n=Ie,o=n.baseQueue,i=r.pending;if(i!==null){if(o!==null){var a=o.next;o.next=i.next,i.next=a}n.baseQueue=o=i,r.pending=null}if(o!==null){o=o.next,n=n.baseState;var l=a=i=null,s=o;do{var u=s.lane;if((Go&u)===u)l!==null&&(l=l.next={lane:0,action:s.action,eagerReducer:s.eagerReducer,eagerState:s.eagerState,next:null}),n=s.eagerReducer===e?s.eagerState:e(n,s.action);else{var p={lane:u,action:s.action,eagerReducer:s.eagerReducer,eagerState:s.eagerState,next:null};l===null?(a=l=p,i=n):l=l.next=p,ge.lanes|=u,ni|=u}s=s.next}while(s!==null&&s!==o);l===null?i=n:l.next=a,rt(n,t.memoizedState)||(dt=!0),t.memoizedState=n,t.baseState=i,t.baseQueue=l,r.lastRenderedState=n}return[t.memoizedState,r.dispatch]}function ei(e){var t=Ir(),r=t.queue;if(r===null)throw Error(_(311));r.lastRenderedReducer=e;var n=r.dispatch,o=r.pending,i=t.memoizedState;if(o!==null){r.pending=null;var a=o=o.next;do i=e(i,a.action),a=a.next;while(a!==o);rt(i,t.memoizedState)||(dt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),r.lastRenderedState=i}return[i,n]}function Ah(e,t,r){var n=t._getVersion;n=n(t._source);var o=t._workInProgressVersionPrimary;if(o!==null?e=o===n:(e=e.mutableReadLanes,(e=(Go&e)===e)&&(t._workInProgressVersionPrimary=n,Rn.push(t))),e)return r(t._source);throw Rn.push(t),Error(_(350))}function jh(e,t,r,n){var o=Re;if(o===null)throw Error(_(349));var i=t._getVersion,a=i(t._source),l=Qo.current,s=l.useState(function(){return Ah(o,t,r)}),u=s[1],p=s[0];s=Te;var m=e.memoizedState,h=m.refs,w=h.getSnapshot,g=m.source;m=m.subscribe;var x=ge;return e.memoizedState={refs:h,source:t,subscribe:n},l.useEffect(function(){h.getSnapshot=r,h.setSnapshot=u;var d=i(t._source);if(!rt(a,d)){d=r(t._source),rt(p,d)||(u(d),d=lr(x),o.mutableReadLanes|=d&o.pendingLanes),d=o.mutableReadLanes,o.entangledLanes|=d;for(var f=o.entanglements,c=d;0r?98:r,function(){e(!0)}),Dr(97<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=a.createElement(r,{is:n.is}):(e=a.createElement(r),r==="select"&&(a=e,n.multiple?a.multiple=!0:n.size&&(a.size=n.size))):e=a.createElementNS(e,r),e[Jt]=t,e[Ba]=n,em(e,t,!1,!1),t.stateNode=e,a=ks(r,n),r){case"dialog":se("cancel",e),se("close",e),o=n;break;case"iframe":case"object":case"embed":se("load",e),o=n;break;case"video":case"audio":for(o=0;oWu&&(t.flags|=64,i=!0,ri(n,!1),t.lanes=33554432)}else{if(!i)if(e=tl(a),e!==null){if(t.flags|=64,i=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),ri(n,!0),n.tail===null&&n.tailMode==="hidden"&&!a.alternate&&!bt)return t=t.lastEffect=n.lastEffect,t!==null&&(t.nextEffect=null),null}else 2*je()-n.renderingStartTime>Wu&&r!==1073741824&&(t.flags|=64,i=!0,ri(n,!1),t.lanes=33554432);n.isBackwards?(a.sibling=t.child,t.child=a):(r=n.last,r!==null?r.sibling=a:t.child=a,n.last=a)}return n.tail!==null?(r=n.tail,n.rendering=r,n.tail=r.sibling,n.lastEffect=t.lastEffect,n.renderingStartTime=je(),r.sibling=null,t=he.current,pe(he,i?t&1|2:t&1),r):null;case 23:case 24:return Xu(),e!==null&&e.memoizedState!==null!=(t.memoizedState!==null)&&n.mode!=="unstable-defer-without-hiding"&&(t.flags|=4),null}throw Error(_(156,t.tag))}function Y0(e){switch(e.tag){case 1:He(e.type)&&Wa();var t=e.flags;return t&4096?(e.flags=t&-4097|64,e):null;case 3:if(Fn(),ue($e),ue(Ae),bu(),t=e.flags,(t&64)!=0)throw Error(_(285));return e.flags=t&-4097|64,e;case 5:return yu(e),null;case 13:return ue(he),t=e.flags,t&4096?(e.flags=t&-4097|64,e):null;case 19:return ue(he),null;case 4:return Fn(),null;case 10:return hu(e),null;case 23:case 24:return Xu(),null;default:return null}}function ju(e,t){try{var r="",n=t;do r+=_y(n),n=n.return;while(n);var o=r}catch(i){o=` Error generating stack: `+i.message+` `+i.stack}return{value:e,source:t,stack:o}}function Iu(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var X0=typeof WeakMap=="function"?WeakMap:Map;function nm(e,t,r){r=nr(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){fl||(fl=!0,$u=n),Iu(e,t)},r}function om(e,t,r){r=nr(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var o=t.value;r.payload=function(){return Iu(e,t),n(o)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){typeof n!="function"&&(St===null?St=new Set([this]):St.add(this),Iu(e,t));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),r}var Q0=typeof WeakSet=="function"?WeakSet:Set;function im(e){var t=e.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(r){cr(e,r)}else t.current=null}function G0(e,t){switch(t.tag){case 0:case 11:case 15:case 22:return;case 1:if(t.flags&256&&e!==null){var r=e.memoizedProps,n=e.memoizedState;e=t.stateNode,t=e.getSnapshotBeforeUpdate(t.elementType===t.type?r:ft(t.type,r),n),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:t.flags&256&&ou(t.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(_(163))}function Z0(e,t,r){switch(r.tag){case 0:case 11:case 15:case 22:if(t=r.updateQueue,t=t!==null?t.lastEffect:null,t!==null){e=t=t.next;do{if((e.tag&3)==3){var n=e.create;e.destroy=n()}e=e.next}while(e!==t)}if(t=r.updateQueue,t=t!==null?t.lastEffect:null,t!==null){e=t=t.next;do{var o=e;n=o.next,o=o.tag,(o&4)!=0&&(o&1)!=0&&(xm(r,e),aw(r,e)),e=n}while(e!==t)}return;case 1:e=r.stateNode,r.flags&4&&(t===null?e.componentDidMount():(n=r.elementType===r.type?t.memoizedProps:ft(r.type,t.memoizedProps),e.componentDidUpdate(n,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),t=r.updateQueue,t!==null&&bh(r,t,e);return;case 3:if(t=r.updateQueue,t!==null){if(e=null,r.child!==null)switch(r.child.tag){case 5:e=r.child.stateNode;break;case 1:e=r.child.stateNode}bh(r,t,e)}return;case 5:e=r.stateNode,t===null&&r.flags&4&&rh(r.type,r.memoizedProps)&&e.focus();return;case 6:return;case 4:return;case 12:return;case 13:r.memoizedState===null&&(r=r.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&wp(r))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(_(163))}function am(e,t){for(var r=e;;){if(r.tag===5){var n=r.stateNode;if(t)n=n.style,typeof n.setProperty=="function"?n.setProperty("display","none","important"):n.display="none";else{n=r.stateNode;var o=r.memoizedProps.style;o=o!=null&&o.hasOwnProperty("display")?o.display:null,n.style.display=rp("display",o)}}else if(r.tag===6)r.stateNode.nodeValue=t?"":r.memoizedProps;else if((r.tag!==23&&r.tag!==24||r.memoizedState===null||r===e)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}}function lm(e,t){if(Pr&&typeof Pr.onCommitFiberUnmount=="function")try{Pr.onCommitFiberUnmount(lu,t)}catch(i){}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(e=t.updateQueue,e!==null&&(e=e.lastEffect,e!==null)){var r=e=e.next;do{var n=r,o=n.destroy;if(n=n.tag,o!==void 0)if((n&4)!=0)xm(t,r);else{n=t;try{o()}catch(i){cr(n,i)}}r=r.next}while(r!==e)}break;case 1:if(im(t),e=t.stateNode,typeof e.componentWillUnmount=="function")try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(i){cr(t,i)}break;case 5:im(t);break;case 4:fm(e,t)}}function sm(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function um(e){return e.tag===5||e.tag===3||e.tag===4}function cm(e){e:{for(var t=e.return;t!==null;){if(um(t))break e;t=t.return}throw Error(_(160))}var r=t;switch(t=r.stateNode,r.tag){case 5:var n=!1;break;case 3:t=t.containerInfo,n=!0;break;case 4:t=t.containerInfo,n=!0;break;default:throw Error(_(161))}r.flags&16&&(Co(t,""),r.flags&=-17);e:t:for(r=e;;){for(;r.sibling===null;){if(r.return===null||um(r.return)){r=null;break e}r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue t;r.child.return=r,r=r.child}if(!(r.flags&2)){r=r.stateNode;break e}}n?Mu(e,r,t):Lu(e,r,t)}function Mu(e,t,r){var n=e.tag,o=n===5||n===6;if(o)e=o?e.stateNode:e.stateNode.instance,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Ua));else if(n!==4&&(e=e.child,e!==null))for(Mu(e,t,r),e=e.sibling;e!==null;)Mu(e,t,r),e=e.sibling}function Lu(e,t,r){var n=e.tag,o=n===5||n===6;if(o)e=o?e.stateNode:e.stateNode.instance,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Lu(e,t,r),e=e.sibling;e!==null;)Lu(e,t,r),e=e.sibling}function fm(e,t){for(var r=t,n=!1,o,i;;){if(!n){n=r.return;e:for(;;){if(n===null)throw Error(_(160));switch(o=n.stateNode,n.tag){case 5:i=!1;break e;case 3:o=o.containerInfo,i=!0;break e;case 4:o=o.containerInfo,i=!0;break e}n=n.return}n=!0}if(r.tag===5||r.tag===6){e:for(var a=e,l=r,s=l;;)if(lm(a,s),s.child!==null&&s.tag!==4)s.child.return=s,s=s.child;else{if(s===l)break e;for(;s.sibling===null;){if(s.return===null||s.return===l)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}i?(a=o,l=r.stateNode,a.nodeType===8?a.parentNode.removeChild(l):a.removeChild(l)):o.removeChild(r.stateNode)}else if(r.tag===4){if(r.child!==null){o=r.stateNode.containerInfo,i=!0,r.child.return=r,r=r.child;continue}}else if(lm(e,r),r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return,r.tag===4&&(n=!1)}r.sibling.return=r.return,r=r.sibling}}function Fu(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var n=r=r.next;do(n.tag&3)==3&&(e=n.destroy,n.destroy=void 0,e!==void 0&&e()),n=n.next;while(n!==r)}return;case 1:return;case 5:if(r=t.stateNode,r!=null){n=t.memoizedProps;var o=e!==null?e.memoizedProps:n;e=t.type;var i=t.updateQueue;if(t.updateQueue=null,i!==null){for(r[Ba]=n,e==="input"&&n.type==="radio"&&n.name!=null&&Xd(r,n),ks(e,o),t=ks(e,n),o=0;oo&&(o=a),r&=~i}if(r=o,r=je()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ew(r/1960))-r,10 component higher in the tree to provide a loading indicator or placeholder to display.`)}Oe!==5&&(Oe=2),s=ju(s,l),h=a;do{switch(h.tag){case 3:i=s,h.flags|=4096,t&=-t,h.lanes|=t;var I=nm(h,i,t);xh(h,I);break e;case 1:i=s;var O=h.type,R=h.stateNode;if((h.flags&64)==0&&(typeof O.getDerivedStateFromError=="function"||R!==null&&typeof R.componentDidCatch=="function"&&(St===null||!St.has(R)))){h.flags|=4096,t&=-t,h.lanes|=t;var T=om(h,i,t);xh(h,T);break e}}h=h.return}while(h!==null)}wm(r)}catch(D){t=D,xe===r&&r!==null&&(xe=r=r.return);continue}break}while(1)}function vm(){var e=ul.current;return ul.current=ll,e===null?ll:e}function si(e,t){var r=V;V|=16;var n=vm();Re===e&&Me===t||Wn(e,t);do try{rw();break}catch(o){gm(e,o)}while(1);if(pu(),V=r,ul.current=n,xe!==null)throw Error(_(261));return Re=null,Me=0,Oe}function rw(){for(;xe!==null;)ym(xe)}function nw(){for(;xe!==null&&!R0();)ym(xe)}function ym(e){var t=Em(e.alternate,e,Mr);e.memoizedProps=e.pendingProps,t===null?wm(e):xe=t,Ru.current=null}function wm(e){var t=e;do{var r=t.alternate;if(e=t.return,(t.flags&2048)==0){if(r=K0(r,t,Mr),r!==null){xe=r;return}if(r=t,r.tag!==24&&r.tag!==23||r.memoizedState===null||(Mr&1073741824)!=0||(r.mode&4)==0){for(var n=0,o=r.child;o!==null;)n|=o.lanes|o.childLanes,o=o.sibling;r.childLanes=n}e!==null&&(e.flags&2048)==0&&(e.firstEffect===null&&(e.firstEffect=t.firstEffect),t.lastEffect!==null&&(e.lastEffect!==null&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1a&&(l=a,a=I,I=l),l=Wp(c,I),i=Wp(c,a),l&&i&&(y.rangeCount!==1||y.anchorNode!==l.node||y.anchorOffset!==l.offset||y.focusNode!==i.node||y.focusOffset!==i.offset)&&(v=v.createRange(),v.setStart(l.node,l.offset),y.removeAllRanges(),I>a?(y.addRange(v),y.extend(i.node,i.offset)):(v.setEnd(i.node,i.offset),y.addRange(v)))))),v=[],y=c;y=y.parentNode;)y.nodeType===1&&v.push({element:y,left:y.scrollLeft,top:y.scrollTop});for(typeof c.focus=="function"&&c.focus(),c=0;cje()-Vu?Wn(e,0):zu|=r),it(e,t)}function uw(e,t){var r=e.stateNode;r!==null&&r.delete(t),t=0,t===0&&(t=e.mode,(t&2)==0?t=1:(t&4)==0?t=In()===99?1:2:(Mt===0&&(Mt=Un),t=Cn(62914560&~Mt),t===0&&(t=4194304))),r=Ge(),e=ml(e,t),e!==null&&(_a(e,t,r),it(e,r))}var Em;Em=function(e,t,r){var n=t.lanes;if(e!==null)if(e.memoizedProps!==t.pendingProps||$e.current)dt=!0;else if((r&n)!=0)dt=(e.flags&16384)!=0;else{switch(dt=!1,t.tag){case 3:Kh(t),xu();break;case 5:_h(t);break;case 1:He(t.type)&&$a(t);break;case 4:vu(t,t.stateNode.containerInfo);break;case 10:n=t.memoizedProps.value;var o=t.type._context;pe(Ka,o._currentValue),o._currentValue=n;break;case 13:if(t.memoizedState!==null)return(r&t.child.childLanes)!=0?Yh(e,t,r):(pe(he,he.current&1),t=jt(e,t,r),t!==null?t.sibling:null);pe(he,he.current&1);break;case 19:if(n=(r&t.childLanes)!=0,(e.flags&64)!=0){if(n)return Jh(e,t,r);t.flags|=64}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),pe(he,he.current),n)break;return null;case 23:case 24:return t.lanes=0,_u(e,t,r)}return jt(e,t,r)}else dt=!1;switch(t.lanes=0,t.tag){case 2:if(n=t.type,e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,o=jn(t,Ae.current),Ln(t,r),o=Su(null,t,n,e,o,r),t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,He(n)){var i=!0;$a(t)}else i=!1;t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,mu(t);var a=n.getDerivedStateFromProps;typeof a=="function"&&Qa(t,n,a,e),o.updater=Ga,t.stateNode=o,o._reactInternals=t,gu(t,n,e,r),t=Pu(null,t,n,!0,i,r)}else t.tag=0,Ke(null,t,o,r),t=t.child;return t;case 16:o=t.elementType;e:{switch(e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=o._init,o=i(o._payload),t.type=o,i=t.tag=fw(o),e=ft(o,e),i){case 0:t=Nu(null,t,o,e,r);break e;case 1:t=qh(null,t,o,e,r);break e;case 11:t=Vh(null,t,o,e,r);break e;case 14:t=Wh(null,t,o,ft(o.type,e),n,r);break e}throw Error(_(306,o,""))}return t;case 0:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:ft(n,o),Nu(e,t,n,o,r);case 1:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:ft(n,o),qh(e,t,n,o,r);case 3:if(Kh(t),n=t.updateQueue,e===null||n===null)throw Error(_(282));if(n=t.pendingProps,o=t.memoizedState,o=o!==null?o.element:null,wh(e,t),Ho(t,n,null,r),n=t.memoizedState.element,n===o)xu(),t=jt(e,t,r);else{if(o=t.stateNode,(i=o.hydrate)&&(ir=Nn(t.stateNode.containerInfo.firstChild),At=t,i=bt=!0),i){if(e=o.mutableSourceEagerHydrationData,e!=null)for(o=0;o{"use strict";function Tm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Tm)}catch(e){console.error(e)}}Tm(),Om.exports=km()});var ng=Y(Hn=>{"use strict";var pt=Ei(),Lt=H();function de(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;rhi;hi++)Ne[hi]=hi+1;var Ne,hi;Ne[15]=0;var xw=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Bm=Object.prototype.hasOwnProperty,Vm={},Wm={};function $m(e){return Bm.call(Wm,e)?!0:Bm.call(Vm,e)?!1:xw.test(e)?Wm[e]=!0:(Vm[e]=!0,!1)}function bw(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Ew(e,t,r,n){if(t===null||typeof t=="undefined"||bw(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ue(e,t,r,n,o,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=o,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var Pe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Pe[e]=new Ue(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Pe[t]=new Ue(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Pe[e]=new Ue(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Pe[e]=new Ue(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Pe[e]=new Ue(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Pe[e]=new Ue(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Pe[e]=new Ue(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Pe[e]=new Ue(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Pe[e]=new Ue(e,5,!1,e.toLowerCase(),null,!1,!1)});var pc=/[\-:]([a-z])/g;function hc(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(pc,hc);Pe[t]=new Ue(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(pc,hc);Pe[t]=new Ue(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(pc,hc);Pe[t]=new Ue(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Pe[e]=new Ue(e,1,!1,e.toLowerCase(),null,!1,!1)});Pe.xlinkHref=new Ue("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Pe[e]=new Ue(e,1,!1,e.toLowerCase(),null,!0,!0)});var Sw=/["'&<>]/;function Fr(e){if(typeof e=="boolean"||typeof e=="number")return""+e;e=""+e;var t=Sw.exec(e);if(t){var r="",n,o=0;for(n=t.index;nkl))throw Error(de(301));if(e===Ct)if(Cl=!0,e={action:r,next:null},dr===null&&(dr=new Map),r=dr.get(t),r===void 0)dr.set(t,e);else{for(t=r;t.next!==null;)t=t.next;t.next=e}}function gc(){}var Ur=null,_w={readContext:function(e){var t=Ur.threadID;return pi(e,t),e[t]},useContext:function(e){Rr();var t=Ur.threadID;return pi(e,t),e[t]},useMemo:Qm,useReducer:Xm,useRef:function(e){Ct=Rr(),le=mc();var t=le.memoizedState;return t===null?(e={current:e},le.memoizedState=e):t},useState:function(e){return Xm(Ym,e)},useLayoutEffect:function(){},useCallback:function(e,t){return Qm(function(){return e},t)},useImperativeHandle:gc,useEffect:gc,useDebugValue:gc,useDeferredValue:function(e){return Rr(),e},useTransition:function(){return Rr(),[function(e){e()},!1]},useOpaqueIdentifier:function(){return(Ur.identifierPrefix||"")+"R:"+(Ur.uniqueID++).toString(36)},useMutableSource:function(e,t){return Rr(),t(e._source)}},Gm={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function Zm(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}var Jm={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},Nw=pt({menuitem:!0},Jm),gi={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Pw=["Webkit","ms","Moz","O"];Object.keys(gi).forEach(function(e){Pw.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),gi[t]=gi[e]})});var Dw=/([A-Z])/g,Aw=/^ms-/,pr=Lt.Children.toArray,vc=yw.ReactCurrentDispatcher,jw={listing:!0,pre:!0,textarea:!0},Iw=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,eg={},yc={};function Mw(e){if(e==null)return e;var t="";return Lt.Children.forEach(e,function(r){r!=null&&(t+=r)}),t}var Lw=Object.prototype.hasOwnProperty,Fw={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null};function tg(e,t){if(e===void 0)throw Error(de(152,di(t)||"Component"))}function Rw(e,t,r){function n(a,l){var s=l.prototype&&l.prototype.isReactComponent,u=ww(l,t,r,s),p=[],m=!1,h={isMounted:function(){return!1},enqueueForceUpdate:function(){if(p===null)return null},enqueueReplaceState:function(v,y){m=!0,p=[y]},enqueueSetState:function(v,y){if(p===null)return null;p.push(y)}};if(s){if(s=new l(a.props,u,h),typeof l.getDerivedStateFromProps=="function"){var w=l.getDerivedStateFromProps.call(null,a.props,s.state);w!=null&&(s.state=pt({},s.state,w))}}else if(Ct={},s=l(a.props,u,h),s=qm(l,a.props,s,u),s==null||s.render==null){e=s,tg(e,l);return}if(s.props=a.props,s.context=u,s.updater=h,h=s.state,h===void 0&&(s.state=h=null),typeof s.UNSAFE_componentWillMount=="function"||typeof s.componentWillMount=="function")if(typeof s.componentWillMount=="function"&&typeof l.getDerivedStateFromProps!="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&typeof l.getDerivedStateFromProps!="function"&&s.UNSAFE_componentWillMount(),p.length){h=p;var g=m;if(p=null,m=!1,g&&h.length===1)s.state=h[0];else{w=g?h[0]:s.state;var x=!0;for(g=g?1:0;g=l))throw Error(de(304));var s=new Uint16Array(l);for(s.set(a),Ne=s,Ne[0]=i+1,a=i;a=s.children.length){var u=s.footer;if(u!==""&&(this.previousWasTextNode=!1),this.stack.pop(),s.type==="select")this.currentSelectValue=null;else if(s.type!=null&&s.type.type!=null&&s.type.type.$$typeof===bl)this.popProvider(s.type);else if(s.type===El){this.suspenseDepth--;var p=i.pop();if(a){a=!1;var m=s.fallbackFrame;if(!m)throw Error(de(303));this.stack.push(m),i[this.suspenseDepth]+="";continue}else i[this.suspenseDepth]+=p}i[this.suspenseDepth]+=u}else{var h=s.children[s.childIndex++],w="";try{w+=this.render(h,s.context,s.domNamespace)}catch(g){throw g!=null&&typeof g.then=="function"?Error(de(294)):g}finally{}i.length<=this.suspenseDepth&&i.push(""),i[this.suspenseDepth]+=w}}return i[0]}finally{vc.current=o,Ur=n,Km()}},t.render=function(r,n,o){if(typeof r=="string"||typeof r=="number")return o=""+r,o===""?"":this.makeStaticMarkup?Fr(o):this.previousWasTextNode?""+Fr(o):(this.previousWasTextNode=!0,Fr(o));if(n=Rw(r,n,this.threadID),r=n.child,n=n.context,r===null||r===!1)return"";if(!Lt.isValidElement(r)){if(r!=null&&r.$$typeof!=null)throw o=r.$$typeof,Error(o===ic?de(257):de(258,o.toString()));return r=pr(r),this.stack.push({type:null,domNamespace:o,children:r,childIndex:0,context:n,footer:""}),""}var i=r.type;if(typeof i=="string")return this.renderDOM(r,n,o);switch(i){case Um:case Rm:case ac:case lc:case cc:case xl:return r=pr(r.props.children),this.stack.push({type:null,domNamespace:o,children:r,childIndex:0,context:n,footer:""}),"";case El:throw Error(de(294));case Fm:throw Error(de(343))}if(typeof i=="object"&&i!==null)switch(i.$$typeof){case uc:Ct={};var a=i.render(r.props,r.ref);return a=qm(i.render,r.props,a,r.ref),a=pr(a),this.stack.push({type:null,domNamespace:o,children:a,childIndex:0,context:n,footer:""}),"";case fc:return r=[Lt.createElement(i.type,pt({ref:r.ref},r.props))],this.stack.push({type:null,domNamespace:o,children:r,childIndex:0,context:n,footer:""}),"";case bl:return i=pr(r.props.children),o={type:r,domNamespace:o,children:i,childIndex:0,context:n,footer:""},this.pushProvider(r),this.stack.push(o),"";case sc:i=r.type,a=r.props;var l=this.threadID;return pi(i,l),i=pr(a.children(i[l])),this.stack.push({type:r,domNamespace:o,children:i,childIndex:0,context:n,footer:""}),"";case Lm:throw Error(de(338));case dc:return i=r.type,a=i._init,i=a(i._payload),r=[Lt.createElement(i,pt({ref:r.ref},r.props))],this.stack.push({type:null,domNamespace:o,children:r,childIndex:0,context:n,footer:""}),""}throw Error(de(130,i==null?i:typeof i,""))},t.renderDOM=function(r,n,o){var i=r.type.toLowerCase();if(o===Gm.html&&Zm(i),!eg.hasOwnProperty(i)){if(!Iw.test(i))throw Error(de(65,i));eg[i]=!0}var a=r.props;if(i==="input")a=pt({type:void 0},a,{defaultChecked:void 0,defaultValue:void 0,value:a.value!=null?a.value:a.defaultValue,checked:a.checked!=null?a.checked:a.defaultChecked});else if(i==="textarea"){var l=a.value;if(l==null){l=a.defaultValue;var s=a.children;if(s!=null){if(l!=null)throw Error(de(92));if(Array.isArray(s)){if(!(1>=s.length))throw Error(de(93));s=s[0]}l=""+s}l==null&&(l="")}a=pt({},a,{value:void 0,children:""+l})}else if(i==="select")this.currentSelectValue=a.value!=null?a.value:a.defaultValue,a=pt({},a,{value:void 0});else if(i==="option"){s=this.currentSelectValue;var u=Mw(a.children);if(s!=null){var p=a.value!=null?a.value+"":u;if(l=!1,Array.isArray(s)){for(var m=0;m":(y+=">",l="");e:{if(s=a.dangerouslySetInnerHTML,s!=null){if(s.__html!=null){s=s.__html;break e}}else if(s=a.children,typeof s=="string"||typeof s=="number"){s=Fr(s);break e}s=null}return s!=null?(a=[],jw.hasOwnProperty(i)&&s.charAt(0)===` `&&(y+=` `),y+=s):a=pr(a.children),r=r.type,o=o==null||o==="http://www.w3.org/1999/xhtml"?Zm(r):o==="http://www.w3.org/2000/svg"&&r==="foreignObject"?"http://www.w3.org/1999/xhtml":o,this.stack.push({domNamespace:o,type:i,children:a,childIndex:0,context:n,footer:l}),this.previousWasTextNode=!1,y},e}();Hn.renderToNodeStream=function(){throw Error(de(207))};Hn.renderToStaticMarkup=function(e,t){e=new rg(e,!0,t);try{return e.read(1/0)}finally{e.destroy()}};Hn.renderToStaticNodeStream=function(){throw Error(de(208))};Hn.renderToString=function(e,t){e=new rg(e,!1,t);try{return e.read(1/0)}finally{e.destroy()}};Hn.version="17.0.2"});var ig=Y((VS,og)=>{"use strict";og.exports=ng()});var lg=Y((WS,ag)=>{ag.exports={setup:function(e){"addEventListener"in window?e.handleEvent("DOMContentLoaded",e.handleMount):e.handleEvent("onload",e.handleMount)},teardown:function(e){e.removeEvent("DOMContentLoaded",e.handleMount),e.removeEvent("onload",e.handleMount)}}});var ug=Y(($S,sg)=>{sg.exports={setup:function(e){e.handleEvent("ready",e.handleMount),e.handleEvent("pjax:end",e.handleMount),e.handleEvent("pjax:beforeReplace",e.handleUnmount)},teardown:function(e){e.removeEvent("ready",e.handleMount),e.removeEvent("pjax:end",e.handleMount),e.removeEvent("pjax:beforeReplace",e.handleUnmount)}}});var fg=Y((HS,cg)=>{cg.exports={setup:function(e){e.handleEvent("turbolinks:load",e.handleMount),e.handleEvent("turbolinks:before-render",e.handleUnmount)},teardown:function(e){e.removeEvent("turbolinks:load",e.handleMount),e.removeEvent("turbolinks:before-render",e.handleUnmount)}}});var pg=Y((qS,dg)=>{dg.exports={setup:function(e){Turbolinks.pagesCached(0),e.handleEvent("page:change",e.handleMount),e.handleEvent("page:receive",e.handleUnmount)},teardown:function(e){e.removeEvent("page:change",e.handleMount),e.removeEvent("page:receive",e.handleUnmount)}}});var mg=Y((KS,hg)=>{hg.exports={setup:function(e){e.handleEvent(Turbolinks.EVENTS.CHANGE,e.handleMount),e.handleEvent(Turbolinks.EVENTS.BEFORE_UNLOAD,e.handleUnmount)},teardown:function(e){e.removeEvent(Turbolinks.EVENTS.CHANGE,e.handleMount),e.removeEvent(Turbolinks.EVENTS.BEFORE_UNLOAD,e.handleUnmount)}}});var Eg=Y((YS,bg)=>{var gg=lg(),vg=ug(),yg=fg(),wg=pg(),xg=mg();bg.exports=function(e){e.handleEvent&&(typeof Turbolinks!="undefined"&&typeof Turbolinks.EVENTS!="undefined"&&xg.teardown(e),yg.teardown(e),wg.teardown(e),vg.teardown(e),gg.teardown(e)),"addEventListener"in window?(e.handleEvent=function(t,r){document.addEventListener(t,r)},e.removeEvent=function(t,r){document.removeEventListener(t,r)}):(e.handleEvent=function(t,r){window.attachEvent(t,r)},e.removeEvent=function(t,r){window.detachEvent(t,r)}),typeof Turbolinks!="undefined"&&Turbolinks.supported?typeof Turbolinks.EVENTS!="undefined"?xg.setup(e):typeof Turbolinks.controller!="undefined"?yg.setup(e):wg.setup(e):typeof $!="undefined"&&typeof $.pjax=="function"?vg.setup(e):gg.setup(e)}});var wc=Y((exports,module)=>{var topLevel=typeof window=="undefined"?exports:window;module.exports=function(className){var constructor;return constructor=topLevel[className],constructor||(constructor=eval(className)),constructor&&constructor.default&&(constructor=constructor.default),constructor}});var Cg=Y((XS,Sg)=>{Sg.exports=function(e){return function(t){var r=t.split("."),n=r.shift(),o=r,i=e("./"+n);return o.forEach(function(a){i=i[a]}),i.__esModule&&(i=i.default),i}}});var Tg=Y((QS,kg)=>{var Uw=wc(),zw=Cg();kg.exports=function(e){var t=zw(e);return function(r){var n;try{n=t(r)}catch(o){try{n=Uw(r)}catch(i){console.error(o),console.error(i)}}return n}}});var Ng=Y((GS,_g)=>{var Og=H(),Tl=nc(),Bw=ig(),Vw=Eg(),Ww=wc(),$w=Tg(),st={CLASS_NAME_ATTR:"data-react-class",PROPS_ATTR:"data-react-props",RENDER_ATTR:"data-hydrate",CACHE_ID_ATTR:"data-react-cache-id",TURBOLINKS_PERMANENT_ATTR:"data-turbolinks-permanent",jQuery:typeof window!="undefined"&&typeof window.jQuery!="undefined"&&window.jQuery,components:{},findDOMNodes:function(e){var t=st.CLASS_NAME_ATTR,r,n;switch(typeof e){case"undefined":r="["+t+"]",n=document;break;case"object":r="["+t+"]",n=e;break;case"string":r=e+"["+t+"], "+e+" ["+t+"]",n=document;break;default:break}return st.jQuery?st.jQuery(r,n):n.querySelectorAll(r)},getConstructor:Ww,useContext:function(e){this.getConstructor=$w(e)},serverRender:function(e,t,r){var n=this.getConstructor(t),o=Og.createElement(n,r);return Bw[e](o)},mountComponents:function(e){for(var t=st,r=t.findDOMNodes(e),n=0;no?1:0})},enumerable:!1,configurable:!0}),e}();function zg(e){if("immediatePropagationStopped"in e)return e;var t=e.stopImmediatePropagation;return Object.assign(e,{immediatePropagationStopped:!1,stopImmediatePropagation:function(){this.immediatePropagationStopped=!0,t.call(this)}})}var Nc=function(){function e(t){this.application=t,this.eventListenerMaps=new Map,this.started=!1}return e.prototype.start=function(){this.started||(this.started=!0,this.eventListeners.forEach(function(t){return t.connect()}))},e.prototype.stop=function(){this.started&&(this.started=!1,this.eventListeners.forEach(function(t){return t.disconnect()}))},Object.defineProperty(e.prototype,"eventListeners",{get:function(){return Array.from(this.eventListenerMaps.values()).reduce(function(t,r){return t.concat(Array.from(r.values()))},[])},enumerable:!1,configurable:!0}),e.prototype.bindingConnected=function(t){this.fetchEventListenerForBinding(t).bindingConnected(t)},e.prototype.bindingDisconnected=function(t){this.fetchEventListenerForBinding(t).bindingDisconnected(t)},e.prototype.handleError=function(t,r,n){n===void 0&&(n={}),this.application.handleError(t,"Error "+r,n)},e.prototype.fetchEventListenerForBinding=function(t){var r=t.eventTarget,n=t.eventName,o=t.eventOptions;return this.fetchEventListener(r,n,o)},e.prototype.fetchEventListener=function(t,r,n){var o=this.fetchEventListenerMapForEventTarget(t),i=this.cacheKey(r,n),a=o.get(i);return a||(a=this.createEventListener(t,r,n),o.set(i,a)),a},e.prototype.createEventListener=function(t,r,n){var o=new _c(t,r,n);return this.started&&o.connect(),o},e.prototype.fetchEventListenerMapForEventTarget=function(t){var r=this.eventListenerMaps.get(t);return r||(r=new Map,this.eventListenerMaps.set(t,r)),r},e.prototype.cacheKey=function(t,r){var n=[t];return Object.keys(r).sort().forEach(function(o){n.push(""+(r[o]?"":"!")+o)}),n.join(":")},e}();var Bg=/^((.+?)(@(window|document))?->)?(.+?)(#([^:]+?))(:(.+))?$/;function Pc(e){var t=e.trim(),r=t.match(Bg)||[];return{eventTarget:Vg(r[4]),eventName:r[2],eventOptions:r[9]?Wg(r[9]):{},identifier:r[5],methodName:r[7]}}function Vg(e){if(e=="window")return window;if(e=="document")return document}function Wg(e){return e.split(":").reduce(function(t,r){var n;return Object.assign(t,(n={},n[r.replace(/^!/,"")]=!/^!/.test(r),n))},{})}function Dc(e){if(e==window)return"window";if(e==document)return"document"}var Ac=function(){function e(t,r,n){this.element=t,this.index=r,this.eventTarget=n.eventTarget||t,this.eventName=n.eventName||$g(t)||Ol("missing event name"),this.eventOptions=n.eventOptions||{},this.identifier=n.identifier||Ol("missing identifier"),this.methodName=n.methodName||Ol("missing method name")}return e.forToken=function(t){return new this(t.element,t.index,Pc(t.content))},e.prototype.toString=function(){var t=this.eventTargetName?"@"+this.eventTargetName:"";return""+this.eventName+t+"->"+this.identifier+"#"+this.methodName},Object.defineProperty(e.prototype,"eventTargetName",{get:function(){return Dc(this.eventTarget)},enumerable:!1,configurable:!0}),e}();var jc={a:function(e){return"click"},button:function(e){return"click"},form:function(e){return"submit"},input:function(e){return e.getAttribute("type")=="submit"?"click":"input"},select:function(e){return"change"},textarea:function(e){return"input"}};function $g(e){var t=e.tagName.toLowerCase();if(t in jc)return jc[t](e)}function Ol(e){throw new Error(e)}var Ic=function(){function e(t,r){this.context=t,this.action=r}return Object.defineProperty(e.prototype,"index",{get:function(){return this.action.index},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"eventTarget",{get:function(){return this.action.eventTarget},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"eventOptions",{get:function(){return this.action.eventOptions},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"identifier",{get:function(){return this.context.identifier},enumerable:!1,configurable:!0}),e.prototype.handleEvent=function(t){this.willBeInvokedByEvent(t)&&this.invokeWithEvent(t)},Object.defineProperty(e.prototype,"eventName",{get:function(){return this.action.eventName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"method",{get:function(){var t=this.controller[this.methodName];if(typeof t=="function")return t;throw new Error('Action "'+this.action+'" references undefined method "'+this.methodName+'"')},enumerable:!1,configurable:!0}),e.prototype.invokeWithEvent=function(t){try{this.method.call(this.controller,t)}catch(s){var r=this,n=r.identifier,o=r.controller,i=r.element,a=r.index,l={identifier:n,controller:o,element:i,index:a,event:t};this.context.handleError(s,'invoking action "'+this.action+'"',l)}},e.prototype.willBeInvokedByEvent=function(t){var r=t.target;return this.element===r?!0:r instanceof Element&&this.element.contains(r)?this.scope.containsElement(r):this.scope.containsElement(this.action.element)},Object.defineProperty(e.prototype,"controller",{get:function(){return this.context.controller},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"methodName",{get:function(){return this.action.methodName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this.scope.element},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scope",{get:function(){return this.context.scope},enumerable:!1,configurable:!0}),e}();var Mc=function(){function e(t,r){var n=this;this.element=t,this.started=!1,this.delegate=r,this.elements=new Set,this.mutationObserver=new MutationObserver(function(o){return n.processMutations(o)})}return e.prototype.start=function(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,childList:!0,subtree:!0}),this.refresh())},e.prototype.stop=function(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)},e.prototype.refresh=function(){if(this.started){for(var t=new Set(this.matchElementsInTree()),r=0,n=Array.from(this.elements);r0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]Gr,DateRangeSelect:()=>gr,EditableImage:()=>zt,ImageCropper:()=>on,ImageGrid:()=>un,ImageUploader:()=>zi,Modal:()=>Bi,PageDates:()=>ao,PageFiles:()=>lo,PageImages:()=>so,PageTree:()=>uo,RichTextArea:()=>br,TagEditor:()=>ta,Toast:()=>po});var Ve=P(H()),Qr=P(J());var Ee=P(H()),et=P(J());function Qn(){return document.queryCommandSupported&&document.queryCommandSupported("copy")}function ht(e){let t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}var oe=P(H()),Zn=P(J());function Je(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var Mf=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Fl=function(){return Math.random().toString(36).substring(7).split("").join(".")},Lf={INIT:"@@redux/INIT"+Fl(),REPLACE:"@@redux/REPLACE"+Fl(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Fl()}};function Pv(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Gn(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Je(0));if(typeof t=="function"&&typeof r=="undefined"&&(r=t,t=void 0),typeof r!="undefined"){if(typeof r!="function")throw new Error(Je(1));return r(Gn)(e,t)}if(typeof e!="function")throw new Error(Je(2));var o=e,i=t,a=[],l=a,s=!1;function u(){l===a&&(l=a.slice())}function p(){if(s)throw new Error(Je(3));return i}function m(x){if(typeof x!="function")throw new Error(Je(4));if(s)throw new Error(Je(5));var d=!0;return u(),l.push(x),function(){if(!!d){if(s)throw new Error(Je(6));d=!1,u();var c=l.indexOf(x);l.splice(c,1),a=null}}}function h(x){if(!Pv(x))throw new Error(Je(7));if(typeof x.type=="undefined")throw new Error(Je(8));if(s)throw new Error(Je(9));try{s=!0,i=o(i,x)}finally{s=!1}for(var d=a=l,f=0;f{switch(t.type){case"OPEN":return re(F({},e),{component:t.payload});case"CLOSE":return re(F({},e),{component:null});default:return e}});var Be=Gn((e=[],t)=>{switch(t.type){case"ERROR":return[...e,{message:t.message,type:"error"}];case"NOTICE":return[...e,{message:t.message,type:"notice"}];case"NEXT":return e.slice(1);default:return e}});function Ff(){return document.querySelector("[name=csrf-token]").content}function Rf(){return{method:"POST",headers:{"Content-Type":"application/json; charset=utf-8","X-CSRF-Token":Ff()}}}async function Uf(e,t){let r=re(F({},Rf()),{method:"POST"});return t&&(r.body=JSON.stringify(t)),(await fetch(e,r)).json()}async function Hr(e,t){let r=re(F({},Rf()),{method:"PUT"});return t&&(r.body=JSON.stringify(t)),(await fetch(e,r)).json()}async function qr(e,t){return(await fetch(e,{method:"POST",body:t,headers:{"X-CSRF-Token":Ff()}})).json()}function ki(e){let{attachment:t}=e,[r,n]=(0,oe.useState)(e.locale),[o,i]=(0,oe.useState)({name:t.name||{},description:t.description||{}}),a=u=>p=>{i(re(F({},o),{[u]:re(F({},o[u]),{[r]:p.target.value})}))},l=u=>{u.preventDefault(),ht(`[attachment:${t.id}]`),Be.dispatch({type:"NOTICE",message:"Embed code copied to clipboard"})},s=u=>{u.preventDefault(),u.stopPropagation();let p=F({},o);Hr(`/admin/attachments/${t.id}`,{attachment:p}),e.onUpdate&&e.onUpdate(p),ze.dispatch({type:"CLOSE"})};return oe.default.createElement("div",{className:"attachment-editor"},oe.default.createElement("form",null,e.locales&&Object.keys(e.locales).length>1&&oe.default.createElement("div",{className:"field"},oe.default.createElement("label",null,"Locale"),oe.default.createElement("select",{name:"locale",onChange:u=>n(u.target.value)},Object.keys(e.locales).map(u=>oe.default.createElement("option",{key:`locale-${u}`,value:u},e.locales[u])))),oe.default.createElement("div",{className:"field"},oe.default.createElement("label",null,"Name"),oe.default.createElement("input",{type:"text",className:"name",value:o.name[r]||"",onChange:a("name")})),oe.default.createElement("div",{className:"field"},oe.default.createElement("label",null,"Description"),oe.default.createElement("textarea",{className:"description",value:o.description[r]||"",onChange:a("description")})),oe.default.createElement("div",{className:"field embed-code"},oe.default.createElement("label",null,"Embed code"),oe.default.createElement("input",{type:"text",value:`[attachment:${t.id}]`,disabled:!0}),Qn()&&oe.default.createElement("button",{onClick:l},"Copy")),oe.default.createElement("div",{className:"field"},oe.default.createElement("label",null,"File"),oe.default.createElement("a",{href:t.url,rel:"noreferrer",target:"_blank"},t.filename)),oe.default.createElement("div",{className:"buttons"},oe.default.createElement("button",{onClick:s},"Save"),oe.default.createElement("button",{onClick:()=>ze.dispatch({type:"CLOSE"})},"Cancel"))))}ki.propTypes={attachment:Zn.default.object,locale:Zn.default.string,locales:Zn.default.object,onUpdate:Zn.default.func};var Ft=P(H()),wd=P(yd());function cy(e){return e.ref.current?e.ref.current.getBoundingClientRect():null}function fy(e,t){if(e&&e.ref&&e.ref.current){let r=e.ref.current.style.display;e.ref.current.style.display="none";let n=t();return e.ref.current.style.display=r,n}else return t()}function dy(e,t){switch(t.type){case"append":return[...e,...t.payload];case"prepend":return[...t.payload,...e];case"insertFiles":var r=e.indexOf("Files");return r===-1||!t.payload?e:[...e.slice(0,r),...t.payload,...e.slice(r+1)];case"update":return e.map(n=>n.handle===t.payload.handle?t.payload:n);case"updatePositions":return fy(t.payload,()=>e.map(n=>re(F({},n),{rect:cy(n)})));case"remove":return e.filter(n=>n.handle!==t.payload.handle);case"replace":return t.payload;case"reorder":return t.payload;default:return e}}function Kr(e){return{record:e,rect:null,ref:Ft.default.createRef(),handle:(0,wd.default)("draggable")}}function mr(e){let t=(0,Ft.useRef)(),[r,n]=(0,Ft.useReducer)(dy,[],()=>e.map(o=>Kr(o)));return(0,Ft.useEffect)(()=>{n({type:"updatePositions"})},[]),{ref:t,draggables:r,dispatch:n}}var Oi=P(H());function py(e){if(!e.dataTransfer||!e.dataTransfer.types)return!1;let t=e.dataTransfer.types;for(var r=0;r{e.forEach(p=>{p.dispatch({type:"updatePositions",payload:u})})},i=(u,p)=>{o(p),n(F({dragging:p},xd(u)))},a=u=>{r.dragging?(u.stopPropagation(),u.preventDefault(),n(F(F({},r),xd(u)))):py(u)&&i(u,"Files")},l=u=>{if(r.dragging){let m=r;var p=[];u.preventDefault(),u.stopPropagation(),r.dragging=="Files"&&(p=hy(u.dataTransfer)),n({dragging:!1,x:null,y:null}),t(m,p),o()}},s=u=>{r.dragging==="Files"&&(u.preventDefault(),u.stopPropagation(),n({dragging:!1,x:null,y:null}))};return(0,Oi.useEffect)(()=>(window.addEventListener("mousemove",a),window.addEventListener("touchmove",a),window.addEventListener("mouseup",l),window.addEventListener("touchend",l),window.addEventListener("mouseout",s),function(){window.removeEventListener("mousemove",a),window.removeEventListener("touchmove",a),window.removeEventListener("mouseup",l),window.removeEventListener("touchend",l),window.removeEventListener("mouseout",s)})),[r,i,{onDragOver:a,onDrop:l}]}var _i=P(H());function Xr(e,t){let r=(0,_i.useRef)(),n=o=>{o.preventDefault(),o.stopPropagation(),t(o,e)};return(0,_i.useEffect)(()=>{e.ref.current=r.current},[]),{ref:r,onDragStart:n,draggable:!0}}function bd(e,t){let{x:r,y:n}=e;var o;if(t.rect)o=t.rect;else if(t.current)o=t.current.getBoundingClientRect();else return!1;return r>=o.left&&r<=o.right&&n>=o.top&&n<=o.bottom}function eo(e,t){let{draggables:r,ref:n}=e,{dragging:o}=t;if(!o)return r;let i=r.filter(a=>a.handle!==o.handle);if(bd(t,n)){let a=i.filter(l=>bd(t,l))[0];if(a){let l=i.indexOf(a);i=[...i.slice(0,l),o,...i.slice(l)]}else i=[...i,o]}return i}function to(e,t){let r=eo(e,t);return t.dragging&&r.indexOf(t.dragging)===-1&&(t.y{g.preventDefault(),ht(`[attachment:${o.id}]`),Be.dispatch({type:"NOTICE",message:"Embed code copied to clipboard"})},s=g=>{g.preventDefault(),e.deleteRecord&&e.deleteRecord()},u=()=>o.description&&o.description[e.locale]?o.description[e.locale]:null,p=()=>o.name&&o.name[e.locale]?o.name[e.locale]:null,m=g=>{g.preventDefault(),ze.dispatch({type:"OPEN",payload:Ee.default.createElement(ki,{attachment:o,locale:e.locale,locales:e.locales,onUpdate:e.onUpdate})})},h=["attachment"];e.placeholder&&h.push("placeholder"),n.uploading&&h.push("uploading");let w=i?"cloud-upload":"paperclip";return Ee.default.createElement("div",F({className:h.join(" ")},a),Ee.default.createElement("input",{name:`${t}[id]`,type:"hidden",value:n.id||""}),Ee.default.createElement("input",{name:`${t}[attachment_id]`,type:"hidden",value:o&&o.id||""}),Ee.default.createElement("input",{name:`${t}[position]`,type:"hidden",value:e.position}),!i&&Ee.default.createElement("div",{className:"actions"},Ee.default.createElement("button",{onClick:m},"Edit"),e.showEmbed&&Ee.default.createElement("button",{onClick:l},"Embed"),e.deleteRecord&&Ee.default.createElement("button",{onClick:s},"Remove")),o&&Ee.default.createElement("div",{className:"attachment-info"},Ee.default.createElement("h3",null,Ee.default.createElement("i",{className:`fa fa-${w} icon`}),p()||Ee.default.createElement("em",null,"Untitled"),Ee.default.createElement("br",null)),!i&&Ee.default.createElement("a",{href:o.url,rel:"noreferrer",target:"_blank"},o.filename),!i&&u()&&Ee.default.createElement("p",null,u())))}Ni.propTypes={locale:et.default.string,locales:et.default.object,draggable:et.default.object,deleteRecord:et.default.func,startDrag:et.default.func,showEmbed:et.default.bool,onUpdate:et.default.func,attributeName:et.default.string,placeholder:et.default.bool,position:et.default.number,ref:et.default.object};var Ed=P(H());function Rl(){return Ed.default.createElement("div",{className:"attachment drop-placeholder",key:"file-placeholder"},"Upload files here")}var Rt=P(H()),ro=P(J()),mt=class extends Rt.default.Component{constructor(t){super(t);this.inputRef=Rt.default.createRef(),this.handleChange=this.handleChange.bind(this),this.triggerDialog=this.triggerDialog.bind(this)}handleChange(t){let r=t.target.files,n=[];for(var o=0;o0&&this.props.callback(n)}render(){return Rt.default.createElement("div",{className:"upload-button"},Rt.default.createElement("span",null,"Drag and drop ",this.props.type||"file",this.props.multiple&&"s"," here, or",this.props.multiline&&Rt.default.createElement("br",null),Rt.default.createElement("button",{onClick:this.triggerDialog},"choose a file")),Rt.default.createElement("input",{type:"file",onChange:this.handleChange,ref:this.inputRef,style:{display:"none"},multiple:this.props.multiple||!1}))}triggerDialog(t){t.preventDefault(),this.inputRef.current.click()}};mt.propTypes={callback:ro.default.func,type:ro.default.string,multiple:ro.default.bool,multiline:ro.default.bool};function my(e){return e.replace(/\.[\w\d]+$/,"").replace(/_/g," ")}function Gr(e){let t=mr(e.records),r=e.locales?Object.keys(e.locales):[e.locale],[n,o]=(0,Ve.useState)([]),i=c=>{let v={};r.forEach(O=>v[O]=c.name);let y=Kr({attachment:{filename:c.name,name:v},uploading:!0}),I=new FormData;return I.append("attachment[file]",c),r.forEach(O=>{I.append(`attachment[name][${O}]`,my(c.name))}),qr("/admin/attachments.json",I).then(O=>{t.dispatch({type:"update",payload:re(F({},y),{record:{attachment:O,uploading:!1}})})}),y},a=c=>{t.dispatch({type:"append",payload:c.map(v=>i(v))})},l=(c,v)=>{t.dispatch({type:"reorder",payload:to(t,c)}),t.dispatch({type:"insertFiles",payload:v.map(y=>i(y))})},[s,u,p]=Yr([t],l),m=c=>[...t.draggables.map(v=>v.record),...n].indexOf(c)+1,h=c=>`${e.attribute}[${m(c)}]`,w=c=>v=>{let{record:y}=c,I=re(F({},c),{record:re(F({},y),{attachment:F(F({},y.attachment),v)})});t.dispatch({type:"update",payload:I})},g=c=>()=>{t.dispatch({type:"remove",payload:c}),c.record.id&&o([...n,c.record])},x=c=>{let{dragging:v}=s;return c==="Files"?Ve.default.createElement(Rl,{key:"placeholder"}):Ve.default.createElement(Ni,{key:c.handle,draggable:c,locale:e.locale,locales:e.locales,showEmbed:e.showEmbed,startDrag:u,position:m(c.record),onUpdate:w(c),deleteRecord:g(c),attributeName:h(c.record),placeholder:v&&v==c})},d=to(t,s),f=["attachments"];return s.dragging&&f.push("dragover"),Ve.default.createElement("div",F({className:f.join(" "),ref:t.ref},p),Ve.default.createElement("div",{className:"files"},d.map(c=>x(c))),Ve.default.createElement("div",{className:"deleted"},n.map(c=>Ve.default.createElement("span",{className:"deleted-attachment",key:c.id},Ve.default.createElement("input",{name:`${h(c)}[id]`,type:"hidden",value:c.id}),Ve.default.createElement("input",{name:`${h(c)}[attachment_id]`,type:"hidden",value:c.attachment&&c.attachment.id||""}),Ve.default.createElement("input",{name:`${h(c)}[_destroy]`,type:"hidden",value:!0})))),Ve.default.createElement("div",{className:"drop-target"},Ve.default.createElement(mt,{multiple:!0,multiline:!0,callback:a})))}Gr.propTypes={attribute:Qr.default.string,locale:Qr.default.string,locales:Qr.default.object,records:Qr.default.array,showEmbed:Qr.default.bool};var Se=P(H()),Zr=P(J()),gr=class extends Se.default.Component{constructor(t){super(t);this.state={startsAt:this.parseDate(t.startsAt)||this.defaultDate(),endsAt:this.parseDate(t.endsAt)||this.defaultDate(60),startTime:"",endTime:""},this.state.startTime=this.timeToString(this.state.startsAt),this.state.endTime=this.timeToString(this.state.endsAt),this.changeStartsAt=this.changeStartsAt.bind(this),this.changeEndsAt=this.changeEndsAt.bind(this)}changeStartsAt(t={}){let r=this.modifyDate(this.state.startsAt,t);this.setDates(r,new Date(this.state.endsAt.getTime()+(r-this.state.startsAt)))}changeEndsAt(t={}){let r=this.modifyDate(this.state.endsAt,t);this.setDates(this.state.startsAt,r)}defaultDate(t=0){let r=1e3*60*60;return new Date(Math.round(new Date().getTime()/r)*r+r+1e3*60*t)}modifyDate(t,r={}){var n=new Date(t);return Object.prototype.hasOwnProperty.call(r,"year")&&n.setFullYear(r.year),Object.prototype.hasOwnProperty.call(r,"month")&&n.setMonth(r.month),Object.prototype.hasOwnProperty.call(r,"date")&&n.setDate(r.date),Object.prototype.hasOwnProperty.call(r,"time")&&r.time.match(/^[\d]{1,2}(:[\d]{1,2})?$/)&&(n.setHours(r.time.split(":")[0]),n.setMinutes(r.time.split(":")[1]||0)),n}parseDate(t){if(!!t)return new Date(t)}setDates(t,r){rn({month:o.target.value}),disabled:this.props.disabled},this.monthOptions().map((o,i)=>Se.default.createElement("option",{key:t+"-month-"+i,value:i},o))),Se.default.createElement("select",{value:r.getDate(),onChange:o=>n({date:o.target.value}),disabled:this.props.disabled},this.dayOptions().map(o=>Se.default.createElement("option",{key:t+"-date-"+o,value:o},o))),Se.default.createElement("select",{value:r.getFullYear(),onChange:o=>n({year:o.target.value}),disabled:this.props.disabled},this.yearOptions().map(o=>Se.default.createElement("option",{key:t+"-year-"+o,value:o},o))))}render(){return Se.default.createElement("div",{className:"date-range-select"},Se.default.createElement("input",{type:"hidden",name:this.props.objectName+"[starts_at]",value:this.startsAtToString()}),Se.default.createElement("input",{type:"hidden",name:this.props.objectName+"[ends_at]",value:this.endsAtToString()}),Se.default.createElement("div",{className:"date"},this.renderDateSelect("starts-at",this.state.startsAt,this.changeStartsAt),!this.props.disableTime&&Se.default.createElement("input",{type:"text",size:"5",value:this.state.startTime,disabled:this.props.disabled,onChange:t=>this.setState({startTime:t.target.value}),onBlur:t=>this.changeStartsAt({time:t.target.value})})),Se.default.createElement("span",{className:"to"},"to"),Se.default.createElement("div",{className:"date"},this.renderDateSelect("ends-at",this.state.endsAt,this.changeEndsAt),!this.props.disableTime&&Se.default.createElement("input",{type:"text",size:"5",value:this.state.endTime,disabled:this.props.disabled,onChange:t=>this.setState({endTime:t.target.value}),onBlur:t=>this.changeEndsAt({time:t.target.value})})))}timeToString(t){return t.toTimeString().slice(0,5)}yearOptions(){let t=2e3;return Array.apply(null,Array(new Date().getFullYear()-t+11)).map((r,n)=>n+t)}monthOptions(){return["January","February","March","April","May","June","July","August","September","October","November","December"]}dayOptions(){return Array.apply(null,Array(31)).map((t,r)=>r+1)}};gr.propTypes={startsAt:Zr.default.string,endsAt:Zr.default.string,disabled:Zr.default.bool,disableTime:Zr.default.bool,objectName:Zr.default.string};var Ot=P(H()),Ut=P(J());var yr=P(H()),an=P(J());var Ye=P(H()),Ii=P(J());var rn=P(H()),vr=P(J()),_d=P(kd());var Jr=P(H());function gy(e,t){let r=Di(e),n=e.image,o=n.real_width/n.real_height;return t?(r.aspect=t,r.width=100,r.height=100/t*o,r.height>100&&(r.height=100,r.width=100*t/o),r.x=(100-r.width)/2,r.y=(100-r.height)/2):delete r.aspect,Td(e,r)}function Td(e,t){let{image:r}=e;return(t.width<5||t.height<5)&&(t={x:0,y:0,width:100,height:100}),t.aspect===null&&delete t.aspect,{aspect:t.aspect,crop_start_x:r.real_width*(t.x/100),crop_start_y:r.real_height*(t.y/100),crop_width:r.real_width*(t.width/100),crop_height:r.real_height*(t.height/100)}}function Od(e,t){let{crop_start_x:r,crop_start_y:n,crop_width:o,crop_height:i,crop_gravity_x:a,crop_gravity_y:l}=e;switch(t.type){case"completeCrop":return ar+o||ln+i?re(F({},e),{cropping:!1,crop_gravity_x:null,crop_gravity_y:null}):re(F({},e),{cropping:!1});case"setCrop":return F(F({},e),Td(e,t.payload));case"setAspect":return F(F({},e),gy(e,t.payload));case"setFocal":return re(F({},e),{crop_gravity_x:o*(t.payload.x/100)+r,crop_gravity_y:i*(t.payload.y/100)+n});case"startCrop":return re(F({},e),{cropping:!0});case"toggleFocal":return a===null?Od(e,{type:"setFocal",payload:{x:50,y:50}}):re(F({},e),{crop_gravity_x:null,crop_gravity_y:null});default:return e}}function vy(e,t){let r=document.createElement("canvas");r.width=e.naturalWidth*(t.width/100),r.height=e.naturalHeight*(t.height/100);let n=r.getContext("2d");return n.drawImage(e,e.naturalWidth*(t.x/100),e.naturalHeight*(t.y/100),e.naturalWidth*(t.width/100),e.naturalHeight*(t.height/100),0,0,e.naturalWidth*(t.width/100),e.naturalHeight*(t.height/100)),[r,n]}function yy(e,t){let r=t.getImageData(0,0,e.width,e.height).data;for(var n=0;na=>a===null?a:i(a),r=t(Math.round),n=t(Math.ceil),o={crop_start_x:r(e.crop_start_x),crop_start_y:r(e.crop_start_y),crop_width:n(e.crop_width),crop_height:n(e.crop_height),crop_gravity_x:r(e.crop_gravity_x),crop_gravity_y:r(e.crop_gravity_y)};return o.crop_start_x+o.crop_width>e.image.real_width&&(o.crop_width=e.image.real_width-o.crop_start_x),o.crop_start_y+o.crop_height>e.image.real_height&&(o.crop_height=e.image.real_height-o.crop_start_y),o}function Di(e){let{image:t,aspect:r,crop_start_x:n,crop_start_y:o,crop_width:i,crop_height:a}=e,l=t.real_width/t.real_height,s=n/t.real_width*100,u=o/t.real_height*100;var p=i/t.real_width*100,m=a/t.real_height*100;return r&&p?m=p/r*l:r&&m&&(p=m*r/l),r===null?{x:s,y:u,width:p,height:m}:{x:s,y:u,width:p,height:m,aspect:r}}function oo(e){let[t,r]=(0,Jr.useReducer)(Od,{aspect:null,cropping:!1,crop_start_x:e.crop_start_x||0,crop_start_y:e.crop_start_y||0,crop_width:e.crop_width||e.real_width,crop_height:e.crop_height||e.real_height,crop_gravity_x:e.crop_gravity_x,crop_gravity_y:e.crop_gravity_y,image:e}),[n,o]=(0,Jr.useState)(null);async function i(){let a=new Image;a.src=t.image.uncropped_url,await a.decode();let[l,s]=vy(a,Di(t));o(yy(l,s))}return(0,Jr.useEffect)(()=>{t.cropping||i()},[t.cropping]),[t,r,n]}var en=P(H()),tn=P(J()),io=class extends en.default.Component{constructor(t){super(t);this.state={dragging:!1,x:t.x,y:t.y},this.dragStart=this.dragStart.bind(this),this.dragEnd=this.dragEnd.bind(this),this.drag=this.drag.bind(this),this.container=en.default.createRef(),this.point=en.default.createRef()}clamp(t,r,n){return tn?n:t}dragStart(t){t.preventDefault(),t.stopPropagation(),t.target==this.point.current&&this.setState({dragging:!0})}dragEnd(){this.state.dragging&&(this.setState({dragging:!1}),this.props.onChange({x:this.state.x,y:this.state.y}))}drag(t){if(this.state.dragging){let o=this.container.current.getBoundingClientRect();var r,n;t.preventDefault(),t.type=="touchmove"?(r=t.touches[0].clientX-(o.x||o.left),n=t.touches[0].clientY-(o.y||o.top)):(r=t.clientX-(o.x||o.left),n=t.clientY-(o.y||o.top)),r=this.clamp(r,0,this.props.width),n=this.clamp(n,0,this.props.height),this.setState({x:r/this.props.width*100,y:n/this.props.height*100})}}render(){let t=this.props.width*(this.state.x/100),r=this.props.height*(this.state.y/100),n={transform:`translate3d(${t}px, ${r}px, 0)`};return en.default.createElement("div",{className:"focal-editor",ref:this.container,onTouchStart:this.dragStart,onTouchEnd:this.dragEnd,onTouchMove:this.drag,onMouseDown:this.dragStart,onMouseUp:this.dragEnd,onMouseMove:this.drag},en.default.createElement("div",{className:"focal-point",style:n,ref:this.point}))}};io.propTypes={x:tn.default.number,y:tn.default.number,onChange:tn.default.func,width:tn.default.number,height:tn.default.number};function Ai(e){let t=()=>{let{image:s,cropping:u,crop_width:p,crop_height:m}=e.cropState;return u?{width:s.real_width,height:s.real_height}:{width:p,height:m}},r=e.containerSize.width,n=e.containerSize.height,o=t().width/t().height;var i=r,a=r/o;a>n&&(a=n,i=n*o);let l={width:`${i}px`,height:`${a}px`};return e.cropState.cropping?rn.default.createElement("div",{className:"image-wrapper",style:l},rn.default.createElement(_d.default,{src:e.cropState.image.uncropped_url,crop:Di(e.cropState),minWidth:10,minHeight:10,onChange:e.setCrop})):rn.default.createElement("div",{className:"image-wrapper",style:l},e.focalPoint&&rn.default.createElement(io,{width:i,height:a,x:e.focalPoint.x,y:e.focalPoint.y,onChange:e.setFocal}),rn.default.createElement("img",{src:e.croppedImage}))}Ai.propTypes={containerSize:vr.default.object,croppedImage:vr.default.string,cropState:vr.default.object,focalPoint:vr.default.object,setCrop:vr.default.func,setFocal:vr.default.func};var We=P(H()),nn=P(J());function ji(e){let{cropping:t}=e.cropState,r=[["Free",null],["1:1",1],["3:2",3/2],["2:3",2/3],["4:3",4/3],["3:4",3/4],["5:4",5/4],["4:5",4/5],["16:9",16/9]],n=l=>s=>{s.preventDefault(),e.setAspect(l)},o=Math.ceil(e.cropState.crop_width),i=Math.ceil(e.cropState.crop_height),a=e.image.content_type.split("/")[1].toUpperCase();return We.default.createElement("div",{className:"toolbars"},We.default.createElement("div",{className:"toolbar"},We.default.createElement("div",{className:"info"},We.default.createElement("span",{className:"format"},o,"x",i," ",a)),We.default.createElement("button",{title:"Crop image",onClick:e.toggleCrop,className:t?"active":""},We.default.createElement("i",{className:"fa fa-crop"})),We.default.createElement("button",{disabled:t,title:"Toggle focal point",onClick:e.toggleFocal},We.default.createElement("i",{className:"fa fa-bullseye"})),We.default.createElement("a",{href:e.image.original_url,className:"button",title:"Download original image",disabled:t,download:e.image.filename,onClick:l=>t&&l.preventDefault()},We.default.createElement("i",{className:"fa fa-download"}))),t&&We.default.createElement("div",{className:"aspect-ratios toolbar"},We.default.createElement("div",{className:"label"},"Lock aspect ratio:"),r.map(l=>We.default.createElement("button",{key:"ratio-"+l[1],className:l[1]==e.cropState.aspect?"active":"",onClick:n(l[1])},l[0]))))}ji.propTypes={cropState:nn.default.object,image:nn.default.object,setAspect:nn.default.func,toggleCrop:nn.default.func,toggleFocal:nn.default.func};function wy(e){return e.crop_gravity_x===null||e.crop_gravity_y===null?null:{x:(e.crop_gravity_x-e.crop_start_x)/e.crop_width*100,y:(e.crop_gravity_y-e.crop_start_y)/e.crop_height*100}}function on(e){let t=(0,Ye.useRef)(),[r,n]=(0,Ye.useState)(null),o=()=>{let u=t.current;u&&n({width:u.offsetWidth-2,height:u.offsetHeight-2})};(0,Ye.useEffect)(()=>(window.addEventListener("resize",o),function(){window.removeEventListener("resize",o)})),(0,Ye.useEffect)(o,[]);let i=u=>{e.dispatch({type:"setAspect",payload:u})},a=u=>{e.dispatch({type:"setCrop",payload:u})},l=u=>{e.dispatch({type:"setFocal",payload:u})},s=()=>{e.cropState.cropping?e.dispatch({type:"completeCrop"}):e.dispatch({type:"startCrop"})};return Ye.default.createElement("div",{className:"visual"},Ye.default.createElement(ji,{cropState:e.cropState,image:e.cropState.image,setAspect:i,toggleCrop:s,toggleFocal:()=>e.dispatch({type:"toggleFocal"})}),Ye.default.createElement("div",{className:"image-container",ref:t},!e.croppedImage&&Ye.default.createElement("div",{className:"loading"},"Loading image\u2026"),e.croppedImage&&r&&Ye.default.createElement(Ai,{cropState:e.cropState,containerSize:r,croppedImage:e.croppedImage,focalPoint:wy(e.cropState),setCrop:a,setFocal:l})))}on.propTypes={croppedImage:Ii.default.string,cropState:Ii.default.object,dispatch:Ii.default.func};var ye=P(H()),gt=P(J());function Mi(e){let{alternative:t,caption:r,image:n,locale:o,locales:i}=e,a=s=>{s.preventDefault(),ht(`[image:${n.id}]`),Be.dispatch({type:"NOTICE",message:"Embed code copied to clipboard"})},l=s=>{e.setLocale(s.target.value)};return ye.default.createElement("form",null,ye.default.createElement("div",{className:"field embed-code"},ye.default.createElement("label",null,"Embed code"),ye.default.createElement("input",{type:"text",value:`[image:${n.id}]`,disabled:!0}),Qn()&&ye.default.createElement("button",{onClick:a},"Copy")),i&&Object.keys(i).length>1&&ye.default.createElement("div",{className:"field"},ye.default.createElement("label",null,"Locale"),ye.default.createElement("select",{name:"locale",value:o,onChange:l},Object.keys(i).map(s=>ye.default.createElement("option",{key:`locale-${s}`,value:s},i[s])))),ye.default.createElement("div",{className:"field "+(t[o]?"":"field-with-warning")},ye.default.createElement("label",null,"Alternative text"),ye.default.createElement("span",{className:"description"},"For visually impaired users and search engines."),ye.default.createElement("textarea",{className:"alternative",value:t[o]||"",onChange:s=>e.updateLocalization("alternative",s.target.value)})),e.showCaption&&ye.default.createElement("div",{className:"field"},ye.default.createElement("label",null,"Caption"),ye.default.createElement("textarea",{onChange:s=>e.updateLocalization("caption",s.target.value),value:r[o]||"",className:"caption"})),ye.default.createElement("div",{className:"buttons"},ye.default.createElement("button",{onClick:e.save},"Save"),ye.default.createElement("button",{onClick:()=>ze.dispatch({type:"CLOSE"})},"Cancel")))}Mi.propTypes={alternative:gt.default.object,caption:gt.default.object,image:gt.default.object,locale:gt.default.string,locales:gt.default.array,setLocale:gt.default.func,save:gt.default.func,showCaption:gt.default.bool,updateLocalization:gt.default.func};function Li(e){let[t,r,n]=oo(e.image),[o,i]=(0,yr.useState)(e.locale),[a,l]=(0,yr.useState)({caption:e.image.caption||{},alternative:e.image.alternative||{}}),s=(p,m)=>{l(re(F({},a),{[p]:re(F({},a[p]),{[o]:m})}))},u=p=>{p.preventDefault(),p.stopPropagation();let m=F(F({},a),Pi(t));Hr(`/admin/images/${e.image.id}`,{image:m}),e.onUpdate&&e.onUpdate(m,n),ze.dispatch({type:"CLOSE"})};return yr.default.createElement("div",{className:"image-editor"},yr.default.createElement(on,{croppedImage:n,cropState:t,dispatch:r}),!t.cropping&&yr.default.createElement(Mi,{alternative:a.alternative,caption:a.caption,image:e.image,locale:o,locales:e.locales,setLocale:i,save:u,showCaption:e.caption,updateLocalization:s}))}Li.propTypes={image:an.default.object,locale:an.default.string,locales:an.default.object,caption:an.default.bool,onUpdate:an.default.func};function zt(e){let[t,r]=(0,Ot.useState)(e.image),[n,o]=(0,Ot.useState)(e.src),i=()=>{let u=t.crop_width||t.real_width,p=t.crop_height||t.real_height;return Math.round(p/u*e.width)},a=(u,p)=>{let m=F(F({},t),u);o(p),r(m),e.onUpdate&&e.onUpdate(m,p)},l=u=>{u.preventDefault(),ze.dispatch({type:"OPEN",payload:Ot.default.createElement(Li,{image:t,caption:e.caption,locale:e.locale,locales:e.locales,onUpdate:a})})},s=!t.alternative[e.locale];return Ot.default.createElement("div",{className:"editable-image"},s&&Ot.default.createElement("span",{className:"alt-warning",title:"Alternative text is missing"},Ot.default.createElement("i",{className:"fa fa-exclamation-triangle icon"})),Ot.default.createElement("img",{src:n,width:e.width,height:i(),onClick:l}))}zt.propTypes={image:Ut.default.object,src:Ut.default.string,caption:Ut.default.bool,locale:Ut.default.string,locales:Ut.default.object,width:Ut.default.number,onUpdate:Ut.default.func};var ie=P(H()),Bt=P(J());var zl=P(H()),ln=P(J());function Fi(e){let{draggable:t,dragState:r,container:n}=e;if(t==="Files")return"";{let o=n.current.getBoundingClientRect(),i=r.x-(o.x||o.left),a=r.y-(o.y||o.top),l={transform:`translate3d(${i}px, ${a}px, 0)`};return zl.default.createElement("div",{className:"drag-image",style:l},t.record.image&&zl.default.createElement("img",{src:t.record.src||t.record.image.thumbnail_url}))}}Fi.propTypes={draggable:ln.default.oneOfType([ln.default.object,ln.default.string]),dragState:ln.default.object,container:ln.default.object};var Bl=P(H());function Vl(){return Bl.default.createElement("div",{className:"grid-image",key:"file-placeholder"},Bl.default.createElement("div",{className:"file-placeholder"}))}var Ce=P(H()),Xe=P(J());var sn=P(H()),Nd=P(J());function Ri(e){return e.src?sn.default.createElement("div",{className:"temp-image"},sn.default.createElement("img",{src:e.src}),sn.default.createElement("span",null,"Uploading...")):sn.default.createElement("div",{className:"file-placeholder"},sn.default.createElement("span",null,"Uploading..."))}Ri.propTypes={src:Nd.default.string};function Ui(e){let{attributeName:t,draggable:r}=e,n=r.record,o=n.image,[i,a]=(0,Ce.useState)(n.src||null),l=Xr(r,e.startDrag);(0,Ce.useEffect)(()=>{if(n.file){let m=new FileReader;m.onload=()=>a(m.result),m.readAsDataURL(n.file)}},[]);let s=m=>{m.preventDefault(),ht(`[image:${o.id}]`),Be.dispatch({type:"NOTICE",message:"Embed code copied to clipboard"})},u=m=>{m.preventDefault(),e.deleteImage&&e.deleteImage()},p=["grid-image"];return e.placeholder&&p.push("placeholder"),n.file&&p.push("uploading"),Ce.default.createElement("div",F({className:p.join(" ")},l),Ce.default.createElement("input",{name:`${t}[id]`,type:"hidden",value:n.id||""}),Ce.default.createElement("input",{name:`${t}[image_id]`,type:"hidden",value:o&&o.id||""}),Ce.default.createElement("input",{name:`${t}[position]`,type:"hidden",value:e.position}),e.enablePrimary&&Ce.default.createElement("input",{name:`${t}[primary]`,type:"hidden",value:e.primary}),!o&&Ce.default.createElement(Ri,{src:i}),o&&Ce.default.createElement(Ce.default.Fragment,null,Ce.default.createElement(zt,{image:o,src:i||o.thumbnail_url,width:250,caption:!0,locale:e.locale,locales:e.locales,onUpdate:e.onUpdate}),Ce.default.createElement("div",{className:"actions"},e.showEmbed&&Ce.default.createElement("button",{onClick:s},"Embed"),e.deleteImage&&Ce.default.createElement("button",{onClick:u},"Remove"))))}Ui.propTypes={draggable:Xe.default.object,deleteImage:Xe.default.func,startDrag:Xe.default.func,locale:Xe.default.string,locales:Xe.default.object,onUpdate:Xe.default.func,attributeName:Xe.default.string,placeholder:Xe.default.bool,enablePrimary:Xe.default.bool,showEmbed:Xe.default.bool,primary:Xe.default.bool,position:Xe.default.number};function Wl(e){let t=["image/gif","image/jpeg","image/pjpeg","image/png","image/tiff"];return e.filter(r=>t.indexOf(r.type)!==-1)}function Pd(e,t,r){let[n,...o]=eo(e,r),i=[...o,...eo(t,r)];return r.dragging&&[n,...i].indexOf(r.dragging)===-1&&(r.yr.primary).slice(0,1):[];return[t,e.records.filter(r=>t.indexOf(r)===-1)]}function un(e){let[t,r]=xy(e),n=mr(t),o=mr(r),[i,a]=(0,ie.useState)([]),l=(0,ie.useRef)(),s=T=>{n.dispatch(T),o.dispatch(T)},u=(T,D)=>{let[Q,k]=Pd(n,o,T);if(n.dispatch({type:"reorder",payload:Q?[Q]:[]}),o.dispatch({type:"reorder",payload:k}),D){let C=Wl(D).map(M=>x(M));s({type:"insertFiles",payload:C})}},[p,m,h]=Yr([n,o],u),w=T=>[...n.draggables.map(D=>D.record),...o.draggables.map(D=>D.record),...i].indexOf(T)+1,g=T=>`${e.attribute}[${w(T)}]`,x=T=>{let D=Kr({image:null,file:T}),Q=new FormData;return Q.append("image[file]",T),qr("/admin/images.json",Q).then(k=>{k.status==="error"?(Be.dispatch({type:"ERROR",message:"Error uploading image: "+k.error}),s({type:"remove",payload:D})):s({type:"update",payload:re(F({},D),{record:{image:k}})})}),D},d=T=>D=>{let{record:Q}=T,k=re(F({},T),{record:re(F({},Q),{image:F(F({},Q.image),D)})});s({type:"update",payload:k})},f=T=>()=>{s({type:"remove",payload:T}),T.record.id&&a([...i,T.record])},c=(T,D)=>{let{dragging:Q}=p;return T==="Files"?ie.default.createElement(Vl,{key:"placeholder"}):ie.default.createElement(Ui,{key:T.handle,draggable:T,locale:e.locale,locales:e.locales,showEmbed:e.showEmbed,startDrag:m,position:w(T.record),primary:D,onUpdate:d(T),enablePrimary:e.enablePrimary,deleteImage:f(T),attributeName:g(T.record),placeholder:Q&&Q==T})},v=T=>{let[D,...Q]=Wl(T).map(k=>x(k));D&&(o.dispatch({type:"prepend",payload:[...n.draggables,...Q]}),n.dispatch({type:"replace",payload:[D]}))},y=T=>{o.dispatch({type:"append",payload:Wl(T).map(D=>x(D))})},I=["image-grid"];e.enablePrimary&&I.push("with-primary-image");let[O,R]=Pd(n,o,p);return ie.default.createElement("div",F({className:I.join(" "),ref:l},h),p.dragging&&ie.default.createElement(Fi,{draggable:p.dragging,dragState:p,container:l}),e.enablePrimary&&ie.default.createElement("div",{className:"primary-image",ref:n.ref},ie.default.createElement("h3",null,"Main image"),O&&ie.default.createElement(ie.default.Fragment,null,c(O,!0),e.primaryAttribute&&ie.default.createElement("input",{type:"hidden",name:e.primaryAttribute,value:O.record&&O.record.image&&O.record.image.id||""})),!O&&ie.default.createElement("div",{className:"drop-target"},ie.default.createElement(mt,{multiple:!0,type:"image",multiline:!0,callback:v}))),ie.default.createElement("div",{className:"grid",ref:o.ref},ie.default.createElement("h3",null,e.enablePrimary?"More images":"Images"),ie.default.createElement("div",{className:"drop-target"},ie.default.createElement(mt,{multiple:!0,type:"image",callback:y})),ie.default.createElement("div",{className:"images"},R.map(T=>c(T,!1)))),ie.default.createElement("div",{className:"deleted"},i.map(T=>ie.default.createElement("span",{className:"deleted-image",key:T.id},ie.default.createElement("input",{name:`${g(T)}[id]`,type:"hidden",value:T.id}),ie.default.createElement("input",{name:`${g(T)}[attachment_id]`,type:"hidden",value:T.image&&T.image.id||""}),ie.default.createElement("input",{name:`${g(T)}[_destroy]`,type:"hidden",value:!0})))))}un.propTypes={attribute:Bt.default.string,locale:Bt.default.string,locales:Bt.default.array,records:Bt.default.array,enablePrimary:Bt.default.bool,primaryAttribute:Bt.default.string,showEmbed:Bt.default.bool};var Le=P(H()),_t=P(J());function by(e){var t=[];if(e.items)for(let r=0;r{f.preventDefault(),o(!0)},p=()=>{o(!1)},m=f=>{if(f.dataTransfer.items)for(var c=0;c{let c=by(f.dataTransfer);f.preventDefault(),c.length>0&&x(c[0])},w=f=>{f.preventDefault(),a(null),s(null)},g=f=>{f.length>0&&x(f[0])},x=f=>{if(["image/gif","image/jpeg","image/pjpeg","image/png","image/tiff"].indexOf(f.type)==-1){alert("Invalid file type, only images in JPEG, PNG or GIF formats are supported");return}let v=e.locale,y=e.locales?Object.keys(e.locales):[v],I=new FormData;a(null),s(null),o(!1),r(!0),I.append("image[file]",f),y.forEach(O=>{I.append(`image[alternative][${O}]`,e.alternative||"")}),qr("/admin/images.json",I).then(O=>{r(!1),O.status==="error"?Be.dispatch({type:"ERROR",message:"Error uploading image: "+O.error}):(s(O.thumbnail_url),a(O))})},d=["image-uploader"];return t?d.push("uploading"):n&&d.push("dragover"),Le.default.createElement("div",{className:d.join(" "),onDragOver:u,onDragLeave:p,onDragEnd:m,onDrop:h},Le.default.createElement("input",{type:"hidden",name:e.attr,value:i?i.id:""}),i&&Le.default.createElement("div",{className:"image"},Le.default.createElement(zt,{image:i,src:l,width:e.width,caption:e.caption,locale:e.locale,locales:e.locales})),Le.default.createElement("div",{className:"ui-wrapper"},t&&Le.default.createElement("div",{className:"ui"},"Uploading image..."),!t&&Le.default.createElement("div",{className:"ui"},Le.default.createElement(mt,{type:"image",multiline:!0,callback:g}),i&&Le.default.createElement("a",{className:"delete remove-image",href:"#",onClick:w},"Remove image"))))}zi.propTypes={locale:_t.default.string,locales:_t.default.object,image:_t.default.object,src:_t.default.string,width:_t.default.number,caption:_t.default.bool,attr:_t.default.string,alternative:_t.default.string};var cn=P(H());var Bi=class extends cn.default.Component{constructor(t){super(t);this.state={component:null},this.store=ze,this.closeModal=this.closeModal.bind(this),this.handleChange=this.handleChange.bind(this),this.handleKeypress=this.handleKeypress.bind(this)}componentDidMount(){this.unsubscribe=this.store.subscribe(this.handleChange),window.addEventListener("keypress",this.handleKeypress)}componentWillUnmount(){this.unsubscribe(),window.removeEventListener("keypress",this.handleKeypress)}closeModal(t){t.stopPropagation(),t.preventDefault(),ze.dispatch({type:"CLOSE"})}handleChange(){this.setState(F({},this.store.getState()))}handleKeypress(t){this.state.component&&(t.key=="Escape"||t.keyCode===27)&&this.closeModal(t)}render(){let t=this.state.component;if(t)document.body.classList.add("modal");else return document.body.classList.remove("modal"),cn.default.createElement("div",{className:"modal-wrapper"});return cn.default.createElement("div",{className:"modal-wrapper open"},cn.default.createElement("div",{className:"background",onClick:this.closeModal}),cn.default.createElement("div",{className:"modal"},t))}};var ut=P(H()),Vi=P(J());var ao=class extends ut.default.Component{constructor(t){super(t);this.state={has_dates:!!t.starts_at,all_day:!!t.all_day},this.toggleAllDay=this.toggleAllDay.bind(this),this.toggleHasDates=this.toggleHasDates.bind(this)}toggleHasDates(){this.setState({has_dates:!this.state.has_dates})}toggleAllDay(){this.setState({all_day:!this.state.all_day})}timeToString(t){return t.toTimeString().slice(0,5)}render(){return ut.default.createElement("div",{className:"page-dates field"},ut.default.createElement("input",{type:"hidden",name:"page[all_day]",value:this.state.has_dates&&this.state.all_day?"1":"0"}),ut.default.createElement("label",null,"Dates"),ut.default.createElement("div",{className:"toggles"},ut.default.createElement("label",{className:"has-dates-toggle"},ut.default.createElement("input",{type:"checkbox",checked:this.state.has_dates,onChange:this.toggleHasDates}),"Enabled"),ut.default.createElement("label",{className:!this.state.has_dates&&"disabled"},ut.default.createElement("input",{type:"checkbox",disabled:!this.state.has_dates,checked:this.state.all_day,onChange:this.toggleAllDay}),"All day event")),ut.default.createElement(gr,{objectName:"page",startsAt:this.props.starts_at,endsAt:this.props.ends_at,disabled:!this.state.has_dates,disableTime:this.state.all_day}))}};ao.propTypes={starts_at:Vi.default.string,ends_at:Vi.default.string,all_day:Vi.default.bool};var Wi=P(H()),$i=P(J());var lo=class extends Wi.default.Component{render(){return Wi.default.createElement("div",{className:"page-files"},Wi.default.createElement(Gr,{attribute:"page[page_files_attributes]",showEmbed:!0,locale:this.props.locale,locales:this.props.locales,records:this.props.records}))}};lo.propTypes={locale:$i.default.string,locales:$i.default.object,records:$i.default.array};var Hi=P(H()),qi=P(J());var so=class extends Hi.default.Component{render(){return Hi.default.createElement("div",{className:"page-images"},Hi.default.createElement(un,{attribute:"page[page_images_attributes]",primaryAttribute:"page[image_id]",enablePrimary:!0,showEmbed:!0,locale:this.props.locale,locales:this.props.locales,records:this.props.records}))}};so.propTypes={locale:qi.default.string,locales:qi.default.object,records:qi.default.array};var $l=P(H()),Yi=P(J());var wr=P(H()),Wt=P(J());var ne=P(H()),Nt=P(J()),Vt=class extends ne.default.Component{constructor(t){super(t);this.state={newName:t.index.node.name},this.innerRef=ne.default.createRef()}permitted(t){return this.node().permissions&&this.node().permissions.indexOf(t)!=-1}actions(){let t=this.node().status!=2?"Publish":"Hide",r=this.node().status!=2?"check":"ban";return this.node().editing?null:this.props.index.id===1?ne.default.createElement("span",{className:"actions"},ne.default.createElement("button",{type:"button",className:"add",onClick:()=>this.props.addChild(this.props.index)},ne.default.createElement("i",{className:"fa fa-plus icon"}),"Add child")):ne.default.createElement("span",{className:"actions"},this.permitted("edit")&&this.button(t,{className:"toggle-status",icon:r,onClick:()=>this.toggleStatus()}),this.permitted("edit")&&this.button("Rename",{className:"edit",icon:"pencil",onClick:()=>this.edit()}),this.permitted("edit")&&this.button("Delete",{className:"delete",icon:"trash",onClick:()=>this.deletePage()}),this.permitted("create")&&this.button("Add child",{className:"add",icon:"plus",onClick:()=>this.props.addChild(this.props.index)}))}addButton(){let t=this,r=this.node(),n=function(){t.props.addChild&&t.props.addChild(t.props.index)};if(!r.collapsed&&this.permitted("create")&&(r.root||this.visibleChildren().length>0))return this.button("Add page here",{className:"add add-inline",icon:"plus",onClick:n})}button(t,r){let n="fa fa-"+r.icon+" icon";return ne.default.createElement("button",{type:"button",className:r.className,onClick:r.onClick},ne.default.createElement("i",{className:n}),t)}childNodes(){let t=this.props.index,r=this.props.tree,n=this.props.dragging;if(t.children&&t.children.length&&!t.node.collapsed){var o={};return t.node.collapsed&&(o.display="none"),o.paddingLeft=this.props.paddingLeft+"px",ne.default.createElement("div",{className:"children",style:o},t.children.map(i=>{var a=r.getIndex(i);return ne.default.createElement(Vt,{tree:r,index:a,key:a.id,dragging:n,paddingLeft:this.props.paddingLeft,addChild:this.props.addChild,onCollapse:this.props.onCollapse,onDragStart:this.props.onDragStart,updatePage:this.props.updatePage})}))}return null}collapseArrow(){let t=this.props.index,r=this;if(!t.parent)return null;let n=function(i){i.stopPropagation();let a=r.props.index.id;r.props.onCollapse&&r.props.onCollapse(a)};if(this.visibleChildren().length>0){let i=t.node.collapsed;var o=null;return i?o="collapse fa fa-caret-right":o="collapse fa fa-caret-down",ne.default.createElement("i",{className:o,onMouseDown:function(a){a.stopPropagation()},onClick:n})}return null}collapsedLabel(){if(this.node().collapsed&&this.node().children&&this.node().children.length>0){let t=this.node().children.length==1?"item":"items";return ne.default.createElement("span",{className:"collapsed-label"},"(",this.node().children.length," ",t,")")}else return null}deletePage(){confirm("Are you sure you want to delete this page?")&&this.updatePage({status:4})}edit(){this.updatePage({editing:!0})}editUrl(t){return`/admin/${t.locale}/pages/${t.param}/edit`}node(){return this.props.index.node}pageName(){return this.node().name?this.node().name:ne.default.createElement("i",{className:"untitled"},"Untitled")}render(){let t=this,r=this.props,n=r.index,o=r.dragging,i=this.node().editing;var a="node",l=i?this.renderEditNode():this.renderNode();n.id===o&&(a="node placeholder");let s=function(u){t.permitted("edit")&&!i&&r.onDragStart&&r.onDragStart(r.index.id,t.innerRef.current,u)};return this.node().status!=4?ne.default.createElement("div",{className:a},ne.default.createElement("div",{className:"inner",ref:this.innerRef,onMouseDown:s},this.collapseArrow(),l),this.childNodes(),this.addButton()):null}renderEditNode(){let t=this,r=function(i){t.setState({newName:i.target.value})},n=function(i){i.preventDefault(),t.updatePage({name:t.state.newName,editing:!1})},o=function(){t.setState({newName:t.node().name}),t.updatePage({editing:!1})};return ne.default.createElement("div",{className:"page edit"},ne.default.createElement("i",{className:"fa fa-file-o icon"}),ne.default.createElement("form",{onSubmit:n},ne.default.createElement("input",{type:"text",value:this.state.newName,autoFocus:!0,onChange:r}),ne.default.createElement("button",{className:"save",type:"submit"},ne.default.createElement("i",{className:"fa fa-cloud icon"}),"Save"),this.button("Cancel",{className:"cancel",icon:"ban",onClick:o})))}renderNode(){let r=this.props.index.node;var n="",o=ne.default.createElement("span",{className:"name"},this.pageName()),i="page",a="fa fa-file-o icon";return typeof r.status!="undefined"&&(i=`page status-${this.node().status}`),r.id&&r.locale&&this.permitted("edit")&&(o=ne.default.createElement("a",{href:this.editUrl(r),className:"name"},this.pageName())),r.id&&r.starts_at&&(n=ne.default.createElement("span",{className:"date"},r.starts_at)),r.news_page?a="fa fa-newspaper-o icon":r.pinned&&(a="fa fa-flag-o icon"),ne.default.createElement("div",{className:i},ne.default.createElement("i",{className:a}),o,n,this.statusLabel(),this.collapsedLabel(),this.actions())}statusLabel(){let t=["Draft","Reviewed","Published","Hidden","Deleted"];return typeof this.node().status!="undefined"&&this.node().status!=2?ne.default.createElement("span",{className:"status-label"},"(",t[this.node().status],")"):""}toggleStatus(){this.node().status!=2?this.updatePage({status:2}):this.updatePage({status:3})}updatePage(t){if(this.props.updatePage)return this.props.updatePage(this.props.index,t)}visibleChildren(){return this.node().children?this.node().children.filter(t=>t.status!=4):[]}};Vt.propTypes={addChild:Nt.default.func,dragging:Nt.default.number,index:Nt.default.object,onCollapse:Nt.default.func,onDragStart:Nt.default.func,paddingLeft:Nt.default.number,tree:Nt.default.object,updatePage:Nt.default.func};var fn=class extends wr.default.Component{constructor(t){super(t);this.state={dragging:this.initDragging()}}initDragging(){return{id:null,x:null,y:null,w:null,h:null,scrollTop:null,scrollLeft:null}}getDraggingDom(){var t=this.props.tree,r=this.state.dragging;if(r&&r.id){var n=t.getIndex(r.id),o={top:r.y,left:r.x,width:r.w};return wr.default.createElement("div",{className:"draggable",style:o},wr.default.createElement(Vt,{tree:t,index:n,paddingLeft:this.props.paddingLeft}))}return null}render(){var t=this.props.tree,r=this.state.dragging;if(t){var n=t.getIndex(1);return wr.default.createElement("div",{className:"page-tree"},this.getDraggingDom(),wr.default.createElement(Vt,{tree:t,index:n,key:n.id,paddingLeft:this.props.paddingLeft,addChild:o=>this.addChild(o),onDragStart:(o,i,a)=>this.dragStart(o,i,a),onCollapse:o=>this.toggleCollapse(o),updatePage:(o,i)=>this.updatePage(o,i),dragging:r&&r.id}))}else return wr.default.createElement("div",{className:"page-tree"},this.getDraggingDom())}addChild(t){let r={name:"",status:0,editing:!0,children:[],published_at:new Date,pinned:!1,locale:t.node.locale,parent_page_id:t.node.id};this.props.addChild(t.id,r)}prevAddButtonCount(t,r){let n=0,o=[],i=t.getIndex(r.parent);for(;i;)o.push(i),i=t.getIndex(i.parent);for(i=r,i=t.getNodeByTop(r.top-1);i;)o.indexOf(i)==-1&&!i.node.collapsed&&i.node.children.filter(a=>a.status!=4).length>0&&(n+=1),i=t.getNodeByTop(i.top-1);return n}scrollOffset(){let t=this.state.dragging;return{top:document.body.scrollTop-t.scrollTop,left:document.body.scrollLeft-t.scrollLeft}}drag(t){if(this._start){var r=Math.abs(t.clientX-this._offsetX)+Math.abs(t.clientY-this._offsetY);if(r>=15)this.setState({dragging:this.dragging}),this._start=!1;else return null}var n=this.props.tree,o=this.state.dragging,i=this.props.paddingLeft,a=null,l=n.getIndex(o.id),s=l.node.collapsed,u=this._startX,p=this._startY,m=this._offsetX,h=this._offsetY,w={x:u+t.clientX-m+this.scrollOffset().left,y:p+t.clientY-h+this.scrollOffset().top};o.x=w.x,o.y=w.y;var g=o.x-i/2-(l.left-2)*i,x=o.y-o.h/2-(l.top-2+this.prevAddButtonCount(n,l))*o.h;if(g<0)l.parent&&!l.next&&(a=n.move(l.id,l.parent,"after"));else if(g>i&&l.prev){var d=n.getIndex(l.prev);!d.node.leaf&&!d.node.collapsed&&(a=n.move(l.id,l.prev,"append"))}if(a&&(l=a,a.node.collapsed=s,o.id=a.id),x<0-o.h*.5){var f=n.getNodeByTop(l.top-1);a=n.move(l.id,f.id,"before")}else if(x>o.h*1.5){let c=l.next?n.getIndex(l.next):n.getNodeByTop(l.top+l.height);c&&c.parent!==l.id&&(c.children&&c.children.length&&!c.node.collapsed?a=n.move(l.id,c.id,"prepend"):a=n.move(l.id,c.id,"after"))}a&&(a.node.collapsed=s,o.id=a.id),this.setState({dragging:o})}dragStart(t,r,n){if(n.button===0){this.dragging={id:t,w:r.offsetWidth,h:r.offsetHeight,x:r.offsetLeft,y:r.offsetTop,scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft},this._startX=r.offsetLeft,this._startY=r.offsetTop,this._offsetX=n.clientX,this._offsetY=n.clientY,this._start=!0;var o=this;this._dragListener=i=>o.drag(i),this._dragEndListener=()=>o.dragEnd(),window.addEventListener("mousemove",this._dragListener),window.addEventListener("mouseup",this._dragEndListener)}}dragEnd(){this._start||(this.props.updateTree(this.props.tree),this.props.movedPage(this.state.dragging.id)),this.setState({dragging:this.initDragging()}),window.removeEventListener("mousemove",this._dragListener),window.removeEventListener("mouseup",this._dragEndListener)}toggleCollapse(t){this.props.toggleCollapsed(t)}updatePage(t,r){this.props.updatePage(t.id,r)}};fn.defaultProps={paddingLeft:15};fn.propTypes={tree:Wt.default.object,addChild:Wt.default.func,movedPage:Wt.default.func,toggleCollapsed:Wt.default.func,paddingLeft:Wt.default.number,updatePage:Wt.default.func,updateTree:Wt.default.func};var Ki=class{constructor(t){this.cnt=1,this.obj=t||{children:[]},this.indexes={},this.build(this.obj)}build(t){var r=this.indexes,n=this.cnt,o=this,i={id:n,node:t};r[this.cnt+""]=i,this.cnt++,t.children&&t.children.length&&a(t.children,i);function a(l,s){var u=[];l.forEach(function(p){var m={};m.id=o.cnt,m.node=p,s&&(m.parent=s.id),r[o.cnt+""]=m,u.push(o.cnt),o.cnt++,p.children&&p.children.length&&a(p.children,m)}),s.children=u,u.forEach(function(p,m){var h=r[p+""];m>0&&(h.prev=u[m-1]),m0&&(o.prev=t[n-1]),n{var l=0;let s=i.getIndex(a.parent);for(;s;)l+=1,s=i.getIndex(s.parent);return l},n=this.collapsedState(),o=function(i){var a=t.getIndex(i),l=a.node;Object.prototype.hasOwnProperty.call(n,l.id)?l.collapsed=n[l.id]:(l.news_page||r(t,a)>1)&&(l.collapsed=!0),a.children&&a.children.length&&a.children.forEach(s=>o(s))};o(1)}collapsedState(){return window&&window.localStorage&&typeof window.localStorage.collapsedPages!="undefined"?JSON.parse(window.localStorage.collapsedPages):{}}createPage(t,r){Uf(`/admin/${t.node.locale}/pages.json`,{page:r}).then(n=>this.updateNode(t,n))}buildTree(t){let r=t.reduce((o,i)=>{let a=i.parent_page_id;return o[a]=[...o[a]||[],i],o},{});t.forEach(o=>o.children=r[o.id]||[]);let n=new Ki({name:"All Pages",locale:this.props.locale,permissions:this.props.permissions,root:!0,children:r[null]});return this.applyCollapsed(n),n.updateNodesPosition(),n}movePage(t,r,n){let o={parent_id:r.node.id,position:n},i=`/admin/${t.node.locale}/pages/${t.node.id}/move.json`;this.performUpdate(t,i,o)}performUpdate(t,r,n){Hr(r,n).then(o=>this.updateNode(t,o))}render(){return $l.default.createElement(fn,{tree:this.state.tree,addChild:this.addChild,movedPage:this.movedPage,toggleCollapsed:this.toggleCollapsed,updatePage:this.updatePage,updateTree:this.updateTree})}reorderChildren(t){let r=this.state.tree;var n=this.state.tree.getIndex(t),o=n.node;!o.news_page||(n.children=n.children.sort(function(i,a){var l=r.getIndex(i).node,s=r.getIndex(a).node;return l.pinned==s.pinned?new Date(s.published_at)-new Date(l.published_at):l.pinned?-1:1}),r.updateNodesPosition())}setCollapsed(t,r){var n=this.state.tree.getIndex(t).node;n.collapsed=r,this.storeCollapsed(t,n.collapsed),this.state.tree.updateNodesPosition()}storeCollapsed(t,r){let n=this.state.tree.getIndex(t).node;var o=this.collapsedState();o[n.id]=r,window.localStorage.collapsedPages=JSON.stringify(o)}updateNode(t,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t.node[n]=r[n]);this.setState({tree:this.state.tree})}};uo.propTypes={pages:Yi.default.array,locale:Yi.default.string,permissions:Yi.default.array};var xr=P(H()),dn=P(J());var Xi=P(H()),Qi=P(J()),co=class extends Xi.default.Component{render(){return Xi.default.createElement("a",{title:this.props.name,className:"button "+this.props.className,onClick:this.props.onClick},Xi.default.createElement("i",{className:"fa fa-"+this.props.className}))}};co.propTypes={className:Qi.default.string,name:Qi.default.string,onClick:Qi.default.func};var br=class extends xr.default.Component{constructor(t){super(t);this.state={value:t.value||"",rows:t.rows||5},this.inputRef=xr.default.createRef(),this.handleChange=this.handleChange.bind(this),this.handleKeyPress=this.handleKeyPress.bind(this),this.getSelection=this.getSelection.bind(this),this.link=this.link.bind(this),this.replaceSelection=this.replaceSelection.bind(this)}actions(){let t=[{name:"bold",className:"bold",hotkey:"b",fn:n=>["",n,""]},{name:"italic",className:"italic",hotkey:"i",fn:n=>["",n,""]}],r=[{name:"Heading 2",className:"header h2",fn:n=>["h2. ",n,""]},{name:"Heading 3",className:"header h3",fn:n=>["h3. ",n,""]},{name:"Heading 4",className:"header h4",fn:n=>["h4. ",n,""]},{name:"Blockquote",className:"quote-left",fn:n=>["bq. ",n,""]},{name:"List",className:"list-ul",fn:n=>["",this.strToList(n,"*"),""]},{name:"Ordered list",className:"list-ol",fn:n=>["",this.strToList(n,"#"),""]},{name:"Link",className:"link",fn:this.link},{name:"Email link",className:"envelope",fn:this.emailLink}];return this.props.simple?t:[...t,...r]}applyAction(t){let[r,n,o]=t(this.getSelection());this.replaceSelection(r,n,o)}emailLink(t){var r=prompt("Enter email address","");let n=t.length>0?t:r;return['"',n,`":mailto:${r}`]}getSelection(){let{selectionStart:t,selectionEnd:r,value:n}=this.inputRef.current;return n.substr(t,r-t)}handleChange(t){this.setState({value:t.target.value})}handleKeyPress(t){let r;t.which>=65&&t.which<=90?r=String.fromCharCode(t.keyCode).toLowerCase():t.keyCode===13&&(r="enter");let n={};this.actions().forEach(o=>{o.hotkey&&(n[o.hotkey]=o.fn)}),(t.metaKey||t.ctrlKey)&&Object.prototype.hasOwnProperty.call(n,r)&&(t.preventDefault(),this.applyAction(n[r]))}link(t){let r=t.length>0?t:"Link text";var n=prompt("Enter link URL","");return n?['"',r,`":${this.relativeUrl(n)}`]:["",r,""]}relativeUrl(t){let r=null;if(!t.match(/^https:\/\//)||!document||!document.location)return t;try{r=new URL(t)}catch(n){console.log("Error parsing URL: ",n)}return r&&r.hostname==document.location.hostname&&(document.location.port||"80")==(r.port||"80")?r.pathname:t}render(){let{value:t,rows:r}=this.state,{id:n,name:o}=this.props,i=a=>l=>{l.preventDefault(),this.applyAction(a)};return xr.default.createElement("div",{className:"rich-text-area"},xr.default.createElement("div",{className:"rich-text toolbar"},this.actions().map(a=>xr.default.createElement(co,{key:a.name,name:a.name,className:a.className,onClick:i(a.fn)}))),xr.default.createElement("textarea",{className:"rich",ref:this.inputRef,id:n,name:o,value:t,rows:r,onChange:this.handleChange,onKeyDown:this.handleKeyPress}))}replaceSelection(t,r,n){let o=this.inputRef.current,{selectionStart:i,selectionEnd:a,value:l}=o;o.value=l.substr(0,i)+t+r+n+l.substr(a,l.length),o.focus({preventScroll:!0}),o.setSelectionRange(i+t.length,i+t.length+r.length),this.setState({value:o.value})}strToList(t,r){return t.split(` `).map(n=>r+" "+n).join(` `)}};br.propTypes={id:dn.default.string,name:dn.default.string,value:dn.default.string,rows:dn.default.number,simple:dn.default.bool};var $t=P(H()),ea=P(J());var pn=P(H()),Dd=P(J());function Gi(e){let[t,r]=(0,pn.useState)(""),n=a=>{a.preventDefault(),e.addTag(t),r("")};return pn.default.createElement("div",{className:"add-tag-form"},pn.default.createElement("input",{name:"add-tag",type:"text",className:"add-tag",value:t,onKeyDown:a=>{a.which===13&&n(a)},onChange:a=>{r(a.target.value)},placeholder:"Add tag..."}),pn.default.createElement("button",{onClick:n,disabled:!t},"Add"))}Gi.propTypes={addTag:Dd.default.func};var fo=P(H()),Zi=P(J());function Ji(e){let t=()=>{e.toggleEnabled(e.tag)},r=["tag"];return e.enabled&&r.push("enabled"),fo.default.createElement("span",{className:r.join(" ")},fo.default.createElement("label",{className:"check-box"},fo.default.createElement("input",{type:"checkbox",name:"tag-"+e.tag,value:"1",checked:e.enabled,onChange:t}),fo.default.createElement("span",{className:"name"},e.tag)))}Ji.propTypes={enabled:Zi.default.bool,tag:Zi.default.string,toggleEnabled:Zi.default.func};function Hl(e,t,r){return r.indexOf(e)===t}function ta(e){let[t,r]=(0,$t.useState)(e.tags),[n,o]=(0,$t.useState)(e.enabled),i=[...t,...n].filter(Hl),a=p=>i.filter(m=>m.toLowerCase()==p.toLowerCase())[0]||p,l=p=>n.map(m=>m.toLowerCase()).indexOf(p.toLowerCase())!==-1,s=p=>{let m=a(p);l(m)?o(n.filter(h=>h!==m)):o([...n,m])},u=p=>{let m=a(p);r([...t,m].filter(Hl)),o([...n,m].filter(Hl))};return $t.default.createElement("div",{className:"tag-editor clearfix"},$t.default.createElement("input",{type:"hidden",name:e.name,value:JSON.stringify(n)}),i.map(p=>$t.default.createElement(Ji,{key:p,tag:p,enabled:l(p),toggleEnabled:s})),$t.default.createElement(Gi,{addTag:u}))}ta.propTypes={name:ea.default.string,enabled:ea.default.array,tags:ea.default.array};var ra=P(H()),ql=P(J());var po=class extends ra.default.Component{constructor(t){super(t);this.state={toast:void 0,fadeout:!1},this.store=Be,this.timer=void 0,this.handleChange=this.handleChange.bind(this)}componentDidMount(){this.unsubscribe=this.store.subscribe(this.handleChange),this.props.error&&this.store.dispatch({type:"ERROR",message:this.props.error}),this.props.notice&&this.store.dispatch({type:"NOTICE",message:this.props.notice})}componentWillUnmount(){this.unsubscribe(),this.timer&&clearTimeout(this.timer)}handleChange(){this.setState({toast:this.store.getState()[0],fadeout:!1}),this.timer||(this.timer=setTimeout(()=>{this.setState({fadeout:!0}),this.timer=setTimeout(()=>{this.timer=void 0,this.setState({fadeout:!1}),this.store.dispatch({type:"NEXT"})},500)},4e3))}render(){let t=this.state.toast,r=["toast"];return t&&(r.push(t.type),this.state.fadeout&&r.push("fadeout")),ra.default.createElement("div",{className:"toast-wrapper"},t&&ra.default.createElement("div",{className:r.join(" ")},t.message))}};po.propTypes={notice:ql.default.string,error:ql.default.string};var oa=class extends kt{static get targets(){return["form"]}preview(){let t=this.formTarget,r=t.action,n=t.target;t.target="_blank",t.action=t.dataset.previewUrl,t.submit(),t.action=r,t.target=n}};var ia=class extends kt{static get targets(){return["tab","link"]}connect(){let t=this.tabNames();if(t.length>0){let r=null,n=/#(.*)$/;if(document.location.toString().match(n)){let o=document.location.toString().match(n)[1];t.indexOf(o)!==-1&&(r=o)}this.showTab(r||t[0])}window.addEventListener("popstate",this.stateHandler.bind(this))}disconnect(){window.removeEventListener("popstate",this.stateHandler.bind(this))}stateHandler(t){t.state&&t.state.tabId&&this.showTab(t.state.tabId)}changeTab(t){t.preventDefault();let r=t.target.dataset.tab;this.showTab(r),history.pushState({tabId:r},"",`${window.location.pathname}#${r}`)}showTab(t){this.linkTargets.forEach(r=>{r.dataset.tab==t?r.classList.add("current"):r.classList.remove("current")}),this.tabTargets.forEach(r=>{r.dataset.tab==t?r.classList.remove("hidden"):r.classList.add("hidden")})}tabNames(){return this.linkTargets.map(t=>t.dataset.tab)}};var aa=class extends kt{static get targets(){return["tab"]}connect(){this.tabTargets.length>0&&this.showTab(this.tabTargets[0].dataset.tab)}changeTab(t){t.preventDefault(),this.showTab(t.target.dataset.tab)}showTab(t){this.tabTargets.forEach(r=>{r.dataset.tab==t?r.classList.remove("hidden"):r.classList.add("hidden")})}};var la=class extends kt{static get targets(){return["advancedOptions","autoPublishNotice","published","publishedDate"]}connect(){this.checkAutoPublish(),this.checkPublishedDate()}checkAutoPublish(){this.publishedDate()>new Date?this.show(this.autoPublishNoticeTarget):this.hide(this.autoPublishNoticeTarget)}checkPublishedDate(){this.publishedTarget.value==2?this.show(this.publishedDateTarget):this.hide(this.publishedDateTarget)}publishedDate(){let t=r=>this.publishedDateTarget.getElementsByClassName(r)[0].value;return new Date(t("year"),t("month")-1,t("day"),t("hour"),t("minute"))}show(t){t.classList.add("show")}hide(t){t.classList.remove("show")}toggle(t){t.classList.contains("show")?this.hide(t):this.show(t)}toggleAdvancedOptions(t){t.preventDefault(),this.toggle(this.advancedOptionsTarget)}};var Dm=P(H()),Am=P(nc());var oc=[],_m=()=>{if(["interactive","complete"].indexOf(document.readyState)>-1)for(;oc.length>0;)oc.shift()()},Nm=class{constructor(){document.onreadystatechange=_m}ready(t){oc.push(t),_m()}},Pm=new Nm;var jm=class{apply(){document.querySelectorAll("textarea.rich").forEach(r=>{this.enhance(r)})}enhance(t){let r=document.createElement("div");t.parentNode.appendChild(r),Am.default.render(Dm.default.createElement(br,{value:t.value,name:t.name,rows:t.rows,id:t.id}),r),t.parentNode.removeChild(t)}start(){Pm.ready(()=>{this.apply()})}},Im=new jm;Ng();function Hw(e,t){window[e]=t}function xc(){Pg.default.start();for(var e in na)Hw(e,na[e]);Im.start();let t=Pl.start();t.register("edit-page",oa),t.register("main",ia),t.register("login",aa),t.register("page-options",la)}xc();})(); /* object-assign (c) Sindre Sorhus @license MIT */ /** @license React v0.20.2 * scheduler.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ /** @license React v17.0.2 * react-dom-server.browser.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ /** @license React v17.0.2 * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ /** @license React v17.0.2 * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */