decap-cms-core 3.6.1 → 3.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,7 +14,7 @@
14
14
  `),!r)throw Error(`Widget "${t}" registered without \`controlComponent\`.`);_n.widgets[t]=vn({control:r,preview:n,schema:o,globalStyles:a,allowMapValue:i},s)}else console.error("`registerWidget` failed, called with incorrect arguments.")}function kn(e){return _n.widgets[e]}function Cn(){return Gt(Object.entries(_n.widgets),(e=>e.map((([e,t])=>vn({name:e},t)))))}function Tn(e){return kn(e||"string")||kn("unknown")}function Pn(){return _n.editorComponents}function jn(){return _n.remarkPlugins}function Rn(e){return _n.widgetValueSerializers[e]}function Mn(e){return _n.backends[e]}function An(e){return _n.mediaLibraries.find((t=>t.name===e))}function In(e){if(!bn.includes(e))throw new Error(`Invalid event name '${e}'`)}async function Dn({name:e,data:t}){In(e);const r=_n.eventHandlers[e];let n=vn({},t);for(const{handler:e,options:o}of r){const r=await e(n,o);if(void 0!==r){const e=n.entry.set("data",r);n=vn(vn({},t),{},{entry:e})}}return n.entry.get("data")}function Ln(e){return _n.locales[e]}function Nn(){return Object.entries(_n.formats).reduce((function(e,[t,{extension:r}]){return vn(vn({},e),{},{[t]:r})}),{})}function $n(){return Object.entries(_n.formats).reduce((function(e,[t,{formatter:r}]){return vn(vn({},e),{},{[t]:r})}),{})}function Fn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Bn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Fn(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Un=["yaml-frontmatter","toml-frontmatter","json-frontmatter"],zn={yml:"yml",yaml:"yml",toml:"toml",json:"json",frontmatter:"md","json-frontmatter":"md","toml-frontmatter":"md","yaml-frontmatter":"md"},qn={yml:wr,yaml:wr,toml:jr,json:Rr,md:zr,markdown:zr,html:zr};function Wn(e,t){const r=Bn({yml:wr,yaml:wr,toml:jr,json:Rr,frontmatter:zr,"json-frontmatter":Hr(t),"toml-frontmatter":Wr(t),"yaml-frontmatter":qr(t)},$n());if(e in r)return r[e];throw new Error(`No formatter available with name: ${e}`)}function Hn(e,t){const r=e.get("frontmatter_delimiter"),n=(o=r,Qe.List.isList(o)?r.toArray():r);var o;const i=e.get("format");if(i)return Wn(i,n);const a=t&&t.path;if(a){const e=a.split(".").pop();if(e)return Qt()(qn,e)}const s=e.get("extension");return s?Qt()(qn,s):Wn("frontmatter",n)}var Vn=__webpack_require__(45455),Gn=__webpack_require__.n(Vn),Kn=__webpack_require__(93433),Yn=__webpack_require__.n(Kn),Jn=__webpack_require__(39714),Qn=__webpack_require__.n(Jn);const Xn="simple",Zn="editorial_workflow",eo=(0,Qe.OrderedMap)({DRAFT:"draft",PENDING_REVIEW:"pending_review",PENDING_PUBLISH:"pending_publish"});(0,Qe.Map)({[eo.get("DRAFT")]:"Draft",[eo.get("PENDING_REVIEW")]:"Waiting for Review",[eo.get("PENDING_PUBLISH")]:"Waiting to go live"});var to,ro=__webpack_require__(1581),no=__webpack_require__.n(ro),oo=__webpack_require__(12430),io=__webpack_require__(33351),ao=__webpack_require__.n(io),so=new Uint8Array(16);function lo(){if(!to&&!(to="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return to(so)}const co=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var uo=[],fo=0;fo<256;++fo)uo.push((fo+256).toString(16).substr(1));const po=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(uo[e[t+0]]+uo[e[t+1]]+uo[e[t+2]]+uo[e[t+3]]+"-"+uo[e[t+4]]+uo[e[t+5]]+"-"+uo[e[t+6]]+uo[e[t+7]]+"-"+uo[e[t+8]]+uo[e[t+9]]+"-"+uo[e[t+10]]+uo[e[t+11]]+uo[e[t+12]]+uo[e[t+13]]+uo[e[t+14]]+uo[e[t+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&co.test(e)}(r))throw TypeError("Stringified UUID is invalid");return r},ho=function(e,t,r){var n=(e=e||{}).random||(e.rng||lo)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var o=0;o<16;++o)t[r+o]=n[o];return t}return po(n)};var go=__webpack_require__(89166),mo=__webpack_require__.n(go),yo=__webpack_require__(3440),vo=__webpack_require__.n(yo);const bo="file_based_collection",wo="folder_based_collection",_o="commit_author",So="commit_date";var xo=__webpack_require__(51756);const Oo=["title","path"],Eo=["title","date","author","description"],ko={title:{type:"string",secondaryTypes:[],synonyms:["title","name","label","headline","header"],defaultPreview:e=>(0,xo.jsx)("h1",null,e),fallbackToFirstField:!0,showError:!0},shortTitle:{type:"string",secondaryTypes:[],synonyms:["short_title","shortTitle","short"],defaultPreview:e=>(0,xo.jsx)("h2",null,e),fallbackToFirstField:!1,showError:!1},author:{type:"string",secondaryTypes:[],synonyms:["author","name","by","byline","owner"],defaultPreview:e=>(0,xo.jsx)("strong",null,e),fallbackToFirstField:!1,showError:!1},date:{type:"datetime",secondaryTypes:["date"],synonyms:["date","publishDate","publish_date"],defaultPreview:e=>e,fallbackToFirstField:!1,showError:!1},description:{type:"string",secondaryTypes:["text","markdown"],synonyms:["shortDescription","short_description","shortdescription","description","intro","introduction","brief","content","biography","bio","summary"],defaultPreview:e=>e,fallbackToFirstField:!1,showError:!1},image:{type:"image",secondaryTypes:[],synonyms:["image","thumbnail","thumb","picture","avatar","photo","cover","hero","logo"],defaultPreview:e=>e,fallbackToFirstField:!1,showError:!1}};var Co=__webpack_require__(34498),To=__webpack_require__.n(Co),Po=__webpack_require__(25291),jo=__webpack_require__.n(Po);let Ro=function(e){return e.Ascending="Ascending",e.Descending="Descending",e.None="None",e}({});var Mo=__webpack_require__(1573),Ao=__webpack_require__.n(Mo),Io=__webpack_require__(26434),Do=__webpack_require__.n(Io),Lo=__webpack_require__(85395),No=__webpack_require__.n(Lo),$o=__webpack_require__(85505),Fo=__webpack_require__.n($o),Bo=__webpack_require__(883),Uo=__webpack_require__(49705),zo=__webpack_require__.n(Uo),qo=__webpack_require__(63449),Wo=__webpack_require__(17826),Ho=__webpack_require__.n(Wo);function Vo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Go(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Vo(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vo(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ko(e,t){return function(e,t){return`${t?"/#":""}${e}`}(`/collections/${e}/new`,t)}function Yo(e,t){const r=Bo.parse(e,!0);return r.query=Go(Go({},r.query),t),Bo.format(r)}const Jo=/[\w\-.~]/i,Qo=/[\xA0-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFEF}\u{10000}-\u{1FFFD}\u{20000}-\u{2FFFD}\u{30000}-\u{3FFFD}\u{40000}-\u{4FFFD}\u{50000}-\u{5FFFD}\u{60000}-\u{6FFFD}\u{70000}-\u{7FFFD}\u{80000}-\u{8FFFD}\u{90000}-\u{9FFFD}\u{A0000}-\u{AFFFD}\u{B0000}-\u{BFFFD}\u{C0000}-\u{CFFFD}\u{D0000}-\u{DFFFD}\u{E1000}-\u{EFFFD}]/u;function Xo(e){return Jo.test(e)}function Zo(e){return Jo.test(e)||Qo.test(e)}function ei(e,t){let r;if("unicode"===e)r=Zo;else{if("ascii"!==e)throw new Error('`options.encoding` must be "unicode" or "ascii".');r=Xo}if(!Array.from(t).every(r))throw new Error("The replacement character(s) (options.replacement) is itself unsafe.");return e=>r(e)?e:t}function ti(e,t){const{replacement:r="",encoding:n="unicode"}=t||{};if(!Fo()(e))throw new Error("The input slug must be a string.");if(!Fo()(r))throw new Error("`options.replacement` must be a string.");return Array.from(e).map(ei(n,r)).join("")}function ri(e,t){const{encoding:r="unicode",sanitize_replacement:n=""}=t||{};return ei(r,n)(e)}function ni(e,t){if(!Fo()(e))throw new Error("The input slug must be a string.");const{encoding:r,clean_accents:n,sanitize_replacement:o}=t||{},i=No()([...n?[qo.Od]:[],Do()(ti,{replacement:o,encoding:r}),Do()(Ho(),{replacement:o})])(e),a=new RegExp(`(?:${mo()(o)})+`,"g"),s=new RegExp(`${mo()(o)}$`),l=new RegExp(`^${mo()(o)}`);return i.replace(a,o).replace(l,"").replace(s,"")}function oi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ii(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?oi(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const{compileStringTemplate:ai,parseDateFromEntry:si,SLUG_MISSING_REQUIRED_DATE:li,keyToPathArray:ci,addFileTemplateFields:ui}=hr.stringTemplate,fi={create:"Create {{collection}} “{{slug}}”",update:"Update {{collection}} “{{slug}}”",delete:"Delete {{collection}} “{{slug}}”",uploadMedia:"Upload “{{path}}”",deleteMedia:"Delete “{{path}}”",openAuthoring:"{{message}}"},pi=/\{\{([^}]+)\}\}/g;function di(e,t,{slug:r,path:n,collection:o,authorLogin:i,authorName:a},s){const l=ii(ii({},fi),t.backend.commit_messages||{}),c=l[e].replace(pi,((e,t)=>{switch(t){case"slug":return r||"";case"path":return n||"";case"collection":return o?o.get("label_singular")||o.get("label"):"";case"author-login":return i||"";case"author-name":return a||"";default:return console.warn(`Ignoring unknown variable “${t}” in commit message template.`),""}}));return s?l.openAuthoring.replace(pi,((e,t)=>{switch(t){case"message":return c;case"author-login":return i||"";case"author-name":return a||"";default:return console.warn(`Ignoring unknown variable “${t}” in open authoring message template.`),""}})):c}function hi(e){return e.trim().toLocaleLowerCase().replace(/[']/g,"").replace(/[.]/g,"-")}function gi(e,t){return r=>t&&t.includes(r)?r:No()([e=>String(e),hi,Do()(ni,e)])(r)}function mi(e,t,r,n,o){if(!e)return;const i=Ao()(e,"/"),a=t.get("type")===bo?mc(t,n.get("slug")):void 0,s=null!==(l=null==a?void 0:a.get("preview_path"))&&void 0!==l?l:t.get("preview_path");var l;if(!s)return e;let c=n.get("data");c=ui(n.get("path"),c,t.get("folder"));const u=(null!==(f=null==a?void 0:a.get("preview_path_date_field"))&&void 0!==f?f:t.get("preview_path_date_field"))||Cc(t,"date");var f;const p=si(n,u),d=gi(o,[c.get("dirname")]);let h;try{h=ai(s,p,r,c,d)}catch(e){if(e.name===li)return console.error(ln`
15
15
  Collection "${t.get("name")}" configuration error:
16
16
  \`preview_path_date_field\` must be a field with a valid date. Ignoring \`preview_path\`.
17
- `),i;throw e}return`${i}/${Yn()(h," /")}`}function yi(e,t,r,n,o,i){if(!t||!t.get("data"))return e;let a=t.get("data").set(o,n);a=ui(t.get("path"),a,r.get("folder"));const s=si(t,Cc(r,"date"))||null,l=a.getIn(ci(kc(r))),c=gi(i,[n,a.get("dirname")]);return ai(e,s,l,a,c)}var vi=__webpack_require__(18149),bi=__webpack_require__.n(vi),wi=__webpack_require__(4335),_i=__webpack_require__.n(wi);function Si(e,t="",r="",n={}){return{collection:e,slug:t,path:r,partial:n.partial||!1,raw:n.raw||"",data:n.data||{},label:n.label||null,isModification:_i()(n.isModification)?n.isModification:null,mediaFiles:n.mediaFiles||[],author:n.author||"",updatedOn:n.updatedOn||"",status:n.status||"",meta:n.meta||{},i18n:n.i18n||{}}}function xi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Oi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xi(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const{fetchWithTimeout:Ei}=pr.unsentRequest;class ki{constructor(e){if(this.config=e,null==e.get("applicationID")||null==e.get("apiKey"))throw"The Algolia search integration needs the credentials (applicationID and apiKey) in the integration configuration.";this.applicationID=e.get("applicationID"),this.apiKey=e.get("apiKey");const t=e.get("indexPrefix");this.indexPrefix=t?`${t}-`:"",this.searchURL=`https://${this.applicationID}-dsn.algolia.net/1`,this.entriesCache={collection:null,page:null,entries:[]}}requestHeaders(e={}){return Oi({"X-Algolia-API-Key":this.apiKey,"X-Algolia-Application-Id":this.applicationID,"Content-Type":"application/json"},e)}parseJsonResponse(e){return e.json().then((t=>e.ok?t:Promise.reject(t)))}urlFor(e,t){const r=[];if(t.params)for(const e in t.params)r.push(`${e}=${encodeURIComponent(t.params[e])}`);return r.length&&(e+=`?${r.join("&")}`),e}request(e,t={}){const r=this.requestHeaders(t.headers||{}),n=this.urlFor(e,t);return Ei(n,Oi(Oi({},t),{},{headers:r})).then((e=>{const t=e.headers.get("Content-Type");return t&&t.match(/json/)?this.parseJsonResponse(e):e.text()}))}search(e,t,r){const n=e.map((e=>({indexName:`${this.indexPrefix}${e}`,params:`query=${t}&page=${r}`})));return this.request(`${this.searchURL}/indexes/*/queries`,{method:"POST",body:JSON.stringify({requests:n})}).then((t=>{const n=t.results.map(((t,r)=>t.hits.map((t=>{const n=t.path.split("/").pop().replace(/\.[^.]+$/,"");return Si(e[r],n,t.path,{data:t.data,partial:!0})}))));return{entries:sr()(n),pagination:r}}))}searchBy(e,t,r){return this.request(`${this.searchURL}/indexes/${this.indexPrefix}${t}`,{params:{restrictSearchableAttributes:e,query:r}})}listEntries(e,t){return this.entriesCache.collection===e&&this.entriesCache.page===t?Promise.resolve({page:this.entriesCache.page,entries:this.entriesCache.entries}):this.request(`${this.searchURL}/indexes/${this.indexPrefix}${e.get("name")}`,{params:{page:t}}).then((t=>{const r=t.hits.map((t=>{const r=_c(e,t.path);return Si(e.get("name"),r,t.path,{data:t.data,partial:!0})}));return this.entriesCache={collection:e,pagination:t.page,entries:r},{entries:r,pagination:t.page}}))}async listAllEntries(e){const t={hitsPerPage:1e3};let r=await this.request(`${this.searchURL}/indexes/${this.indexPrefix}${e.get("name")}`,{params:t}),{nbPages:n=0,hits:o,page:i}=r;for(i+=1;i<n;)r=await this.request(`${this.searchURL}/indexes/${this.indexPrefix}${e.get("name")}`,{params:Oi(Oi({},t),{},{page:i})}),o=[...o,...r.hits],i+=1;const a=o.map((t=>{const r=_c(e,t.path);return Si(e.get("name"),r,t.path,{data:t.data,partial:!0})}));return a}getEntry(e,t){return this.searchBy("slug",e.get("name"),t).then((r=>{const n=r.hits.filter((e=>e.slug===t))[0];return Si(e.get("name"),t,n.path,{data:n.data,partial:!0})}))}}var Ci=__webpack_require__(42208),Ti=__webpack_require__.n(Ci);function Pi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ji(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pi(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const{fetchWithTimeout:Ri}=pr.unsentRequest;class Mi{constructor(e,t){if(this.config=e,null==e.get("getSignedFormURL"))throw"The AssetStore integration needs the getSignedFormURL in the integration configuration.";this.getToken=t,this.shouldConfirmUpload=e.get("shouldConfirmUpload",!1),this.getSignedFormURL=Ao()(e.get("getSignedFormURL"),"/")}parseJsonResponse(e){return e.json().then((t=>e.ok?t:Promise.reject(t)))}urlFor(e,t){const r=[];if(t.params)for(const e in t.params)r.push(`${e}=${encodeURIComponent(t.params[e])}`);return r.length&&(e+=`?${r.join("&")}`),e}requestHeaders(e={}){return ji({},e)}confirmRequest(e){this.getToken().then((t=>this.request(`${this.getSignedFormURL}/${e}`,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify({state:"uploaded"})})))}async request(e,t={}){const r=this.requestHeaders(t.headers||{}),n=this.urlFor(e,t),o=await Ri(n,ji(ji({},t),{},{headers:r})),i=o.headers.get("Content-Type");return i&&i.match(/json/)?await this.parseJsonResponse(o):o.text()}async retrieve(e,t,r){const n=Ti()({search:e,page:t,filter:r?"private":"public"},(e=>!!e)),o=Yo(this.getSignedFormURL,n),i={"Content-Type":"application/json",Authorization:`Bearer ${await this.getToken()}`},a=(await this.request(o,{headers:i})).map((({id:e,name:t,size:r,url:n})=>({id:e,name:t,size:r,displayURL:n,url:n,path:n})));return a}delete(e){const t=`${this.getSignedFormURL}/${e}`;return this.getToken().then((e=>this.request(t,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}})))}async upload(e,t=!1){const r={name:e.name,size:e.size};e.type&&(r.content_type=e.type),t&&(r.visibility="private");try{const t=await this.getToken(),n=await this.request(this.getSignedFormURL,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(r)}),o=n.form.url,i=n.form.fields,{id:a,name:s,size:l,url:c}=n.asset,u=new FormData;return Object.keys(i).forEach((e=>u.append(e,i[e]))),u.append("file",e,e.name),await this.request(o,{method:"POST",body:u}),this.shouldConfirmUpload&&await this.confirmRequest(a),{success:!0,asset:{id:a,name:s,size:l,displayURL:c,url:c,path:c}}}catch(e){throw console.error(e),e}}}const Ai=function(){let e=null;return(t,r,n)=>(e||(e=function(e,t){let r=(0,Qe.Map)({});return e.get("providers").forEach(((e,n)=>{switch(n){case"algolia":r=r.set("algolia",new ki(e));break;case"assetStore":r=r.set("assetStore",new Mi(e,t))}})),r}(t,r)),e.get(n))}(),Ii="SEARCH_ENTRIES_REQUEST",Di="SEARCH_ENTRIES_SUCCESS",Li="SEARCH_ENTRIES_FAILURE",Ni="QUERY_REQUEST",$i="QUERY_SUCCESS",Fi="QUERY_FAILURE",Bi="SEARCH_CLEAR",Ui="CLEAR_REQUESTS";function zi(){return{type:Bi}}function qi(e,t,r,n,o,i){return async(a,s)=>{const l=s(),c=rf(l.config),u=Gf(l,t,"search"),f=l.collections.find((e=>e.get("name")===t));a({type:Ui});const p=`${t}-${r.join()}-${n}-${o}-${i}`,d=l.search.requests.find((({id:e})=>e==p)),h=d?d.queryResponse:u?Ai(l.integrations,c.getToken,u).searchBy(r.map((e=>`data.${e}`)),t,n):c.query(f,r,n,o,i);a(function(e,t){return{type:Ni,payload:{searchTerm:e,request:t}}}(n,d?void 0:{id:p,expires:new Date((new Date).getTime()+1e4),queryResponse:h}));try{const t=await h;return a(function(e,t){return{type:$i,payload:{namespace:e,hits:t}}}(e,t.hits))}catch(e){return a(function(e){return{type:Fi,payload:{error:e}}}(e))}}}function Wi(e,t){return new pr.Cursor(e.getIn(["cursorsByType","collectionEntries",t]))}var Hi=__webpack_require__(1842),Vi=__webpack_require__.n(Hi);function Gi(e,t,r){let n=t.reduce(((t,n)=>{const o=n.get("name"),i=e.get(o),a=Rn(n.get("widget")),s=n.get("fields");return s&&Qe.List.isList(i)?t.set(o,i.map((e=>Gi(e,s,r)))):s&&Qe.Map.isMap(i)?t.set(o,Gi(i,s,r)):a&&!Vi()(i)?t.set(o,a[r](i)):Vi()(i)?t:t.set(o,i)}),(0,Qe.Map)());return n=e.mergeDeep(n),n}const Ki={PRESENCE:"PRESENCE",PATTERN:"PATTERN",RANGE:"RANGE",CUSTOM:"CUSTOM"};function Yi({predicate:e,run:t}){return{type:Je,predicate:e,run:t}}async function Ji(e,t,r=3e4){let n=!1;const o=new Promise((r=>{e(Yi(t(r)))})),i=new Promise((e=>{setTimeout((()=>{n?e():(console.warn("Wait Action timed out"),e(null))}),r)}));return await Promise.race([o.then((e=>(n=!0,e))).catch(null),i])}const Qi="NOTIFICATION_SEND",Xi="NOTIFICATION_DISMISS",Zi="NOTIFICATION_CLEAR";function ea(e){return{type:Qi,payload:e}}function ta(e){return{type:Xi,id:e}}function ra(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function na(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ra(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ra(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const oa="MEDIA_LIBRARY_OPEN",ia="MEDIA_LIBRARY_CLOSE",aa="MEDIA_LIBRARY_CREATE",sa="MEDIA_INSERT",la="MEDIA_REMOVE_INSERTED",ca="MEDIA_LOAD_REQUEST",ua="MEDIA_LOAD_SUCCESS",fa="MEDIA_LOAD_FAILURE",pa="MEDIA_PERSIST_REQUEST",da="MEDIA_PERSIST_SUCCESS",ha="MEDIA_PERSIST_FAILURE",ga="MEDIA_DELETE_REQUEST",ma="MEDIA_DELETE_SUCCESS",ya="MEDIA_DELETE_FAILURE",va="MEDIA_DISPLAY_URL_REQUEST",ba="MEDIA_DISPLAY_URL_SUCCESS",wa="MEDIA_DISPLAY_URL_FAILURE";function _a(e){return(t,r)=>{const n=r().mediaLibrary.get("externalLibrary");n&&n.onClearControl({id:e})}}function Sa(e){return(t,r)=>{const n=r().mediaLibrary.get("externalLibrary");n&&n.onRemoveControl({id:e})}}function xa(e={}){return(t,r)=>{const n=r().mediaLibrary.get("externalLibrary");if(n){const{controlID:t,value:r,config:o=(0,Qe.Map)(),allowMultiple:i,forImage:a}=e;n.show({id:t,value:r,config:o.toJS(),allowMultiple:i,imagesOnly:a})}t(function(e){return{type:oa,payload:e}}(e))}}function Oa(e,t){return(r,n)=>{const o=n(),i=o.config,a=o.entryDraft.get("entry"),s=o.entryDraft.getIn(["entry","collection"]),l=o.collections.get(s);r(function(e){return{type:sa,payload:{mediaPath:e}}}(e=Array.isArray(e)?e.map((e=>lc(i,l,e,a,t))):lc(i,l,e,a,t)))}}function Ea(e){return{type:la,payload:{controlID:e}}}function ka(e={}){const{delay:t=0,query:r="",page:n=1,privateUpload:o}=e;return async(e,i)=>{const a=i(),s=rf(a.config),l=Gf(a,null,"assetStore");if(l){const t=Ai(a.integrations,s.getToken,l);e(Ra(n));try{const i=await t.retrieve(r,n,o);return e(Ma(i,{page:n,canPaginate:!0,dynamicSearch:!0,dynamicSearchQuery:r,privateUpload:o}))}catch(t){return e(Aa({privateUpload:o}))}}function c(){return s.getMedia().then((t=>e(Ma(t)))).catch((t=>{console.error(t),404===t.status?(console.log("This 404 was expected and handled appropriately."),e(Ma([]))):e(Aa())}))}return e(Ra(n)),t>0?new Promise((e=>{setTimeout((()=>e(c())),t)})):c()}}function Ca({id:e,file:t,assetProxy:r,draft:n}){return{id:e,name:(0,pr.basename)(r.path),displayURL:r.url,draft:n,file:t,size:t.size,url:r.url,path:r.path,field:r.field}}function Ta(e,t={}){const{privateUpload:r,field:n}=t;return async(t,o)=>{const i=o(),a=rf(i.config),s=Gf(i,null,"assetStore"),l=qa(i,n),c=ni(e.name.toLowerCase(),i.config.slug),u=l.find((e=>e.name.toLowerCase()===c)),f=cc(i.entryDraft);if(!s&&u){if(!window.confirm(`${u.name} already exists. Do you want to replace it?`))return;await t(Pa(u,{privateUpload:r}))}!s&&f||t({type:pa});try{let o,l;if(s)try{const t=Ai(i.integrations,a.getToken,s),n=await t.upload(e,r);o=Tr({url:n.asset.url,path:n.asset.url})}catch(t){o=Tr({file:e,path:c})}else{if(r)throw new Error("The Private Upload option is only available for Asset Store Integration");{const t=i.entryDraft.get("entry"),r=i.collections.get(null==t?void 0:t.get("collection")),a=sc(i.config,r,t,c,n);o=Tr({file:e,path:a,field:n})}}if(t(Xa(o)),s)l=Ca({id:await(0,pr.getBlobSHA)(e),file:e,assetProxy:o,draft:!1});else{if(f)return l=Ca({id:await(0,pr.getBlobSHA)(e),file:e,assetProxy:o,draft:f}),t(function(e){return{type:ul,payload:e}}(l));l=await a.persistMedia(i.config,o)}return t(function(e,t={}){const{privateUpload:r}=t;return{type:da,payload:{file:e,privateUpload:r}}}(l,{privateUpload:r}))}catch(e){return console.error(e),t(ea({message:`Failed to persist media: ${e}`,type:"error",dismissAfter:8e3})),t(function(e={}){const{privateUpload:t}=e;return{type:ha,payload:{privateUpload:t}}}({privateUpload:r}))}}}function Pa(e,t={}){const{privateUpload:r}=t;return async(t,n)=>{const o=n(),i=rf(o.config),a=Gf(o,null,"assetStore");if(a){const n=Ai(o.integrations,i.getToken,a);t(Ia());try{return await n.delete(e.id),t(Da(e,{privateUpload:r}))}catch(e){return console.error(e),t(ea({message:`Failed to delete media: ${e.message}`,type:"error",dismissAfter:8e3})),t(La({privateUpload:r}))}}try{if(e.draft)t(Za(e.path)),t(_l({id:e.id}));else{const r=cc(o.entryDraft);t(Ia()),t(Za(e.path)),await i.deleteMedia(o.config,e.path),t(Da(e)),r&&t(_l({id:e.id}))}}catch(e){return console.error(e),t(ea({message:`Failed to delete media: ${e.message}`,type:"error",dismissAfter:8e3})),t(La())}}}function ja(e){return async(t,r)=>{const{displayURL:n,id:o}=e,i=r(),a=Wa(i,o);if(!o||!n||a.get("url")||a.get("isFetching")||a.get("err"))return Promise.resolve();if("string"==typeof n)return t(Na(o)),void t($a(o,n));try{const e=rf(i.config);t(Na(o));const r=await e.getMediaDisplayURL(n);if(!r)throw new Error("No display URL was returned!");t($a(o,r))}catch(e){console.error(e),t(function(e,t){return{type:wa,payload:{key:e,err:t}}}(o,e))}}}function Ra(e){return{type:ca,payload:{page:e}}}function Ma(e,t={}){return{type:ua,payload:na({files:e},t)}}function Aa(e={}){const{privateUpload:t}=e;return{type:fa,payload:{privateUpload:t}}}function Ia(){return{type:ga}}function Da(e,t={}){const{privateUpload:r}=t;return{type:ma,payload:{file:e,privateUpload:r}}}function La(e={}){const{privateUpload:t}=e;return{type:ya,payload:{privateUpload:t}}}function Na(e){return{type:va,payload:{key:e}}}function $a(e,t){return{type:ba,payload:{key:e,url:t}}}async function Fa(e,t){!1===t.mediaLibrary.get("isLoading")||t.mediaLibrary.get("externalLibrary")||await Ji(e,(e=>({predicate:({type:e})=>e===ua||e===fa,run:()=>e()})))}function Ba(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ua(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ba(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ba(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const za={isVisible:!1,showMediaButton:!0,controlMedia:(0,Qe.Map)(),displayURLs:(0,Qe.Map)(),config:(0,Qe.Map)()};function qa(e,t){const{mediaLibrary:r,entryDraft:n}=e,o=cc(e.entryDraft),i=Gf(e,null,"assetStore");let a;if(o&&!i){const r=n.getIn(["entry","mediaFiles"],(0,Qe.List)()).toJS(),o=n.get("entry"),i=e.collections.get(null==o?void 0:o.get("collection")),s=ac(e.config,i,o,t);a=r.filter((e=>(0,dr.dirname)(e.path)===s)).map((e=>Ua({key:e.id},e)))}else a=r.get("files")||[];return a}function Wa(e,t){return e.mediaLibrary.getIn(["displayURLs",t],(0,Qe.Map)())}const Ha="ADD_ASSETS",Va="ADD_ASSET",Ga="REMOVE_ASSET",Ka="LOAD_ASSET_REQUEST",Ya="LOAD_ASSET_SUCCESS",Ja="LOAD_ASSET_FAILURE";function Qa(e){return{type:Ha,payload:e}}function Xa(e){return{type:Va,payload:e}}function Za(e){return{type:Ga,payload:e}}const es=Tr({path:"empty.svg",file:new File(['<svg xmlns="http://www.w3.org/2000/svg"></svg>'],"empty.svg",{type:"image/svg+xml"})});function ts(e,t,r){return function(n,o){return e(rs({collection:t,entry:r,path:n,field:o}))}}function rs({collection:e,entry:t,path:r,field:n}){return(o,i)=>{if(!r)return es;const a=i(),s=sc(a.config,e,t,r,n);let{asset:l,isLoading:c,error:u}=a.medias[s]||{};return c?es:l||((0,pr.isAbsolutePath)(s)||u?(l=Tr({path:s,url:r}),o(Xa(l))):(o(function(e){return async(t,r)=>{try{t({type:Ka,payload:{path:e}}),await Fa(t,r());const i=(n=r(),o=e,qa(n).find((e=>e.path===o)));if(i){const n=await async function(e,t,r){const n=Wa(t,r.id);let o;if(n.get("url"))o=n.get("url");else if(n.get("err"))o=null;else{var i;const t=r.id,a=Ji(e,(e=>({predicate:({type:e,payload:r})=>(e===ba||e===wa)&&r.key===t,run:(t,r,n)=>e(n.payload.url)})));n.get("isFetching")||e(ja(r)),o=null!==(i=await a)&&void 0!==i?i:null}return o}(t,r(),i);t(Xa(Tr({path:e,url:n||e})))}else{const{url:n}=await async function(e,t){const r=rf(e.config),{url:n}=await r.getMediaFile(t);return{url:n}}(r(),e);t(Xa(Tr({path:e,url:n})))}t(function(e){return{type:Ya,payload:{path:e}}}(e))}catch(r){t(function(e,t){return{type:Ja,payload:{path:e,error:t}}}(e,r))}var n,o}}(s)),l=es),l)}}const ns=function(e){void 0===e&&(e={}),ge||se(!1);var t=window.history,r=(window.navigator.userAgent.indexOf("Firefox"),e),n=r.getUserConfirmation,o=void 0===n?me:n,i=r.hashType,a=void 0===i?"slash":i,s=e.basename?fe(le(e.basename)):"",l=ve[a],c=l.encodePath,u=l.decodePath;function f(){var e=u(we());return s&&(e=ue(e,s)),de(e)}var p=he();function h(e){d(k,e),k.length=t.length,p.notifyListeners(k.location,k.action)}var g=!1,m=null;function y(){var e=we(),t=c(e);if(e!==t)_e(t);else{var r=f(),n=k.location;if(!g&&function(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash}(n,r))return;if(m===pe(r))return;m=null,function(e){if(g)g=!1,h();else{p.confirmTransitionTo(e,"POP",o,(function(t){t?h({action:"POP",location:e}):function(e){var t=k.location,r=_.lastIndexOf(pe(t));-1===r&&(r=0);var n=_.lastIndexOf(pe(e));-1===n&&(n=0);var o=r-n;o&&(g=!0,S(o))}(e)}))}}(r)}}var v=we(),b=c(v);v!==b&&_e(b);var w=f(),_=[pe(w)];function S(e){t.go(e)}var x=0;function O(e){1===(x+=e)&&1===e?window.addEventListener(ye,y):0===x&&window.removeEventListener(ye,y)}var E=!1,k={length:t.length,action:"POP",location:w,createHref:function(e){var t=document.querySelector("base"),r="";return t&&t.getAttribute("href")&&(r=be(window.location.href)),r+"#"+c(s+pe(e))},push:function(e,t){var r="PUSH",n=de(e,void 0,void 0,k.location);p.confirmTransitionTo(n,r,o,(function(e){if(e){var t=pe(n),o=c(s+t);if(we()!==o){m=t,function(e){window.location.hash=e}(o);var i=_.lastIndexOf(pe(k.location)),a=_.slice(0,i+1);a.push(t),_=a,h({action:r,location:n})}else h()}}))},replace:function(e,t){var r="REPLACE",n=de(e,void 0,void 0,k.location);p.confirmTransitionTo(n,r,o,(function(e){if(e){var t=pe(n),o=c(s+t);we()!==o&&(m=t,_e(o));var i=_.indexOf(pe(k.location));-1!==i&&(_[i]=t),h({action:r,location:n})}}))},go:S,goBack:function(){S(-1)},goForward:function(){S(1)},block:function(e){void 0===e&&(e=!1);var t=p.setPrompt(e);return E||(O(1),E=!0),function(){return E&&(E=!1,O(-1)),t()}},listen:function(e){var t=p.appendListener(e);return O(1),function(){O(-1),t()}}};return k}();function os(e){return ns.push(`/collections/${e}`)}function is(e){return ns.replace(`/collections/${e}/new`)}function as(e,t){return ns.replace(`/collections/${e}/entries/${t}`)}const ss="UNPUBLISHED_ENTRY_REQUEST",ls="UNPUBLISHED_ENTRY_SUCCESS",cs="UNPUBLISHED_ENTRY_REDIRECT",us="UNPUBLISHED_ENTRIES_REQUEST",fs="UNPUBLISHED_ENTRIES_SUCCESS",ps="UNPUBLISHED_ENTRIES_FAILURE",ds="UNPUBLISHED_ENTRY_PERSIST_REQUEST",hs="UNPUBLISHED_ENTRY_PERSIST_SUCCESS",gs="UNPUBLISHED_ENTRY_PERSIST_FAILURE",ms="UNPUBLISHED_ENTRY_STATUS_CHANGE_REQUEST",ys="UNPUBLISHED_ENTRY_STATUS_CHANGE_SUCCESS",vs="UNPUBLISHED_ENTRY_STATUS_CHANGE_FAILURE",bs="UNPUBLISHED_ENTRY_PUBLISH_REQUEST",ws="UNPUBLISHED_ENTRY_PUBLISH_SUCCESS",_s="UNPUBLISHED_ENTRY_PUBLISH_FAILURE",Ss="UNPUBLISHED_ENTRY_DELETE_SUCCESS";function xs(e,t){return{type:fs,payload:{entries:e,pages:t}}}function Os(e,t){return{type:ds,payload:{collection:e.get("name"),slug:t}}}function Es(e,t){return{type:hs,payload:{collection:e.get("name"),entry:t}}}function ks(e,t,r){return{type:gs,payload:{error:e,collection:t.get("name"),slug:r},error:e}}function Cs(e,t){return async(r,n)=>{const o=n(),i=rf(o.config);if(!Qt()(o.editorialWorkflow.toJS(),"pages.ids",!1))try{const{entries:e,pagination:t}=await i.unpublishedEntries(o.collections);r(xs(e,t))}catch(e){}r(function(e,t){return{type:ss,payload:{collection:e.get("name"),slug:t}}}(e,t));try{const n=await i.unpublishedEntry(o,e,t),a=await Promise.all(n.mediaFiles.filter((e=>e.draft)).map((({url:e,file:t,path:r})=>Tr({path:r,url:e,file:t}))));r(Qa(a)),r(function(e,t){return{type:ls,payload:{collection:e.get("name"),entry:t}}}(e,n)),r(bl(n))}catch(n){n.name===pr.EDITORIAL_WORKFLOW_ERROR&&n.notUnderEditorialWorkflow?(r(function(e,t){return{type:cs,payload:{collection:e.get("name"),slug:t}}}(e,t)),r(Sl(e,t))):r(ea({message:{key:"ui.toast.onFailToLoadEntries",details:n},type:"error",dismissAfter:8e3}))}}}function Ts(e){return(t,r)=>{const n=r(),o=rf(n.config),i=Qt()(n.editorialWorkflow.toJS(),"pages.ids",!1);n.config.publish_mode!==Zn||i||(t({type:us}),o.unpublishedEntries(e).then((e=>t(xs(e.entries,e.pagination)))).catch((e=>{t(ea({message:{key:"ui.toast.onFailToLoadEntries",details:e},type:"error",dismissAfter:8e3})),t(function(e){return{type:ps,error:"Failed to load entries",payload:e}}(e)),Promise.reject(e)})))}}function Ps(e,t,r,n){return(o,i)=>{if(r===n)return;const a=i(),s=rf(a.config);o(function(e,t){return{type:ms,payload:{collection:e,slug:t}}}(e,t)),s.updateUnpublishedEntryStatus(e,t,n).then((()=>{o(ea({message:{key:"ui.toast.entryUpdated"},type:"success",dismissAfter:4e3})),o(function(e,t,r){return{type:ys,payload:{collection:e,slug:t,newStatus:r}}}(e,t,n))})).catch((r=>{o(ea({message:{key:"ui.toast.onFailToUpdateStatus",details:r},type:"error",dismissAfter:8e3})),o(function(e,t){return{type:vs,payload:{collection:e,slug:t}}}(e,t))}))}}function js(e,t){return(r,n)=>{const o=n(),i=rf(o.config);return r(function(e,t){return{type:"UNPUBLISHED_ENTRY_DELETE_REQUEST",payload:{collection:e,slug:t}}}(e,t)),i.deleteUnpublishedEntry(e,t).then((()=>{r(ea({message:{key:"ui.toast.onDeleteUnpublishedChanges"},type:"success",dismissAfter:4e3})),r(function(e,t){return{type:Ss,payload:{collection:e,slug:t}}}(e,t))})).catch((n=>{r(ea({message:{key:"ui.toast.onDeleteUnpublishedChanges",details:n},type:"error",dismissAfter:8e3})),r(function(e,t){return{type:"UNPUBLISHED_ENTRY_DELETE_FAILURE",payload:{collection:e,slug:t}}}(e,t))}))}}function Rs(e,t){return async(r,n)=>{const o=n(),i=o.collections,a=rf(o.config),s=Vf(o,e,t);r(function(e,t){return{type:bs,payload:{collection:e,slug:t}}}(e,t));try{await a.publishUnpublishedEntry(s),r(ka()),r(ea({message:{key:"ui.toast.entryPublished"},type:"success",dismissAfter:4e3})),r(function(e,t){return{type:ws,payload:{collection:e,slug:t}}}(e,t));const n=i.get(e);if(!n.has("nested"))return r(Sl(n,t));{r(kl(n));const e=Qu(n,s.get("path"));Sl(n,e),t!==e&&cc(o.entryDraft)&&as(n.get("name"),e)}}catch(n){r(ea({message:{key:"ui.toast.onFailToPublishEntry",details:n},type:"error",dismissAfter:8e3})),r(function(e,t){return{type:_s,payload:{collection:e,slug:t}}}(e,t))}}}const Ms=(0,Qe.Map)({entry:(0,Qe.Map)(),fieldsMetaData:(0,Qe.Map)(),fieldsErrors:(0,Qe.Map)(),hasChanged:!1,key:""});function As(e,t){if(!jc(e))return;const r=t.getIn(["entry","meta"]),n=r&&r.get("path"),o=Qt()(e.toJS(),["meta","path","index_file"]),i=vc(e);return n&&(0,dr.join)(e.get("folder"),n,`${o}.${i}`)}function Is(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ds(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Is(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Is(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Ls="ENTRY_REQUEST",Ns="ENTRY_SUCCESS",$s="ENTRY_FAILURE",Fs="ENTRIES_REQUEST",Bs="ENTRIES_SUCCESS",Us="ENTRIES_FAILURE",zs="SORT_ENTRIES_REQUEST",qs="SORT_ENTRIES_SUCCESS",Ws="SORT_ENTRIES_FAILURE",Hs="FILTER_ENTRIES_REQUEST",Vs="FILTER_ENTRIES_SUCCESS",Gs="FILTER_ENTRIES_FAILURE",Ks="GROUP_ENTRIES_REQUEST",Ys="GROUP_ENTRIES_SUCCESS",Js="GROUP_ENTRIES_FAILURE",Qs="DRAFT_CREATE_FROM_ENTRY",Xs="DRAFT_CREATE_EMPTY",Zs="DRAFT_DISCARD",el="DRAFT_CHANGE_FIELD",tl="DRAFT_VALIDATION_ERRORS",rl="DRAFT_CLEAR_ERRORS",nl="DRAFT_LOCAL_BACKUP_RETRIEVED",ol="DRAFT_CREATE_FROM_LOCAL_BACKUP",il="DRAFT_CREATE_DUPLICATE_FROM_ENTRY",al="ENTRY_PERSIST_REQUEST",sl="ENTRY_PERSIST_SUCCESS",ll="ENTRY_PERSIST_FAILURE",cl="ENTRY_DELETE_SUCCESS",ul="ADD_DRAFT_ENTRY_MEDIA_FILE",fl="REMOVE_DRAFT_ENTRY_MEDIA_FILE",pl="CHANGE_VIEW_STYLE";function dl(e){return{type:Fs,payload:{collection:e.get("name")}}}function hl(e,t,r,n,o=!0){return{type:Bs,payload:{collection:e.get("name"),entries:t,page:r,cursor:pr.Cursor.create(n),append:o}}}function gl(e,t){return{type:Us,error:"Failed to load entries",payload:t.toString(),meta:{collection:e.get("name")}}}async function ml(e,t){const r=rf(e.config),n=Gf(e,t.get("name"),"listEntries"),o=n?Ai(e.integrations,r.getToken,n):r;return await o.listAllEntries(t)}function yl(e,t,r=Ro.Ascending){return async(n,o)=>{const i=o(),a=ec(i.entries,e.get("name"));if(n({type:zs,payload:{collection:e.get("name"),key:t,direction:r}}),!a)try{const o=await ml(i,e);n({type:qs,payload:{collection:e.get("name"),key:t,direction:r,entries:o}})}catch(o){n({type:Ws,payload:{collection:e.get("name"),key:t,direction:r,error:o}})}}}function vl(e,t){return{type:cl,payload:{collectionName:e.get("name"),entrySlug:t}}}function bl(e){return{type:Qs,payload:{entry:e}}}function wl(e){return{type:rl,payload:{uniqueFieldId:e}}}function _l({id:e}){return{type:fl,payload:{id:e}}}function Sl(e,t){return async(r,n)=>{await Fa(r,n()),r(function(e,t){return{type:Ls,payload:{collection:e.get("name"),slug:t}}}(e,t));try{const o=await xl(n(),e,t);r(function(e,t){return{type:Ns,payload:{collection:e.get("name"),entry:t}}}(e,o)),r(bl(o))}catch(n){r(ea({message:{details:n.message,key:"ui.toast.onFailToLoadEntries"},type:"error",dismissAfter:8e3})),r(function(e,t,r){return{type:$s,payload:{error:e,collection:t.get("name"),slug:r}}}(n,e,t))}}}async function xl(e,t,r){const n=rf(e.config);return await n.getEntry(e,t,r)}const Ol=(0,Qe.fromJS)({append_next:{action:"next",append:!0}});function El(e){return pr.Cursor.create(e).updateStore("actions",(e=>e.union(Ol.filter((t=>e.has(t.get("action")))).keySeq())))}function kl(e,t=0){return async(r,n)=>{if(e.get("isFetching"))return;const o=n(),i=Yl(o.entries,e.get("name"));if(i&&i.length>0){const t=i[0];return r(yl(e,t.get("key"),t.get("direction")))}const a=rf(o.config),s=Gf(o,e.get("name"),"listEntries"),l=s?Ai(o.integrations,a.getToken,s):a,c=!!(t&&!isNaN(t)&&t>0);r(dl(e));try{const n=e.has("nested")||Lc(e);let o=await(n?l.listAllEntries(e).then((e=>({entries:e}))):l.listEntries(e,t));o=Ds(Ds({},o),{},{cursor:s?pr.Cursor.create({actions:["next"],meta:{usingOldPaginationAPI:!0},data:{nextPage:t+1}}):pr.Cursor.create(o.cursor)}),r(hl(e,o.cursor.meta.get("usingOldPaginationAPI")?o.entries.reverse():o.entries,o.pagination,El(o.cursor),c))}catch(t){return r(ea({message:{details:t,key:"ui.toast.onFailToLoadEntries"},type:"error",dismissAfter:8e3})),Promise.reject(r(gl(e,t)))}}}function Cl(e,t=(()=>!1)){return e.reduce(((e,r)=>{const n=e,o=r;if(t(o))return n;const i=o.get("field")||o.get("fields"),a="list"==o.get("widget"),s=o.get("name"),l=o.get("default",null);if(Qe.List.isList(i)||Qe.Map.isMap(i)){if(a&&Qe.List.isList(l))n[s]=l;else{const e=Qe.List.isList(i)?i:(0,Qe.List)([i]),r=a?[Cl(e,t)]:Cl(e,t);c=r,[[{}],{}].some((e=>bi()(c,e)))||(n[s]=r)}return n}var c;return null!==l&&(n[s]=l),n}),{})}function Tl({entry:e}){return e.get("mediaFiles").toArray().filter((e=>e.get("draft"))).map((e=>Tr({path:e.get("path"),file:e.get("file"),url:e.get("url"),field:e.get("field")})))}function Pl(e,t){const r=yc(e,t.get("slug"));function n(e){return function(e,t){return Gi(e,t,"serialize")}(e,r)}const o=n(t.get("data"));let i=t.set("data",o);return Lc(e)&&(i=function(e,t,r){const{locales:n,defaultLocale:o}=Nc(e);return n.filter((e=>e!==o)).forEach((e=>{const n=Uc(e);t=t.setIn(n,r(t.getIn(n)))})),t}(e,i,n)),i}function jl(e,t,r){return{error:{type:Ki.CUSTOM,message:r(`editor.editorControlPane.widget.${t}`,{path:e})}}}const Rl="VIEW_STYLE_LIST",Ml="VIEW_STYLE_GRID";function Al(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Il(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Al(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Al(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const{keyToPathArray:Dl}=hr.stringTemplate;let Ll,Nl,$l,Fl,Bl;const Ul="decap-cms.entries.sort",zl="decap-cms.entries.viewStyle",ql=jo()((()=>{const e=localStorage.getItem(Ul);if(e)try{const t=JSON.parse(e);let r=(0,Qe.Map)();return Object.entries(t).forEach((([e,t])=>{let n=(0,Qe.OrderedMap)();Zt()(Object.values(t),["index"]).forEach((e=>{const{key:t,direction:r}=e;n=n.set(t,(0,Qe.fromJS)({key:t,direction:r}))})),r=r.set(e,n)})),r}catch(e){return(0,Qe.Map)()}return(0,Qe.Map)()}));function Wl(e){if(e){const t={};e.keySeq().forEach((r=>{const n=r;e.get(n).valueSeq().toJS().map(((e,t)=>Il(Il({},e),{},{index:t}))).forEach((e=>{Yt()(t,[n,e.key],e)}))})),localStorage.setItem(Ul,JSON.stringify(t))}else localStorage.removeItem(Ul)}const Hl=jo()((()=>localStorage.getItem(zl)||(localStorage.setItem(zl,Rl),Rl)));function Vl(e,t){const r=e.get("sort");return null==r?void 0:r.get(t)}function Gl(e,t){const r=e.get("filter");return(null==r?void 0:r.get(t))||(0,Qe.Map)()}function Kl(e,t){const r=e.get("group");return(null==r?void 0:r.get(t))||(0,Qe.Map)()}function Yl(e,t){const r=Vl(e,t),n=(null==r?void 0:r.valueSeq().filter((e=>(null==e?void 0:e.get("direction"))!==Ro.None)).toArray())||[];return n}function Jl(e,t,r){return e.getIn(["entities",`${t}.${r}`])}function Ql(e,t){return e.getIn(["pages",t,"ids"],(0,Qe.List)())}function Xl(e,t){const r=Ql(e,t),n=r&&r.map((r=>Jl(e,t,r)));return n}function Zl(e,t){const r=t.get("name");let n=Xl(e,r);const o=Yl(e,r);if(o&&o.length>0){const e=o.map((e=>function(e,t){return t===So?"updatedOn":t!==_o||Oc(e,t)?`data.${t}`:"author"}(t,e.get("key")))),r=o.map((e=>e.get("direction")===Ro.Ascending?"asc":"desc"));n=(0,Qe.fromJS)(To()(n.toJS(),e,r))}const i=function(e,t){const r=Gl(e,t),n=(null==r?void 0:r.valueSeq().filter((e=>!0===(null==e?void 0:e.get("active")))).toArray())||[];return n}(e,r);return i&&i.length>0&&(n=n.filter((e=>{const t=i.every((t=>{const r=t.get("pattern"),n=t.get("field"),o=(e.get("data")||(0,Qe.Map)()).getIn(Dl(n));return void 0!==o&&new RegExp(String(r)).test(String(o))}));return t})).toList()),n}function ec(e,t){return e.getIn(["pages",t,"isFetching"],!1)}const tc="DRAFT_MEDIA_FILES";function rc(e,t){const r=e.find((e=>(null==e?void 0:e.get("name"))===t));return r}function nc(e,t,r,n){if(!t)return!1;if(n&&n.has(e))return!0;if(t.has("files")){const n=rc(t.get("files"),r);if(n&&n.has(e))return!0}return!!t.has(e)}function oc(e,t,r,n,o,i,a){const s=i.filter((e=>e===o))[0];if(s)return yi(s.has(e)?s.get(e):`{{${e}}}`,n,r,a,e,t.slug);for(let s of i){s.has(e)||(s=s.set(e,`{{${e}}}`));const i=yi(s.get(e),n,r,a,e,t.slug);let l=null;if(s.has("fields")?l=oc(e,t,r,n,o,s.get("fields").toArray(),i):s.has("field")?l=oc(e,t,r,n,o,[s.get("field")],i):s.has("types")&&(l=oc(e,t,r,n,o,s.get("types").toArray(),i)),null!=l)return l}return null}function ic(e,t,r,n,o){let i=t[e];if(r.has(e)||(r=r.set(e,`{{${e}}}`)),r.has("files")){i=yi(r.get(e),n,r,i,e,t.slug);let a=rc(r.get("files"),null==n?void 0:n.get("slug"));if(a&&(a.has(e)||(a=a.set(e,`{{${e}}}`)),i=yi(a.get(e),n,r,i,e,t.slug),o)){const s=oc(e,t,r,n,o,a.get("fields").toArray(),i);null!==s&&(i=s)}}else if(i=yi(r.get(e),n,r,i,e,t.slug),o){const a=oc(e,t,r,n,o,r.get("fields").toArray(),i);null!==a&&(i=a)}return i}function ac(e,t,r,n){const o="media_folder";let i=e[o];if(nc(o,t,null==r?void 0:r.get("slug"),n)){const a=ic(o,e,t,r,n);if(a.startsWith("/"))i=(0,dr.join)(a);else{const e=null==r?void 0:r.get("path");i=e?(0,dr.join)((0,dr.dirname)(e),a):(0,dr.join)(t.get("folder"),tc)}}return tr()(i,"/")}function sc(e,t,r,n,o){if((0,pr.isAbsolutePath)(n))return n;const i=ac(e,t,r,o);return(0,dr.join)(i,(0,pr.basename)(n))}function lc(e,t,r,n,o){if((0,pr.isAbsolutePath)(r))return r;const i="public_folder";let a=e[i];return nc(i,t,null==n?void 0:n.get("slug"),o)&&(a=ic(i,e,t,n,o)),(0,pr.isAbsolutePath)(a)?function(e,...t){return zo()(e,...t)}(a,(0,pr.basename)(r)):(0,dr.join)(a,(0,pr.basename)(r))}function cc(e){const t=e.get("entry");return t&&!t.isEmpty()}function uc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?uc(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const{keyToPathArray:pc}=hr.stringTemplate,dc=(0,Qe.fromJS)({}),hc={[wo]:{entryExtension(e){const t=e.get("extension")||Qt()(Bn(Bn({},zn),Nn()),e.get("format")||"frontmatter");if(!t)throw new Error(`No extension found for format ${e.get("format")}`);return t.replace(/^\./,"")},fields:e=>e.get("fields"),entryPath(e,t){return`${e.get("folder").replace(/\/$/,"")}/${t}.${this.entryExtension(e)}`},entrySlug(e,t){var r;const n=e.get("folder").replace(/\/$/,"");return null===(r=t.split(n+"/").pop())||void 0===r?void 0:r.replace(new RegExp(`\\.${mo()(this.entryExtension(e))}$`),"")},allowNewEntries:e=>e.get("create"),allowDeletion:e=>e.get("delete",!0),templateName:e=>e.get("name")},[bo]:{fileForEntry(e,t){const r=e.get("files");return r&&r.filter((e=>(null==e?void 0:e.get("name"))===t)).get(0)},fields(e,t){const r=this.fileForEntry(e,t);return r&&r.get("fields")},entryPath(e,t){const r=this.fileForEntry(e,t);return r&&r.get("file")},entrySlug(e,t){const r=e.get("files").filter((e=>(null==e?void 0:e.get("file"))===t)).get(0);return r&&r.get("name")},entryLabel(e,t){const r=this.fileForEntry(e,t);return r&&r.get("label")},allowNewEntries:()=>!1,allowDeletion:e=>e.get("delete",!1),templateName:(e,t)=>t}};function gc(e){const t=e.reduce(((e,t)=>{if(t.has("media_folder")&&(e=[...e,t]),t.has("fields")){var r;const n=null===(r=t.get("fields"))||void 0===r?void 0:r.toArray();e=[...e,...gc(n)]}else if(t.has("field")){const r=t.get("field");e=[...e,...gc([r])]}else if(t.has("types")){var n;const r=null===(n=t.get("types"))||void 0===n?void 0:n.toArray();e=[...e,...gc(r)]}return e}),[]);return t}function mc(e,t){var r;return null===(r=e.get("files"))||void 0===r?void 0:r.toArray().find((e=>e.get("name")===t))}function yc(e,t){return hc[e.get("type")].fields(e,t)}function vc(e){return hc[wo].entryExtension(e)}function bc(e,t){return hc[bo].entryLabel(e,t)}function wc(e,t){return hc[e.get("type")].entryPath(e,t)}function _c(e,t){return hc[e.get("type")].entrySlug(e,t)}function Sc(e){return hc[e.get("type")].allowDeletion(e)}function xc(e,t=""){let r=e.map((e=>`${t}${e.get("name")}`));return e.forEach(((e,t)=>{if(e.has("fields")){var n;const o=null===(n=e.get("fields"))||void 0===n?void 0:n.toArray();r=[...r,...xc(o,`${r[t]}.`)]}else if(e.has("field")){const n=e.get("field");r=[...r,...xc([n],`${r[t]}.`)]}else if(e.has("types")){var o;const n=null===(o=e.get("types"))||void 0===o?void 0:o.toArray();r=[...r,...xc(n,`${r[t]}.`)]}})),r}function Oc(e,t){const r=pc(t);let n,o,i=e.get("fields",(0,Qe.List)()).toArray();for(;(n=r.shift())&&i;){var a,s,l,c,u;if(o=i.find((e=>e.get("name")===n)),null!==(a=o)&&void 0!==a&&a.has("fields"))i=null===(c=o)||void 0===c||null===(u=c.get("fields"))||void 0===u?void 0:u.toArray();else if(null!==(s=o)&&void 0!==s&&s.has("field")){var f;i=[null===(f=o)||void 0===f?void 0:f.get("field")]}else if(null!==(l=o)&&void 0!==l&&l.has("types")){var p,d;i=null===(p=o)||void 0===p||null===(d=p.get("types"))||void 0===d?void 0:d.toArray()}}return o}function Ec(e,t,r=(()=>!1)){return r()||(e=e.map((e=>{const n=t(e);return r()?n:n.has("fields")?n.set("fields",Ec(n.get("fields"),t,r)):n.has("field")?n.set("field",Ec((0,Qe.List)([n.get("field")]),t,r).get(0)):n.has("types")?n.set("types",Ec(n.get("types"),t,r)):n})).toList()),e}function kc(e){const t=e.get("identifier_field"),r=t?[t,...Oo]:[...Oo],n=xc(e.get("fields",(0,Qe.List)()).toArray());return r.find((e=>n.find((t=>t.toLowerCase().trim()===e.toLowerCase().trim()))))}function Cc(e,t){if("title"===t&&e.get("identifier_field"))return kc(e);const r=ko[t],n=e.get("fields");let o;if(!n||!r)return null;const i=n.filter((e=>(null==e?void 0:e.get("widget","string"))===r.type)).map((e=>null==e?void 0:e.get("name")));if(o=i.filter((e=>-1!==r.synonyms.indexOf(e))),o&&o.size>0)return o.first();const a=n.filter((e=>-1!==r.secondaryTypes.indexOf(null==e?void 0:e.get("widget","string")))).map((e=>null==e?void 0:e.get("name")));return o=a.filter((e=>-1!==r.synonyms.indexOf(e))),o&&o.size>0?o.first():r.fallbackToFirstField&&i.size>0?i.first():(r.showError&&(s=`The Field ${t} is missing for the collection “${e.get("name")}”`,l=`Decap CMS tries to infer the entry ${t} automatically, but one couldn't be found for entries of the collection “${e.get("name")}”. Please check your site configuration.`,console.error(`%c ⛔ ${s}\n%c${l}\n\n`,"color: black; font-weight: bold; font-size: 16px; line-height: 50px;","color: black;")),null);var s,l}function Tc(e,t){const r=e.get("summary");if(r)return function(e,t,r){let n=t.get("data");const o=si(t,Cc(r,"date"))||null,i=n.getIn(ci(kc(r)));return n=ui(t.get("path"),n,r.get("folder")),t.get("author")&&!Oc(r,_o)&&(n=n.set(_o,t.get("author"))),t.get("updatedOn")&&!Oc(r,So)&&(n=n.set(So,t.get("updatedOn"))),ai(e,o,i,n)}(r,t,e);if(e.get("type")==bo){const r=bc(e,t.get("slug"));if(r)return r}const n=t.get("data"),o=Cc(e,"title"),i=o&&n.getIn(pc(o));return i||"title"===o?i:n.getIn(pc("title"))}function Pc(e,t,r){let n=Eo.map((n=>{const o=Cc(e,n);return!t.isGitBackend()||"author"!==n||o||r?o:_o})).filter(Boolean);return t.isGitBackend()&&!r&&(n=[So,...n]),n}function jc(e){var t;return e.has("folder")&&e.get("type")===wo&&e.has("meta")&&(null===(t=e.get("meta"))||void 0===t?void 0:t.has("path"))}function Rc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Mc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Rc(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Ac="i18n";let Ic=function(e){return e.MULTIPLE_FOLDERS="multiple_folders",e.MULTIPLE_FILES="multiple_files",e.SINGLE_FILE="single_file",e}({}),Dc=function(e){return e.TRANSLATE="translate",e.DUPLICATE="duplicate",e.NONE="none",e}({});function Lc(e){return e.has(Ac)}function Nc(e){if(!Lc(e))return{};const{structure:t,locales:r,default_locale:n}=e.get(Ac).toJS();return{structure:t,locales:r,defaultLocale:n}}function $c(e,t,r){return t!==r&&e.get(Ac)===Dc.TRANSLATE}function Fc(e,t,r){return t!==r&&e.get(Ac)===Dc.DUPLICATE}function Bc(e,t,r){return t!==r&&e.get(Ac)===Dc.NONE}function Uc(e){return[Ac,e,"data"]}function zc(e,t){return e!==t?Uc(e):["data"]}function qc(e,t,r,n,o){switch(e){case Ic.MULTIPLE_FOLDERS:return r.replace(`/${n}`,`/${o}/${n}`);case Ic.MULTIPLE_FILES:return r.replace(new RegExp(`${mo()(t)}$`),`${o}.${t}`);case Ic.SINGLE_FILE:default:return r}}function Wc(e,t,r){switch(e){case Ic.MULTIPLE_FOLDERS:{const e=r.split("/");return e.pop(),e.pop()}case Ic.MULTIPLE_FILES:return r.slice(0,-`.${t}`.length).split(".").pop();case Ic.SINGLE_FILE:default:return""}}function Hc(e,t,r,n){const{structure:o,locales:i}=Nc(e);return o===Ic.SINGLE_FILE?[r]:i.map((e=>qc(o,t,r,n,e)))}function Vc(e,t,r){switch(e){case Ic.MULTIPLE_FOLDERS:return t.replace(`${r}/`,"");case Ic.MULTIPLE_FILES:return t.replace(`.${r}`,"");case Ic.SINGLE_FILE:default:return t}}function Gc(e,t,r,n){let o=n.find((e=>e.locale===r));o||(o=n[0],console.warn(`Could not locale entry for default locale '${r}'`));const i=n.filter((e=>e.locale!==o.locale)).reduce(((e,{locale:t,value:r})=>{const n=Uc(t);return Yt()(e,n,r.data)}),{}),a=Vc(t,o.value.path,r),s=_c(e,a);return Mc(Mc(Mc({},o.value),{},{raw:""},i),{},{path:a,slug:s})}function Kc(e,t,r){const n=e.data[t]||{},o=r.filter((e=>e!==t)).map((t=>({locale:t,value:e.data[t]}))).filter((e=>e.value)).reduce(((e,t)=>Mc(Mc({},e),{},{[t.locale]:{data:t.value}})),{});return Mc(Mc({},e),{},{data:n,i18n:o,raw:""})}function Yc(e,t,r){const{structure:n,defaultLocale:o,locales:i}=Nc(e);if(n===Ic.SINGLE_FILE)return r.map((e=>Kc(e,o,i)));const a=vo()(r.map((e=>({locale:Wc(n,t,e.path),value:e}))),(({locale:e,value:t})=>Vc(n,t.path,e)));return Object.values(a).reduce(((t,r)=>[...t,Gc(e,n,o,r)]),[])}function Jc(e,t,r,n,o=[t.get("name")]){const i=e.getIn(["entry","data",...o]);return t.get(Ac)===Dc.DUPLICATE&&r.filter((e=>e!==n)).forEach((t=>{e=e.setIn(["entry",...zc(t,n),...o],i)})),t.has("field")&&!Qe.List.isList(i)?[t.get("field")].forEach((t=>{e=Jc(e,t,r,n,[...o,t.get("name")])})):t.has("fields")&&!Qe.List.isList(i)&&t.get("fields").toArray().forEach((t=>{e=Jc(e,t,r,n,[...o,t.get("name")])})),e}function Qc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Xc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qc(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Zc={type:"string",minLength:2,maxLength:10,pattern:"^[a-zA-Z-_]+$"},eu={type:"object",properties:{structure:{type:"string",enum:Object.values(Ic)},locales:{type:"array",minItems:1,items:Zc,uniqueItems:!0},default_locale:Zc}},tu=Xc(Xc({},eu),{},{required:["structure","locales"]}),ru={oneOf:[{type:"boolean"},eu]},nu={oneOf:[{type:"boolean"},{type:"string",enum:Object.values(Dc)}]};function ou(){const e=ho();return{$id:`fields_${e}`,type:"array",minItems:1,items:{$id:`field_${e}`,type:"object",properties:{name:{type:"string"},label:{type:"string"},widget:{type:"string"},required:{type:"boolean"},i18n:nu,hint:{type:"string"},pattern:{type:"array",minItems:2,items:[{oneOf:[{type:"string"},{instanceof:"RegExp"}]},{type:"string"}]},field:{$ref:`field_${e}`},fields:{$ref:`fields_${e}`},types:{$ref:`fields_${e}`}},select:{$data:"0/widget"},selectCases:Xc({},su()),required:["name"]},uniqueItemProperties:["name"]}}const iu={type:"array",minItems:1,items:{type:"object",properties:{label:{type:"string"},field:{type:"string"},pattern:{oneOf:[{type:"boolean"},{type:"string"}]}},additionalProperties:!1,required:["label","field","pattern"]}},au={type:"array",minItems:1,items:{type:"object",properties:{label:{type:"string"},field:{type:"string"},pattern:{type:"string"}},additionalProperties:!1,required:["label","field"]}};function su(){const e=Cn().map((e=>({[e.name]:e.schema})));return Object.assign(...e)}class lu extends(function(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Error)){constructor(e,...t){const r=e.map((({message:e,instancePath:t})=>{const r=t.slice(1).split("/").map((e=>e.match(/^\d+$/)?`[${e}]`:`.${e}`)).join("").slice(1);return`${r?`'${r}'`:"config"} ${e}`})).join("\n");super(r,...t),this.errors=e,this.message=r}toString(){return this.message}}const cu=["hooks","collections","provider"];function uu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fu(e){const t=(e.integrations||[]).reduce(((t,r)=>{const{hooks:n,collections:o,provider:i}=r,a=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(r,cu);if(t.providers[i]=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?uu(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},a),!o)return n.forEach((e=>{t.hooks[e]=i})),t;const s="*"===o?e.collections.map((e=>e.name)):o;return s.forEach((e=>{n.forEach((r=>{t.hooks[e]?t.hooks[e][r]=i:t.hooks[e]={[r]:i}}))})),t}),{providers:{},hooks:{}});return(0,Qe.fromJS)(t)}const pu=(0,Qe.fromJS)({providers:{},hooks:{}});function du(e,t,r){return t?e.getIn(["hooks",t,r],!1):e.getIn(["hooks",r],!1)}const hu=["sortableFields"];function gu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function mu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gu(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const yu="CONFIG_REQUEST",vu="CONFIG_SUCCESS",bu="CONFIG_FAILURE";function wu(e){return"types"in e||"field"in e}function _u(e,t){return e.map((e=>{const r=t(e);return function(e){return"fields"in e}(r)?mu(mu({},r),{},{fields:_u(r.fields,t)}):wu(r)&&r.field?mu(mu({},r),{},{field:_u([r.field],t)[0]}):wu(r)&&r.types?mu(mu({},r),{},{types:_u(r.types,t)}):r}))}function Su(e){return"media_folder"in e&&!("public_folder"in e)?mu(mu({},e),{},{public_folder:e.media_folder}):e}const xu={dateFormat:"date_format",timeFormat:"time_format",pickerUtc:"picker_utc",editorComponents:"editor_components",valueType:"value_type",valueField:"value_field",searchFields:"search_fields",displayFields:"display_fields",optionsLength:"options_length"};function Ou(e){const t=Object.keys(xu).filter((t=>t in e)).map((t=>{const r=xu[t];return console.warn(`Field ${e.name} is using a deprecated configuration '${t}'. Please use '${r}'`),{[r]:e[t]}}));return Object.assign({},e,...t)}function Eu(e){return!0===e[Ac]?mu(mu({},e),{},{[Ac]:Dc.TRANSLATE}):!1!==e[Ac]&&e[Ac]?e:mu(mu({},e),{},{[Ac]:Dc.NONE})}function ku(e,t){if("boolean"==typeof e)return t;{const r=e.locales||t.locales,n=e.default_locale||r[0],o=Qn()(t,e);return o.locales=r,o.default_locale=n,Pu(o),o}}function Cu(e,t){return _u(e,t?Eu:e=>{const t=mu({},e);return delete t[Ac],t})}function Tu(e){if(e&&e.structure!==Ic.SINGLE_FILE)throw new Error(`i18n configuration for files collections is limited to ${Ic.SINGLE_FILE} structure`)}function Pu(e){if(e&&e.default_locale&&!e.locales.includes(e.default_locale))throw new Error(`i18n locales '${e.locales.join(", ")}' are missing the default locale ${e.default_locale}`)}function ju(e,t){return!!du(fu((0,Qe.fromJS)(e)),t.name,"listEntries")}function Ru(e){return{type:vu,payload:e}}function Mu(e){return{type:bu,error:"Error loading config",payload:e}}function Au(e={},t){return window.CMS_CONFIG?Ru(window.CMS_CONFIG):async r=>{r({type:yu});try{const n=function(){const e=document.querySelector('link[rel="cms-config-url"]');return e&&{"text/yaml":"yaml","application/x-yaml":"yaml"}[e.type]&&e.href?(console.log(`Using config file path: "${e.href}"`),e.href):"config.yml"}(),o=!Gn()(e),i=!1===e.load_config_file?{}:await async function(e,t){const r=await fetch(e,{credentials:"same-origin"}).catch((e=>e));if(r instanceof Error||200!==r.status){if(t)return{};const e=r instanceof Error?r.message:r.status;throw new Error(`Failed to load config.yml (${e})`)}const n=r.headers.get("Content-Type")||"Not-Found";return-1===n.indexOf("yaml")&&(console.log(`Response for ${e} was not yaml. (Content-Type: ${n})`),t)?{}:function(e){const t=mr().parse(e,{maxAliasCount:-1,prettyErrors:!0,merge:!0});if("undefined"!=typeof window&&"string"==typeof window.CMS_ENV&&t[window.CMS_ENV]){const e=Object.keys(t[window.CMS_ENV]);for(const r of e)t[r]=t[window.CMS_ENV][r]}return t}(await r.text())}(n,o),a=Qn()(i,e);!function(e){const t=new(no())({allErrors:!0,$data:!0,strict:!1});if((0,oo.uniqueItemProperties)(t),(0,oo.select)(t),(0,oo.instanceof)(t),(0,oo.prohibited)(t),ao()(t),!t.validate({type:"object",properties:{backend:{type:"object",properties:{name:{type:"string",examples:["test-repo"]},auth_scope:{type:"string",examples:["repo","public_repo"],enum:["repo","public_repo"]},cms_label_prefix:{type:"string",minLength:1},open_authoring:{type:"boolean",examples:[!0]}},required:["name"]},local_backend:{oneOf:[{type:"boolean"},{type:"object",properties:{url:{type:"string",examples:["http://localhost:8081/api/v1"]},allowed_hosts:{type:"array",items:{type:"string"}}},additionalProperties:!1}]},locale:{type:"string",examples:["en","fr","de"]},i18n:tu,site_url:{type:"string",examples:["https://example.com"]},display_url:{type:"string",examples:["https://example.com"]},logo_url:{type:"string",examples:["https://example.com/images/logo.svg"]},show_preview_links:{type:"boolean"},media_folder:{type:"string",examples:["assets/uploads"]},public_folder:{type:"string",examples:["/uploads"]},media_folder_relative:{type:"boolean"},media_library:{type:"object",properties:{name:{type:"string",examples:["uploadcare"]},config:{type:"object"}},required:["name"]},publish_mode:{type:"string",enum:["simple","editorial_workflow",""],examples:["editorial_workflow"]},slug:{type:"object",properties:{encoding:{type:"string",enum:["unicode","ascii"]},clean_accents:{type:"boolean"}}},collections:{type:"array",minItems:1,items:{type:"object",properties:{name:{type:"string"},label:{type:"string"},label_singular:{type:"string"},description:{type:"string"},folder:{type:"string"},files:{type:"array",items:{type:"object",properties:{name:{type:"string"},label:{type:"string"},label_singular:{type:"string"},description:{type:"string"},file:{type:"string"},preview_path:{type:"string"},preview_path_date_field:{type:"string"},fields:ou()},required:["name","label","file","fields"]},uniqueItemProperties:["name"]},identifier_field:{type:"string"},summary:{type:"string"},slug:{type:"string"},path:{type:"string"},preview_path:{type:"string"},preview_path_date_field:{type:"string"},create:{type:"boolean"},publish:{type:"boolean"},hide:{type:"boolean"},editor:{type:"object",properties:{preview:{type:"boolean"}}},format:{type:"string"},extension:{type:"string"},frontmatter_delimiter:{type:["string","array"],minItems:2,maxItems:2,items:{type:"string"}},fields:ou(),sortable_fields:{type:"array",items:{type:"string"}},sortableFields:{type:"array",items:{type:"string"}},view_filters:iu,view_groups:au,nested:{type:"object",properties:{depth:{type:"number",minimum:1,maximum:1e3},subfolders:{type:"boolean"},summary:{type:"string"}},required:["depth"]},meta:{type:"object",properties:{path:{type:"object",properties:{label:{type:"string"},widget:{type:"string"},index_file:{type:"string"}},required:["label","widget","index_file"]}},additionalProperties:!1,minProperties:1},i18n:ru},required:["name","label"],oneOf:[{required:["files"]},{required:["folder","fields"]}],not:{required:["sortable_fields","sortableFields"]},if:{required:["extension"]},then:{if:{properties:{extension:{enum:Object.keys(qn)}}},else:{required:["format"]}},dependencies:{frontmatter_delimiter:{properties:{format:{enum:Un}},required:["format"]}}},uniqueItemProperties:["name"]},editor:{type:"object",properties:{preview:{type:"boolean"}}}},required:["backend","collections"],anyOf:[{required:["media_folder"]},{required:["media_library"]}]},e)){const e=t.errors.map((e=>{switch(e.keyword){case"uniqueItemProperties":{const t=e.instancePath||"";let r=e;return t.endsWith("/fields")?r=Xc(Xc({},e),{},{message:"fields names must be unique"}):t.endsWith("/files")?r=Xc(Xc({},e),{},{message:"files names must be unique"}):t.endsWith("/collections")&&(r=Xc(Xc({},e),{},{message:"collections names must be unique"})),r}case"instanceof":{const t=e.instancePath||"";let r=e;return/fields\/\d+\/pattern\/\d+/.test(t)&&(r=Xc(Xc({},e),{},{message:"must be a regular expression"})),r}default:return e}}));throw console.error("Config Errors",e),new lu(e)}}(a);const s=function(e){const{collections:t=[]}=e,r=t.map((e=>{const{fields:t,files:r}=e;let n=e;if(t){const e=_u(t,Ou);n=mu(mu({},n),{},{fields:e})}if(r){const e=r.map((e=>{const t=_u(e.fields,Ou);return mu(mu({},e),{},{fields:t})}));n=mu(mu({},n),{},{files:e})}if(n.sortableFields){const{sortableFields:t}=n;n=mu(mu({},function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(n,hu)),{},{sortable_fields:t}),console.warn(`Collection ${e.name} is using a deprecated configuration 'sortableFields'. Please use 'sortable_fields'`)}return n}));return mu(mu({},e),{},{collections:r})}(await async function(e){if(!e.local_backend)return e;const{proxyUrl:t,publish_modes:r,type:n}=await async function(e){if(!["localhost","127.0.0.1",..."boolean"==typeof e?[]:(null==e?void 0:e.allowed_hosts)||[]].includes(location.hostname)||!e)return{};const t="http://localhost:8081/api/v1",r=!0===e?t:e.url||t.replace("localhost",location.hostname);try{console.log(`Looking for Decap CMS Proxy Server at '${r}'`);const e=await fetch(`${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"info"})}),{repo:t,publish_modes:n,type:o}=await e.json();return"string"==typeof t&&Array.isArray(n)&&"string"==typeof o?(console.log(`Detected Decap CMS Proxy Server at '${r}' with repo: '${t}'`),{proxyUrl:r,publish_modes:n,type:o}):(console.log(`Decap CMS Proxy Server not detected at '${r}'`),{})}catch{return console.log(`Decap CMS Proxy Server not detected at '${r}'`),{}}}(e.local_backend);return t?Gt(e,(e=>{e.backend.name="proxy",e.backend.proxy_url=t,e.publish_mode&&(e.publish_mode=function(e,t,r){if(e.publish_mode&&t&&!t.includes(e.publish_mode)){const n=t[0];return console.log(`'${e.publish_mode}' is not supported by '${r}' backend, switching to '${n}'`),n}return e.publish_mode}(e,r,n))})):e}(a)),l=Gt(s,(e=>{e.publish_mode=e.publish_mode||Xn,e.slug=e.slug||{},e.collections=e.collections||[],!e.display_url&&e.site_url&&(e.display_url=e.site_url);const t=`/${Yn()(e.media_folder,"/")}`;"public_folder"in e||(e.public_folder=t),"encoding"in e.slug||(e.slug.encoding="unicode"),"clean_accents"in e.slug||(e.slug.clean_accents=!1),"sanitize_replacement"in e.slug||(e.slug.sanitize_replacement="-");const r=e[Ac];r&&(r.default_locale=r.default_locale||r.locales[0]),Pu(r);const n=tf(e);for(const t of e.collections){"publish"in t||(t.publish=!0);let o=t[Ac];r&&o?(o=ku(o,r),t[Ac]=o):(o=void 0,delete t[Ac]),t.fields&&(t.fields=Cu(t.fields,Boolean(o)));const{folder:i,files:a,view_filters:s,view_groups:l,meta:c}=t;if(i&&(t.type=wo,t.path&&!t.media_folder&&(t.media_folder=""),"media_folder"in t&&!("public_folder"in t)&&(t.public_folder=t.media_folder),t.fields&&(t.fields=_u(t.fields,Su)),t.folder=tr()(i,"/"),c&&c.path)){const e=mu({name:"path",meta:!0,required:!0},c.path);t.fields=[e,...t.fields||[]]}if(a){t.type=bo,Tu(o),delete t.nested,delete t.meta;for(const e of a){e.file=Yn()(e.file,"/"),"media_folder"in e&&!("public_folder"in e)&&(e.public_folder=e.media_folder),e.fields&&(e.fields=_u(e.fields,Su));let t=e[Ac];t&&o?(t=ku(t,o),e[Ac]=t):(t=void 0,delete e[Ac]),Tu(t),e.fields&&(e.fields=Cu(e.fields,Boolean(t)))}}t.sortable_fields||(t.sortable_fields=Pc((0,Qe.fromJS)(t),n,ju(e,t))),t.view_filters=(s||[]).map((e=>mu(mu({},e),{},{id:`${e.field}__${e.pattern}`}))),t.view_groups=(l||[]).map((e=>mu(mu({},e),{},{id:`${e.field}__${e.pattern}`}))),e.editor&&!t.editor&&(t.editor={preview:e.editor.preview})}}));r(Ru(l)),"function"==typeof t&&t()}catch(e){throw r(Mu(e)),e}}}function Iu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Du(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Iu(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Iu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Lu(e){return e.locale||"en"}function Nu(e){return e.publish_mode===Zn}const $u=Gt(((e,t)=>{switch(t.type){case yu:e.isFetching=!0;break;case vu:return Du(Du({},t.payload),{},{isFetching:!1,error:void 0});case bu:e.isFetching=!1,e.error=t.payload.toString()}}),{isFetching:!0}),Fu=["field"];function Bu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Uu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Bu(Object(r),!0).forEach((function(t){zu(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function zu(e,t,r){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const{extractTemplateVars:qu,dateParsers:Wu,expandPath:Hu}=hr.stringTemplate;class Vu{constructor(){zu(this,"storageKey","decap-cms-user")}retrieve(){const e=window.localStorage.getItem(this.storageKey);return e&&JSON.parse(e)}store(e){window.localStorage.setItem(this.storageKey,JSON.stringify(e))}logout(){window.localStorage.removeItem(this.storageKey)}}function Gu(e,t){const r="backup";return e?`${r}.${e}${t?`.${t}`:""}`:r}function Ku(e,t){const r=Qt()(t.data,e);if(r)return String(r);{const r=e.split(".")[0];return t[r]?t[r]:""}}function Yu(e){return t=>e.reduce(((e,r)=>{const n=Ku(r,t);return n?`${e} ${n}`:e}),"")}function Ju(e,t){return e.score>t.score?-1:e.score<t.score?1:0}function Qu(e,t){const r=e.get("folder",""),n=t.toLowerCase().replace(r.toLowerCase(),"");return(0,dr.join)((0,dr.dirname)(tr()(n,"/")),(0,dr.basename)(n,(0,dr.extname)(t)))}function Xu(e,t){return jc(t)?(0,dr.dirname)(e).slice(t.get("folder").length+1)||"/":e}function Zu(e){var t;let r;return r=(null===(t=e.get("nested"))||void 0===t?void 0:t.get("depth"))||(0,pr.getPathDepth)(e.get("path","")),Lc(e)&&(r=function(e,t){const{structure:r}=Nc(e);return r===Ic.MULTIPLE_FOLDERS?t+1:t}(e,r)),r}class ef{constructor(e,{backendName:t,authStore:r,config:n}){if(zu(this,"implementation",void 0),zu(this,"backendName",void 0),zu(this,"config",void 0),zu(this,"authStore",void 0),zu(this,"user",void 0),zu(this,"backupSync",void 0),zu(this,"updateUserCredentials",(e=>{const t=this.authStore.retrieve();if(t&&t.backendName===this.backendName)return this.user=Uu(Uu({},t),e),this.authStore.store(this.user),this.user})),zu(this,"getToken",(()=>this.implementation.getToken())),this.deleteAnonymousBackup(),this.config=n,this.implementation=e.init(this.config,{useWorkflow:Nu(this.config),updateUserCredentials:this.updateUserCredentials,initialWorkflowStatus:eo.first()}),this.backendName=t,this.authStore=r,null===this.implementation)throw new Error("Cannot instantiate a Backend with no implementation");this.backupSync=(0,pr.asyncLock)()}async status(){let e={auth:{status:!0},api:{status:!0,statusPage:""}};for(let t=1;t<=3;t++){if(e=await this.implementation.status(),Object.values(e).every((e=>!0===e.status)))return e;await new Promise((e=>setTimeout(e,1e3*t)))}return e}currentUser(){if(this.user)return this.user;const e=this.authStore.retrieve();return e&&e.backendName===this.backendName?Promise.resolve(this.implementation.restoreUser(e)).then((e=>(this.user=Uu(Uu({},e),{},{backendName:this.backendName}),this.authStore.store(this.user),this.user))):Promise.resolve(null)}isGitBackend(){var e,t;return(null===(e=(t=this.implementation).isGitBackend)||void 0===e?void 0:e.call(t))||!1}authComponent(){return this.implementation.authComponent()}authenticate(e){return this.implementation.authenticate(e).then((e=>(this.user=Uu(Uu({},e),{},{backendName:this.backendName}),this.authStore&&this.authStore.store(this.user),this.user)))}async logout(){try{await this.implementation.logout()}catch(e){console.warn("Error during logout",e.message)}finally{this.user=null,this.authStore&&this.authStore.logout()}}async entryExist(e,t,r,n){const o=n&&await this.implementation.unpublishedEntry({collection:e.get("name"),slug:r}).catch((e=>e.name===pr.EDITORIAL_WORKFLOW_ERROR&&e.notUnderEditorialWorkflow?Promise.resolve(!1):Promise.reject(e)));return o||await this.implementation.getEntry(t).then((({data:e})=>e)).catch((()=>Promise.resolve(!1)))}async generateUniqueSlug(e,t,r,n,o){const i=r.slug;let a;a=o?Qu(e,o):function(e,t,r){const n=e.get("slug")||"{{slug}}",o=t.getIn(ci(kc(e)));if(!o)throw new Error("Collection must have a field name that is a valid entry identifier, or must have `identifier_field` set");const i=gi(r),a=new Date,s=ai(n,a,o,t,i);if(e.has("path")){const r=hi(e.get("path"));return ai(r,a,s,t,(e=>e===s?e:i(e)))}return s}(e,t,i);let s=1,l=a;for(;n.includes(l)||await this.entryExist(e,wc(e,l),l,Nu(r));)l=`${a}${ri(" ",i)}${s++}`;return l}processEntries(e,t){const r=e.map((e=>Si(t.get("name"),_c(t,e.file.path),e.file.path,{raw:e.data||"",label:e.file.label,author:e.file.author,updatedOn:e.file.updatedOn,meta:{path:Xu(e.file.path,t)}}))).map(this.entryWithFormat(t)),n=t.get("filter"),o=n?this.filterEntries({entries:r},n):r;if(Lc(t)){const e=vc(t);return Yc(t,e,o)}return o}async listEntries(e){var t;const r=vc(e);let n;const o=e.get("type");if(o===wo)n=()=>{const t=Zu(e);return this.implementation.entriesByFolder(e.get("folder"),r,t)};else{if(o!==bo)throw new Error(`Unknown collection type: ${o}`);{const t=e.get("files").map((e=>({path:e.get("file"),label:e.get("label")}))).toArray();n=()=>this.implementation.entriesByFiles(t)}}const i=await n(),a=pr.Cursor.create(i[pr.CURSOR_COMPATIBILITY_SYMBOL]).wrapData({cursorType:"collectionEntries",collection:e});return{entries:this.processEntries(i,e),pagination:null===(t=a.meta)||void 0===t?void 0:t.get("page"),cursor:a}}async listAllEntries(e){if(e.get("folder")&&this.implementation.allEntriesByFolder){const t=Zu(e),r=vc(e);return this.implementation.allEntriesByFolder(e.get("folder"),r,t,function(e){let t="";return e.get("path")&&(t=`${e.get("folder")}/${e.get("path")}`.replace(/{{.*}}/gm,"(.*)")),Lc(e)&&(t=function(e,{defaultLocale:t,structure:r}){return r===Ic.MULTIPLE_FOLDERS?`${t}\\/${e}`:r===Ic.MULTIPLE_FILES?`${e}\\.${t}\\..*`:e}(t,Nc(e))),t?new RegExp(t):void 0}(e)).then((t=>this.processEntries(t,e)))}const t=await this.listEntries(e),{entries:r}=t;let{cursor:n}=t;for(;n&&n.actions.includes("next");){const{entries:e,cursor:t}=await this.traverseCursor(n,"next");r.push(...e),n=t}return r}async search(e,t){const r=[],n=e.map((async e=>{const r=e.get("summary",""),n=qu(r);let o=[];var i;e.get("type")===bo?null===(i=e.get("files"))||void 0===i||i.forEach((e=>{const t=e.get("fields").map((e=>e.get("name"))).toArray();o=[...o,...t]})):o=[Cc(e,"title"),Cc(e,"shortTitle"),Cc(e,"author"),...n.map((t=>Wu[t]?Cc(e,"date"):t))];const a=o.filter(Boolean),s=await this.listAllEntries(e);return ur.filter(t,s,{extract:Yu(nr()(a))})})).map((e=>e.catch((e=>(r.push(e),[]))))),o=await Promise.all(n).then((e=>sr()(e)));if(r.length>0)throw new Error({message:"Errors occurred while searching entries locally!",errors:r});const i=o.filter((({score:e})=>e>5)).sort(Ju).map((e=>e.original));return{entries:i}}async query(e,t,r,n,o){let i=await this.listAllEntries(e);n&&(i=i.filter((e=>e.slug===n)));const a=function(e,t){const r=e.reduce(((e,r)=>{const n=t.reduce(((e,t)=>{const n=Hu({data:r.data,path:t});return e.push(...n),e}),[]);for(let t=0;t<n.length;t++)e.push(Uu(Uu({},r),{},{field:n[t]}));return e}),[]);return r}(i,t);let s=ur.filter(r,a,{extract:e=>Ku(e.field,e)}).sort(Ju).map((e=>e.original));void 0!==o&&o>0&&(s=s.slice(0,o));const l=function(e){const t=e.map((e=>e.field)),r={},n=e.reduce(((e,t)=>{if(!e[t.slug]){const{field:n}=t,o=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(t,Fu);e[t.slug]=o,r[t.slug]=(0,Qe.Set)()}const n=t.field.split(".");let o=e[t.slug].data;for(let e=0;e<n.length;e++)if(o=o[n[e]],Array.isArray(o)){const o=n.slice(0,e+1).join(".");r[t.slug]=r[t.slug].add(o)}return e}),{});return Object.keys(n).forEach((e=>{const o=n[e].data;for(const n of r[e].toArray()){const e=Qt()(o,n),r=e.filter(((e,r)=>t.some((e=>`${e}.`.startsWith(`${n}.${r}.`)))));r.sort(((r,o)=>{const i=e.indexOf(r),a=e.indexOf(o),s=`${n}.${i}.`,l=`${n}.${a}.`,c=t.findIndex((e=>`${e}.`.startsWith(s))),u=t.findIndex((e=>`${e}.`.startsWith(l)));return c-u})),Yt()(o,n,r)}})),Object.values(n)}(s);return{query:r,hits:l}}traverseCursor(e,t){const[r,n]=e.unwrapData(),o=r.get("collection");return this.implementation.traverseCursor(n,t).then((async({entries:e,cursor:t})=>({entries:this.processEntries(e,o),cursor:pr.Cursor.create(t).wrapData({cursorType:"collectionEntries",collection:o})})))}async getLocalDraftBackup(e,t){const r=Gu(e.get("name"),t),n=await pr.localForage.getItem(r);if(!n||!n.raw.trim())return{};const{raw:o,path:i}=n;let{mediaFiles:a=[]}=n;a=a.map((e=>e.file?Uu(Uu({},e),{},{url:URL.createObjectURL(e.file)}):e));const s=bc(e,t),l=r=>this.entryWithFormat(e)(Si(e.get("name"),t,i,{raw:r,label:s,mediaFiles:a,meta:{path:Xu(i,e)}})),c=l(o);if(Lc(e)&&n.i18n){const e=function(e,t){const r=Object.entries(e).reduce(((e,[r,{raw:n}])=>{const o=t(n);return Mc(Mc({},e),{},{[r]:{data:o.data}})}),{});return r}(n.i18n,l);c.i18n=e}return{entry:c}}async persistLocalDraftBackup(e,t){try{await this.backupSync.acquire();const r=Gu(t.get("name"),e.get("slug")),n=this.entryToRaw(t,e);if(!n.trim())return;const o=await Promise.all(e.get("mediaFiles").toJS().map((async e=>{var t;if(null!==(t=e.url)&&void 0!==t&&t.startsWith("blob:")){const t=await fetch(e.url).then((e=>e.blob()));return Uu(Uu({},e),{},{file:(0,pr.blobToFileObj)(e.name,t)})}return e})));let i;return Lc(t)&&(i=function(e,t,r){const{locales:n,defaultLocale:o}=Nc(e),i=n.filter((e=>e!==o)).reduce(((e,n)=>{const i=zc(n,o),a=t.getIn(i);if(!a)return e;const s=t.set("data",a);return Mc(Mc({},e),{},{[n]:{raw:r(s)}})}),{});return i}(t,e,(e=>this.entryToRaw(t,e)))),await pr.localForage.setItem(r,Uu({raw:n,path:e.get("path"),mediaFiles:o},i&&{i18n:i})),await pr.localForage.setItem(Gu(),n)}catch(e){console.warn("persistLocalDraftBackup",e)}finally{this.backupSync.release()}}async deleteLocalDraftBackup(e,t){try{return await this.backupSync.acquire(),await pr.localForage.removeItem(Gu(e.get("name"),t)),t&&await pr.localForage.removeItem(Gu(e.get("name"))),await this.deleteAnonymousBackup()}catch(e){console.warn("deleteLocalDraftBackup",e)}finally{this.backupSync.release()}}deleteAnonymousBackup(){return pr.localForage.removeItem(Gu())}async getEntry(e,t,r){const n=wc(t,r),o=bc(t,r),i=vc(t),a=async n=>{const i=await this.implementation.getEntry(n);let a=Si(t.get("name"),r,i.file.path,{raw:i.data,label:o,mediaFiles:[],meta:{path:Xu(i.file.path,t)}});return a=this.entryWithFormat(t)(a),a=await this.processEntry(e,t,a),a};let s;return s=Lc(t)?await async function(e,t,r,n,o){const{structure:i,locales:a,defaultLocale:s}=Nc(e);let l;if(i===Ic.SINGLE_FILE)l=Kc(await o(r),s,a);else{const c=(await Promise.all(a.map((async e=>{const a=qc(i,t,r,n,e);return{value:await o(a).catch((()=>null)),locale:e}})))).filter((e=>null!==e.value));l=Gc(e,i,s,c)}return l}(t,i,n,r,a):await a(n),s}getMedia(){return this.implementation.getMedia()}getMediaFile(e){return this.implementation.getMediaFile(e)}getMediaDisplayURL(e){if(this.implementation.getMediaDisplayURL)return this.implementation.getMediaDisplayURL(e);const t=new Error("getMediaDisplayURL is not implemented by the current backend, but the backend returned a displayURL which was not a string!");return t.displayURL=e,Promise.reject(t)}entryWithFormat(e){return t=>{const r=Hn(e,t);if(t&&void 0!==t.raw){const e=r&&cr()(r.fromFile.bind(r,t.raw))||{};return ir()(e)&&console.error(e),Object.assign(t,{data:ir()(e)?{}:e})}return r.fromFile(t)}}async processUnpublishedEntry(e,t,r){const{slug:n}=t;let o;if(e.get("type")===bo){const t=e.get("files").find((e=>(null==e?void 0:e.get("name"))===n));o=(0,dr.extname)(t.get("file"))}else o=vc(e);const i=[];if(r){const r=t.diffs.filter((e=>!e.path.endsWith(o))),a=await Promise.all(r.map((t=>this.implementation.unpublishedEntryMediaFile(e.get("name"),n,t.path,t.id))));i.push(...a.map((e=>Uu(Uu({},e),{},{draft:!0}))))}const a=Zt()(t.diffs.filter((e=>e.path.endsWith(o))),(e=>e.path.length)),s=(r,o,a)=>{const s=Si(e.get("name"),n,o,{raw:r,isModification:!a,label:e&&bc(e,n),mediaFiles:i,updatedOn:t.updatedAt,author:t.pullRequestAuthor,status:t.status,meta:{path:Xu(o,e)}});return this.entryWithFormat(e)(s)},l=async r=>{const n=await this.implementation.unpublishedEntryDataFile(e.get("name"),t.slug,r.path,r.id);return s(n,r.path,r.newFile)};if(a.length<=0){const t=await this.implementation.getEntry(wc(e,n));return s(t.data,t.file.path,!1)}if(Lc(e)){const t=wc(e,n),r=function(e,t,r,n,o){const{structure:i}=Nc(e);return i===Ic.SINGLE_FILE?o:Hc(e,t,r,n).reduce(((e,t)=>{const r=o.find((e=>e.path===t));return r?[...e,r]:[...e,{path:t,id:"",newFile:!1}]}),[])}(e,o,t,n,a);let i=await Promise.all(r.map((e=>l(e).catch((()=>null)))));return i=i.filter(Boolean),(await Yc(e,o,i))[0]}return await l(a[0])}async unpublishedEntries(e){const t=await this.implementation.unpublishedEntries(),r=(await Promise.all(t.map((async t=>{const r=await this.implementation.unpublishedEntry({id:t}),n=r.collection,o=e.find((e=>e.get("name")===n));return o?await this.processUnpublishedEntry(o,r,!1):(console.warn(`Missing collection '${n}' for unpublished entry '${t}'`),null)})))).filter(Boolean);return{pagination:0,entries:r}}async processEntry(e,t,r){const n=du(e.integrations,null,"assetStore"),o=function(e,t,r){const n=function(e,t){return e.has("folder")?gc(e.get("fields").toArray()):e.has("files")?gc((null===(r=mc(e,t))||void 0===r?void 0:r.get("fields").toArray())||[]):[];var r}(t,r.get("slug")),o=n.map((n=>ac(e,t,r,n)));return t.has("files")&&mc(t,r.get("slug"))&&o.unshift(ac(e,t,r,void 0)),t.has("media_folder")&&(t=t.delete("files"),o.unshift(ac(e,t,r,void 0))),(0,Qe.Set)(o).toArray()}(e.config,t,(0,Qe.fromJS)(r));if(o.length>0&&!n){const e=await Promise.all(o.map((e=>this.implementation.getMedia(e))));r.mediaFiles=r.mediaFiles.concat(...e)}else r.mediaFiles=r.mediaFiles.concat(e.mediaLibrary.get("files")||[]);return r}async unpublishedEntry(e,t,r){const n=await this.implementation.unpublishedEntry({collection:t.get("name"),slug:r});let o=await this.processUnpublishedEntry(t,n,!0);return o=await this.processEntry(e,t,o),o}getDeploy(e,t,r){const n=this.config.site_url;if(n&&!1!==this.config.show_preview_links)return{url:mi(n,e,t,r,this.config.slug),status:"SUCCESS"}}async getDeployPreview(e,t,r,{maxAttempts:n=1,interval:o=5e3}={}){if(!this.implementation.getDeployPreview||!1===this.config.show_preview_links)return;let i,a=0;for(;!i&&a<n;)a++,i=await this.implementation.getDeployPreview(e.get("name"),t),i||await new Promise((e=>setTimeout((()=>e(void 0)),o)));return i?{url:mi(i.url,e,t,r,this.config.slug),status:i.status?i.status.toUpperCase():""}:void 0}async persistEntry({config:e,collection:t,entryDraft:r,assetProxies:n,usedSlugs:o,unpublished:i=!1,status:a}){const s=await this.invokePreSaveEvent(r.get("entry"));let l;l=void 0===s.get("data")?s&&r.setIn(["entry","data"],s)||r:s&&r.setIn(["entry"],s)||r;const c=l.getIn(["entry","newRecord"])||!1,u=Nu(e),f=As(t,l);let p;if(c){if(!function(e){return hc[e.get("type")].allowNewEntries(e)}(t))throw new Error("Not allowed to create new entries in this collection");const r=await this.generateUniqueSlug(t,l.getIn(["entry","data"]),e,o,f),i=f||wc(t,r);p={path:i,slug:r,raw:this.entryToRaw(t,l.get("entry"))},function(e,t,r,n,o){e.map((e=>{const i=e.path,a=sc(t,r,n.get("entry").set("path",o),i,e.field);e.path=a}))}(n,e,t,l,i)}else{const e=l.getIn(["entry","slug"]);p={path:l.getIn(["entry","path"]),slug:f&&!u?Qu(t,f):e,raw:this.entryToRaw(t,l.get("entry")),newPath:f}}const{slug:d,path:h,newPath:g}=p;let m=[p];if(Lc(t)){const e=vc(t);m=function(e,t,r,n,o,i,a){const{structure:s,defaultLocale:l,locales:c}=Nc(e);if(s===Ic.SINGLE_FILE){const e=c.reduce(((e,t)=>{const n=zc(t,l);return e.set(t,r.getIn(n))}),(0,Qe.Map)({})),u=r.set("data",e);return[Mc({path:qc(s,t,o,i,c[0]),slug:i,raw:n(u)},a&&{newPath:qc(s,t,a,i,c[0])})]}return c.map((e=>{const c=zc(e,l),u=r.set("data",r.getIn(c));return Mc({path:qc(s,t,o,i,e),slug:i,raw:u.get("data")?n(u):""},a&&{newPath:qc(s,t,a,i,e)})})).filter((e=>e.raw))}(t,e,l.get("entry"),(e=>this.entryToRaw(t,e)),h,d,g)}const y=await this.currentUser(),v=Uu({newEntry:c,commitMessage:di(c?"create":"update",e,{collection:t,slug:d,path:h,authorLogin:y.login,authorName:y.name},y.useOpenAuthoring),collectionName:t.get("name"),useWorkflow:u},{unpublished:i,status:a});return u||await this.invokePrePublishEvent(l.get("entry")),await this.implementation.persistEntry({dataFiles:m,assets:n},v),await this.invokePostSaveEvent(l.get("entry")),u||await this.invokePostPublishEvent(l.get("entry")),d}async invokeEventWithEntry(e,t){const{login:r,name:n}=await this.currentUser();return await Dn({name:e,data:{entry:t,author:{login:r,name:n}}})}async invokePrePublishEvent(e){await this.invokeEventWithEntry("prePublish",e)}async invokePostPublishEvent(e){await this.invokeEventWithEntry("postPublish",e)}async invokePreUnpublishEvent(e){await this.invokeEventWithEntry("preUnpublish",e)}async invokePostUnpublishEvent(e){await this.invokeEventWithEntry("postUnpublish",e)}async invokePreSaveEvent(e){return await this.invokeEventWithEntry("preSave",e)}async invokePostSaveEvent(e){await this.invokeEventWithEntry("postSave",e)}async persistMedia(e,t){const r=await this.currentUser(),n={commitMessage:di("uploadMedia",e,{path:t.path,authorLogin:r.login,authorName:r.name},r.useOpenAuthoring)};return this.implementation.persistMedia(t,n)}async deleteEntry(e,t,r){const n=e.config,o=wc(t,r),i=vc(t);if(!Sc(t))throw new Error("Not allowed to delete entries in this collection");const a=await this.currentUser(),s=di("delete",n,{collection:t,slug:r,path:o,authorLogin:a.login,authorName:a.name},a.useOpenAuthoring),l=Jl(e.entries,t.get("name"),r);await this.invokePreUnpublishEvent(l);let c=[o];Lc(t)&&(c=Hc(t,i,o,r)),await this.implementation.deleteFiles(c,s),await this.invokePostUnpublishEvent(l)}async deleteMedia(e,t){const r=await this.currentUser(),n=di("deleteMedia",e,{path:t,authorLogin:r.login,authorName:r.name},r.useOpenAuthoring);return this.implementation.deleteFiles([t],n)}persistUnpublishedEntry(e){return this.persistEntry(Uu(Uu({},e),{},{unpublished:!0}))}updateUnpublishedEntryStatus(e,t,r){return this.implementation.updateUnpublishedEntryStatus(e,t,r)}async publishUnpublishedEntry(e){const t=e.get("collection"),r=e.get("slug");await this.invokePrePublishEvent(e),await this.implementation.publishUnpublishedEntry(t,r),await this.invokePostPublishEvent(e)}deleteUnpublishedEntry(e,t){return this.implementation.deleteUnpublishedEntry(e,t)}entryToRaw(e,t){const r=Hn(e,t.toJS()),n=this.fieldsOrder(e,t),o=function(e,t){let r=[];if(e.has("folder"))r=e.get("fields").toArray();else if(e.has("files")){const n=e.get("files").find((e=>(null==e?void 0:e.get("name"))===t.get("slug")));r=n.get("fields").toArray()}const n={};return xc(r).forEach((t=>{const r=Oc(e,t);null!=r&&r.has("comment")&&(n[t]=r.get("comment"))})),n}(e,t);let i=r.toFile(t.get("data").toJS(),n,o);return"\n"!=i.slice(-1)&&(i+="\n"),i}fieldsOrder(e,t){if(e.get("fields"))return e.get("fields").map((e=>e.get("name"))).toArray();const r=(e.get("files")||(0,Qe.List)()).filter((e=>e.get("name")===t.get("slug"))).get(0);if(null==r)throw new Error(`No file found for ${t.get("slug")} in ${e.get("name")}`);return r.get("fields").map((e=>e.get("name"))).toArray()}filterEntries(e,t){return e.entries.filter((e=>{const r=e.data[t.get("field")];return Array.isArray(r)?r.includes(t.get("value")):r===t.get("value")}))}}function tf(e){if(!e.backend.name)throw new Error("No backend defined in configuration");const{name:t}=e.backend,r=new Vu,n=Mn(t);if(n)return new ef(n,{backendName:t,authStore:r,config:e});throw new Error(`Backend not found: ${t}`)}const rf=function(){let e;return t=>e||(e=tf(t))}(),nf="AUTH_REQUEST",of="AUTH_SUCCESS",af="AUTH_FAILURE",sf="AUTH_REQUEST_DONE",lf="USE_OPEN_AUTHORING",cf="LOGOUT";function uf(){return{type:nf}}function ff(e){return{type:of,payload:e}}function pf(e){return{type:af,error:"Failed to authenticate",payload:e}}function df(){return{type:lf}}function hf(){return(e,t)=>{const r=t(),n=rf(r.config);Promise.resolve(n.logout()).then((()=>{e({type:cf}),e({type:Zi})}))}}const gf=Gt(((e,t)=>{switch(t.type){case nf:e.isFetching=!0;break;case of:e.user=t.payload;break;case af:e.error=t.payload&&t.payload.toString();break;case sf:e.isFetching=!1;break;case cf:e.user=void 0,e.isFetching=!1}}),{isFetching:!1,user:void 0,error:void 0});var mf=__webpack_require__(37994),yf=__webpack_require__.n(mf);function vf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function bf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vf(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vf(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const wf={isFetching:!1,term:"",collections:[],page:0,entryIds:[],queryHits:{},error:void 0,requests:[]},_f=Gt(((e,t)=>{switch(t.type){case Bi:return wf;case Ii:{const{page:r,searchTerm:n,searchCollections:o}=t.payload;e.isFetching=!0,e.term=n,e.collections=o,e.page=r;break}case Di:{const{entries:r,page:n}=t.payload,o=r.map((e=>({collection:e.collection,slug:e.slug})));e.isFetching=!1,e.page=n,e.entryIds=!n||isNaN(n)||0===n?o:e.entryIds.concat(o);break}case Li:{const{error:r}=t.payload;e.isFetching=!1,e.error=r;break}case Ni:{const{searchTerm:r,request:n}=t.payload;e.isFetching=!0,e.term=r,n&&e.requests.push(n);break}case Ui:e.requests=e.requests.filter((e=>e.expires>=new Date));break;case $i:{const{namespace:r,hits:n}=t.payload;e.isFetching=!1,e.queryHits[r]=n;break}case Fi:{const{error:r}=t.payload;e.isFetching=!1,e.error=r}}}),wf),Sf=_f;function xf(e){return Object.values(e).some((e=>e.isLoading))}const Of=Gt(((e,t)=>{switch(t.type){case Ha:t.payload.forEach((t=>{e[t.path]={asset:t,isLoading:!1,error:null}}));break;case Va:{const r=t.payload;e[r.path]={asset:r,isLoading:!1,error:null};break}case Ga:{const r=t.payload;delete e[r];break}case Ka:{const{path:r}=t.payload;e[r]=e[r]||{},e[r].isLoading=!0;break}case Ya:{const{path:r}=t.payload;e[r]=e[r]||{},e[r].isLoading=!1,e[r].error=null;break}case Ja:{const{path:r,error:n}=t.payload;e[r]=e[r]||{},e[r].isLoading=!1,e[r].error=n}}}),{}),Ef="DEPLOY_PREVIEW_REQUEST",kf="DEPLOY_PREVIEW_SUCCESS",Cf="DEPLOY_PREVIEW_FAILURE";function Tf(e,t){return{type:Cf,payload:{collection:e,slug:t}}}const Pf=Gt(((e,t)=>{switch(t.type){case Ef:{const{collection:r,slug:n}=t.payload,o=`${r}.${n}`;e[o]=e[o]||{},e[o].isFetching=!0;break}case kf:{const{collection:r,slug:n,url:o,status:i}=t.payload,a=`${r}.${n}`;e[a].isFetching=!1,e[a].url=o,e[a].status=i;break}case Cf:{const{collection:r,slug:n}=t.payload;e[`${r}.${n}`].isFetching=!1;break}}}),{}),jf=Pf,Rf=["DEPLOY_PREVIEW","STATUS_REQUEST","STATUS_SUCCESS","STATUS_FAILURE"];function Mf(e){return Rf.some((t=>e.type.includes(t)))}const Af=Gt(((e,t)=>{!Mf(t)&&t.type.includes("REQUEST")?e.isFetching=!0:Mf(t)||!t.type.includes("SUCCESS")&&!t.type.includes("FAILURE")?t.type===lf&&(e.useOpenAuthoring=!0):e.isFetching=!1}),{isFetching:!1,useOpenAuthoring:!1}),If="STATUS_REQUEST",Df="STATUS_SUCCESS",Lf="STATUS_FAILURE";function Nf(e){return{type:Df,payload:{status:e}}}const $f=Gt(((e,t)=>{switch(t.type){case If:e.isFetching=!0;break;case Df:e.isFetching=!1,e.status=t.payload.status;break;case Lf:e.isFetching=!1,e.error=t.payload.error}}),{isFetching:!1,status:{auth:{status:!0},api:{status:!0,statusPage:""}},error:void 0});function Ff(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Bf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ff(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ff(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Uf=Gt(((e,t)=>{switch(t.type){case Zi:e.notifications=[];break;case Xi:e.notifications=e.notifications.filter((e=>e.id!==t.id));break;case Qi:e.notifications=[...e.notifications,Bf({id:ho()},t.payload)]}}),{notifications:[]}),zf={auth:gf,config:$u,collections:function(e=dc,t){if(t.type===vu){const e=t.payload.collections;let r=(0,Qe.OrderedMap)({});return e.forEach((e=>{r=r.set(e.name,(0,Qe.fromJS)(e))})),r}return e},search:Sf,integrations:function(e=pu,t){return t.type===vu?fu(t.payload):e},entries:function(e=(0,Qe.Map)({entities:(0,Qe.Map)(),pages:(0,Qe.Map)(),sort:ql(),viewStyle:Hl()}),t){switch(t.type){case Ls:{const r=t.payload;return e.setIn(["entities",`${r.collection}.${r.slug}`,"isFetching"],!0)}case Ns:{const r=t.payload;return Ll=r.collection,Bl=r.entry.slug,e.withMutations((e=>{e.setIn(["entities",`${Ll}.${Bl}`],(0,Qe.fromJS)(r.entry));const t=e.getIn(["pages",Ll,"ids"],(0,Qe.List)());t.includes(Bl)||e.setIn(["pages",Ll,"ids"],t.unshift(Bl))}))}case Fs:{const r=t.payload,n=e.withMutations((e=>{e.setIn(["pages",r.collection,"isFetching"],!0)}));return n}case Bs:{const r=t.payload;return Ll=r.collection,Nl=r.entries,$l=r.append,Fl=r.page,e.withMutations((e=>{Nl.forEach((t=>e.setIn(["entities",`${Ll}.${t.slug}`],(0,Qe.fromJS)(t).set("isFetching",!1))));const t=(0,Qe.List)(Nl.map((e=>e.slug)));e.setIn(["pages",Ll],(0,Qe.Map)({page:Fl,ids:$l?e.getIn(["pages",Ll,"ids"],(0,Qe.List)()).concat(t):t}))}))}case Us:return e.setIn(["pages",t.meta.collection,"isFetching"],!1);case $s:{const r=t.payload;return e.withMutations((e=>{e.setIn(["entities",`${r.collection}.${r.slug}`,"isFetching"],!1),e.setIn(["entities",`${r.collection}.${r.slug}`,"error"],r.error.message)}))}case Di:{const r=t.payload;return Nl=r.entries,e.withMutations((e=>{Nl.forEach((t=>e.setIn(["entities",`${t.collection}.${t.slug}`],(0,Qe.fromJS)(t).set("isFetching",!1))))}))}case cl:{const r=t.payload;return e.withMutations((e=>{e.deleteIn(["entities",`${r.collectionName}.${r.entrySlug}`]),e.updateIn(["pages",r.collectionName,"ids"],(e=>e.filter((e=>e!==r.entrySlug))))}))}case zs:{const r=t.payload,{collection:n,key:o,direction:i}=r,a=e.withMutations((e=>{const t=(0,Qe.OrderedMap)({[o]:(0,Qe.Map)({key:o,direction:i})});e.setIn(["sort",n],t),e.setIn(["pages",n,"isFetching"],!0),e.deleteIn(["pages",n,"page"])}));return Wl(a.get("sort")),a}case Ys:case Vs:case qs:{const r=t.payload,{collection:n,entries:o}=r;Nl=o;const i=e.withMutations((e=>{Nl.forEach((t=>e.setIn(["entities",`${t.collection}.${t.slug}`],(0,Qe.fromJS)(t).set("isFetching",!1)))),e.setIn(["pages",n,"isFetching"],!1);const t=(0,Qe.List)(Nl.map((e=>e.slug)));e.setIn(["pages",n],(0,Qe.Map)({page:1,ids:t}))}));return i}case Ws:{const r=t.payload,{collection:n,key:o}=r,i=e.withMutations((e=>{e.deleteIn(["sort",n,o]),e.setIn(["pages",n,"isFetching"],!1)}));return Wl(i.get("sort")),i}case Hs:{const r=t.payload,{collection:n,filter:o}=r,i=e.withMutations((e=>{const t=e.getIn(["filter",n,o.id],(0,Qe.fromJS)(o));e.setIn(["filter",n,t.get("id")],t.set("active",!t.get("active")))}));return i}case Gs:{const r=t.payload,{collection:n,filter:o}=r,i=e.withMutations((e=>{e.deleteIn(["filter",n,o.id]),e.setIn(["pages",n,"isFetching"],!1)}));return i}case Ks:{const r=t.payload,{collection:n,group:o}=r,i=e.withMutations((e=>{const t=e.getIn(["group",n,o.id],(0,Qe.fromJS)(o));e.deleteIn(["group",n]),e.setIn(["group",n,t.get("id")],t.set("active",!t.get("active")))}));return i}case Js:{const r=t.payload,{collection:n,group:o}=r,i=e.withMutations((e=>{e.deleteIn(["group",n,o.id]),e.setIn(["pages",n,"isFetching"],!1)}));return i}case pl:{const n=t.payload,{style:o}=n,i=e.withMutations((e=>{e.setIn(["viewStyle"],o)}));return(r=i.get("viewStyle"))?localStorage.setItem(zl,r):localStorage.removeItem(zl),i}default:return e}var r},cursors:function(e=(0,Qe.fromJS)({cursorsByType:{collectionEntries:{}}}),t){switch(t.type){case Bs:return e.setIn(["cursorsByType","collectionEntries",t.payload.collection],pr.Cursor.create(t.payload.cursor).store);case Vs:case Ys:case qs:return e.deleteIn(["cursorsByType","collectionEntries",t.payload.collection]);default:return e}},editorialWorkflow:function(e=(0,Qe.Map)(),t){switch(t.type){case vu:return(t.payload&&t.payload.publish_mode)===Zn?(0,Qe.Map)({entities:(0,Qe.Map)(),pages:(0,Qe.Map)()}):e;case ss:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isFetching"],!0);case cs:return e.deleteIn(["entities",`${t.payload.collection}.${t.payload.slug}`]);case ls:return e.setIn(["entities",`${t.payload.collection}.${t.payload.entry.slug}`],(0,Qe.fromJS)(t.payload.entry));case us:return e.setIn(["pages","isFetching"],!0);case fs:return e.withMutations((e=>{t.payload.entries.forEach((t=>e.setIn(["entities",`${t.collection}.${t.slug}`],(0,Qe.fromJS)(t).set("isFetching",!1)))),e.set("pages",(0,Qe.Map)(bf(bf({},t.payload.pages),{},{ids:(0,Qe.List)(t.payload.entries.map((e=>e.slug)))})))}));case ds:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isPersisting"],!0);case hs:return e.withMutations((e=>{e.setIn(["entities",`${t.payload.collection}.${t.payload.entry.get("slug")}`],(0,Qe.fromJS)(t.payload.entry)),e.deleteIn(["entities",`${t.payload.collection}.${t.payload.entry.get("slug")}`,"isPersisting"]),e.updateIn(["pages","ids"],(0,Qe.List)(),(e=>e.push(t.payload.entry.get("slug"))))}));case gs:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isPersisting"],!1);case ms:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isUpdatingStatus"],!0);case ys:return e.withMutations((e=>{e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"status"],t.payload.newStatus),e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isUpdatingStatus"],!1)}));case vs:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isUpdatingStatus"],!1);case bs:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isPublishing"],!0);case ws:case Ss:return e.deleteIn(["entities",`${t.payload.collection}.${t.payload.slug}`]);default:return e}},entryDraft:function(e=(0,Qe.Map)(),t){switch(t.type){case Qs:return e.withMutations((e=>{e.set("entry",(0,Qe.fromJS)(t.payload.entry)),e.setIn(["entry","newRecord"],!1),e.set("fieldsMetaData",(0,Qe.Map)()),e.set("fieldsErrors",(0,Qe.Map)()),e.set("hasChanged",!1),e.set("key",ho())}));case Xs:return e.withMutations((e=>{e.set("entry",(0,Qe.fromJS)(t.payload)),e.setIn(["entry","newRecord"],!0),e.set("fieldsMetaData",(0,Qe.Map)()),e.set("fieldsErrors",(0,Qe.Map)()),e.set("hasChanged",!1),e.set("key",ho())}));case ol:return e.withMutations((e=>{const t=e.get("localBackup").get("entry");e.delete("localBackup"),e.set("entry",t),e.setIn(["entry","newRecord"],!t.get("path")),e.set("fieldsMetaData",(0,Qe.Map)()),e.set("fieldsErrors",(0,Qe.Map)()),e.set("hasChanged",!0),e.set("key",ho())}));case il:return e.withMutations((e=>{e.set("entry",(0,Qe.fromJS)(t.payload)),e.setIn(["entry","newRecord"],!0),e.set("mediaFiles",(0,Qe.List)()),e.set("fieldsMetaData",(0,Qe.Map)()),e.set("fieldsErrors",(0,Qe.Map)()),e.set("hasChanged",!0)}));case Zs:return Ms;case nl:{const{entry:r}=t.payload,n=new Qe.Map({entry:(0,Qe.fromJS)(r)});return e.set("localBackup",n)}case el:return e.withMutations((e=>{const{field:r,value:n,metadata:o,entries:i,i18n:a}=t.payload,s=r.get("name"),l=r.get("meta"),c=a&&zc(a.currentLocale,a.defaultLocale)||["data"];l?e.setIn(["entry","meta",s],n):(e.setIn(["entry",...c,s],n),a&&(e=Jc(e,r,a.locales,a.defaultLocale))),e.mergeDeepIn(["fieldsMetaData"],(0,Qe.fromJS)(o));const u=e.getIn(["entry",...c]),f=e.getIn(["entry","meta"]);e.set("hasChanged",!i.some((e=>u.equals(e.get(...c))))||!i.some((e=>f.equals(e.get("meta")))))}));case tl:return 0===t.payload.errors.length?e.deleteIn(["fieldsErrors",t.payload.uniquefieldId]):e.setIn(["fieldsErrors",t.payload.uniquefieldId],t.payload.errors);case rl:{const{uniqueFieldId:r}=t.payload;return e.deleteIn(["fieldsErrors",r])}case al:case ds:return e.setIn(["entry","isPersisting"],!0);case ll:case gs:return e.deleteIn(["entry","isPersisting"]);case ms:return e.setIn(["entry","isUpdatingStatus"],!0);case vs:case ys:return e.deleteIn(["entry","isUpdatingStatus"]);case bs:return e.setIn(["entry","isPublishing"],!0);case ws:case _s:return e.deleteIn(["entry","isPublishing"]);case sl:case hs:return e.withMutations((e=>{e.deleteIn(["entry","isPersisting"]),e.set("hasChanged",!1),e.getIn(["entry","slug"])||e.setIn(["entry","slug"],t.payload.slug)}));case cl:return e.withMutations((e=>{e.deleteIn(["entry","isPersisting"]),e.set("hasChanged",!1)}));case ul:return e.withMutations((e=>{const r=e.getIn(["entry","mediaFiles"]);e.setIn(["entry","mediaFiles"],r.filterNot((e=>e.get("id")===t.payload.id)).insert(0,(0,Qe.fromJS)(t.payload))),e.set("hasChanged",!0)}));case fl:return e.withMutations((e=>{const r=e.getIn(["entry","mediaFiles"]);e.setIn(["entry","mediaFiles"],r.filterNot((e=>e.get("id")===t.payload.id))),e.set("hasChanged",!0)}));default:return e}},medias:Of,mediaLibrary:function(e=(0,Qe.Map)(za),t){switch(t.type){case aa:return e.withMutations((e=>{e.set("externalLibrary",t.payload),e.set("showMediaButton",t.payload.enableStandalone())}));case oa:{const{controlID:r,forImage:n,privateUpload:o,config:i,field:a,value:s,replaceIndex:l}=t.payload,c=i||(0,Qe.Map)();return e.get("privateUpload")!==o?(0,Qe.Map)({isVisible:!0,forImage:n,controlID:r,canInsert:!!r,privateUpload:o,config:c,controlMedia:(0,Qe.Map)(),displayURLs:(0,Qe.Map)(),field:a,value:s,replaceIndex:l}):e.withMutations((e=>{e.set("isVisible",!0),e.set("forImage",null!=n&&n),e.set("controlID",null!=r?r:""),e.set("canInsert",!!r),e.set("privateUpload",o),e.set("config",c),e.set("field",null!=a?a:""),e.set("value",""==s&&c.get("multiple")?[]:null!=s?s:""),e.set("replaceIndex",null!=l&&l)}))}case ia:return e.set("isVisible",!1);case sa:{const{mediaPath:r}=t.payload,n=e.get("controlID"),o=e.get("value");if(!Array.isArray(o))return e.withMutations((e=>{e.setIn(["controlMedia",n],r)}));const i=e.get("replaceIndex"),a=Array.isArray(r)?r:[r],s=o;return"number"==typeof i?s[i]=a[0]:s.push(...a),e.withMutations((e=>{e.setIn(["controlMedia",n],s)}))}case la:{const r=t.payload.controlID;return e.setIn(["controlMedia",r],"")}case ca:return e.withMutations((e=>{e.set("isLoading",!0),e.set("isPaginating",t.payload.page>1)}));case ua:{const{files:r=[],page:n,canPaginate:o,dynamicSearch:i,dynamicSearchQuery:a,privateUpload:s}=t.payload;if(e.get("privateUpload")!==s)return e;const l=r.map((e=>Ua(Ua({},e),{},{key:ho()})));return e.withMutations((e=>{if(e.set("isLoading",!1),e.set("isPaginating",!1),e.set("page",null!=n?n:1),e.set("hasNextPage",!!(o&&r.length>0)),e.set("dynamicSearch",null!=i&&i),e.set("dynamicSearchQuery",null!=a?a:""),e.set("dynamicSearchActive",!!a),n&&n>1){const t=e.get("files").concat(l);e.set("files",t)}else e.set("files",l)}))}case fa:return e.get("privateUpload")!==t.payload.privateUpload?e:e.set("isLoading",!1);case pa:return e.set("isPersisting",!0);case da:{const{file:r,privateUpload:n}=t.payload;return e.get("privateUpload")!==n?e:e.withMutations((e=>{const t=[Ua(Ua({},r),{},{key:ho()}),...e.get("files")];e.set("files",t),e.set("isPersisting",!1)}))}case ha:return e.get("privateUpload")!==t.payload.privateUpload?e:e.set("isPersisting",!1);case ga:return e.set("isDeleting",!0);case ma:{const{file:r,privateUpload:n}=t.payload,{key:o,id:i}=r;return e.get("privateUpload")!==n?e:e.withMutations((e=>{const t=e.get("files").filter((e=>o?e.key!==o:e.id!==i));e.set("files",t),e.deleteIn(["displayURLs",i]),e.set("isDeleting",!1)}))}case ya:return e.get("privateUpload")!==t.payload.privateUpload?e:e.set("isDeleting",!1);case va:return e.setIn(["displayURLs",t.payload.key,"isFetching"],!0);case ba:{const r=["displayURLs",t.payload.key];return e.setIn([...r,"isFetching"],!1).setIn([...r,"url"],t.payload.url)}case wa:{const r=["displayURLs",t.payload.key];return e.setIn([...r,"isFetching"],!1).setIn([...r,"err"],t.payload.err||!0).deleteIn([...r,"url"])}default:return e}},deploys:jf,globalUI:Af,status:$f,notifications:Uf};function qf(e,t,r){return Jl(e.entries,t,r)}function Wf(e,t){return Ql(e.entries,t)}function Hf(e,t,r){return function(e,t,r){return e[`${t}.${r}`]}(e.deploys,t,r)}function Vf(e,t,r){return function(e,t,r){return e&&e.getIn(["entities",`${t}.${r}`])}(e.editorialWorkflow,t,r)}function Gf(e,t,r){return du(e.integrations,t,r)}function Kf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const Yf=(0,He.MT)((0,He.UY)(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Kf(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kf(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},zf)),(0,Ve.Uo)((0,He.md)(Ye,(({dispatch:e,getState:t})=>{let r=[];return n=>o=>{if(o.type===Je)return r.push(o),null;const i=n(o);return function(n){const o=[],i=[];for(const e of r)e.predicate(n)?o.push(e):i.push(e);r=i;for(const r of o)r.run(e,t,n)}(o),i}}))));var Jf=__webpack_require__(98537),Qf=__webpack_require__.n(Jf);function Xf(e){return Qf()({},Ln("en"),Ln(e))}function Zf(e){var t=null;return function(){return null==t&&(t=e()),t}}function ep(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function tp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var rp=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),tp(this,"entered",[]),tp(this,"isNodeInDocument",void 0),this.isNodeInDocument=t}var t,r;return t=e,r=[{key:"enter",value:function(e){var t=this,r=this.entered.length;return this.entered=function(e,t){var r=new Set,n=function(e){return r.add(e)};e.forEach(n),t.forEach(n);var o=[];return r.forEach((function(e){return o.push(e)})),o}(this.entered.filter((function(r){return t.isNodeInDocument(r)&&(!r.contains||r.contains(e))})),[e]),0===r&&this.entered.length>0}},{key:"leave",value:function(e){var t,r,n=this.entered.length;return this.entered=(t=this.entered.filter(this.isNodeInDocument),r=e,t.filter((function(e){return e!==r}))),n>0&&0===this.entered.length}},{key:"reset",value:function(){this.entered=[]}}],r&&ep(t.prototype,r),e}(),np=Zf((function(){return/firefox/i.test(navigator.userAgent)})),op=Zf((function(){return Boolean(window.safari)}));function ip(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ap(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var sp=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ap(this,"xs",void 0),ap(this,"ys",void 0),ap(this,"c1s",void 0),ap(this,"c2s",void 0),ap(this,"c3s",void 0);for(var n=t.length,o=[],i=0;i<n;i++)o.push(i);o.sort((function(e,r){return t[e]<t[r]?-1:1}));for(var a,s,l=[],c=[],u=[],f=0;f<n-1;f++)a=t[f+1]-t[f],s=r[f+1]-r[f],c.push(a),l.push(s),u.push(s/a);for(var p=[u[0]],d=0;d<c.length-1;d++){var h=u[d],g=u[d+1];if(h*g<=0)p.push(0);else{a=c[d];var m=c[d+1],y=a+m;p.push(3*y/((y+m)/h+(y+a)/g))}}p.push(u[u.length-1]);for(var v,b=[],w=[],_=0;_<p.length-1;_++){v=u[_];var S=p[_],x=1/c[_],O=S+p[_+1]-v-v;b.push((v-S-O)*x),w.push(O*x*x)}this.xs=t,this.ys=r,this.c1s=p,this.c2s=b,this.c3s=w}var t,r;return t=e,r=[{key:"interpolate",value:function(e){var t=this.xs,r=this.ys,n=this.c1s,o=this.c2s,i=this.c3s,a=t.length-1;if(e===t[a])return r[a];for(var s,l=0,c=i.length-1;l<=c;){var u=t[s=Math.floor(.5*(l+c))];if(u<e)l=s+1;else{if(!(u>e))return r[s];c=s-1}}var f=e-t[a=Math.max(0,c)],p=f*f;return r[a]+n[a]*f+o[a]*p+i[a]*f*p}}],r&&ip(t.prototype,r),e}(),lp=1;function cp(e){var t=e.nodeType===lp?e:e.parentElement;if(!t)return null;var r=t.getBoundingClientRect(),n=r.top;return{x:r.left,y:n}}function up(e){return{x:e.clientX,y:e.clientY}}var fp,pp="__NATIVE_FILE__",dp="__NATIVE_URL__",hp="__NATIVE_TEXT__",gp="__NATIVE_HTML__";function mp(e,t,r){var n=t.reduce((function(t,r){return t||e.getData(r)}),"");return null!=n?n:r}function yp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var vp=(yp(fp={},pp,{exposeProperties:{files:function(e){return Array.prototype.slice.call(e.files)},items:function(e){return e.items},dataTransfer:function(e){return e}},matchesTypes:["Files"]}),yp(fp,gp,{exposeProperties:{html:function(e,t){return mp(e,t,"")},dataTransfer:function(e){return e}},matchesTypes:["Html","text/html"]}),yp(fp,dp,{exposeProperties:{urls:function(e,t){return mp(e,t,"").split("\n")},dataTransfer:function(e){return e}},matchesTypes:["Url","text/uri-list"]}),yp(fp,hp,{exposeProperties:{text:function(e,t){return mp(e,t,"")},dataTransfer:function(e){return e}},matchesTypes:["Text","text/plain"]}),fp);function bp(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function wp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var _p=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),wp(this,"item",void 0),wp(this,"config",void 0),this.config=t,this.item={},this.initializeExposedProperties()}var t,r;return t=e,(r=[{key:"initializeExposedProperties",value:function(){var e=this;Object.keys(this.config.exposeProperties).forEach((function(t){Object.defineProperty(e.item,t,{configurable:!0,enumerable:!0,get:function(){return console.warn("Browser doesn't allow reading \"".concat(t,'" until the drop event.')),null}})}))}},{key:"loadDataTransfer",value:function(e){var t=this;if(e){var r={};Object.keys(this.config.exposeProperties).forEach((function(n){r[n]={value:t.config.exposeProperties[n](e,t.config.matchesTypes),configurable:!0,enumerable:!0}})),Object.defineProperties(this.item,r)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(e,t){return t===e.getSourceId()}},{key:"endDrag",value:function(){}}])&&bp(t.prototype,r),e}();function Sp(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(vp).filter((function(e){return vp[e].matchesTypes.some((function(e){return t.indexOf(e)>-1}))}))[0]||null}function xp(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Op(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ep=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Op(this,"ownerDocument",null),Op(this,"globalContext",void 0),Op(this,"optionsArgs",void 0),this.globalContext=t,this.optionsArgs=r}var t,r;return t=e,(r=[{key:"window",get:function(){return this.globalContext?this.globalContext:"undefined"!=typeof window?window:void 0}},{key:"document",get:function(){var e;return null!==(e=this.globalContext)&&void 0!==e&&e.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var e;return(null===(e=this.optionsArgs)||void 0===e?void 0:e.rootElement)||this.window}}])&&xp(t.prototype,r),e}();function kp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Cp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kp(Object(r),!0).forEach((function(t){Pp(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Tp(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Pp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var jp=function(){function t(e,r,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Pp(this,"options",void 0),Pp(this,"actions",void 0),Pp(this,"monitor",void 0),Pp(this,"registry",void 0),Pp(this,"enterLeaveCounter",void 0),Pp(this,"sourcePreviewNodes",new Map),Pp(this,"sourcePreviewNodeOptions",new Map),Pp(this,"sourceNodes",new Map),Pp(this,"sourceNodeOptions",new Map),Pp(this,"dragStartSourceIds",null),Pp(this,"dropTargetIds",[]),Pp(this,"dragEnterTargetIds",[]),Pp(this,"currentNativeSource",null),Pp(this,"currentNativeHandle",null),Pp(this,"currentDragSourceNode",null),Pp(this,"altKeyPressed",!1),Pp(this,"mouseMoveTimeoutTimer",null),Pp(this,"asyncEndDragFrameId",null),Pp(this,"dragOverTargetIds",null),Pp(this,"lastClientOffset",null),Pp(this,"hoverRafId",null),Pp(this,"getSourceClientOffset",(function(e){var t=o.sourceNodes.get(e);return t&&cp(t)||null})),Pp(this,"endDragNativeItem",(function(){o.isDraggingNativeItem()&&(o.actions.endDrag(),o.currentNativeHandle&&o.registry.removeSource(o.currentNativeHandle),o.currentNativeHandle=null,o.currentNativeSource=null)})),Pp(this,"isNodeInDocument",(function(e){return Boolean(e&&o.document&&o.document.body&&o.document.body.contains(e))})),Pp(this,"endDragIfSourceWasRemovedFromDOM",(function(){var e=o.currentDragSourceNode;null==e||o.isNodeInDocument(e)||o.clearCurrentDragSourceNode()&&o.monitor.isDragging()&&o.actions.endDrag()})),Pp(this,"handleTopDragStartCapture",(function(){o.clearCurrentDragSourceNode(),o.dragStartSourceIds=[]})),Pp(this,"handleTopDragStart",(function(e){if(!e.defaultPrevented){var t=o.dragStartSourceIds;o.dragStartSourceIds=null;var r=up(e);o.monitor.isDragging()&&o.actions.endDrag(),o.actions.beginDrag(t||[],{publishSource:!1,getSourceClientOffset:o.getSourceClientOffset,clientOffset:r});var n=e.dataTransfer,i=Sp(n);if(o.monitor.isDragging()){if(n&&"function"==typeof n.setDragImage){var a=o.monitor.getSourceId(),s=o.sourceNodes.get(a),l=o.sourcePreviewNodes.get(a)||s;if(l){var c=o.getCurrentSourcePreviewNodeOptions(),u=function(e,t,r,n,o){var i,a,s="IMG"===(i=t).nodeName&&(np()||!(null!==(a=document.documentElement)&&void 0!==a&&a.contains(i))),l=cp(s?e:t),c={x:r.x-l.x,y:r.y-l.y},u=e.offsetWidth,f=e.offsetHeight,p=n.anchorX,d=n.anchorY,h=function(e,t,r,n){var o=e?t.width:r,i=e?t.height:n;return op()&&e&&(i/=window.devicePixelRatio,o/=window.devicePixelRatio),{dragPreviewWidth:o,dragPreviewHeight:i}}(s,t,u,f),g=h.dragPreviewWidth,m=h.dragPreviewHeight,y=o.offsetX,v=o.offsetY,b=0===v||v;return{x:0===y||y?y:new sp([0,.5,1],[c.x,c.x/u*g,c.x+g-u]).interpolate(p),y:b?v:function(){var e=new sp([0,.5,1],[c.y,c.y/f*m,c.y+m-f]).interpolate(d);return op()&&s&&(e+=(window.devicePixelRatio-1)*m),e}()}}(s,l,r,{anchorX:c.anchorX,anchorY:c.anchorY},{offsetX:c.offsetX,offsetY:c.offsetY});n.setDragImage(l,u.x,u.y)}}try{null==n||n.setData("application/json",{})}catch(e){}o.setCurrentDragSourceNode(e.target),o.getCurrentSourcePreviewNodeOptions().captureDraggingState?o.actions.publishDragSource():setTimeout((function(){return o.actions.publishDragSource()}),0)}else if(i)o.beginDragNativeItem(i);else{if(n&&!n.types&&(e.target&&!e.target.hasAttribute||!e.target.hasAttribute("draggable")))return;e.preventDefault()}}})),Pp(this,"handleTopDragEndCapture",(function(){o.clearCurrentDragSourceNode()&&o.monitor.isDragging()&&o.actions.endDrag()})),Pp(this,"handleTopDragEnterCapture",(function(e){if(o.dragEnterTargetIds=[],o.enterLeaveCounter.enter(e.target)&&!o.monitor.isDragging()){var t=e.dataTransfer,r=Sp(t);r&&o.beginDragNativeItem(r,t)}})),Pp(this,"handleTopDragEnter",(function(e){var t=o.dragEnterTargetIds;o.dragEnterTargetIds=[],o.monitor.isDragging()&&(o.altKeyPressed=e.altKey,t.length>0&&o.actions.hover(t,{clientOffset:up(e)}),t.some((function(e){return o.monitor.canDropOnTarget(e)}))&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=o.getCurrentDropEffect())))})),Pp(this,"handleTopDragOverCapture",(function(){o.dragOverTargetIds=[]})),Pp(this,"handleTopDragOver",(function(e){var t=o.dragOverTargetIds;if(o.dragOverTargetIds=[],!o.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer&&(e.dataTransfer.dropEffect="none"));o.altKeyPressed=e.altKey,o.lastClientOffset=up(e),null===o.hoverRafId&&"undefined"!=typeof requestAnimationFrame&&(o.hoverRafId=requestAnimationFrame((function(){o.monitor.isDragging()&&o.actions.hover(t||[],{clientOffset:o.lastClientOffset}),o.hoverRafId=null}))),(t||[]).some((function(e){return o.monitor.canDropOnTarget(e)}))?(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=o.getCurrentDropEffect())):o.isDraggingNativeItem()?e.preventDefault():(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="none"))})),Pp(this,"handleTopDragLeaveCapture",(function(e){o.isDraggingNativeItem()&&e.preventDefault(),o.enterLeaveCounter.leave(e.target)&&o.isDraggingNativeItem()&&setTimeout((function(){return o.endDragNativeItem()}),0)})),Pp(this,"handleTopDropCapture",(function(e){var t;o.dropTargetIds=[],o.isDraggingNativeItem()?(e.preventDefault(),null===(t=o.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer)):Sp(e.dataTransfer)&&e.preventDefault(),o.enterLeaveCounter.reset()})),Pp(this,"handleTopDrop",(function(e){var t=o.dropTargetIds;o.dropTargetIds=[],o.actions.hover(t,{clientOffset:up(e)}),o.actions.drop({dropEffect:o.getCurrentDropEffect()}),o.isDraggingNativeItem()?o.endDragNativeItem():o.monitor.isDragging()&&o.actions.endDrag()})),Pp(this,"handleSelectStart",(function(e){var t=e.target;"function"==typeof t.dragDrop&&("INPUT"===t.tagName||"SELECT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||(e.preventDefault(),t.dragDrop()))})),this.options=new Ep(r,n),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new rp(this.isNodeInDocument)}var r,n;return r=t,(n=[{key:"profile",value:function(){var e,t;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:(null===(e=this.dragStartSourceIds)||void 0===e?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:(null===(t=this.dragOverTargetIds)||void 0===t?void 0:t.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var e=this.rootElement;if(void 0!==e){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}},{key:"teardown",value:function(){var e,t=this.rootElement;void 0!==t&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId&&(null===(e=this.window)||void 0===e||e.cancelAnimationFrame(this.asyncEndDragFrameId)))}},{key:"connectDragPreview",value:function(e,t,r){var n=this;return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,t),function(){n.sourcePreviewNodes.delete(e),n.sourcePreviewNodeOptions.delete(e)}}},{key:"connectDragSource",value:function(e,t,r){var n=this;this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,r);var o=function(t){return n.handleDragStart(t,e)},i=function(e){return n.handleSelectStart(e)};return t.setAttribute("draggable","true"),t.addEventListener("dragstart",o),t.addEventListener("selectstart",i),function(){n.sourceNodes.delete(e),n.sourceNodeOptions.delete(e),t.removeEventListener("dragstart",o),t.removeEventListener("selectstart",i),t.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(e,t){var r=this,n=function(t){return r.handleDragEnter(t,e)},o=function(t){return r.handleDragOver(t,e)},i=function(t){return r.handleDrop(t,e)};return t.addEventListener("dragenter",n),t.addEventListener("dragover",o),t.addEventListener("drop",i),function(){t.removeEventListener("dragenter",n),t.removeEventListener("dragover",o),t.removeEventListener("drop",i)}}},{key:"addEventListeners",value:function(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var e=this.monitor.getSourceId(),t=this.sourceNodeOptions.get(e);return Cp({dropEffect:this.altKeyPressed?"copy":"move"},t||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var e=this.monitor.getSourceId();return Cp({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}},{key:"isDraggingNativeItem",value:function(){var t=this.monitor.getItemType();return Object.keys(e).some((function(r){return e[r]===t}))}},{key:"beginDragNativeItem",value:function(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=function(e,t){var r=new _p(vp[e]);return r.loadDataTransfer(t),r}(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(e){var t=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.mouseMoveTimeoutTimer=setTimeout((function(){var e;return null===(e=t.rootElement)||void 0===e?void 0:e.addEventListener("mousemove",t.endDragIfSourceWasRemovedFromDOM,!0)}),1e3)}},{key:"clearCurrentDragSourceNode",value:function(){var e;return!!this.currentDragSourceNode&&(this.currentDragSourceNode=null,this.rootElement&&(null===(e=this.window)||void 0===e||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)),this.mouseMoveTimeoutTimer=null,!0)}},{key:"handleDragStart",value:function(e,t){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(t))}},{key:"handleDragEnter",value:function(e,t){this.dragEnterTargetIds.unshift(t)}},{key:"handleDragOver",value:function(e,t){null===this.dragOverTargetIds&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}},{key:"handleDrop",value:function(e,t){this.dropTargetIds.unshift(t)}}])&&Tp(r.prototype,n),t}(),Rp=function(e,t,r){return new jp(e,t,r)};function Mp(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];if(!e){var i;if(void 0===t)i=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;(i=new Error(t.replace(/%s/g,(function(){return n[a++]})))).name="Invariant Violation"}throw i.framesToPop=1,i}}function Ap(e,t,r){var n=r.getRegistry(),o=n.addTarget(e,t);return[o,function(){return n.removeTarget(o)}]}function Ip(e,t,r){var n=r.getRegistry(),o=n.addSource(e,t);return[o,function(){return n.removeSource(o)}]}function Dp(e){var r={};return Object.keys(e).forEach((function(n){var o=e[n];if(n.endsWith("Ref"))r[n]=e[n];else{var i=function(e){return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!(0,t.isValidElement)(r)){var o=r;return e(o,n),o}var i=r;!function(e){if("string"!=typeof e.type){var t=e.type.displayName||e.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(t," into a <div>, or turn it into a ")+"drag source or a drop target itself.")}}(i);var a=n?function(t){return e(t,n)}:e;return function(e,r){var n=e.ref;return Mp("string"!=typeof n,"Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?(0,t.cloneElement)(e,{ref:function(e){Lp(n,e),Lp(r,e)}}):(0,t.cloneElement)(e,{ref:r})}(i,a)}}(o);r[n]=function(){return i}}})),r}function Lp(e,t){"function"==typeof e?e(t):e.current=t}function Np(e){return Np="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Np(e)}function $p(e){return null!==e&&"object"===Np(e)&&Object.prototype.hasOwnProperty.call(e,"current")}function Fp(e,t,r,n){var o=r?r.call(n,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l<i.length;l++){var c=i[l];if(!s(c))return!1;var u=e[c],f=t[c];if(!1===(o=r?r.call(n,u,f,c):void 0)||void 0===o&&u!==f)return!1}return!0}function Bp(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Up(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var zp=function(){function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Up(this,"hooks",Dp({dragSource:function(e,t){r.clearDragSource(),r.dragSourceOptions=t||null,$p(e)?r.dragSourceRef=e:r.dragSourceNode=e,r.reconnectDragSource()},dragPreview:function(e,t){r.clearDragPreview(),r.dragPreviewOptions=t||null,$p(e)?r.dragPreviewRef=e:r.dragPreviewNode=e,r.reconnectDragPreview()}})),Up(this,"handlerId",null),Up(this,"dragSourceRef",null),Up(this,"dragSourceNode",void 0),Up(this,"dragSourceOptionsInternal",null),Up(this,"dragSourceUnsubscribe",void 0),Up(this,"dragPreviewRef",null),Up(this,"dragPreviewNode",void 0),Up(this,"dragPreviewOptionsInternal",null),Up(this,"dragPreviewUnsubscribe",void 0),Up(this,"lastConnectedHandlerId",null),Up(this,"lastConnectedDragSource",null),Up(this,"lastConnectedDragSourceOptions",null),Up(this,"lastConnectedDragPreview",null),Up(this,"lastConnectedDragPreviewOptions",null),Up(this,"backend",void 0),this.backend=t}var t,r;return t=e,(r=[{key:"receiveHandlerId",value:function(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}},{key:"connectTarget",get:function(){return this.dragSource}},{key:"dragSourceOptions",get:function(){return this.dragSourceOptionsInternal},set:function(e){this.dragSourceOptionsInternal=e}},{key:"dragPreviewOptions",get:function(){return this.dragPreviewOptionsInternal},set:function(e){this.dragPreviewOptionsInternal=e}},{key:"reconnect",value:function(){this.reconnectDragSource(),this.reconnectDragPreview()}},{key:"reconnectDragSource",value:function(){var e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();t&&this.disconnectDragSource(),this.handlerId&&(e?t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)):this.lastConnectedDragSource=e)}},{key:"reconnectDragPreview",value:function(){var e=this.dragPreview,t=this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();t&&this.disconnectDragPreview(),this.handlerId&&(e?t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=e,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,e,this.dragPreviewOptions)):this.lastConnectedDragPreview=e)}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didConnectedDragSourceChange",value:function(){return this.lastConnectedDragSource!==this.dragSource}},{key:"didConnectedDragPreviewChange",value:function(){return this.lastConnectedDragPreview!==this.dragPreview}},{key:"didDragSourceOptionsChange",value:function(){return!Fp(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!Fp(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}},{key:"disconnectDragSource",value:function(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}},{key:"disconnectDragPreview",value:function(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}},{key:"dragSource",get:function(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}},{key:"dragPreview",get:function(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}},{key:"clearDragSource",value:function(){this.dragSourceNode=null,this.dragSourceRef=null}},{key:"clearDragPreview",value:function(){this.dragPreviewNode=null,this.dragPreviewRef=null}}])&&Bp(t.prototype,r),e}();function qp(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Wp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Hp=!1,Vp=!1,Gp=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Wp(this,"internalMonitor",void 0),Wp(this,"sourceId",null),this.internalMonitor=t.getMonitor()}var t,r;return t=e,(r=[{key:"receiveHandlerId",value:function(e){this.sourceId=e}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){Mp(!Hp,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Hp=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Hp=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;Mp(!Vp,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Vp=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Vp=!1}}},{key:"subscribeToStateChange",value:function(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}},{key:"isDraggingSource",value:function(e){return this.internalMonitor.isDraggingSource(e)}},{key:"isOverTarget",value:function(e,t){return this.internalMonitor.isOverTarget(e,t)}},{key:"getTargetIds",value:function(){return this.internalMonitor.getTargetIds()}},{key:"isSourcePublic",value:function(){return this.internalMonitor.isSourcePublic()}},{key:"getSourceId",value:function(){return this.internalMonitor.getSourceId()}},{key:"subscribeToOffsetChange",value:function(e){return this.internalMonitor.subscribeToOffsetChange(e)}},{key:"canDragSource",value:function(e){return this.internalMonitor.canDragSource(e)}},{key:"canDropOnTarget",value:function(e){return this.internalMonitor.canDropOnTarget(e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}])&&qp(t.prototype,r),e}();function Kp(e){return Kp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kp(e)}function Yp(e){var t=e.current;return null==t?null:t.decoratedRef?t.decoratedRef.current:t}function Jp(e){return"function"==typeof e}function Qp(){}function Xp(e){if(!function(e){return"object"===Kp(e)&&null!==e}(e))return!1;if(null===Object.getPrototypeOf(e))return!0;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Zp(e,t){return"string"==typeof e||"symbol"===Kp(e)||!!t&&Array.isArray(e)&&e.every((function(e){return Zp(e,!1)}))}var ed=__webpack_require__(52322),td=(0,t.createContext)({dragDropManager:void 0});function rd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function od(e,t,r){return t&&nd(e.prototype,t),r&&nd(e,r),e}function id(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ad=function(){function e(t){rd(this,e),id(this,"isDisposed",!1),id(this,"action",void 0),this.action=Jp(t)?t:Qp}return od(e,[{key:"dispose",value:function(){this.isDisposed||(this.action(),this.isDisposed=!0)}}],[{key:"isDisposable",value:function(e){return Boolean(e&&Jp(e.dispose))}},{key:"_fixup",value:function(t){return e.isDisposable(t)?t:e.empty}},{key:"create",value:function(t){return new e(t)}}]),e}();id(ad,"empty",{dispose:Qp});var sd=function(){function e(){rd(this,e),id(this,"isDisposed",!1),id(this,"disposables",void 0);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];this.disposables=r}return od(e,[{key:"add",value:function(e){this.isDisposed?e.dispose():this.disposables.push(e)}},{key:"remove",value:function(e){var t=!1;if(!this.isDisposed){var r=this.disposables.indexOf(e);-1!==r&&(t=!0,this.disposables.splice(r,1),e.dispose())}return t}},{key:"clear",value:function(){if(!this.isDisposed){for(var e=this.disposables.length,t=new Array(e),r=0;r<e;r++)t[r]=this.disposables[r];this.disposables=[];for(var n=0;n<e;n++)t[n].dispose()}}},{key:"dispose",value:function(){if(!this.isDisposed){this.isDisposed=!0;for(var e=this.disposables.length,t=new Array(e),r=0;r<e;r++)t[r]=this.disposables[r];this.disposables=[];for(var n=0;n<e;n++)t[n].dispose()}}}]),e}(),ld=function(){function e(){rd(this,e),id(this,"isDisposed",!1),id(this,"current",void 0)}return od(e,[{key:"getDisposable",value:function(){return this.current}},{key:"setDisposable",value:function(e){var t=this.isDisposed;if(!t){var r=this.current;this.current=e,r&&r.dispose()}t&&e&&e.dispose()}},{key:"dispose",value:function(){if(!this.isDisposed){this.isDisposed=!0;var e=this.current;this.current=void 0,e&&e.dispose()}}}]),e}();function cd(e){return cd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cd(e)}function ud(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function fd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function pd(e,t){return pd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},pd(e,t)}function dd(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hd(e){return hd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},hd(e)}function gd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function md(e){var r=e.DecoratedComponent,n=e.createHandler,o=e.createMonitor,i=e.createConnector,a=e.registerHandler,s=e.containerDisplayName,l=e.getType,c=e.collect,u=e.options.arePropsEqual,f=void 0===u?Fp:u,p=r,d=r.displayName||r.name||"Component",h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&pd(e,t)}(m,e);var r,s,u,h,g=(u=m,h=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=hd(u);if(h){var r=hd(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===cd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return dd(e)}(this,e)});function m(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,m),gd(dd(r=g.call(this,e)),"decoratedRef",(0,t.createRef)()),gd(dd(r),"handlerId",void 0),gd(dd(r),"manager",void 0),gd(dd(r),"handlerMonitor",void 0),gd(dd(r),"handlerConnector",void 0),gd(dd(r),"handler",void 0),gd(dd(r),"disposable",void 0),gd(dd(r),"currentType",void 0),gd(dd(r),"handleChange",(function(){var e=r.getCurrentState();Fp(e,r.state)||r.setState(e)})),r.disposable=new ld,r.receiveProps(e),r.dispose(),r}return r=m,s=[{key:"getHandlerId",value:function(){return this.handlerId}},{key:"getDecoratedComponentInstance",value:function(){return Mp(this.decoratedRef.current,"In order to access an instance of the decorated component, it must either be a class component or use React.forwardRef()"),this.decoratedRef.current}},{key:"shouldComponentUpdate",value:function(e,t){return!f(e,this.props)||!Fp(t,this.state)}},{key:"componentDidMount",value:function(){this.disposable=new ld,this.currentType=void 0,this.receiveProps(this.props),this.handleChange()}},{key:"componentDidUpdate",value:function(e){f(this.props,e)||(this.receiveProps(this.props),this.handleChange())}},{key:"componentWillUnmount",value:function(){this.dispose()}},{key:"receiveProps",value:function(e){this.handler&&(this.handler.receiveProps(e),this.receiveType(l(e)))}},{key:"receiveType",value:function(e){if(this.handlerMonitor&&this.manager&&this.handlerConnector&&e!==this.currentType){this.currentType=e;var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ud(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ud(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(a(e,this.handler,this.manager),2),r=t[0],n=t[1];this.handlerId=r,this.handlerMonitor.receiveHandlerId(r),this.handlerConnector.receiveHandlerId(r);var o=this.manager.getMonitor().subscribeToStateChange(this.handleChange,{handlerIds:[r]});this.disposable.setDisposable(new sd(new ad(o),new ad(n)))}}},{key:"dispose",value:function(){this.disposable.dispose(),this.handlerConnector&&this.handlerConnector.receiveHandlerId(null)}},{key:"getCurrentState",value:function(){return this.handlerConnector?c(this.handlerConnector.hooks,this.handlerMonitor,this.props):{}}},{key:"render",value:function(){var e=this;return(0,ed.jsx)(td.Consumer,{children:function(t){var r,n,o=t.dragDropManager;return e.receiveDragDropManager(o),"undefined"!=typeof requestAnimationFrame&&requestAnimationFrame((function(){var t;return null===(t=e.handlerConnector)||void 0===t?void 0:t.reconnect()})),(0,ed.jsx)(p,Object.assign({},e.props,e.getCurrentState(),{ref:(r=p,(n=r)&&n.prototype&&"function"==typeof n.prototype.render||function(e){var t;return"Symbol(react.forward_ref)"===(null==e||null===(t=e.$$typeof)||void 0===t?void 0:t.toString())}(r)?e.decoratedRef:null)}),void 0)}},void 0)}},{key:"receiveDragDropManager",value:function(e){void 0===this.manager&&(Mp(void 0!==e,"Could not find the drag and drop manager in the context of %s. Make sure to render a DndProvider component in your top-level component. Read more: http://react-dnd.github.io/react-dnd/docs/troubleshooting#could-not-find-the-drag-and-drop-manager-in-the-context",d,d),void 0!==e&&(this.manager=e,this.handlerMonitor=o(e),this.handlerConnector=i(e.getBackend()),this.handler=n(this.handlerMonitor,this.decoratedRef)))}}],s&&fd(r.prototype,s),m}(t.Component);return gd(h,"DecoratedComponent",r),gd(h,"displayName","".concat(s,"(").concat(d,")")),m()(h,r)}function yd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function vd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var bd=["canDrag","beginDrag","isDragging","endDrag"],wd=["beginDrag"],_d=function(){function e(t,r,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),vd(this,"props",null),vd(this,"spec",void 0),vd(this,"monitor",void 0),vd(this,"ref",void 0),vd(this,"beginDrag",(function(){if(o.props)return o.spec.beginDrag(o.props,o.monitor,o.ref.current)})),this.spec=t,this.monitor=r,this.ref=n}var t,r;return t=e,(r=[{key:"receiveProps",value:function(e){this.props=e}},{key:"canDrag",value:function(){return!!this.props&&(!this.spec.canDrag||this.spec.canDrag(this.props,this.monitor))}},{key:"isDragging",value:function(e,t){return!!this.props&&(this.spec.isDragging?this.spec.isDragging(this.props,this.monitor):t===e.getSourceId())}},{key:"endDrag",value:function(){this.props&&this.spec.endDrag&&this.spec.endDrag(this.props,this.monitor,Yp(this.ref))}}])&&yd(t.prototype,r),e}();function Sd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function xd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Od=!1,Ed=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),xd(this,"internalMonitor",void 0),xd(this,"targetId",null),this.internalMonitor=t.getMonitor()}var t,r;return t=e,(r=[{key:"receiveHandlerId",value:function(e){this.targetId=e}},{key:"getHandlerId",value:function(){return this.targetId}},{key:"subscribeToStateChange",value:function(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}},{key:"canDrop",value:function(){if(!this.targetId)return!1;Mp(!Od,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Od=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Od=!1}}},{key:"isOver",value:function(e){return!!this.targetId&&this.internalMonitor.isOverTarget(this.targetId,e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}])&&Sd(t.prototype,r),e}();function kd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Cd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Td=function(){function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Cd(this,"hooks",Dp({dropTarget:function(e,t){r.clearDropTarget(),r.dropTargetOptions=t,$p(e)?r.dropTargetRef=e:r.dropTargetNode=e,r.reconnect()}})),Cd(this,"handlerId",null),Cd(this,"dropTargetRef",null),Cd(this,"dropTargetNode",void 0),Cd(this,"dropTargetOptionsInternal",null),Cd(this,"unsubscribeDropTarget",void 0),Cd(this,"lastConnectedHandlerId",null),Cd(this,"lastConnectedDropTarget",null),Cd(this,"lastConnectedDropTargetOptions",null),Cd(this,"backend",void 0),this.backend=t}var t,r;return t=e,(r=[{key:"connectTarget",get:function(){return this.dropTarget}},{key:"reconnect",value:function(){var e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();var t=this.dropTarget;this.handlerId&&(t?e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions)):this.lastConnectedDropTarget=t)}},{key:"receiveHandlerId",value:function(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}},{key:"dropTargetOptions",get:function(){return this.dropTargetOptionsInternal},set:function(e){this.dropTargetOptionsInternal=e}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didDropTargetChange",value:function(){return this.lastConnectedDropTarget!==this.dropTarget}},{key:"didOptionsChange",value:function(){return!Fp(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}},{key:"disconnectDropTarget",value:function(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}},{key:"dropTarget",get:function(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}},{key:"clearDropTarget",value:function(){this.dropTargetRef=null,this.dropTargetNode=null}}])&&kd(t.prototype,r),e}();function Pd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function jd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Rd=["canDrop","hover","drop"],Md=function(){function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),jd(this,"props",null),jd(this,"spec",void 0),jd(this,"monitor",void 0),jd(this,"ref",void 0),this.spec=t,this.monitor=r,this.ref=n}var t,r;return t=e,(r=[{key:"receiveProps",value:function(e){this.props=e}},{key:"receiveMonitor",value:function(e){this.monitor=e}},{key:"canDrop",value:function(){return!this.spec.canDrop||this.spec.canDrop(this.props,this.monitor)}},{key:"hover",value:function(){this.spec.hover&&this.props&&this.spec.hover(this.props,this.monitor,Yp(this.ref))}},{key:"drop",value:function(){if(this.spec.drop)return this.spec.drop(this.props,this.monitor,this.ref.current)}}])&&Pd(t.prototype,r),e}();var Ad="dnd-core/INIT_COORDS",Id="dnd-core/BEGIN_DRAG",Dd="dnd-core/PUBLISH_DRAG_SOURCE",Ld="dnd-core/HOVER",Nd="dnd-core/DROP",$d="dnd-core/END_DRAG";function Fd(e,t){return{type:Ad,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}function Bd(e){return Bd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bd(e)}function Ud(e){return"object"===Bd(e)}var zd={type:Ad,payload:{clientOffset:null,sourceClientOffset:null}};function qd(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{publishSource:!0},n=r.publishSource,o=void 0===n||n,i=r.clientOffset,a=r.getSourceClientOffset,s=e.getMonitor(),l=e.getRegistry();e.dispatch(Fd(i)),function(e,t,r){Mp(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach((function(e){Mp(r.getSource(e),"Expected sourceIds to be registered.")}))}(t,s,l);var c=function(e,t){for(var r=null,n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}(t,s);if(null!==c){var u=null;if(i){if(!a)throw new Error("getSourceClientOffset must be defined");!function(e){Mp("function"==typeof e,"When clientOffset is provided, getSourceClientOffset must be a function.")}(a),u=a(c)}e.dispatch(Fd(i,u));var f=l.getSource(c).beginDrag(s,c);if(null!=f){!function(e){Mp(Ud(e),"Item must be an object.")}(f),l.pinSource(c);var p=l.getSourceType(c);return{type:Id,payload:{itemType:p,item:f,sourceId:c,clientOffset:i||null,sourceClientOffset:u||null,isSourcePublic:!!o}}}}else e.dispatch(zd)}}function Wd(e){return function(){if(e.getMonitor().isDragging())return{type:Dd}}}function Hd(e,t){return null===t?null===e:Array.isArray(e)?e.some((function(e){return e===t})):e===t}function Vd(e){return function(t){var r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clientOffset;!function(e){Mp(Array.isArray(e),"Expected targetIds to be an array.")}(t);var n=t.slice(0),o=e.getMonitor(),i=e.getRegistry();return function(e,t,r){Mp(t.isDragging(),"Cannot call hover while not dragging."),Mp(!t.didDrop(),"Cannot call hover after drop.");for(var n=0;n<e.length;n++){var o=e[n];Mp(e.lastIndexOf(o)===n,"Expected targetIds to be unique in the passed array."),Mp(r.getTarget(o),"Expected targetIds to be registered.")}}(n,o,i),function(e,t,r){for(var n=e.length-1;n>=0;n--){var o=e[n];Hd(t.getTargetType(o),r)||e.splice(n,1)}}(n,i,o.getItemType()),function(e,t,r){e.forEach((function(e){r.getTarget(e).hover(t,e)}))}(n,o,i),{type:Ld,payload:{targetIds:n,clientOffset:r||null}}}}function Gd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Kd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gd(Object(r),!0).forEach((function(t){Yd(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Yd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jd(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.getMonitor(),n=e.getRegistry();!function(e){Mp(e.isDragging(),"Cannot call drop while not dragging."),Mp(!e.didDrop(),"Cannot call drop twice during one drag operation.")}(r);var o=function(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}(r);o.forEach((function(o,i){var a=function(e,t,r,n){var o=r.getTarget(e),i=o?o.drop(n,e):void 0;return function(e){Mp(void 0===e||Ud(e),"Drop result must either be an object or undefined.")}(i),void 0===i&&(i=0===t?{}:n.getDropResult()),i}(o,i,n,r),s={type:Nd,payload:{dropResult:Kd(Kd({},t),a)}};e.dispatch(s)}))}}function Qd(e){return function(){var t=e.getMonitor(),r=e.getRegistry();!function(e){Mp(e.isDragging(),"Cannot call endDrag while not dragging.")}(t);var n=t.getSourceId();return null!=n&&(r.getSource(n,!0).endDrag(t,n),r.unpinSource()),{type:$d}}}function Xd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Zd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var eh=function(){function e(t,r){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Zd(this,"store",void 0),Zd(this,"monitor",void 0),Zd(this,"backend",void 0),Zd(this,"isSetUp",!1),Zd(this,"handleRefCountChange",(function(){var e=n.store.getState().refCount>0;n.backend&&(e&&!n.isSetUp?(n.backend.setup(),n.isSetUp=!0):!e&&n.isSetUp&&(n.backend.teardown(),n.isSetUp=!1))})),this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}var t,r;return t=e,r=[{key:"receiveBackend",value:function(e){this.backend=e}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var e=this,t=this.store.dispatch,r=function(e){return{beginDrag:qd(e),publishDragSource:Wd(e),hover:Vd(e),drop:Jd(e),endDrag:Qd(e)}}(this);return Object.keys(r).reduce((function(n,o){var i,a=r[o];return n[o]=(i=a,function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];var a=i.apply(e,n);void 0!==a&&t(a)}),n}),{})}},{key:"dispatch",value:function(e){this.store.dispatch(e)}}],r&&Xd(t.prototype,r),e}(),th=function(e,t){return e===t};function rh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function nh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rh(Object(r),!0).forEach((function(t){oh(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function oh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ih={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function ah(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ih,n=arguments.length>1?arguments[1]:void 0,o=n.payload;switch(n.type){case Ad:case Id:return{initialSourceClientOffset:o.sourceClientOffset,initialClientOffset:o.clientOffset,clientOffset:o.clientOffset};case Ld:return e=r.clientOffset,t=o.clientOffset,!e&&!t||e&&t&&e.x===t.x&&e.y===t.y?r:nh(nh({},r),{},{clientOffset:o.clientOffset});case $d:case Nd:return ih;default:return r}}var sh="dnd-core/ADD_SOURCE",lh="dnd-core/ADD_TARGET",ch="dnd-core/REMOVE_SOURCE",uh="dnd-core/REMOVE_TARGET";function fh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ph(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fh(Object(r),!0).forEach((function(t){dh(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function dh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var hh={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function gh(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:hh,n=arguments.length>1?arguments[1]:void 0,o=n.payload;switch(n.type){case Id:return ph(ph({},r),{},{itemType:o.itemType,item:o.item,sourceId:o.sourceId,isSourcePublic:o.isSourcePublic,dropResult:null,didDrop:!1});case Dd:return ph(ph({},r),{},{isSourcePublic:!0});case Ld:return ph(ph({},r),{},{targetIds:o.targetIds});case uh:return-1===r.targetIds.indexOf(o.targetId)?r:ph(ph({},r),{},{targetIds:(e=r.targetIds,t=o.targetId,e.filter((function(e){return e!==t})))});case Nd:return ph(ph({},r),{},{dropResult:o.dropResult,didDrop:!0,targetIds:[]});case $d:return ph(ph({},r),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return r}}function mh(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;switch((arguments.length>1?arguments[1]:void 0).type){case sh:case lh:return e+1;case ch:case uh:return e-1;default:return e}}var yh=[],vh=[];function bh(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case Ld:break;case sh:case lh:case uh:case ch:return yh;default:return vh}var t=e.payload,r=t.targetIds,n=void 0===r?[]:r,o=t.prevTargetIds,i=void 0===o?[]:o,a=function(e,t){var r=new Map,n=function(e){r.set(e,r.has(e)?r.get(e)+1:1)};e.forEach(n),t.forEach(n);var o=[];return r.forEach((function(e,t){1===e&&o.push(t)})),o}(n,i),s=a.length>0||!function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:th;if(e.length!==t.length)return!1;for(var n=0;n<e.length;++n)if(!r(e[n],t[n]))return!1;return!0}(n,i);if(!s)return yh;var l=i[i.length-1],c=n[n.length-1];return l!==c&&(l&&a.push(l),c&&a.push(c)),a}function wh(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0)+1}function _h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Sh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_h(Object(r),!0).forEach((function(t){xh(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function xh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Oh(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:bh(r.dirtyHandlerIds,{type:n.type,payload:Sh(Sh({},n.payload),{},{prevTargetIds:(e=r,"dragOperation.targetIds",t=[],"dragOperation.targetIds".split(".").reduce((function(e,r){return e&&e[r]?e[r]:t||null}),e))})}),dragOffset:ah(r.dragOffset,n),refCount:mh(r.refCount,n),dragOperation:gh(r.dragOperation,n),stateId:wh(r.stateId)}}function Eh(e,t){return{x:e.x-t.x,y:e.y-t.y}}function kh(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ch(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}yh.__IS_NONE__=!0,vh.__IS_ALL__=!0;var Th,Ph=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ch(this,"store",void 0),Ch(this,"registry",void 0),this.store=t,this.registry=r}var t,r;return t=e,r=[{key:"subscribeToStateChange",value:function(e){var t=this,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{handlerIds:void 0}).handlerIds;Mp("function"==typeof e,"listener must be a function."),Mp(void 0===r||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");var n=this.store.getState().stateId;return this.store.subscribe((function(){var o=t.store.getState(),i=o.stateId;try{var a=i===n||i===n+1&&!function(e,t){if(e===yh)return!1;if(e===vh||void 0===t)return!0;var r,n=(r=e,t.filter((function(e){return r.indexOf(e)>-1})));return n.length>0}(o.dirtyHandlerIds,r);a||e()}finally{n=i}}))}},{key:"subscribeToOffsetChange",value:function(e){var t=this;Mp("function"==typeof e,"listener must be a function.");var r=this.store.getState().dragOffset;return this.store.subscribe((function(){var n=t.store.getState().dragOffset;n!==r&&(r=n,e())}))}},{key:"canDragSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e);return Mp(t,"Expected to find a valid source. sourceId=".concat(e)),!this.isDragging()&&t.canDrag(this,e)}},{key:"canDropOnTarget",value:function(e){if(!e)return!1;var t=this.registry.getTarget(e);return Mp(t,"Expected to find a valid target. targetId=".concat(e)),!(!this.isDragging()||this.didDrop())&&Hd(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e)}},{key:"isDragging",value:function(){return Boolean(this.getItemType())}},{key:"isDraggingSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e,!0);return Mp(t,"Expected to find a valid source. sourceId=".concat(e)),!(!this.isDragging()||!this.isSourcePublic())&&this.registry.getSourceType(e)===this.getItemType()&&t.isDragging(this,e)}},{key:"isOverTarget",value:function(e){if(!e)return!1;var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shallow:!1}).shallow;if(!this.isDragging())return!1;var r=this.registry.getTargetType(e),n=this.getItemType();if(n&&!Hd(r,n))return!1;var o=this.getTargetIds();if(!o.length)return!1;var i=o.indexOf(e);return t?i===o.length-1:i>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return Boolean(this.store.getState().dragOperation.isSourcePublic)}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return t=(e=this.store.getState().dragOffset).clientOffset,r=e.initialClientOffset,n=e.initialSourceClientOffset,t&&r&&n?Eh(function(e,t){return{x:e.x+t.x,y:e.y+t.y}}(t,n),r):null;var e,t,r,n}},{key:"getDifferenceFromInitialOffset",value:function(){return t=(e=this.store.getState().dragOffset).clientOffset,r=e.initialClientOffset,t&&r?Eh(t,r):null;var e,t,r}}],r&&kh(t.prototype,r),e}(),jh=0;function Rh(e){return Rh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rh(e)}function Mh(e,t){t&&Array.isArray(e)?e.forEach((function(e){return Mh(e,!1)})):Mp("string"==typeof e||"symbol"===Rh(e),t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}!function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"}(Th||(Th={}));const Ah="undefined"!=typeof global?global:self,Ih=Ah.MutationObserver||Ah.WebKitMutationObserver;function Dh(e){return function(){const t=setTimeout(n,0),r=setInterval(n,50);function n(){clearTimeout(t),clearInterval(r),e()}}}const Lh="function"==typeof Ih?function(e){let t=1;const r=new Ih(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}:Dh;class Nh{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}}const $h=new class{enqueueTask(e){const{queue:t,requestFlush:r}=this;t.length||(r(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let t=0,r=e.length-this.index;t<r;t++)e[t]=e[t+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=Lh(this.flush),this.requestErrorThrow=Dh((()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()}))}},Fh=new class{create(e){const t=this.freeTasks,r=t.length?t.pop():new Nh(this.onError,(e=>t[t.length]=e));return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}($h.registerPendingError);function Bh(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Uh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return qh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?qh(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qh(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Wh(e){switch(e[0]){case"S":return Th.SOURCE;case"T":return Th.TARGET;default:Mp(!1,"Cannot parse handler ID: ".concat(e))}}function Hh(e,t){var r=e.entries(),n=!1;do{var o=r.next(),i=o.done;if(zh(o.value,2)[1]===t)return!0;n=!!i}while(!n);return!1}var Vh=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Uh(this,"types",new Map),Uh(this,"dragSources",new Map),Uh(this,"dropTargets",new Map),Uh(this,"pinnedSourceId",null),Uh(this,"pinnedSource",null),Uh(this,"store",void 0),this.store=t}var t,r;return t=e,r=[{key:"addSource",value:function(e,t){Mh(e),function(e){Mp("function"==typeof e.canDrag,"Expected canDrag to be a function."),Mp("function"==typeof e.beginDrag,"Expected beginDrag to be a function."),Mp("function"==typeof e.endDrag,"Expected endDrag to be a function.")}(t);var r=this.addHandler(Th.SOURCE,e,t);return this.store.dispatch(function(e){return{type:sh,payload:{sourceId:e}}}(r)),r}},{key:"addTarget",value:function(e,t){Mh(e,!0),function(e){Mp("function"==typeof e.canDrop,"Expected canDrop to be a function."),Mp("function"==typeof e.hover,"Expected hover to be a function."),Mp("function"==typeof e.drop,"Expected beginDrag to be a function.")}(t);var r=this.addHandler(Th.TARGET,e,t);return this.store.dispatch(function(e){return{type:lh,payload:{targetId:e}}}(r)),r}},{key:"containsHandler",value:function(e){return Hh(this.dragSources,e)||Hh(this.dropTargets,e)}},{key:"getSource",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Mp(this.isSourceId(e),"Expected a valid source ID."),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}},{key:"getTarget",value:function(e){return Mp(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}},{key:"getSourceType",value:function(e){return Mp(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}},{key:"getTargetType",value:function(e){return Mp(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}},{key:"isSourceId",value:function(e){return Wh(e)===Th.SOURCE}},{key:"isTargetId",value:function(e){return Wh(e)===Th.TARGET}},{key:"removeSource",value:function(e){var t,r=this;Mp(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(e){return{type:ch,payload:{sourceId:e}}}(e)),t=function(){r.dragSources.delete(e),r.types.delete(e)},$h.enqueueTask(Fh.create(t))}},{key:"removeTarget",value:function(e){Mp(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(e){return{type:uh,payload:{targetId:e}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}},{key:"pinSource",value:function(e){var t=this.getSource(e);Mp(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}},{key:"unpinSource",value:function(){Mp(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(e,t,r){var n=function(e){var t=(jh++).toString();switch(e){case Th.SOURCE:return"S".concat(t);case Th.TARGET:return"T".concat(t);default:throw new Error("Unknown Handler Role: ".concat(e))}}(e);return this.types.set(n,t),e===Th.SOURCE?this.dragSources.set(n,r):e===Th.TARGET&&this.dropTargets.set(n,r),n}}],r&&Bh(t.prototype,r),e}();function Gh(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=(t=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__,(0,He.MT)(Oh,t&&r&&r({name:"dnd-core",instanceId:"dnd-core"}))),a=new Ph(i,new Vh(i)),s=new eh(i,a),l=e(s,n,o);return s.receiveBackend(l),s}var Kh=["children"];function Yh(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Jh=0,Qh=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),Xh=(0,t.memo)((function(e){var r=e.children,n=function(e){if("manager"in e)return[{dragDropManager:e.manager},!1];var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zh(),r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,o=t;return o[Qh]||(o[Qh]={dragDropManager:Gh(e,t,r,n)}),o[Qh]}(e.backend,e.context,e.options,e.debugMode);return[t,!e.context]}(function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,Kh)),o=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Yh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Yh(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(n,2),i=o[0],a=o[1];return(0,t.useEffect)((function(){if(a){var e=Zh();return++Jh,function(){0==--Jh&&(e[Qh]=null)}}}),[]),(0,ed.jsx)(td.Provider,Object.assign({value:i},{children:r}),void 0)}));function Zh(){return void 0!==__webpack_require__.g?__webpack_require__.g:window}const eg=["namespace"],tg=["children","isDragging","connectDragComponent"],rg=["onDrop","namespace"];function ng(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function og(e){let{namespace:t}=e,n=ng(e,eg);const o=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e;"function"!=typeof e&&(Mp(Zp(e),'Expected "type" provided as the first argument to DragSource to be a string, or a function that returns a string given the current props. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',e),o=function(){return e}),Mp(Xp(t),'Expected "spec" provided as the second argument to DragSource to be a plain object. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',t);var i=function(e){return Object.keys(e).forEach((function(t){Mp(bd.indexOf(t)>-1,'Expected the drag source specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',bd.join(", "),t),Mp("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source",t,t,e[t])})),wd.forEach((function(t){Mp("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source",t,t,e[t])})),function(t,r){return new _d(e,t,r)}}(t);return Mp("function"==typeof r,'Expected "collect" provided as the third argument to DragSource to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',r),Mp(Xp(n),'Expected "options" provided as the fourth argument to DragSource to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',r),function(e){return md({containerDisplayName:"DragSource",createHandler:i,registerHandler:Ip,createConnector:function(e){return new zp(e)},createMonitor:function(e){return new Gp(e)},DecoratedComponent:e,getType:o,collect:r,options:n})}}(t,{beginDrag(e){let{children:t,isDragging:r,connectDragComponent:n}=e;return ng(e,tg)}},(e=>({connectDragComponent:e.dragSource()})))((({children:e,connectDragComponent:t})=>e(t)));return r().createElement(o,n,n.children)}function ig(e){let{onDrop:t,namespace:n}=e,o=ng(e,rg);const i=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e;"function"!=typeof e&&(Mp(Zp(e,!0),'Expected "type" provided as the first argument to DropTarget to be a string, an array of strings, or a function that returns either given the current props. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',e),o=function(){return e}),Mp(Xp(t),'Expected "spec" provided as the second argument to DropTarget to be a plain object. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',t);var i=function(e){return Object.keys(e).forEach((function(t){Mp(Rd.indexOf(t)>-1,'Expected the drop target specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',Rd.join(", "),t),Mp("function"==typeof e[t],"Expected %s in the drop target specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target",t,t,e[t])})),function(t,r){return new Md(e,t,r)}}(t);return Mp("function"==typeof r,'Expected "collect" provided as the third argument to DropTarget to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',r),Mp(Xp(n),'Expected "options" provided as the fourth argument to DropTarget to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',r),function(e){return md({containerDisplayName:"DropTarget",createHandler:i,registerHandler:Ap,createMonitor:function(e){return new Ed(e)},createConnector:function(e){return new Td(e)},DecoratedComponent:e,getType:o,collect:r,options:n})}}(n,{drop(e,r){t(r.getItem())}},((e,t)=>({connectDropTarget:e.dropTarget(),isHovered:t.isOver()})))((({children:e,connectDropTarget:t,isHovered:r})=>e(t,{isHovered:r})));return r().createElement(i,o,o.children)}function ag(e){var t=Object.create(null);return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}og.propTypes={namespace:i().any.isRequired,children:i().func.isRequired},ig.propTypes={onDrop:i().func.isRequired,namespace:i().any.isRequired,children:i().func.isRequired};var sg=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,lg=ag((function(e){return sg.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),cg=function(e,t,r){var n=e.key+"-"+t.name;!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles)},ug={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},fg=/[A-Z]|^ms/g,pg=/_EMO_([^_]+?)_([^]*?)_EMO_/g,dg=function(e){return 45===e.charCodeAt(1)},hg=function(e){return null!=e&&"boolean"!=typeof e},gg=ag((function(e){return dg(e)?e:e.replace(fg,"-$&").toLowerCase()})),mg=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(pg,(function(e,t,r){return vg={name:t,styles:r,next:vg},t}))}return 1===ug[e]||dg(e)||"number"!=typeof t||0===t?t:t+"px"};function yg(e,t,r){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return vg={name:r.name,styles:r.styles,next:vg},r.name;if(void 0!==r.styles){var n=r.next;if(void 0!==n)for(;void 0!==n;)vg={name:n.name,styles:n.styles,next:vg},n=n.next;return r.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o++)n+=yg(e,t,r[o])+";";else for(var i in r){var a=r[i];if("object"!=typeof a)null!=t&&void 0!==t[a]?n+=i+"{"+t[a]+"}":hg(a)&&(n+=gg(i)+":"+mg(i,a)+";");else if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var s=yg(e,t,a);switch(i){case"animation":case"animationName":n+=gg(i)+":"+s+";";break;default:n+=i+"{"+s+"}"}}else for(var l=0;l<a.length;l++)hg(a[l])&&(n+=gg(i)+":"+mg(i,a[l])+";")}return n}(e,t,r);case"function":if(void 0!==e){var o=vg,i=r(e);return vg=o,yg(e,t,i)}}if(null==t)return r;var a=t[r];return void 0!==a?a:r}var vg,bg=/label:\s*([^\s;\n{]+)\s*(;|$)/g,wg=!!t.useInsertionEffect&&t.useInsertionEffect,_g=wg||function(e){return e()},Sg=(wg||t.useLayoutEffect,lg),xg=function(e){return"theme"!==e},Og=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?Sg:xg},Eg=function(e,t,r){var n;if(t){var o=t.shouldForwardProp;n=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof n&&r&&(n=e.__emotion_forwardProp),n},kg=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return cg(t,r,n),_g((function(){return function(e,t,r){cg(e,t,r);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do{e.insert(t===o?"."+n:"",o,e.sheet,!0),o=o.next}while(void 0!==o)}}(t,r,n)})),null},Cg=function e(r,n){var o,i,a=r.__emotion_real===r,s=a&&r.__emotion_base||r;void 0!==n&&(o=n.label,i=n.target);var l=Eg(r,n,a),c=l||Og(s),u=!c("as");return function(){var f=arguments,p=a&&void 0!==r.__emotion_styles?r.__emotion_styles.slice(0):[];if(void 0!==o&&p.push("label:"+o+";"),null==f[0]||void 0===f[0].raw)p.push.apply(p,f);else{p.push(f[0][0]);for(var h=f.length,g=1;g<h;g++)p.push(f[g],f[0][g])}var m=(0,xo.withEmotionCache)((function(e,r,n){var o,a,f,d,h=u&&e.as||s,g="",m=[],y=e;if(null==e.theme){for(var v in y={},e)y[v]=e[v];y.theme=t.useContext(xo.ThemeContext)}"string"==typeof e.className?(o=r.registered,a=m,f=e.className,d="",f.split(" ").forEach((function(e){void 0!==o[e]?a.push(o[e]+";"):d+=e+" "})),g=d):null!=e.className&&(g=e.className+" ");var b=function(e,t,r){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var n=!0,o="";vg=void 0;var i=e[0];null==i||void 0===i.raw?(n=!1,o+=yg(r,t,i)):o+=i[0];for(var a=1;a<e.length;a++)o+=yg(r,t,e[a]),n&&(o+=i[a]);bg.lastIndex=0;for(var s,l="";null!==(s=bg.exec(o));)l+="-"+s[1];var c=function(e){for(var t,r=0,n=0,o=e.length;o>=4;++n,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(o){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(o)+l;return{name:c,styles:o,next:vg}}(p.concat(m),r.registered,y);g+=r.key+"-"+b.name,void 0!==i&&(g+=" "+i);var w=u&&void 0===l?Og(h):c,_={};for(var S in e)u&&"as"===S||w(S)&&(_[S]=e[S]);return _.className=g,_.ref=n,t.createElement(t.Fragment,null,t.createElement(kg,{cache:r,serialized:b,isStringTag:"string"==typeof h}),t.createElement(h,_))}));return m.displayName=void 0!==o?o:"Styled("+("string"==typeof s?s:s.displayName||s.name||"Component")+")",m.defaultProps=r.defaultProps,m.__emotion_real=m,m.__emotion_base=s,m.__emotion_styles=p,m.__emotion_forwardProp=l,Object.defineProperty(m,"toString",{value:function(){return"."+i}}),m.withComponent=function(t,r){return e(t,d({},n,r,{shouldForwardProp:Eg(m,r,!0)})).apply(void 0,p)},m}},Tg=__webpack_require__(36585),Pg=__webpack_require__.n(Tg);function jg(e,{target:t=document.body}={}){if("string"!=typeof e)throw new TypeError(`Expected parameter \`text\` to be a \`string\`, got \`${typeof e}\`.`);const r=document.createElement("textarea"),n=document.activeElement;r.value=e,r.setAttribute("readonly",""),r.style.contain="strict",r.style.position="absolute",r.style.left="-9999px",r.style.fontSize="12pt";const o=document.getSelection(),i=o.rangeCount>0&&o.getRangeAt(0);t.append(r),r.select(),r.selectionStart=0,r.selectionEnd=e.length;let a=!1;try{a=document.execCommand("copy")}catch{}return r.remove(),i&&(o.removeAllRanges(),o.addRange(i)),n&&n.focus(),a}var Rg=__webpack_require__(67129);const Mg=/\s+at.*[(\s](.*)\)?/,Ag=/^(?:(?:(?:node|node:[\w/]+|(?:(?:node:)?internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)(?:\.js)?:\d+:\d+)|native)/,Ig=void 0===Rg.homedir?"":Rg.homedir().replace(/\\/g,"/");function Dg(e,{pretty:t=!1,basePath:r}={}){const n=r&&new RegExp(`(at | \\()${function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(r.replace(/\\/g,"/"))}`,"g");if("string"==typeof e)return e.replace(/\\/g,"/").split("\n").filter((e=>{const t=e.match(Mg);if(null===t||!t[1])return!0;const r=t[1];return!(r.includes(".app/Contents/Resources/electron.asar")||r.includes(".app/Contents/Resources/default_app.asar")||r.includes("node_modules/electron/dist/resources/electron.asar")||r.includes("node_modules/electron/dist/resources/default_app.asar")||Ag.test(r))})).filter((e=>""!==e.trim())).map((e=>(n&&(e=e.replace(n,"$1")),t&&(e=e.replace(Mg,((e,t)=>e.replace(t,t.replace(Ig,"~"))))),e))).join("\n")}function Lg(e,t,r){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ng="https://github.com/decaporg/decap-cms/issues/new?";function $g({title:e,config:t}){try{const r=function({config:e}){let t="";"string"==typeof DECAP_CMS_VERSION?t=`decap-cms@${DECAP_CMS_VERSION}`:"string"==typeof DECAP_CMS_APP_VERSION&&(t=`decap-cms-app@${DECAP_CMS_APP_VERSION}`);const r=function({version:e,provider:t,browser:r,config:n}){return`\n**Describe the bug**\n\n**To Reproduce**\n\n**Expected behavior**\n\n**Screenshots**\n\n**Applicable Versions:**\n - Decap CMS version: \`${e}\`\n - Git provider: \`${t}\`\n - Browser version: \`${r}\`\n\n**CMS configuration**\n\`\`\`\n${n}\n\`\`\`\n\n**Additional context**\n`}({version:t,provider:e.backend.name,browser:navigator.userAgent,config:mr().stringify(e)});return r}({config:t}),n=new URLSearchParams;return n.append("title",Pg()(e,{length:100})),n.append("body",Pg()(r,{length:4e3,omission:"\n..."})),n.append("labels","type: bug"),`${Ng}${n.toString()}`}catch(e){return console.log(e),`${Ng}template=bug_report.md`}}const Fg=Cg("div",{target:"emw4gx72",label:"ErrorBoundaryContainer"})("padding:40px;h1{font-size:28px;color:",qe.colors.text,";}h2{font-size:20px;}strong{color:",qe.colors.textLead,";font-weight:500;}hr{width:200px;margin:30px 0;border:0;height:1px;background-color:",qe.colors.text,";}a{color:",qe.colors.active,";}"),Bg=Cg("span",{target:"emw4gx71",label:"PrivacyWarning"})("color:",qe.colors.text,";"),Ug=Cg("button",{target:"emw4gx70",label:"CopyButton"})(qe.buttons.button,";",qe.buttons.default,";",qe.buttons.gray,";display:block;margin:12px 0;");function zg({entry:e,t}){return console.log(e),(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)("hr",null),(0,xo.jsx)("h2",null,t("ui.errorBoundary.recoveredEntry.heading")),(0,xo.jsx)("strong",null,t("ui.errorBoundary.recoveredEntry.warning")),(0,xo.jsx)(Ug,{onClick:()=>jg(e)},t("ui.errorBoundary.recoveredEntry.copyButtonLabel")),(0,xo.jsx)("pre",null,(0,xo.jsx)("code",null,e)))}class qg extends r().Component{constructor(...e){super(...e),Lg(this,"state",{hasError:!1,errorMessage:"",errorTitle:"",backup:""})}static getDerivedStateFromError(e){return console.error(e),{hasError:!0,errorMessage:Dg(e.stack,{basePath:window.location.origin||""}),errorTitle:e.toString()}}shouldComponentUpdate(e,t){return!this.props.showBackup||this.state.errorMessage!==t.errorMessage||this.state.backup!==t.backup}async componentDidUpdate(){if(this.props.showBackup){const e=await pr.localForage.getItem("backup");e&&console.log(e),this.setState({backup:e})}}render(){const{hasError:e,errorMessage:t,backup:n,errorTitle:o}=this.state,{showBackup:i,t:a}=this.props;return e?(0,xo.jsx)(Fg,null,(0,xo.jsx)("h1",null,a("ui.errorBoundary.title")),(0,xo.jsx)("p",null,(0,xo.jsx)("span",null,a("ui.errorBoundary.details")),(0,xo.jsx)("a",{href:$g({title:o,config:this.props.config}),target:"_blank",rel:"noopener noreferrer","data-testid":"issue-url"},a("ui.errorBoundary.reportIt"))),(0,xo.jsx)("p",null,a("ui.errorBoundary.privacyWarning").split("\n").map(((e,t)=>(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(Bg,{key:t},e),(0,xo.jsx)("br",null))))),(0,xo.jsx)("hr",null),(0,xo.jsx)("h2",null,a("ui.errorBoundary.detailsHeading")),(0,xo.jsx)("p",null,t),n&&i&&(0,xo.jsx)(zg,{entry:n,t:a})):this.props.children}}Lg(qg,"propTypes",{children:i().node,t:i().func.isRequired,config:i().object.isRequired});const Wg=(0,We.Iu)()(qg);function Hg({label:e,imagesOnly:t,onChange:r,disabled:n,className:o}){return(0,xo.jsx)("label",{tabIndex:"0",className:`nc-fileUploadButton ${o||""}`},(0,xo.jsx)("span",null,e),(0,xo.jsx)("input",{type:"file",accept:t?"image/*":"*/*",onChange:r,disabled:n}))}Hg.propTypes={className:i().string,label:i().string.isRequired,imagesOnly:i().bool,onChange:i().func.isRequired,disabled:i().bool};var Vg=__webpack_require__(37149),Gg=__webpack_require__.n(Vg),Kg={name:"1o9c9d2-ReactModalGlobalStyles",styles:".ReactModal__Body--open{overflow:hidden;};label:ReactModalGlobalStyles;"};function Yg(){return(0,xo.jsx)(xo.Global,{styles:Kg})}const Jg=`\n ${qe.shadows.dropDeep};\n background-color: #fff;\n border-radius: ${qe.lengths.borderRadius};\n height: 80%;\n text-align: center;\n max-width: 2200px;\n padding: 20px;\n\n &:focus {\n outline: none;\n }\n `,Qg=`\n z-index: ${qe.zIndex.zIndex99999};\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n opacity: 0;\n background-color: rgba(0, 0, 0, 0);\n transition: background-color ${qe.transitions.main}, opacity ${qe.transitions.main};\n `;class Xg extends r().Component{componentDidMount(){Gg().setAppElement("#nc-root")}render(){const{isOpen:e,children:t,className:n,onClose:o}=this.props;return(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(Yg,null),(0,xo.jsx)(xo.ClassNames,null,(({css:r,cx:i})=>(0,xo.jsx)(Gg(),{isOpen:e,onRequestClose:o,closeTimeoutMS:300,className:{base:i(r`
17
+ `),i;throw e}return`${i}/${Yn()(h," /")}`}function yi(e,t,r,n,o,i){if(!t||!t.get("data"))return e;let a=t.get("data").set(o,n);a=ui(t.get("path"),a,r.get("folder"));const s=si(t,Cc(r,"date"))||null,l=a.getIn(ci(kc(r))),c=gi(i,[n,a.get("dirname")]);return ai(e,s,l,a,c)}var vi=__webpack_require__(18149),bi=__webpack_require__.n(vi),wi=__webpack_require__(4335),_i=__webpack_require__.n(wi);function Si(e,t="",r="",n={}){return{collection:e,slug:t,path:r,partial:n.partial||!1,raw:n.raw||"",data:n.data||{},label:n.label||null,isModification:_i()(n.isModification)?n.isModification:null,mediaFiles:n.mediaFiles||[],author:n.author||"",updatedOn:n.updatedOn||"",status:n.status||"",meta:n.meta||{},i18n:n.i18n||{}}}function xi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Oi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xi(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const{fetchWithTimeout:Ei}=pr.unsentRequest;class ki{constructor(e){if(this.config=e,null==e.get("applicationID")||null==e.get("apiKey"))throw"The Algolia search integration needs the credentials (applicationID and apiKey) in the integration configuration.";this.applicationID=e.get("applicationID"),this.apiKey=e.get("apiKey");const t=e.get("indexPrefix");this.indexPrefix=t?`${t}-`:"",this.searchURL=`https://${this.applicationID}-dsn.algolia.net/1`,this.entriesCache={collection:null,page:null,entries:[]}}requestHeaders(e={}){return Oi({"X-Algolia-API-Key":this.apiKey,"X-Algolia-Application-Id":this.applicationID,"Content-Type":"application/json"},e)}parseJsonResponse(e){return e.json().then((t=>e.ok?t:Promise.reject(t)))}urlFor(e,t){const r=[];if(t.params)for(const e in t.params)r.push(`${e}=${encodeURIComponent(t.params[e])}`);return r.length&&(e+=`?${r.join("&")}`),e}request(e,t={}){const r=this.requestHeaders(t.headers||{}),n=this.urlFor(e,t);return Ei(n,Oi(Oi({},t),{},{headers:r})).then((e=>{const t=e.headers.get("Content-Type");return t&&t.match(/json/)?this.parseJsonResponse(e):e.text()}))}search(e,t,r){const n=e.map((e=>({indexName:`${this.indexPrefix}${e}`,params:`query=${t}&page=${r}`})));return this.request(`${this.searchURL}/indexes/*/queries`,{method:"POST",body:JSON.stringify({requests:n})}).then((t=>{const n=t.results.map(((t,r)=>t.hits.map((t=>{const n=t.path.split("/").pop().replace(/\.[^.]+$/,"");return Si(e[r],n,t.path,{data:t.data,partial:!0})}))));return{entries:sr()(n),pagination:r}}))}searchBy(e,t,r){return this.request(`${this.searchURL}/indexes/${this.indexPrefix}${t}`,{params:{restrictSearchableAttributes:e,query:r}})}listEntries(e,t){return this.entriesCache.collection===e&&this.entriesCache.page===t?Promise.resolve({page:this.entriesCache.page,entries:this.entriesCache.entries}):this.request(`${this.searchURL}/indexes/${this.indexPrefix}${e.get("name")}`,{params:{page:t}}).then((t=>{const r=t.hits.map((t=>{const r=_c(e,t.path);return Si(e.get("name"),r,t.path,{data:t.data,partial:!0})}));return this.entriesCache={collection:e,pagination:t.page,entries:r},{entries:r,pagination:t.page}}))}async listAllEntries(e){const t={hitsPerPage:1e3};let r=await this.request(`${this.searchURL}/indexes/${this.indexPrefix}${e.get("name")}`,{params:t}),{nbPages:n=0,hits:o,page:i}=r;for(i+=1;i<n;)r=await this.request(`${this.searchURL}/indexes/${this.indexPrefix}${e.get("name")}`,{params:Oi(Oi({},t),{},{page:i})}),o=[...o,...r.hits],i+=1;const a=o.map((t=>{const r=_c(e,t.path);return Si(e.get("name"),r,t.path,{data:t.data,partial:!0})}));return a}getEntry(e,t){return this.searchBy("slug",e.get("name"),t).then((r=>{const n=r.hits.filter((e=>e.slug===t))[0];return Si(e.get("name"),t,n.path,{data:n.data,partial:!0})}))}}var Ci=__webpack_require__(42208),Ti=__webpack_require__.n(Ci);function Pi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ji(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pi(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const{fetchWithTimeout:Ri}=pr.unsentRequest;class Mi{constructor(e,t){if(this.config=e,null==e.get("getSignedFormURL"))throw"The AssetStore integration needs the getSignedFormURL in the integration configuration.";this.getToken=t,this.shouldConfirmUpload=e.get("shouldConfirmUpload",!1),this.getSignedFormURL=Ao()(e.get("getSignedFormURL"),"/")}parseJsonResponse(e){return e.json().then((t=>e.ok?t:Promise.reject(t)))}urlFor(e,t){const r=[];if(t.params)for(const e in t.params)r.push(`${e}=${encodeURIComponent(t.params[e])}`);return r.length&&(e+=`?${r.join("&")}`),e}requestHeaders(e={}){return ji({},e)}confirmRequest(e){this.getToken().then((t=>this.request(`${this.getSignedFormURL}/${e}`,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify({state:"uploaded"})})))}async request(e,t={}){const r=this.requestHeaders(t.headers||{}),n=this.urlFor(e,t),o=await Ri(n,ji(ji({},t),{},{headers:r})),i=o.headers.get("Content-Type");return i&&i.match(/json/)?await this.parseJsonResponse(o):o.text()}async retrieve(e,t,r){const n=Ti()({search:e,page:t,filter:r?"private":"public"},(e=>!!e)),o=Yo(this.getSignedFormURL,n),i={"Content-Type":"application/json",Authorization:`Bearer ${await this.getToken()}`},a=(await this.request(o,{headers:i})).map((({id:e,name:t,size:r,url:n})=>({id:e,name:t,size:r,displayURL:n,url:n,path:n})));return a}delete(e){const t=`${this.getSignedFormURL}/${e}`;return this.getToken().then((e=>this.request(t,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}})))}async upload(e,t=!1){const r={name:e.name,size:e.size};e.type&&(r.content_type=e.type),t&&(r.visibility="private");try{const t=await this.getToken(),n=await this.request(this.getSignedFormURL,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(r)}),o=n.form.url,i=n.form.fields,{id:a,name:s,size:l,url:c}=n.asset,u=new FormData;return Object.keys(i).forEach((e=>u.append(e,i[e]))),u.append("file",e,e.name),await this.request(o,{method:"POST",body:u}),this.shouldConfirmUpload&&await this.confirmRequest(a),{success:!0,asset:{id:a,name:s,size:l,displayURL:c,url:c,path:c}}}catch(e){throw console.error(e),e}}}const Ai=function(){let e=null;return(t,r,n)=>(e||(e=function(e,t){let r=(0,Qe.Map)({});return e.get("providers").forEach(((e,n)=>{switch(n){case"algolia":r=r.set("algolia",new ki(e));break;case"assetStore":r=r.set("assetStore",new Mi(e,t))}})),r}(t,r)),e.get(n))}(),Ii="SEARCH_ENTRIES_REQUEST",Di="SEARCH_ENTRIES_SUCCESS",Li="SEARCH_ENTRIES_FAILURE",Ni="QUERY_REQUEST",$i="QUERY_SUCCESS",Fi="QUERY_FAILURE",Bi="SEARCH_CLEAR",Ui="CLEAR_REQUESTS";function zi(){return{type:Bi}}function qi(e,t,r,n,o,i){return async(a,s)=>{const l=s(),c=rf(l.config),u=Gf(l,t,"search"),f=l.collections.find((e=>e.get("name")===t));a({type:Ui});const p=`${t}-${r.join()}-${n}-${o}-${i}`,d=l.search.requests.find((({id:e})=>e==p)),h=d?d.queryResponse:u?Ai(l.integrations,c.getToken,u).searchBy(r.map((e=>`data.${e}`)),t,n):c.query(f,r,n,o,i);a(function(e,t){return{type:Ni,payload:{searchTerm:e,request:t}}}(n,d?void 0:{id:p,expires:new Date((new Date).getTime()+1e4),queryResponse:h}));try{const t=await h;return a(function(e,t){return{type:$i,payload:{namespace:e,hits:t}}}(e,t.hits))}catch(e){return a(function(e){return{type:Fi,payload:{error:e}}}(e))}}}function Wi(e,t){return new pr.Cursor(e.getIn(["cursorsByType","collectionEntries",t]))}var Hi=__webpack_require__(1842),Vi=__webpack_require__.n(Hi);function Gi(e,t,r){let n=t.reduce(((t,n)=>{const o=n.get("name"),i=e.get(o),a=Rn(n.get("widget")),s=n.get("fields");return s&&Qe.List.isList(i)?t.set(o,i.map((e=>Gi(e,s,r)))):s&&Qe.Map.isMap(i)?t.set(o,Gi(i,s,r)):a&&!Vi()(i)?t.set(o,a[r](i)):Vi()(i)?t:t.set(o,i)}),(0,Qe.Map)());return n=e.mergeDeep(n),n}const Ki={PRESENCE:"PRESENCE",PATTERN:"PATTERN",RANGE:"RANGE",CUSTOM:"CUSTOM"};function Yi({predicate:e,run:t}){return{type:Je,predicate:e,run:t}}async function Ji(e,t,r=3e4){let n=!1;const o=new Promise((r=>{e(Yi(t(r)))})),i=new Promise((e=>{setTimeout((()=>{n?e():(console.warn("Wait Action timed out"),e(null))}),r)}));return await Promise.race([o.then((e=>(n=!0,e))).catch(null),i])}const Qi="NOTIFICATION_SEND",Xi="NOTIFICATION_DISMISS",Zi="NOTIFICATION_CLEAR";function ea(e){return{type:Qi,payload:e}}function ta(e){return{type:Xi,id:e}}function ra(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function na(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ra(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ra(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const oa="MEDIA_LIBRARY_OPEN",ia="MEDIA_LIBRARY_CLOSE",aa="MEDIA_LIBRARY_CREATE",sa="MEDIA_INSERT",la="MEDIA_REMOVE_INSERTED",ca="MEDIA_LOAD_REQUEST",ua="MEDIA_LOAD_SUCCESS",fa="MEDIA_LOAD_FAILURE",pa="MEDIA_PERSIST_REQUEST",da="MEDIA_PERSIST_SUCCESS",ha="MEDIA_PERSIST_FAILURE",ga="MEDIA_DELETE_REQUEST",ma="MEDIA_DELETE_SUCCESS",ya="MEDIA_DELETE_FAILURE",va="MEDIA_DISPLAY_URL_REQUEST",ba="MEDIA_DISPLAY_URL_SUCCESS",wa="MEDIA_DISPLAY_URL_FAILURE";function _a(e){return(t,r)=>{const n=r().mediaLibrary.get("externalLibrary");n&&n.onClearControl({id:e})}}function Sa(e){return(t,r)=>{const n=r().mediaLibrary.get("externalLibrary");n&&n.onRemoveControl({id:e})}}function xa(e={}){return(t,r)=>{const n=r().mediaLibrary.get("externalLibrary");if(n){const{controlID:t,value:r,config:o=(0,Qe.Map)(),allowMultiple:i,forImage:a}=e;n.show({id:t,value:r,config:o.toJS(),allowMultiple:i,imagesOnly:a})}t(function(e){return{type:oa,payload:e}}(e))}}function Oa(e,t){return(r,n)=>{const o=n(),i=o.config,a=o.entryDraft.get("entry"),s=o.entryDraft.getIn(["entry","collection"]),l=o.collections.get(s);r(function(e){return{type:sa,payload:{mediaPath:e}}}(e=Array.isArray(e)?e.map((e=>lc(i,l,e,a,t))):lc(i,l,e,a,t)))}}function Ea(e){return{type:la,payload:{controlID:e}}}function ka(e={}){const{delay:t=0,query:r="",page:n=1,privateUpload:o}=e;return async(e,i)=>{const a=i(),s=rf(a.config),l=Gf(a,null,"assetStore");if(l){const t=Ai(a.integrations,s.getToken,l);e(Ra(n));try{const i=await t.retrieve(r,n,o);return e(Ma(i,{page:n,canPaginate:!0,dynamicSearch:!0,dynamicSearchQuery:r,privateUpload:o}))}catch(t){return e(Aa({privateUpload:o}))}}function c(){return s.getMedia().then((t=>e(Ma(t)))).catch((t=>{console.error(t),404===t.status?(console.log("This 404 was expected and handled appropriately."),e(Ma([]))):e(Aa())}))}return e(Ra(n)),t>0?new Promise((e=>{setTimeout((()=>e(c())),t)})):c()}}function Ca({id:e,file:t,assetProxy:r,draft:n}){return{id:e,name:(0,pr.basename)(r.path),displayURL:r.url,draft:n,file:t,size:t.size,url:r.url,path:r.path,field:r.field}}function Ta(e,t={}){const{privateUpload:r,field:n}=t;return async(t,o)=>{const i=o(),a=rf(i.config),s=Gf(i,null,"assetStore"),l=qa(i,n),c=ni(e.name.toLowerCase(),i.config.slug),u=l.find((e=>e.name.toLowerCase()===c)),f=cc(i.entryDraft);if(!s&&u){if(!window.confirm(`${u.name} already exists. Do you want to replace it?`))return;await t(Pa(u,{privateUpload:r}))}!s&&f||t({type:pa});try{let o,l;if(s)try{const t=Ai(i.integrations,a.getToken,s),n=await t.upload(e,r);o=Tr({url:n.asset.url,path:n.asset.url})}catch(t){o=Tr({file:e,path:c})}else{if(r)throw new Error("The Private Upload option is only available for Asset Store Integration");{const t=i.entryDraft.get("entry"),r=i.collections.get(null==t?void 0:t.get("collection")),a=sc(i.config,r,t,c,n);o=Tr({file:e,path:a,field:n})}}if(t(Xa(o)),s)l=Ca({id:await(0,pr.getBlobSHA)(e),file:e,assetProxy:o,draft:!1});else{if(f)return l=Ca({id:await(0,pr.getBlobSHA)(e),file:e,assetProxy:o,draft:f}),t(function(e){return{type:ul,payload:e}}(l));l=await a.persistMedia(i.config,o)}return t(function(e,t={}){const{privateUpload:r}=t;return{type:da,payload:{file:e,privateUpload:r}}}(l,{privateUpload:r}))}catch(e){return console.error(e),t(ea({message:`Failed to persist media: ${e}`,type:"error",dismissAfter:8e3})),t(function(e={}){const{privateUpload:t}=e;return{type:ha,payload:{privateUpload:t}}}({privateUpload:r}))}}}function Pa(e,t={}){const{privateUpload:r}=t;return async(t,n)=>{const o=n(),i=rf(o.config),a=Gf(o,null,"assetStore");if(a){const n=Ai(o.integrations,i.getToken,a);t(Ia());try{return await n.delete(e.id),t(Da(e,{privateUpload:r}))}catch(e){return console.error(e),t(ea({message:`Failed to delete media: ${e.message}`,type:"error",dismissAfter:8e3})),t(La({privateUpload:r}))}}try{if(e.draft)t(Za(e.path)),t(_l({id:e.id}));else{const r=cc(o.entryDraft);t(Ia()),t(Za(e.path)),await i.deleteMedia(o.config,e.path),t(Da(e)),r&&t(_l({id:e.id}))}}catch(e){return console.error(e),t(ea({message:`Failed to delete media: ${e.message}`,type:"error",dismissAfter:8e3})),t(La())}}}function ja(e){return async(t,r)=>{const{displayURL:n,id:o}=e,i=r(),a=Wa(i,o);if(!o||!n||a.get("url")||a.get("isFetching")||a.get("err"))return Promise.resolve();if("string"==typeof n)return t(Na(o)),void t($a(o,n));try{const e=rf(i.config);t(Na(o));const r=await e.getMediaDisplayURL(n);if(!r)throw new Error("No display URL was returned!");t($a(o,r))}catch(e){console.error(e),t(function(e,t){return{type:wa,payload:{key:e,err:t}}}(o,e))}}}function Ra(e){return{type:ca,payload:{page:e}}}function Ma(e,t={}){return{type:ua,payload:na({files:e},t)}}function Aa(e={}){const{privateUpload:t}=e;return{type:fa,payload:{privateUpload:t}}}function Ia(){return{type:ga}}function Da(e,t={}){const{privateUpload:r}=t;return{type:ma,payload:{file:e,privateUpload:r}}}function La(e={}){const{privateUpload:t}=e;return{type:ya,payload:{privateUpload:t}}}function Na(e){return{type:va,payload:{key:e}}}function $a(e,t){return{type:ba,payload:{key:e,url:t}}}async function Fa(e,t){!1===t.mediaLibrary.get("isLoading")||t.mediaLibrary.get("externalLibrary")||await Ji(e,(e=>({predicate:({type:e})=>e===ua||e===fa,run:()=>e()})))}function Ba(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ua(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ba(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ba(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const za={isVisible:!1,showMediaButton:!0,controlMedia:(0,Qe.Map)(),displayURLs:(0,Qe.Map)(),config:(0,Qe.Map)()};function qa(e,t){const{mediaLibrary:r,entryDraft:n}=e,o=cc(e.entryDraft),i=Gf(e,null,"assetStore");let a;if(o&&!i){const r=n.getIn(["entry","mediaFiles"],(0,Qe.List)()).toJS(),o=n.get("entry"),i=e.collections.get(null==o?void 0:o.get("collection")),s=ac(e.config,i,o,t);a=r.filter((e=>(0,dr.dirname)(e.path)===s)).map((e=>Ua({key:e.id},e)))}else a=r.get("files")||[];return a}function Wa(e,t){return e.mediaLibrary.getIn(["displayURLs",t],(0,Qe.Map)())}const Ha="ADD_ASSETS",Va="ADD_ASSET",Ga="REMOVE_ASSET",Ka="LOAD_ASSET_REQUEST",Ya="LOAD_ASSET_SUCCESS",Ja="LOAD_ASSET_FAILURE";function Qa(e){return{type:Ha,payload:e}}function Xa(e){return{type:Va,payload:e}}function Za(e){return{type:Ga,payload:e}}const es=Tr({path:"empty.svg",file:new File(['<svg xmlns="http://www.w3.org/2000/svg"></svg>'],"empty.svg",{type:"image/svg+xml"})});function ts(e,t,r){return function(n,o){return e(rs({collection:t,entry:r,path:n,field:o}))}}function rs({collection:e,entry:t,path:r,field:n}){return(o,i)=>{if(!r)return es;const a=i(),s=sc(a.config,e,t,r,n);let{asset:l,isLoading:c,error:u}=a.medias[s]||{};return c?es:l||((0,pr.isAbsolutePath)(s)||u?(l=Tr({path:s,url:r}),o(Xa(l))):(o(function(e){return async(t,r)=>{try{t({type:Ka,payload:{path:e}}),await Fa(t,r());const i=(n=r(),o=e,qa(n).find((e=>e.path===o)));if(i){const n=await async function(e,t,r){const n=Wa(t,r.id);let o;if(n.get("url"))o=n.get("url");else if(n.get("err"))o=null;else{var i;const t=r.id,a=Ji(e,(e=>({predicate:({type:e,payload:r})=>(e===ba||e===wa)&&r.key===t,run:(t,r,n)=>e(n.payload.url)})));n.get("isFetching")||e(ja(r)),o=null!==(i=await a)&&void 0!==i?i:null}return o}(t,r(),i);t(Xa(Tr({path:e,url:n||e})))}else{const{url:n}=await async function(e,t){const r=rf(e.config),{url:n}=await r.getMediaFile(t);return{url:n}}(r(),e);t(Xa(Tr({path:e,url:n})))}t(function(e){return{type:Ya,payload:{path:e}}}(e))}catch(r){t(function(e,t){return{type:Ja,payload:{path:e,error:t}}}(e,r))}var n,o}}(s)),l=es),l)}}const ns=function(e){void 0===e&&(e={}),ge||se(!1);var t=window.history,r=(window.navigator.userAgent.indexOf("Firefox"),e),n=r.getUserConfirmation,o=void 0===n?me:n,i=r.hashType,a=void 0===i?"slash":i,s=e.basename?fe(le(e.basename)):"",l=ve[a],c=l.encodePath,u=l.decodePath;function f(){var e=u(we());return s&&(e=ue(e,s)),de(e)}var p=he();function h(e){d(k,e),k.length=t.length,p.notifyListeners(k.location,k.action)}var g=!1,m=null;function y(){var e=we(),t=c(e);if(e!==t)_e(t);else{var r=f(),n=k.location;if(!g&&function(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash}(n,r))return;if(m===pe(r))return;m=null,function(e){if(g)g=!1,h();else{p.confirmTransitionTo(e,"POP",o,(function(t){t?h({action:"POP",location:e}):function(e){var t=k.location,r=_.lastIndexOf(pe(t));-1===r&&(r=0);var n=_.lastIndexOf(pe(e));-1===n&&(n=0);var o=r-n;o&&(g=!0,S(o))}(e)}))}}(r)}}var v=we(),b=c(v);v!==b&&_e(b);var w=f(),_=[pe(w)];function S(e){t.go(e)}var x=0;function O(e){1===(x+=e)&&1===e?window.addEventListener(ye,y):0===x&&window.removeEventListener(ye,y)}var E=!1,k={length:t.length,action:"POP",location:w,createHref:function(e){var t=document.querySelector("base"),r="";return t&&t.getAttribute("href")&&(r=be(window.location.href)),r+"#"+c(s+pe(e))},push:function(e,t){var r="PUSH",n=de(e,void 0,void 0,k.location);p.confirmTransitionTo(n,r,o,(function(e){if(e){var t=pe(n),o=c(s+t);if(we()!==o){m=t,function(e){window.location.hash=e}(o);var i=_.lastIndexOf(pe(k.location)),a=_.slice(0,i+1);a.push(t),_=a,h({action:r,location:n})}else h()}}))},replace:function(e,t){var r="REPLACE",n=de(e,void 0,void 0,k.location);p.confirmTransitionTo(n,r,o,(function(e){if(e){var t=pe(n),o=c(s+t);we()!==o&&(m=t,_e(o));var i=_.indexOf(pe(k.location));-1!==i&&(_[i]=t),h({action:r,location:n})}}))},go:S,goBack:function(){S(-1)},goForward:function(){S(1)},block:function(e){void 0===e&&(e=!1);var t=p.setPrompt(e);return E||(O(1),E=!0),function(){return E&&(E=!1,O(-1)),t()}},listen:function(e){var t=p.appendListener(e);return O(1),function(){O(-1),t()}}};return k}();function os(e){return ns.push(`/collections/${e}`)}function is(e){return ns.replace(`/collections/${e}/new`)}function as(e,t){return ns.replace(`/collections/${e}/entries/${t}`)}const ss="UNPUBLISHED_ENTRY_REQUEST",ls="UNPUBLISHED_ENTRY_SUCCESS",cs="UNPUBLISHED_ENTRY_REDIRECT",us="UNPUBLISHED_ENTRIES_REQUEST",fs="UNPUBLISHED_ENTRIES_SUCCESS",ps="UNPUBLISHED_ENTRIES_FAILURE",ds="UNPUBLISHED_ENTRY_PERSIST_REQUEST",hs="UNPUBLISHED_ENTRY_PERSIST_SUCCESS",gs="UNPUBLISHED_ENTRY_PERSIST_FAILURE",ms="UNPUBLISHED_ENTRY_STATUS_CHANGE_REQUEST",ys="UNPUBLISHED_ENTRY_STATUS_CHANGE_SUCCESS",vs="UNPUBLISHED_ENTRY_STATUS_CHANGE_FAILURE",bs="UNPUBLISHED_ENTRY_PUBLISH_REQUEST",ws="UNPUBLISHED_ENTRY_PUBLISH_SUCCESS",_s="UNPUBLISHED_ENTRY_PUBLISH_FAILURE",Ss="UNPUBLISHED_ENTRY_DELETE_SUCCESS";function xs(e,t){return{type:fs,payload:{entries:e,pages:t}}}function Os(e,t){return{type:ds,payload:{collection:e.get("name"),slug:t}}}function Es(e,t){return{type:hs,payload:{collection:e.get("name"),entry:t}}}function ks(e,t,r){return{type:gs,payload:{error:e,collection:t.get("name"),slug:r},error:e}}function Cs(e,t){return async(r,n)=>{const o=n(),i=rf(o.config);if(!Qt()(o.editorialWorkflow.toJS(),"pages.ids",!1))try{const{entries:e,pagination:t}=await i.unpublishedEntries(o.collections);r(xs(e,t))}catch(e){}r(function(e,t){return{type:ss,payload:{collection:e.get("name"),slug:t}}}(e,t));try{const n=await i.unpublishedEntry(o,e,t),a=await Promise.all(n.mediaFiles.filter((e=>e.draft)).map((({url:e,file:t,path:r})=>Tr({path:r,url:e,file:t}))));r(Qa(a)),r(function(e,t){return{type:ls,payload:{collection:e.get("name"),entry:t}}}(e,n)),r(bl(n))}catch(n){n.name===pr.EDITORIAL_WORKFLOW_ERROR&&n.notUnderEditorialWorkflow?(r(function(e,t){return{type:cs,payload:{collection:e.get("name"),slug:t}}}(e,t)),r(Sl(e,t))):r(ea({message:{key:"ui.toast.onFailToLoadEntries",details:n},type:"error",dismissAfter:8e3}))}}}function Ts(e){return(t,r)=>{const n=r(),o=rf(n.config),i=Qt()(n.editorialWorkflow.toJS(),"pages.ids",!1);n.config.publish_mode!==Zn||i||(t({type:us}),o.unpublishedEntries(e).then((e=>t(xs(e.entries,e.pagination)))).catch((e=>{t(ea({message:{key:"ui.toast.onFailToLoadEntries",details:e},type:"error",dismissAfter:8e3})),t(function(e){return{type:ps,error:"Failed to load entries",payload:e}}(e)),Promise.reject(e)})))}}function Ps(e,t,r,n){return(o,i)=>{if(r===n)return;const a=i(),s=rf(a.config);o(function(e,t){return{type:ms,payload:{collection:e,slug:t}}}(e,t)),s.updateUnpublishedEntryStatus(e,t,n).then((()=>{o(ea({message:{key:"ui.toast.entryUpdated"},type:"success",dismissAfter:4e3})),o(function(e,t,r){return{type:ys,payload:{collection:e,slug:t,newStatus:r}}}(e,t,n))})).catch((r=>{o(ea({message:{key:"ui.toast.onFailToUpdateStatus",details:r},type:"error",dismissAfter:8e3})),o(function(e,t){return{type:vs,payload:{collection:e,slug:t}}}(e,t))}))}}function js(e,t){return(r,n)=>{const o=n(),i=rf(o.config);return r(function(e,t){return{type:"UNPUBLISHED_ENTRY_DELETE_REQUEST",payload:{collection:e,slug:t}}}(e,t)),i.deleteUnpublishedEntry(e,t).then((()=>{r(ea({message:{key:"ui.toast.onDeleteUnpublishedChanges"},type:"success",dismissAfter:4e3})),r(function(e,t){return{type:Ss,payload:{collection:e,slug:t}}}(e,t))})).catch((n=>{r(ea({message:{key:"ui.toast.onDeleteUnpublishedChanges",details:n},type:"error",dismissAfter:8e3})),r(function(e,t){return{type:"UNPUBLISHED_ENTRY_DELETE_FAILURE",payload:{collection:e,slug:t}}}(e,t))}))}}function Rs(e,t){return async(r,n)=>{const o=n(),i=o.collections,a=rf(o.config),s=Vf(o,e,t);r(function(e,t){return{type:bs,payload:{collection:e,slug:t}}}(e,t));try{await a.publishUnpublishedEntry(s),r(ka()),r(ea({message:{key:"ui.toast.entryPublished"},type:"success",dismissAfter:4e3})),r(function(e,t){return{type:ws,payload:{collection:e,slug:t}}}(e,t));const n=i.get(e);if(!n.has("nested"))return r(Sl(n,t));{r(kl(n));const e=Qu(n,s.get("path"));Sl(n,e),t!==e&&cc(o.entryDraft)&&as(n.get("name"),e)}}catch(n){r(ea({message:{key:"ui.toast.onFailToPublishEntry",details:n},type:"error",dismissAfter:8e3})),r(function(e,t){return{type:_s,payload:{collection:e,slug:t}}}(e,t))}}}const Ms=(0,Qe.Map)({entry:(0,Qe.Map)(),fieldsMetaData:(0,Qe.Map)(),fieldsErrors:(0,Qe.Map)(),hasChanged:!1,key:""});function As(e,t){if(!jc(e))return;const r=t.getIn(["entry","meta"]),n=r&&r.get("path"),o=Qt()(e.toJS(),["meta","path","index_file"]),i=vc(e);return n&&(0,dr.join)(e.get("folder"),n,`${o}.${i}`)}function Is(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ds(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Is(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Is(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Ls="ENTRY_REQUEST",Ns="ENTRY_SUCCESS",$s="ENTRY_FAILURE",Fs="ENTRIES_REQUEST",Bs="ENTRIES_SUCCESS",Us="ENTRIES_FAILURE",zs="SORT_ENTRIES_REQUEST",qs="SORT_ENTRIES_SUCCESS",Ws="SORT_ENTRIES_FAILURE",Hs="FILTER_ENTRIES_REQUEST",Vs="FILTER_ENTRIES_SUCCESS",Gs="FILTER_ENTRIES_FAILURE",Ks="GROUP_ENTRIES_REQUEST",Ys="GROUP_ENTRIES_SUCCESS",Js="GROUP_ENTRIES_FAILURE",Qs="DRAFT_CREATE_FROM_ENTRY",Xs="DRAFT_CREATE_EMPTY",Zs="DRAFT_DISCARD",el="DRAFT_CHANGE_FIELD",tl="DRAFT_VALIDATION_ERRORS",rl="DRAFT_CLEAR_ERRORS",nl="DRAFT_LOCAL_BACKUP_RETRIEVED",ol="DRAFT_CREATE_FROM_LOCAL_BACKUP",il="DRAFT_CREATE_DUPLICATE_FROM_ENTRY",al="ENTRY_PERSIST_REQUEST",sl="ENTRY_PERSIST_SUCCESS",ll="ENTRY_PERSIST_FAILURE",cl="ENTRY_DELETE_SUCCESS",ul="ADD_DRAFT_ENTRY_MEDIA_FILE",fl="REMOVE_DRAFT_ENTRY_MEDIA_FILE",pl="CHANGE_VIEW_STYLE";function dl(e){return{type:Fs,payload:{collection:e.get("name")}}}function hl(e,t,r,n,o=!0){return{type:Bs,payload:{collection:e.get("name"),entries:t,page:r,cursor:pr.Cursor.create(n),append:o}}}function gl(e,t){return{type:Us,error:"Failed to load entries",payload:t.toString(),meta:{collection:e.get("name")}}}async function ml(e,t){const r=rf(e.config),n=Gf(e,t.get("name"),"listEntries"),o=n?Ai(e.integrations,r.getToken,n):r;return await o.listAllEntries(t)}function yl(e,t,r=Ro.Ascending){return async(n,o)=>{const i=o(),a=ec(i.entries,e.get("name"));if(n({type:zs,payload:{collection:e.get("name"),key:t,direction:r}}),!a)try{const o=await ml(i,e);n({type:qs,payload:{collection:e.get("name"),key:t,direction:r,entries:o}})}catch(o){n({type:Ws,payload:{collection:e.get("name"),key:t,direction:r,error:o}})}}}function vl(e,t){return{type:cl,payload:{collectionName:e.get("name"),entrySlug:t}}}function bl(e){return{type:Qs,payload:{entry:e}}}function wl(e){return{type:rl,payload:{uniqueFieldId:e}}}function _l({id:e}){return{type:fl,payload:{id:e}}}function Sl(e,t){return async(r,n)=>{await Fa(r,n()),r(function(e,t){return{type:Ls,payload:{collection:e.get("name"),slug:t}}}(e,t));try{const o=await xl(n(),e,t);r(function(e,t){return{type:Ns,payload:{collection:e.get("name"),entry:t}}}(e,o)),r(bl(o))}catch(n){r(ea({message:{details:n.message,key:"ui.toast.onFailToLoadEntries"},type:"error",dismissAfter:8e3})),r(function(e,t,r){return{type:$s,payload:{error:e,collection:t.get("name"),slug:r}}}(n,e,t))}}}async function xl(e,t,r){const n=rf(e.config);return await n.getEntry(e,t,r)}const Ol=(0,Qe.fromJS)({append_next:{action:"next",append:!0}});function El(e){return pr.Cursor.create(e).updateStore("actions",(e=>e.union(Ol.filter((t=>e.has(t.get("action")))).keySeq())))}function kl(e,t=0){return async(r,n)=>{if(e.get("isFetching"))return;const o=n(),i=Yl(o.entries,e.get("name"));if(i&&i.length>0){const t=i[0];return r(yl(e,t.get("key"),t.get("direction")))}const a=rf(o.config),s=Gf(o,e.get("name"),"listEntries"),l=s?Ai(o.integrations,a.getToken,s):a,c=!!(t&&!isNaN(t)&&t>0);r(dl(e));try{const n=e.has("nested")||Lc(e);let o=await(n?l.listAllEntries(e).then((e=>({entries:e}))):l.listEntries(e,t));o=Ds(Ds({},o),{},{cursor:s?pr.Cursor.create({actions:["next"],meta:{usingOldPaginationAPI:!0},data:{nextPage:t+1}}):pr.Cursor.create(o.cursor)}),r(hl(e,o.cursor.meta.get("usingOldPaginationAPI")?o.entries.reverse():o.entries,o.pagination,El(o.cursor),c))}catch(t){return r(ea({message:{details:t,key:"ui.toast.onFailToLoadEntries"},type:"error",dismissAfter:8e3})),Promise.reject(r(gl(e,t)))}}}function Cl(e,t=(()=>!1)){return e.reduce(((e,r)=>{const n=e,o=r;if(t(o))return n;const i=o.get("field")||o.get("fields"),a="list"==o.get("widget"),s=o.get("name"),l=o.get("default",null);if(Qe.List.isList(i)||Qe.Map.isMap(i)){if(a&&Qe.List.isList(l))n[s]=l;else{const e=Qe.List.isList(i)?i:(0,Qe.List)([i]),r=a?[Cl(e,t)]:Cl(e,t);c=r,[[{}],{}].some((e=>bi()(c,e)))||(n[s]=r)}return n}var c;return null!==l&&(n[s]=l),n}),{})}function Tl({entry:e}){return e.get("mediaFiles").toArray().filter((e=>e.get("draft"))).map((e=>Tr({path:e.get("path"),file:e.get("file"),url:e.get("url"),field:e.get("field")})))}function Pl(e,t){const r=yc(e,t.get("slug"));function n(e){return function(e,t){return Gi(e,t,"serialize")}(e,r)}const o=n(t.get("data"));let i=t.set("data",o);return Lc(e)&&(i=function(e,t,r){const{locales:n,defaultLocale:o}=Nc(e);return n.filter((e=>e!==o)).forEach((e=>{const n=Uc(e);t=t.setIn(n,r(t.getIn(n)))})),t}(e,i,n)),i}function jl(e,t,r){return{error:{type:Ki.CUSTOM,message:r(`editor.editorControlPane.widget.${t}`,{path:e})}}}const Rl="VIEW_STYLE_LIST",Ml="VIEW_STYLE_GRID";function Al(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Il(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Al(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Al(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const{keyToPathArray:Dl}=hr.stringTemplate;let Ll,Nl,$l,Fl,Bl;const Ul="decap-cms.entries.sort",zl="decap-cms.entries.viewStyle",ql=jo()((()=>{const e=localStorage.getItem(Ul);if(e)try{const t=JSON.parse(e);let r=(0,Qe.Map)();return Object.entries(t).forEach((([e,t])=>{let n=(0,Qe.OrderedMap)();Zt()(Object.values(t),["index"]).forEach((e=>{const{key:t,direction:r}=e;n=n.set(t,(0,Qe.fromJS)({key:t,direction:r}))})),r=r.set(e,n)})),r}catch(e){return(0,Qe.Map)()}return(0,Qe.Map)()}));function Wl(e){if(e){const t={};e.keySeq().forEach((r=>{const n=r;e.get(n).valueSeq().toJS().map(((e,t)=>Il(Il({},e),{},{index:t}))).forEach((e=>{Yt()(t,[n,e.key],e)}))})),localStorage.setItem(Ul,JSON.stringify(t))}else localStorage.removeItem(Ul)}const Hl=jo()((()=>localStorage.getItem(zl)||(localStorage.setItem(zl,Rl),Rl)));function Vl(e,t){const r=e.get("sort");return null==r?void 0:r.get(t)}function Gl(e,t){const r=e.get("filter");return(null==r?void 0:r.get(t))||(0,Qe.Map)()}function Kl(e,t){const r=e.get("group");return(null==r?void 0:r.get(t))||(0,Qe.Map)()}function Yl(e,t){const r=Vl(e,t),n=(null==r?void 0:r.valueSeq().filter((e=>(null==e?void 0:e.get("direction"))!==Ro.None)).toArray())||[];return n}function Jl(e,t,r){return e.getIn(["entities",`${t}.${r}`])}function Ql(e,t){return e.getIn(["pages",t,"ids"],(0,Qe.List)())}function Xl(e,t){const r=Ql(e,t),n=r&&r.map((r=>Jl(e,t,r)));return n}function Zl(e,t){const r=t.get("name");let n=Xl(e,r);const o=Yl(e,r);if(o&&o.length>0){const e=o.map((e=>function(e,t){return t===So?"updatedOn":t!==_o||Oc(e,t)?`data.${t}`:"author"}(t,e.get("key")))),r=o.map((e=>e.get("direction")===Ro.Ascending?"asc":"desc"));n=(0,Qe.fromJS)(To()(n.toJS(),e,r))}const i=function(e,t){const r=Gl(e,t),n=(null==r?void 0:r.valueSeq().filter((e=>!0===(null==e?void 0:e.get("active")))).toArray())||[];return n}(e,r);return i&&i.length>0&&(n=n.filter((e=>{const t=i.every((t=>{const r=t.get("pattern"),n=t.get("field"),o=(e.get("data")||(0,Qe.Map)()).getIn(Dl(n));return void 0!==o&&new RegExp(String(r)).test(String(o))}));return t})).toList()),n}function ec(e,t){return e.getIn(["pages",t,"isFetching"],!1)}const tc="DRAFT_MEDIA_FILES";function rc(e,t){const r=e.find((e=>(null==e?void 0:e.get("name"))===t));return r}function nc(e,t,r,n){if(!t)return!1;if(n&&n.has(e))return!0;if(t.has("files")){const n=rc(t.get("files"),r);if(n&&n.has(e))return!0}return!!t.has(e)}function oc(e,t,r,n,o,i,a){const s=i.filter((e=>e===o))[0];if(s)return yi(s.has(e)?s.get(e):`{{${e}}}`,n,r,a,e,t.slug);for(let s of i){s.has(e)||(s=s.set(e,`{{${e}}}`));const i=yi(s.get(e),n,r,a,e,t.slug);let l=null;if(s.has("fields")?l=oc(e,t,r,n,o,s.get("fields").toArray(),i):s.has("field")?l=oc(e,t,r,n,o,[s.get("field")],i):s.has("types")&&(l=oc(e,t,r,n,o,s.get("types").toArray(),i)),null!=l)return l}return null}function ic(e,t,r,n,o){let i=t[e];if(r.has(e)||(r=r.set(e,`{{${e}}}`)),r.has("files")){i=yi(r.get(e),n,r,i,e,t.slug);let a=rc(r.get("files"),null==n?void 0:n.get("slug"));if(a&&(a.has(e)||(a=a.set(e,`{{${e}}}`)),i=yi(a.get(e),n,r,i,e,t.slug),o)){const s=oc(e,t,r,n,o,a.get("fields").toArray(),i);null!==s&&(i=s)}}else if(i=yi(r.get(e),n,r,i,e,t.slug),o){const a=oc(e,t,r,n,o,r.get("fields").toArray(),i);null!==a&&(i=a)}return i}function ac(e,t,r,n){const o="media_folder";let i=e[o];if(nc(o,t,null==r?void 0:r.get("slug"),n)){const a=ic(o,e,t,r,n);if(a.startsWith("/"))i=(0,dr.join)(a);else{const e=null==r?void 0:r.get("path");i=e?(0,dr.join)((0,dr.dirname)(e),a):(0,dr.join)(t.get("folder"),tc)}}return tr()(i,"/")}function sc(e,t,r,n,o){if((0,pr.isAbsolutePath)(n))return n;const i=ac(e,t,r,o);return(0,dr.join)(i,(0,pr.basename)(n))}function lc(e,t,r,n,o){if((0,pr.isAbsolutePath)(r))return r;const i="public_folder";let a=e[i];return nc(i,t,null==n?void 0:n.get("slug"),o)&&(a=ic(i,e,t,n,o)),(0,pr.isAbsolutePath)(a)?function(e,...t){return zo()(e,...t)}(a,(0,pr.basename)(r)):(0,dr.join)(a,(0,pr.basename)(r))}function cc(e){const t=e.get("entry");return t&&!t.isEmpty()}function uc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?uc(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const{keyToPathArray:pc}=hr.stringTemplate,dc=(0,Qe.fromJS)({}),hc={[wo]:{entryExtension(e){const t=e.get("extension")||Qt()(Bn(Bn({},zn),Nn()),e.get("format")||"frontmatter");if(!t)throw new Error(`No extension found for format ${e.get("format")}`);return t.replace(/^\./,"")},fields:e=>e.get("fields"),entryPath(e,t){return`${e.get("folder").replace(/\/$/,"")}/${t}.${this.entryExtension(e)}`},entrySlug(e,t){var r;const n=e.get("folder").replace(/\/$/,"");return null===(r=t.split(n+"/").pop())||void 0===r?void 0:r.replace(new RegExp(`\\.${mo()(this.entryExtension(e))}$`),"")},allowNewEntries:e=>e.get("create"),allowDeletion:e=>e.get("delete",!0),templateName:e=>e.get("name")},[bo]:{fileForEntry(e,t){const r=e.get("files");return r&&r.filter((e=>(null==e?void 0:e.get("name"))===t)).get(0)},fields(e,t){const r=this.fileForEntry(e,t);return r&&r.get("fields")},entryPath(e,t){const r=this.fileForEntry(e,t);return r&&r.get("file")},entrySlug(e,t){const r=e.get("files").filter((e=>(null==e?void 0:e.get("file"))===t)).get(0);return r&&r.get("name")},entryLabel(e,t){const r=this.fileForEntry(e,t);return r&&r.get("label")},allowNewEntries:()=>!1,allowDeletion:e=>e.get("delete",!1),templateName:(e,t)=>t}};function gc(e){const t=e.reduce(((e,t)=>{if(t.has("media_folder")&&(e=[...e,t]),t.has("fields")){var r;const n=null===(r=t.get("fields"))||void 0===r?void 0:r.toArray();e=[...e,...gc(n)]}else if(t.has("field")){const r=t.get("field");e=[...e,...gc([r])]}else if(t.has("types")){var n;const r=null===(n=t.get("types"))||void 0===n?void 0:n.toArray();e=[...e,...gc(r)]}return e}),[]);return t}function mc(e,t){var r;return null===(r=e.get("files"))||void 0===r?void 0:r.toArray().find((e=>e.get("name")===t))}function yc(e,t){return hc[e.get("type")].fields(e,t)}function vc(e){return hc[wo].entryExtension(e)}function bc(e,t){return hc[bo].entryLabel(e,t)}function wc(e,t){return hc[e.get("type")].entryPath(e,t)}function _c(e,t){return hc[e.get("type")].entrySlug(e,t)}function Sc(e){return hc[e.get("type")].allowDeletion(e)}function xc(e,t=""){let r=e.map((e=>`${t}${e.get("name")}`));return e.forEach(((e,t)=>{if(e.has("fields")){var n;const o=null===(n=e.get("fields"))||void 0===n?void 0:n.toArray();r=[...r,...xc(o,`${r[t]}.`)]}else if(e.has("field")){const n=e.get("field");r=[...r,...xc([n],`${r[t]}.`)]}else if(e.has("types")){var o;const n=null===(o=e.get("types"))||void 0===o?void 0:o.toArray();r=[...r,...xc(n,`${r[t]}.`)]}})),r}function Oc(e,t){const r=pc(t);let n,o,i=e.get("fields",(0,Qe.List)()).toArray();for(;(n=r.shift())&&i;){var a,s,l,c,u;if(o=i.find((e=>e.get("name")===n)),null!==(a=o)&&void 0!==a&&a.has("fields"))i=null===(c=o)||void 0===c||null===(u=c.get("fields"))||void 0===u?void 0:u.toArray();else if(null!==(s=o)&&void 0!==s&&s.has("field")){var f;i=[null===(f=o)||void 0===f?void 0:f.get("field")]}else if(null!==(l=o)&&void 0!==l&&l.has("types")){var p,d;i=null===(p=o)||void 0===p||null===(d=p.get("types"))||void 0===d?void 0:d.toArray()}}return o}function Ec(e,t,r=(()=>!1)){return r()||(e=e.map((e=>{const n=t(e);return r()?n:n.has("fields")?n.set("fields",Ec(n.get("fields"),t,r)):n.has("field")?n.set("field",Ec((0,Qe.List)([n.get("field")]),t,r).get(0)):n.has("types")?n.set("types",Ec(n.get("types"),t,r)):n})).toList()),e}function kc(e){const t=e.get("identifier_field"),r=t?[t,...Oo]:[...Oo],n=xc(e.get("fields",(0,Qe.List)()).toArray());return r.find((e=>n.find((t=>t.toLowerCase().trim()===e.toLowerCase().trim()))))}function Cc(e,t){if("title"===t&&e.get("identifier_field"))return kc(e);const r=ko[t],n=e.get("fields");let o;if(!n||!r)return null;const i=n.filter((e=>(null==e?void 0:e.get("widget","string"))===r.type)).map((e=>null==e?void 0:e.get("name")));if(o=i.filter((e=>-1!==r.synonyms.indexOf(e))),o&&o.size>0)return o.first();const a=n.filter((e=>-1!==r.secondaryTypes.indexOf(null==e?void 0:e.get("widget","string")))).map((e=>null==e?void 0:e.get("name")));return o=a.filter((e=>-1!==r.synonyms.indexOf(e))),o&&o.size>0?o.first():r.fallbackToFirstField&&i.size>0?i.first():(r.showError&&(s=`The Field ${t} is missing for the collection “${e.get("name")}”`,l=`Decap CMS tries to infer the entry ${t} automatically, but one couldn't be found for entries of the collection “${e.get("name")}”. Please check your site configuration.`,console.error(`%c ⛔ ${s}\n%c${l}\n\n`,"color: black; font-weight: bold; font-size: 16px; line-height: 50px;","color: black;")),null);var s,l}function Tc(e,t){const r=e.get("summary");if(r)return function(e,t,r){let n=t.get("data");const o=si(t,Cc(r,"date"))||null,i=n.getIn(ci(kc(r)));return n=ui(t.get("path"),n,r.get("folder")),t.get("author")&&!Oc(r,_o)&&(n=n.set(_o,t.get("author"))),t.get("updatedOn")&&!Oc(r,So)&&(n=n.set(So,t.get("updatedOn"))),ai(e,o,i,n)}(r,t,e);if(e.get("type")==bo){const r=bc(e,t.get("slug"));if(r)return r}const n=t.get("data"),o=Cc(e,"title"),i=o&&n.getIn(pc(o));return i||"title"===o?i:n.getIn(pc("title"))}function Pc(e,t,r){let n=Eo.map((n=>{const o=Cc(e,n);return!t.isGitBackend()||"author"!==n||o||r?o:_o})).filter(Boolean);return t.isGitBackend()&&!r&&(n=[So,...n]),n}function jc(e){var t;return e.has("folder")&&e.get("type")===wo&&e.has("meta")&&(null===(t=e.get("meta"))||void 0===t?void 0:t.has("path"))}function Rc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Mc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Rc(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Ac="i18n";let Ic=function(e){return e.MULTIPLE_FOLDERS="multiple_folders",e.MULTIPLE_FILES="multiple_files",e.SINGLE_FILE="single_file",e}({}),Dc=function(e){return e.TRANSLATE="translate",e.DUPLICATE="duplicate",e.NONE="none",e}({});function Lc(e){return e.has(Ac)}function Nc(e){if(!Lc(e))return{};const{structure:t,locales:r,default_locale:n}=e.get(Ac).toJS();return{structure:t,locales:r,defaultLocale:n}}function $c(e,t,r){return t!==r&&e.get(Ac)===Dc.TRANSLATE}function Fc(e,t,r){return t!==r&&e.get(Ac)===Dc.DUPLICATE}function Bc(e,t,r){return t!==r&&e.get(Ac)===Dc.NONE}function Uc(e){return[Ac,e,"data"]}function zc(e,t){return e!==t?Uc(e):["data"]}function qc(e,t,r,n,o){switch(e){case Ic.MULTIPLE_FOLDERS:return r.replace(`/${n}`,`/${o}/${n}`);case Ic.MULTIPLE_FILES:return r.replace(new RegExp(`${mo()(t)}$`),`${o}.${t}`);case Ic.SINGLE_FILE:default:return r}}function Wc(e,t,r){switch(e){case Ic.MULTIPLE_FOLDERS:{const e=r.split("/");return e.pop(),e.pop()}case Ic.MULTIPLE_FILES:return r.slice(0,-`.${t}`.length).split(".").pop();case Ic.SINGLE_FILE:default:return""}}function Hc(e,t,r,n){const{structure:o,locales:i}=Nc(e);return o===Ic.SINGLE_FILE?[r]:i.map((e=>qc(o,t,r,n,e)))}function Vc(e,t,r){switch(e){case Ic.MULTIPLE_FOLDERS:return t.replace(`${r}/`,"");case Ic.MULTIPLE_FILES:return t.replace(`.${r}`,"");case Ic.SINGLE_FILE:default:return t}}function Gc(e,t,r,n){let o=n.find((e=>e.locale===r));o||(o=n[0],console.warn(`Could not locale entry for default locale '${r}'`));const i=n.filter((e=>e.locale!==o.locale)).reduce(((e,{locale:t,value:r})=>{const n=Uc(t);return Yt()(e,n,r.data)}),{}),a=Vc(t,o.value.path,r),s=_c(e,a);return Mc(Mc(Mc({},o.value),{},{raw:""},i),{},{path:a,slug:s})}function Kc(e,t,r){const n=e.data[t]||{},o=r.filter((e=>e!==t)).map((t=>({locale:t,value:e.data[t]}))).filter((e=>e.value)).reduce(((e,t)=>Mc(Mc({},e),{},{[t.locale]:{data:t.value}})),{});return Mc(Mc({},e),{},{data:n,i18n:o,raw:""})}function Yc(e,t,r){const{structure:n,defaultLocale:o,locales:i}=Nc(e);if(n===Ic.SINGLE_FILE)return r.map((e=>Kc(e,o,i)));const a=vo()(r.map((e=>({locale:Wc(n,t,e.path),value:e}))),(({locale:e,value:t})=>Vc(n,t.path,e)));return Object.values(a).reduce(((t,r)=>[...t,Gc(e,n,o,r)]),[])}function Jc(e,t,r,n,o=[t.get("name")]){const i=e.getIn(["entry","data",...o]);return t.get(Ac)===Dc.DUPLICATE&&r.filter((e=>e!==n)).forEach((t=>{e=e.setIn(["entry",...zc(t,n),...o],i)})),t.has("field")&&!Qe.List.isList(i)?[t.get("field")].forEach((t=>{e=Jc(e,t,r,n,[...o,t.get("name")])})):t.has("fields")&&!Qe.List.isList(i)&&t.get("fields").toArray().forEach((t=>{e=Jc(e,t,r,n,[...o,t.get("name")])})),e}function Qc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Xc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qc(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Zc={type:"string",minLength:2,maxLength:10,pattern:"^[a-zA-Z-_]+$"},eu={type:"object",properties:{structure:{type:"string",enum:Object.values(Ic)},locales:{type:"array",minItems:1,items:Zc,uniqueItems:!0},default_locale:Zc}},tu=Xc(Xc({},eu),{},{required:["structure","locales"]}),ru={oneOf:[{type:"boolean"},eu]},nu={oneOf:[{type:"boolean"},{type:"string",enum:Object.values(Dc)}]};function ou(){const e=ho();return{$id:`fields_${e}`,type:"array",minItems:1,items:{$id:`field_${e}`,type:"object",properties:{name:{type:"string"},label:{type:"string"},widget:{type:"string"},required:{type:"boolean"},i18n:nu,hint:{type:"string"},pattern:{type:"array",minItems:2,items:[{oneOf:[{type:"string"},{instanceof:"RegExp"}]},{type:"string"}]},field:{$ref:`field_${e}`},fields:{$ref:`fields_${e}`},types:{$ref:`fields_${e}`}},select:{$data:"0/widget"},selectCases:Xc({},su()),required:["name"]},uniqueItemProperties:["name"]}}const iu={type:"array",minItems:1,items:{type:"object",properties:{label:{type:"string"},field:{type:"string"},pattern:{oneOf:[{type:"boolean"},{type:"string"}]}},additionalProperties:!1,required:["label","field","pattern"]}},au={type:"array",minItems:1,items:{type:"object",properties:{label:{type:"string"},field:{type:"string"},pattern:{type:"string"}},additionalProperties:!1,required:["label","field"]}};function su(){const e=Cn().map((e=>({[e.name]:e.schema})));return Object.assign(...e)}class lu extends(function(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Error)){constructor(e,...t){const r=e.map((({message:e,instancePath:t})=>{const r=t.slice(1).split("/").map((e=>e.match(/^\d+$/)?`[${e}]`:`.${e}`)).join("").slice(1);return`${r?`'${r}'`:"config"} ${e}`})).join("\n");super(r,...t),this.errors=e,this.message=r}toString(){return this.message}}const cu=["hooks","collections","provider"];function uu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fu(e){const t=(e.integrations||[]).reduce(((t,r)=>{const{hooks:n,collections:o,provider:i}=r,a=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(r,cu);if(t.providers[i]=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?uu(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},a),!o)return n.forEach((e=>{t.hooks[e]=i})),t;const s="*"===o?e.collections.map((e=>e.name)):o;return s.forEach((e=>{n.forEach((r=>{t.hooks[e]?t.hooks[e][r]=i:t.hooks[e]={[r]:i}}))})),t}),{providers:{},hooks:{}});return(0,Qe.fromJS)(t)}const pu=(0,Qe.fromJS)({providers:{},hooks:{}});function du(e,t,r){return t?e.getIn(["hooks",t,r],!1):e.getIn(["hooks",r],!1)}const hu=["sortableFields"];function gu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function mu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gu(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const yu="CONFIG_REQUEST",vu="CONFIG_SUCCESS",bu="CONFIG_FAILURE";function wu(e){return"types"in e||"field"in e}function _u(e,t){return e.map((e=>{const r=t(e);return function(e){return"fields"in e}(r)?mu(mu({},r),{},{fields:_u(r.fields,t)}):wu(r)&&r.field?mu(mu({},r),{},{field:_u([r.field],t)[0]}):wu(r)&&r.types?mu(mu({},r),{},{types:_u(r.types,t)}):r}))}function Su(e){return"media_folder"in e&&!("public_folder"in e)?mu(mu({},e),{},{public_folder:e.media_folder}):e}const xu={dateFormat:"date_format",timeFormat:"time_format",pickerUtc:"picker_utc",editorComponents:"editor_components",valueType:"value_type",valueField:"value_field",searchFields:"search_fields",displayFields:"display_fields",optionsLength:"options_length"};function Ou(e){const t=Object.keys(xu).filter((t=>t in e)).map((t=>{const r=xu[t];return console.warn(`Field ${e.name} is using a deprecated configuration '${t}'. Please use '${r}'`),{[r]:e[t]}}));return Object.assign({},e,...t)}function Eu(e){return!0===e[Ac]?mu(mu({},e),{},{[Ac]:Dc.TRANSLATE}):!1!==e[Ac]&&e[Ac]?e:mu(mu({},e),{},{[Ac]:Dc.NONE})}function ku(e,t){if("boolean"==typeof e)return t;{const r=e.locales||t.locales,n=e.default_locale||r[0],o=Qn()(t,e);return o.locales=r,o.default_locale=n,Pu(o),o}}function Cu(e,t){return _u(e,t?Eu:e=>{const t=mu({},e);return delete t[Ac],t})}function Tu(e){if(e&&e.structure!==Ic.SINGLE_FILE)throw new Error(`i18n configuration for files collections is limited to ${Ic.SINGLE_FILE} structure`)}function Pu(e){if(e&&e.default_locale&&!e.locales.includes(e.default_locale))throw new Error(`i18n locales '${e.locales.join(", ")}' are missing the default locale ${e.default_locale}`)}function ju(e,t){return!!du(fu((0,Qe.fromJS)(e)),t.name,"listEntries")}function Ru(e){return{type:vu,payload:e}}function Mu(e){return{type:bu,error:"Error loading config",payload:e}}function Au(e={},t){return window.CMS_CONFIG?Ru(window.CMS_CONFIG):async r=>{r({type:yu});try{const n=function(){const e=document.querySelector('link[rel="cms-config-url"]');return e&&{"text/yaml":"yaml","application/x-yaml":"yaml"}[e.type]&&e.href?(console.log(`Using config file path: "${e.href}"`),e.href):"config.yml"}(),o=!Gn()(e),i=!1===e.load_config_file?{}:await async function(e,t){const r=await fetch(e,{credentials:"same-origin"}).catch((e=>e));if(r instanceof Error||200!==r.status){if(t)return{};const e=r instanceof Error?r.message:r.status;throw new Error(`Failed to load config.yml (${e})`)}const n=r.headers.get("Content-Type")||"Not-Found";return-1===n.indexOf("yaml")&&(console.log(`Response for ${e} was not yaml. (Content-Type: ${n})`),t)?{}:function(e){const t=mr().parse(e,{maxAliasCount:-1,prettyErrors:!0,merge:!0});if("undefined"!=typeof window&&"string"==typeof window.CMS_ENV&&t[window.CMS_ENV]){const e=Object.keys(t[window.CMS_ENV]);for(const r of e)t[r]=t[window.CMS_ENV][r]}return t}(await r.text())}(n,o),a=Qn()(i,e);!function(e){const t=new(no())({allErrors:!0,$data:!0,strict:!1});if((0,oo.uniqueItemProperties)(t),(0,oo.select)(t),(0,oo.instanceof)(t),(0,oo.prohibited)(t),ao()(t),!t.validate({type:"object",properties:{backend:{type:"object",properties:{name:{type:"string",examples:["test-repo"]},auth_scope:{type:"string",examples:["repo","public_repo"],enum:["repo","public_repo"]},cms_label_prefix:{type:"string",minLength:1},open_authoring:{type:"boolean",examples:[!0]}},required:["name"]},local_backend:{oneOf:[{type:"boolean"},{type:"object",properties:{url:{type:"string",examples:["http://localhost:8081/api/v1"]},allowed_hosts:{type:"array",items:{type:"string"}}},additionalProperties:!1}]},locale:{type:"string",examples:["en","fr","de"]},i18n:tu,site_url:{type:"string",examples:["https://example.com"]},display_url:{type:"string",examples:["https://example.com"]},logo_url:{type:"string",examples:["https://example.com/images/logo.svg"]},show_preview_links:{type:"boolean"},media_folder:{type:"string",examples:["assets/uploads"]},public_folder:{type:"string",examples:["/uploads"]},media_folder_relative:{type:"boolean"},media_library:{type:"object",properties:{name:{type:"string",examples:["uploadcare"]},config:{type:"object"}},required:["name"]},publish_mode:{type:"string",enum:["simple","editorial_workflow",""],examples:["editorial_workflow"]},slug:{type:"object",properties:{encoding:{type:"string",enum:["unicode","ascii"]},clean_accents:{type:"boolean"}}},collections:{type:"array",minItems:1,items:{type:"object",properties:{name:{type:"string"},label:{type:"string"},label_singular:{type:"string"},description:{type:"string"},folder:{type:"string"},files:{type:"array",items:{type:"object",properties:{name:{type:"string"},label:{type:"string"},label_singular:{type:"string"},description:{type:"string"},file:{type:"string"},preview_path:{type:"string"},preview_path_date_field:{type:"string"},fields:ou()},required:["name","label","file","fields"]},uniqueItemProperties:["name"]},identifier_field:{type:"string"},summary:{type:"string"},slug:{type:"string"},path:{type:"string"},preview_path:{type:"string"},preview_path_date_field:{type:"string"},create:{type:"boolean"},publish:{type:"boolean"},hide:{type:"boolean"},editor:{type:"object",properties:{preview:{type:"boolean"}}},format:{type:"string"},extension:{type:"string"},frontmatter_delimiter:{type:["string","array"],minItems:2,maxItems:2,items:{type:"string"}},fields:ou(),sortable_fields:{type:"array",items:{type:"string"}},sortableFields:{type:"array",items:{type:"string"}},view_filters:iu,view_groups:au,nested:{type:"object",properties:{depth:{type:"number",minimum:1,maximum:1e3},subfolders:{type:"boolean"},summary:{type:"string"}},required:["depth"]},meta:{type:"object",properties:{path:{type:"object",properties:{label:{type:"string"},widget:{type:"string"},index_file:{type:"string"}},required:["label","widget","index_file"]}},additionalProperties:!1,minProperties:1},i18n:ru},required:["name","label"],oneOf:[{required:["files"]},{required:["folder","fields"]}],not:{required:["sortable_fields","sortableFields"]},if:{required:["extension"]},then:{if:{properties:{extension:{enum:Object.keys(qn)}}},else:{required:["format"]}},dependencies:{frontmatter_delimiter:{properties:{format:{enum:Un}},required:["format"]}}},uniqueItemProperties:["name"]},editor:{type:"object",properties:{preview:{type:"boolean"}}}},required:["backend","collections"],anyOf:[{required:["media_folder"]},{required:["media_library"]}]},e)){const e=t.errors.map((e=>{switch(e.keyword){case"uniqueItemProperties":{const t=e.instancePath||"";let r=e;return t.endsWith("/fields")?r=Xc(Xc({},e),{},{message:"fields names must be unique"}):t.endsWith("/files")?r=Xc(Xc({},e),{},{message:"files names must be unique"}):t.endsWith("/collections")&&(r=Xc(Xc({},e),{},{message:"collections names must be unique"})),r}case"instanceof":{const t=e.instancePath||"";let r=e;return/fields\/\d+\/pattern\/\d+/.test(t)&&(r=Xc(Xc({},e),{},{message:"must be a regular expression"})),r}default:return e}}));throw console.error("Config Errors",e),new lu(e)}}(a);const s=function(e){const{collections:t=[]}=e,r=t.map((e=>{const{fields:t,files:r}=e;let n=e;if(t){const e=_u(t,Ou);n=mu(mu({},n),{},{fields:e})}if(r){const e=r.map((e=>{const t=_u(e.fields,Ou);return mu(mu({},e),{},{fields:t})}));n=mu(mu({},n),{},{files:e})}if(n.sortableFields){const{sortableFields:t}=n;n=mu(mu({},function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(n,hu)),{},{sortable_fields:t}),console.warn(`Collection ${e.name} is using a deprecated configuration 'sortableFields'. Please use 'sortable_fields'`)}return n}));return mu(mu({},e),{},{collections:r})}(await async function(e){if(!e.local_backend)return e;const{proxyUrl:t,publish_modes:r,type:n}=await async function(e){if(!["localhost","127.0.0.1",..."boolean"==typeof e?[]:(null==e?void 0:e.allowed_hosts)||[]].includes(location.hostname)||!e)return{};const t="http://localhost:8081/api/v1",r=!0===e?t:e.url||t.replace("localhost",location.hostname);try{console.log(`Looking for Decap CMS Proxy Server at '${r}'`);const e=await fetch(`${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"info"})}),{repo:t,publish_modes:n,type:o}=await e.json();return"string"==typeof t&&Array.isArray(n)&&"string"==typeof o?(console.log(`Detected Decap CMS Proxy Server at '${r}' with repo: '${t}'`),{proxyUrl:r,publish_modes:n,type:o}):(console.log(`Decap CMS Proxy Server not detected at '${r}'`),{})}catch{return console.log(`Decap CMS Proxy Server not detected at '${r}'`),{}}}(e.local_backend);return t?Gt(e,(e=>{e.backend.name="proxy",e.backend.proxy_url=t,e.publish_mode&&(e.publish_mode=function(e,t,r){if(e.publish_mode&&t&&!t.includes(e.publish_mode)){const n=t[0];return console.log(`'${e.publish_mode}' is not supported by '${r}' backend, switching to '${n}'`),n}return e.publish_mode}(e,r,n))})):e}(a)),l=Gt(s,(e=>{e.publish_mode=e.publish_mode||Xn,e.slug=e.slug||{},e.collections=e.collections||[],!e.display_url&&e.site_url&&(e.display_url=e.site_url);const t=`/${Yn()(e.media_folder,"/")}`;"public_folder"in e||(e.public_folder=t),"encoding"in e.slug||(e.slug.encoding="unicode"),"clean_accents"in e.slug||(e.slug.clean_accents=!1),"sanitize_replacement"in e.slug||(e.slug.sanitize_replacement="-");const r=e[Ac];r&&(r.default_locale=r.default_locale||r.locales[0]),Pu(r);const n=tf(e);for(const t of e.collections){"publish"in t||(t.publish=!0);let o=t[Ac];r&&o?(o=ku(o,r),t[Ac]=o):(o=void 0,delete t[Ac]),t.fields&&(t.fields=Cu(t.fields,Boolean(o)));const{folder:i,files:a,view_filters:s,view_groups:l,meta:c}=t;if(i&&(t.type=wo,t.path&&!t.media_folder&&(t.media_folder=""),"media_folder"in t&&!("public_folder"in t)&&(t.public_folder=t.media_folder),t.fields&&(t.fields=_u(t.fields,Su)),t.folder=tr()(i,"/"),c&&c.path)){const e=mu({name:"path",meta:!0,required:!0},c.path);t.fields=[e,...t.fields||[]]}if(a){t.type=bo,Tu(o),delete t.nested,delete t.meta;for(const e of a){e.file=Yn()(e.file,"/"),"media_folder"in e&&!("public_folder"in e)&&(e.public_folder=e.media_folder),e.fields&&(e.fields=_u(e.fields,Su));let t=e[Ac];t&&o?(t=ku(t,o),e[Ac]=t):(t=void 0,delete e[Ac]),Tu(t),e.fields&&(e.fields=Cu(e.fields,Boolean(t)))}}t.sortable_fields||(t.sortable_fields=Pc((0,Qe.fromJS)(t),n,ju(e,t))),t.view_filters=(s||[]).map((e=>mu(mu({},e),{},{id:`${e.field}__${e.pattern}`}))),t.view_groups=(l||[]).map((e=>mu(mu({},e),{},{id:`${e.field}__${e.pattern}`}))),e.editor&&!t.editor&&(t.editor={preview:e.editor.preview})}}));r(Ru(l)),"function"==typeof t&&t()}catch(e){throw r(Mu(e)),e}}}function Iu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Du(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Iu(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Iu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Lu(e){return e.locale||"en"}function Nu(e){return e.publish_mode===Zn}const $u=Gt(((e,t)=>{switch(t.type){case yu:e.isFetching=!0;break;case vu:return Du(Du({},t.payload),{},{isFetching:!1,error:void 0});case bu:e.isFetching=!1,e.error=t.payload.toString()}}),{isFetching:!0}),Fu=["field"];function Bu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Uu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Bu(Object(r),!0).forEach((function(t){zu(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function zu(e,t,r){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const{extractTemplateVars:qu,dateParsers:Wu,expandPath:Hu}=hr.stringTemplate;class Vu{constructor(){zu(this,"storageKey","decap-cms-user")}retrieve(){const e=window.localStorage.getItem(this.storageKey);return e&&JSON.parse(e)}store(e){window.localStorage.setItem(this.storageKey,JSON.stringify(e))}logout(){window.localStorage.removeItem(this.storageKey)}}function Gu(e,t){const r="backup";return e?`${r}.${e}${t?`.${t}`:""}`:r}function Ku(e,t){const r=Qt()(t.data,e);if(r)return String(r);{const r=e.split(".")[0];return t[r]?t[r]:""}}function Yu(e){return t=>e.reduce(((e,r)=>{const n=Ku(r,t);return n?`${e} ${n}`:e}),"")}function Ju(e,t){return e.score>t.score?-1:e.score<t.score?1:0}function Qu(e,t){const r=e.get("folder",""),n=t.toLowerCase().replace(r.toLowerCase(),"");return(0,dr.join)((0,dr.dirname)(tr()(n,"/")),(0,dr.basename)(n,(0,dr.extname)(t)))}function Xu(e,t){return jc(t)?(0,dr.dirname)(e).slice(t.get("folder").length+1)||"/":e}function Zu(e){var t;let r;return r=(null===(t=e.get("nested"))||void 0===t?void 0:t.get("depth"))||(0,pr.getPathDepth)(e.get("path","")),Lc(e)&&(r=function(e,t){const{structure:r}=Nc(e);return r===Ic.MULTIPLE_FOLDERS?t+1:t}(e,r)),r}class ef{constructor(e,{backendName:t,authStore:r,config:n}){if(zu(this,"implementation",void 0),zu(this,"backendName",void 0),zu(this,"config",void 0),zu(this,"authStore",void 0),zu(this,"user",void 0),zu(this,"backupSync",void 0),zu(this,"updateUserCredentials",(e=>{const t=this.authStore.retrieve();if(t&&t.backendName===this.backendName)return this.user=Uu(Uu({},t),e),this.authStore.store(this.user),this.user})),zu(this,"getToken",(()=>this.implementation.getToken())),this.deleteAnonymousBackup(),this.config=n,this.implementation=e.init(this.config,{useWorkflow:Nu(this.config),updateUserCredentials:this.updateUserCredentials,initialWorkflowStatus:eo.first()}),this.backendName=t,this.authStore=r,null===this.implementation)throw new Error("Cannot instantiate a Backend with no implementation");this.backupSync=(0,pr.asyncLock)()}async status(){let e={auth:{status:!0},api:{status:!0,statusPage:""}};for(let t=1;t<=3;t++){if(e=await this.implementation.status(),Object.values(e).every((e=>!0===e.status)))return e;await new Promise((e=>setTimeout(e,1e3*t)))}return e}currentUser(){if(this.user)return this.user;const e=this.authStore.retrieve();return e&&e.backendName===this.backendName?Promise.resolve(this.implementation.restoreUser(e)).then((e=>(this.user=Uu(Uu({},e),{},{backendName:this.backendName}),this.authStore.store(this.user),this.user))):Promise.resolve(null)}isGitBackend(){var e,t;return(null===(e=(t=this.implementation).isGitBackend)||void 0===e?void 0:e.call(t))||!1}authComponent(){return this.implementation.authComponent()}authenticate(e){return this.implementation.authenticate(e).then((e=>(this.user=Uu(Uu({},e),{},{backendName:this.backendName}),this.authStore&&this.authStore.store(this.user),this.user)))}async logout(){try{await this.implementation.logout()}catch(e){console.warn("Error during logout",e.message)}finally{this.user=null,this.authStore&&this.authStore.logout()}}async entryExist(e,t,r,n){const o=n&&await this.implementation.unpublishedEntry({collection:e.get("name"),slug:r}).catch((e=>e.name===pr.EDITORIAL_WORKFLOW_ERROR&&e.notUnderEditorialWorkflow?Promise.resolve(!1):Promise.reject(e)));return o||await this.implementation.getEntry(t).then((({data:e})=>e)).catch((()=>Promise.resolve(!1)))}async generateUniqueSlug(e,t,r,n,o){const i=r.slug;let a;a=o?Qu(e,o):function(e,t,r){const n=e.get("slug")||"{{slug}}",o=t.getIn(ci(kc(e)));if(!o)throw new Error("Collection must have a field name that is a valid entry identifier, or must have `identifier_field` set");const i=gi(r),a=new Date,s=ai(n,a,o,t,i);if(e.has("path")){const r=hi(e.get("path"));return ai(r,a,s,t,(e=>e===s?e:i(e)))}return s}(e,t,i);let s=1,l=a;for(;n.includes(l)||await this.entryExist(e,wc(e,l),l,Nu(r));)l=`${a}${ri(" ",i)}${s++}`;return l}processEntries(e,t){const r=e.map((e=>Si(t.get("name"),_c(t,e.file.path),e.file.path,{raw:e.data||"",label:e.file.label,author:e.file.author,updatedOn:e.file.updatedOn,meta:{path:Xu(e.file.path,t)}}))).map(this.entryWithFormat(t)),n=t.get("filter"),o=n?this.filterEntries({entries:r},n):r;if(Lc(t)){const e=vc(t);return Yc(t,e,o)}return o}async listEntries(e){var t;const r=vc(e);let n;const o=e.get("type");if(o===wo)n=()=>{const t=Zu(e);return this.implementation.entriesByFolder(e.get("folder"),r,t)};else{if(o!==bo)throw new Error(`Unknown collection type: ${o}`);{const t=e.get("files").map((e=>({path:e.get("file"),label:e.get("label")}))).toArray();n=()=>this.implementation.entriesByFiles(t)}}const i=await n(),a=pr.Cursor.create(i[pr.CURSOR_COMPATIBILITY_SYMBOL]).wrapData({cursorType:"collectionEntries",collection:e});return{entries:this.processEntries(i,e),pagination:null===(t=a.meta)||void 0===t?void 0:t.get("page"),cursor:a}}async listAllEntries(e){if(e.get("folder")&&this.implementation.allEntriesByFolder){const t=Zu(e),r=vc(e);return this.implementation.allEntriesByFolder(e.get("folder"),r,t,function(e){let t="";return e.get("path")&&(t=`${e.get("folder")}/${e.get("path")}`.replace(/{{.*}}/gm,"(.*)")),Lc(e)&&(t=function(e,{defaultLocale:t,structure:r}){return r===Ic.MULTIPLE_FOLDERS?`${t}\\/${e}`:r===Ic.MULTIPLE_FILES?`${e}\\.${t}\\..*`:e}(t,Nc(e))),t?new RegExp(t):void 0}(e)).then((t=>this.processEntries(t,e)))}const t=await this.listEntries(e),{entries:r}=t;let{cursor:n}=t;for(;n&&n.actions.includes("next");){const{entries:e,cursor:t}=await this.traverseCursor(n,"next");r.push(...e),n=t}return r}async search(e,t){const r=[],n=e.map((async e=>{const r=e.get("summary",""),n=qu(r);let o=[];var i;e.get("type")===bo?null===(i=e.get("files"))||void 0===i||i.forEach((e=>{const t=e.get("fields").map((e=>e.get("name"))).toArray();o=[...o,...t]})):o=[Cc(e,"title"),Cc(e,"shortTitle"),Cc(e,"author"),...n.map((t=>Wu[t]?Cc(e,"date"):t))];const a=o.filter(Boolean),s=await this.listAllEntries(e);return ur.filter(t,s,{extract:Yu(nr()(a))})})).map((e=>e.catch((e=>(r.push(e),[]))))),o=await Promise.all(n).then((e=>sr()(e)));if(r.length>0)throw new Error({message:"Errors occurred while searching entries locally!",errors:r});const i=o.filter((({score:e})=>e>5)).sort(Ju).map((e=>e.original));return{entries:i}}async query(e,t,r,n,o){let i=await this.listAllEntries(e);n&&(i=i.filter((e=>e.slug===n)));const a=function(e,t){const r=e.reduce(((e,r)=>{const n=t.reduce(((e,t)=>{const n=Hu({data:r.data,path:t});return e.push(...n),e}),[]);for(let t=0;t<n.length;t++)e.push(Uu(Uu({},r),{},{field:n[t]}));return e}),[]);return r}(i,t);let s=ur.filter(r,a,{extract:e=>Ku(e.field,e)}).sort(Ju).map((e=>e.original));void 0!==o&&o>0&&(s=s.slice(0,o));const l=function(e){const t=e.map((e=>e.field)),r={},n=e.reduce(((e,t)=>{if(!e[t.slug]){const{field:n}=t,o=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(t,Fu);e[t.slug]=o,r[t.slug]=(0,Qe.Set)()}const n=t.field.split(".");let o=e[t.slug].data;for(let e=0;e<n.length;e++)if(o=o[n[e]],Array.isArray(o)){const o=n.slice(0,e+1).join(".");r[t.slug]=r[t.slug].add(o)}return e}),{});return Object.keys(n).forEach((e=>{const o=n[e].data;for(const n of r[e].toArray()){const e=Qt()(o,n),r=e.filter(((e,r)=>t.some((e=>`${e}.`.startsWith(`${n}.${r}.`)))));r.sort(((r,o)=>{const i=e.indexOf(r),a=e.indexOf(o),s=`${n}.${i}.`,l=`${n}.${a}.`,c=t.findIndex((e=>`${e}.`.startsWith(s))),u=t.findIndex((e=>`${e}.`.startsWith(l)));return c-u})),Yt()(o,n,r)}})),Object.values(n)}(s);return{query:r,hits:l}}traverseCursor(e,t){const[r,n]=e.unwrapData(),o=r.get("collection");return this.implementation.traverseCursor(n,t).then((async({entries:e,cursor:t})=>({entries:this.processEntries(e,o),cursor:pr.Cursor.create(t).wrapData({cursorType:"collectionEntries",collection:o})})))}async getLocalDraftBackup(e,t){const r=Gu(e.get("name"),t),n=await pr.localForage.getItem(r);if(!n||!n.raw.trim())return{};const{raw:o,path:i}=n;let{mediaFiles:a=[]}=n;a=a.map((e=>e.file?Uu(Uu({},e),{},{url:URL.createObjectURL(e.file)}):e));const s=bc(e,t),l=r=>this.entryWithFormat(e)(Si(e.get("name"),t,i,{raw:r,label:s,mediaFiles:a,meta:{path:Xu(i,e)}})),c=l(o);if(Lc(e)&&n.i18n){const e=function(e,t){const r=Object.entries(e).reduce(((e,[r,{raw:n}])=>{const o=t(n);return Mc(Mc({},e),{},{[r]:{data:o.data}})}),{});return r}(n.i18n,l);c.i18n=e}return{entry:c}}async persistLocalDraftBackup(e,t){try{await this.backupSync.acquire();const r=Gu(t.get("name"),e.get("slug")),n=this.entryToRaw(t,e);if(!n.trim())return;const o=await Promise.all(e.get("mediaFiles").toJS().map((async e=>{var t;if(null!==(t=e.url)&&void 0!==t&&t.startsWith("blob:")){const t=await fetch(e.url).then((e=>e.blob()));return Uu(Uu({},e),{},{file:(0,pr.blobToFileObj)(e.name,t)})}return e})));let i;return Lc(t)&&(i=function(e,t,r){const{locales:n,defaultLocale:o}=Nc(e),i=n.filter((e=>e!==o)).reduce(((e,n)=>{const i=zc(n,o),a=t.getIn(i);if(!a)return e;const s=t.set("data",a);return Mc(Mc({},e),{},{[n]:{raw:r(s)}})}),{});return i}(t,e,(e=>this.entryToRaw(t,e)))),await pr.localForage.setItem(r,Uu({raw:n,path:e.get("path"),mediaFiles:o},i&&{i18n:i})),await pr.localForage.setItem(Gu(),n)}catch(e){console.warn("persistLocalDraftBackup",e)}finally{this.backupSync.release()}}async deleteLocalDraftBackup(e,t){try{return await this.backupSync.acquire(),await pr.localForage.removeItem(Gu(e.get("name"),t)),t&&await pr.localForage.removeItem(Gu(e.get("name"))),await this.deleteAnonymousBackup()}catch(e){console.warn("deleteLocalDraftBackup",e)}finally{this.backupSync.release()}}deleteAnonymousBackup(){return pr.localForage.removeItem(Gu())}async getEntry(e,t,r){const n=wc(t,r),o=bc(t,r),i=vc(t),a=async n=>{const i=await this.implementation.getEntry(n);let a=Si(t.get("name"),r,i.file.path,{raw:i.data,label:o,mediaFiles:[],meta:{path:Xu(i.file.path,t)}});return a=this.entryWithFormat(t)(a),a=await this.processEntry(e,t,a),a};let s;return s=Lc(t)?await async function(e,t,r,n,o){const{structure:i,locales:a,defaultLocale:s}=Nc(e);let l;if(i===Ic.SINGLE_FILE)l=Kc(await o(r),s,a);else{const c=(await Promise.all(a.map((async e=>{const a=qc(i,t,r,n,e);return{value:await o(a).catch((()=>null)),locale:e}})))).filter((e=>null!==e.value));l=Gc(e,i,s,c)}return l}(t,i,n,r,a):await a(n),s}getMedia(){return this.implementation.getMedia()}getMediaFile(e){return this.implementation.getMediaFile(e)}getMediaDisplayURL(e){if(this.implementation.getMediaDisplayURL)return this.implementation.getMediaDisplayURL(e);const t=new Error("getMediaDisplayURL is not implemented by the current backend, but the backend returned a displayURL which was not a string!");return t.displayURL=e,Promise.reject(t)}entryWithFormat(e){return t=>{const r=Hn(e,t);if(t&&void 0!==t.raw){const e=r&&cr()(r.fromFile.bind(r,t.raw))||{};return ir()(e)&&console.error(e),Object.assign(t,{data:ir()(e)?{}:e})}return r.fromFile(t)}}async processUnpublishedEntry(e,t,r){const{slug:n}=t;let o;if(e.get("type")===bo){const t=e.get("files").find((e=>(null==e?void 0:e.get("name"))===n));o=(0,dr.extname)(t.get("file"))}else o=vc(e);const i=[];if(r){const r=t.diffs.filter((e=>!e.path.endsWith(o))),a=await Promise.all(r.map((t=>this.implementation.unpublishedEntryMediaFile(e.get("name"),n,t.path,t.id))));i.push(...a.map((e=>Uu(Uu({},e),{},{draft:!0}))))}const a=Zt()(t.diffs.filter((e=>e.path.endsWith(o))),(e=>e.path.length)),s=(r,o,a)=>{const s=Si(e.get("name"),n,o,{raw:r,isModification:!a,label:e&&bc(e,n),mediaFiles:i,updatedOn:t.updatedAt,author:t.pullRequestAuthor,status:t.status,meta:{path:Xu(o,e)}});return this.entryWithFormat(e)(s)},l=async r=>{const n=await this.implementation.unpublishedEntryDataFile(e.get("name"),t.slug,r.path,r.id);return s(n,r.path,r.newFile)};if(a.length<=0){const t=await this.implementation.getEntry(wc(e,n));return s(t.data,t.file.path,!1)}if(Lc(e)){const t=wc(e,n),r=function(e,t,r,n,o){const{structure:i}=Nc(e);return i===Ic.SINGLE_FILE?o:Hc(e,t,r,n).reduce(((e,t)=>{const r=o.find((e=>e.path===t));return r?[...e,r]:[...e,{path:t,id:"",newFile:!1}]}),[])}(e,o,t,n,a);let i=await Promise.all(r.map((e=>l(e).catch((()=>null)))));return i=i.filter(Boolean),(await Yc(e,o,i))[0]}return await l(a[0])}async unpublishedEntries(e){const t=await this.implementation.unpublishedEntries(),r=(await Promise.all(t.map((async t=>{const r=await this.implementation.unpublishedEntry({id:t}),n=r.collection,o=e.find((e=>e.get("name")===n));return o?await this.processUnpublishedEntry(o,r,!1):(console.warn(`Missing collection '${n}' for unpublished entry '${t}'`),null)})))).filter(Boolean);return{pagination:0,entries:r}}async processEntry(e,t,r){const n=du(e.integrations,null,"assetStore"),o=function(e,t,r){const n=function(e,t){return e.has("folder")?gc(e.get("fields").toArray()):e.has("files")?gc((null===(r=mc(e,t))||void 0===r?void 0:r.get("fields").toArray())||[]):[];var r}(t,r.get("slug")),o=n.map((n=>ac(e,t,r,n)));return t.has("files")&&mc(t,r.get("slug"))&&o.unshift(ac(e,t,r,void 0)),t.has("media_folder")&&(t=t.delete("files"),o.unshift(ac(e,t,r,void 0))),(0,Qe.Set)(o).toArray()}(e.config,t,(0,Qe.fromJS)(r));if(o.length>0&&!n){const e=await Promise.all(o.map((e=>this.implementation.getMedia(e))));r.mediaFiles=r.mediaFiles.concat(...e)}else r.mediaFiles=r.mediaFiles.concat(e.mediaLibrary.get("files")||[]);return r}async unpublishedEntry(e,t,r){const n=await this.implementation.unpublishedEntry({collection:t.get("name"),slug:r});let o=await this.processUnpublishedEntry(t,n,!0);return o=await this.processEntry(e,t,o),o}getDeploy(e,t,r){const n=this.config.site_url;if(n&&!1!==this.config.show_preview_links)return{url:mi(n,e,t,r,this.config.slug),status:"SUCCESS"}}async getDeployPreview(e,t,r,{maxAttempts:n=1,interval:o=5e3}={}){if(!this.implementation.getDeployPreview||!1===this.config.show_preview_links)return;let i,a=0;for(;!i&&a<n;)a++,i=await this.implementation.getDeployPreview(e.get("name"),t),i||await new Promise((e=>setTimeout((()=>e(void 0)),o)));return i?{url:mi(i.url,e,t,r,this.config.slug),status:i.status?i.status.toUpperCase():""}:void 0}async persistEntry({config:e,collection:t,entryDraft:r,assetProxies:n,usedSlugs:o,unpublished:i=!1,status:a}){const s=await this.invokePreSaveEvent(r.get("entry"));let l;l=void 0===s.get("data")?s&&r.setIn(["entry","data"],s)||r:s&&r.setIn(["entry"],s)||r;const c=l.getIn(["entry","newRecord"])||!1,u=Nu(e),f=As(t,l);let p;if(c){if(!function(e){return hc[e.get("type")].allowNewEntries(e)}(t))throw new Error("Not allowed to create new entries in this collection");const r=await this.generateUniqueSlug(t,l.getIn(["entry","data"]),e,o,f),i=f||wc(t,r);p={path:i,slug:r,raw:this.entryToRaw(t,l.get("entry"))},function(e,t,r,n,o){e.map((e=>{const i=e.path,a=sc(t,r,n.get("entry").set("path",o),i,e.field);e.path=a}))}(n,e,t,l,i)}else{const e=l.getIn(["entry","slug"]),r=l.getIn(["entry","path"]);p={path:r,slug:f&&!u?Qu(t,f):e,raw:this.entryToRaw(t,l.get("entry")),newPath:f===r?void 0:f}}const{slug:d,path:h,newPath:g}=p;let m=[p];if(Lc(t)){const e=vc(t);m=function(e,t,r,n,o,i,a){const{structure:s,defaultLocale:l,locales:c}=Nc(e);if(s===Ic.SINGLE_FILE){const e=c.reduce(((e,t)=>{const n=zc(t,l);return e.set(t,r.getIn(n))}),(0,Qe.Map)({})),u=r.set("data",e);return[Mc({path:qc(s,t,o,i,c[0]),slug:i,raw:n(u)},a&&{newPath:qc(s,t,a,i,c[0])})]}return c.map((e=>{const c=zc(e,l),u=r.set("data",r.getIn(c));return Mc({path:qc(s,t,o,i,e),slug:i,raw:u.get("data")?n(u):""},a&&{newPath:qc(s,t,a,i,e)})})).filter((e=>e.raw))}(t,e,l.get("entry"),(e=>this.entryToRaw(t,e)),h,d,g)}const y=await this.currentUser(),v=Uu({newEntry:c,commitMessage:di(c?"create":"update",e,{collection:t,slug:d,path:h,authorLogin:y.login,authorName:y.name},y.useOpenAuthoring),collectionName:t.get("name"),useWorkflow:u},{unpublished:i,status:a});return u||await this.invokePrePublishEvent(l.get("entry")),await this.implementation.persistEntry({dataFiles:m,assets:n},v),await this.invokePostSaveEvent(l.get("entry")),u||await this.invokePostPublishEvent(l.get("entry")),d}async invokeEventWithEntry(e,t){const{login:r,name:n}=await this.currentUser();return await Dn({name:e,data:{entry:t,author:{login:r,name:n}}})}async invokePrePublishEvent(e){await this.invokeEventWithEntry("prePublish",e)}async invokePostPublishEvent(e){await this.invokeEventWithEntry("postPublish",e)}async invokePreUnpublishEvent(e){await this.invokeEventWithEntry("preUnpublish",e)}async invokePostUnpublishEvent(e){await this.invokeEventWithEntry("postUnpublish",e)}async invokePreSaveEvent(e){return await this.invokeEventWithEntry("preSave",e)}async invokePostSaveEvent(e){await this.invokeEventWithEntry("postSave",e)}async persistMedia(e,t){const r=await this.currentUser(),n={commitMessage:di("uploadMedia",e,{path:t.path,authorLogin:r.login,authorName:r.name},r.useOpenAuthoring)};return this.implementation.persistMedia(t,n)}async deleteEntry(e,t,r){const n=e.config,o=wc(t,r),i=vc(t);if(!Sc(t))throw new Error("Not allowed to delete entries in this collection");const a=await this.currentUser(),s=di("delete",n,{collection:t,slug:r,path:o,authorLogin:a.login,authorName:a.name},a.useOpenAuthoring),l=Jl(e.entries,t.get("name"),r);await this.invokePreUnpublishEvent(l);let c=[o];Lc(t)&&(c=Hc(t,i,o,r)),await this.implementation.deleteFiles(c,s),await this.invokePostUnpublishEvent(l)}async deleteMedia(e,t){const r=await this.currentUser(),n=di("deleteMedia",e,{path:t,authorLogin:r.login,authorName:r.name},r.useOpenAuthoring);return this.implementation.deleteFiles([t],n)}persistUnpublishedEntry(e){return this.persistEntry(Uu(Uu({},e),{},{unpublished:!0}))}updateUnpublishedEntryStatus(e,t,r){return this.implementation.updateUnpublishedEntryStatus(e,t,r)}async publishUnpublishedEntry(e){const t=e.get("collection"),r=e.get("slug");await this.invokePrePublishEvent(e),await this.implementation.publishUnpublishedEntry(t,r),await this.invokePostPublishEvent(e)}deleteUnpublishedEntry(e,t){return this.implementation.deleteUnpublishedEntry(e,t)}entryToRaw(e,t){const r=Hn(e,t.toJS()),n=this.fieldsOrder(e,t),o=function(e,t){let r=[];if(e.has("folder"))r=e.get("fields").toArray();else if(e.has("files")){const n=e.get("files").find((e=>(null==e?void 0:e.get("name"))===t.get("slug")));r=n.get("fields").toArray()}const n={};return xc(r).forEach((t=>{const r=Oc(e,t);null!=r&&r.has("comment")&&(n[t]=r.get("comment"))})),n}(e,t);let i=r.toFile(t.get("data").toJS(),n,o);return"\n"!=i.slice(-1)&&(i+="\n"),i}fieldsOrder(e,t){if(e.get("fields"))return e.get("fields").map((e=>e.get("name"))).toArray();const r=(e.get("files")||(0,Qe.List)()).filter((e=>e.get("name")===t.get("slug"))).get(0);if(null==r)throw new Error(`No file found for ${t.get("slug")} in ${e.get("name")}`);return r.get("fields").map((e=>e.get("name"))).toArray()}filterEntries(e,t){return e.entries.filter((e=>{const r=e.data[t.get("field")];return Array.isArray(r)?r.includes(t.get("value")):r===t.get("value")}))}}function tf(e){if(!e.backend.name)throw new Error("No backend defined in configuration");const{name:t}=e.backend,r=new Vu,n=Mn(t);if(n)return new ef(n,{backendName:t,authStore:r,config:e});throw new Error(`Backend not found: ${t}`)}const rf=function(){let e;return t=>e||(e=tf(t))}(),nf="AUTH_REQUEST",of="AUTH_SUCCESS",af="AUTH_FAILURE",sf="AUTH_REQUEST_DONE",lf="USE_OPEN_AUTHORING",cf="LOGOUT";function uf(){return{type:nf}}function ff(e){return{type:of,payload:e}}function pf(e){return{type:af,error:"Failed to authenticate",payload:e}}function df(){return{type:lf}}function hf(){return(e,t)=>{const r=t(),n=rf(r.config);Promise.resolve(n.logout()).then((()=>{e({type:cf}),e({type:Zi})}))}}const gf=Gt(((e,t)=>{switch(t.type){case nf:e.isFetching=!0;break;case of:e.user=t.payload;break;case af:e.error=t.payload&&t.payload.toString();break;case sf:e.isFetching=!1;break;case cf:e.user=void 0,e.isFetching=!1}}),{isFetching:!1,user:void 0,error:void 0});var mf=__webpack_require__(37994),yf=__webpack_require__.n(mf);function vf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function bf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vf(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vf(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const wf={isFetching:!1,term:"",collections:[],page:0,entryIds:[],queryHits:{},error:void 0,requests:[]},_f=Gt(((e,t)=>{switch(t.type){case Bi:return wf;case Ii:{const{page:r,searchTerm:n,searchCollections:o}=t.payload;e.isFetching=!0,e.term=n,e.collections=o,e.page=r;break}case Di:{const{entries:r,page:n}=t.payload,o=r.map((e=>({collection:e.collection,slug:e.slug})));e.isFetching=!1,e.page=n,e.entryIds=!n||isNaN(n)||0===n?o:e.entryIds.concat(o);break}case Li:{const{error:r}=t.payload;e.isFetching=!1,e.error=r;break}case Ni:{const{searchTerm:r,request:n}=t.payload;e.isFetching=!0,e.term=r,n&&e.requests.push(n);break}case Ui:e.requests=e.requests.filter((e=>e.expires>=new Date));break;case $i:{const{namespace:r,hits:n}=t.payload;e.isFetching=!1,e.queryHits[r]=n;break}case Fi:{const{error:r}=t.payload;e.isFetching=!1,e.error=r}}}),wf),Sf=_f;function xf(e){return Object.values(e).some((e=>e.isLoading))}const Of=Gt(((e,t)=>{switch(t.type){case Ha:t.payload.forEach((t=>{e[t.path]={asset:t,isLoading:!1,error:null}}));break;case Va:{const r=t.payload;e[r.path]={asset:r,isLoading:!1,error:null};break}case Ga:{const r=t.payload;delete e[r];break}case Ka:{const{path:r}=t.payload;e[r]=e[r]||{},e[r].isLoading=!0;break}case Ya:{const{path:r}=t.payload;e[r]=e[r]||{},e[r].isLoading=!1,e[r].error=null;break}case Ja:{const{path:r,error:n}=t.payload;e[r]=e[r]||{},e[r].isLoading=!1,e[r].error=n}}}),{}),Ef="DEPLOY_PREVIEW_REQUEST",kf="DEPLOY_PREVIEW_SUCCESS",Cf="DEPLOY_PREVIEW_FAILURE";function Tf(e,t){return{type:Cf,payload:{collection:e,slug:t}}}const Pf=Gt(((e,t)=>{switch(t.type){case Ef:{const{collection:r,slug:n}=t.payload,o=`${r}.${n}`;e[o]=e[o]||{},e[o].isFetching=!0;break}case kf:{const{collection:r,slug:n,url:o,status:i}=t.payload,a=`${r}.${n}`;e[a].isFetching=!1,e[a].url=o,e[a].status=i;break}case Cf:{const{collection:r,slug:n}=t.payload;e[`${r}.${n}`].isFetching=!1;break}}}),{}),jf=Pf,Rf=["DEPLOY_PREVIEW","STATUS_REQUEST","STATUS_SUCCESS","STATUS_FAILURE"];function Mf(e){return Rf.some((t=>e.type.includes(t)))}const Af=Gt(((e,t)=>{!Mf(t)&&t.type.includes("REQUEST")?e.isFetching=!0:Mf(t)||!t.type.includes("SUCCESS")&&!t.type.includes("FAILURE")?t.type===lf&&(e.useOpenAuthoring=!0):e.isFetching=!1}),{isFetching:!1,useOpenAuthoring:!1}),If="STATUS_REQUEST",Df="STATUS_SUCCESS",Lf="STATUS_FAILURE";function Nf(e){return{type:Df,payload:{status:e}}}const $f=Gt(((e,t)=>{switch(t.type){case If:e.isFetching=!0;break;case Df:e.isFetching=!1,e.status=t.payload.status;break;case Lf:e.isFetching=!1,e.error=t.payload.error}}),{isFetching:!1,status:{auth:{status:!0},api:{status:!0,statusPage:""}},error:void 0});function Ff(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Bf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ff(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ff(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Uf=Gt(((e,t)=>{switch(t.type){case Zi:e.notifications=[];break;case Xi:e.notifications=e.notifications.filter((e=>e.id!==t.id));break;case Qi:e.notifications=[...e.notifications,Bf({id:ho()},t.payload)]}}),{notifications:[]}),zf={auth:gf,config:$u,collections:function(e=dc,t){if(t.type===vu){const e=t.payload.collections;let r=(0,Qe.OrderedMap)({});return e.forEach((e=>{r=r.set(e.name,(0,Qe.fromJS)(e))})),r}return e},search:Sf,integrations:function(e=pu,t){return t.type===vu?fu(t.payload):e},entries:function(e=(0,Qe.Map)({entities:(0,Qe.Map)(),pages:(0,Qe.Map)(),sort:ql(),viewStyle:Hl()}),t){switch(t.type){case Ls:{const r=t.payload;return e.setIn(["entities",`${r.collection}.${r.slug}`,"isFetching"],!0)}case Ns:{const r=t.payload;return Ll=r.collection,Bl=r.entry.slug,e.withMutations((e=>{e.setIn(["entities",`${Ll}.${Bl}`],(0,Qe.fromJS)(r.entry));const t=e.getIn(["pages",Ll,"ids"],(0,Qe.List)());t.includes(Bl)||e.setIn(["pages",Ll,"ids"],t.unshift(Bl))}))}case Fs:{const r=t.payload,n=e.withMutations((e=>{e.setIn(["pages",r.collection,"isFetching"],!0)}));return n}case Bs:{const r=t.payload;return Ll=r.collection,Nl=r.entries,$l=r.append,Fl=r.page,e.withMutations((e=>{Nl.forEach((t=>e.setIn(["entities",`${Ll}.${t.slug}`],(0,Qe.fromJS)(t).set("isFetching",!1))));const t=(0,Qe.List)(Nl.map((e=>e.slug)));e.setIn(["pages",Ll],(0,Qe.Map)({page:Fl,ids:$l?e.getIn(["pages",Ll,"ids"],(0,Qe.List)()).concat(t):t}))}))}case Us:return e.setIn(["pages",t.meta.collection,"isFetching"],!1);case $s:{const r=t.payload;return e.withMutations((e=>{e.setIn(["entities",`${r.collection}.${r.slug}`,"isFetching"],!1),e.setIn(["entities",`${r.collection}.${r.slug}`,"error"],r.error.message)}))}case Di:{const r=t.payload;return Nl=r.entries,e.withMutations((e=>{Nl.forEach((t=>e.setIn(["entities",`${t.collection}.${t.slug}`],(0,Qe.fromJS)(t).set("isFetching",!1))))}))}case cl:{const r=t.payload;return e.withMutations((e=>{e.deleteIn(["entities",`${r.collectionName}.${r.entrySlug}`]),e.updateIn(["pages",r.collectionName,"ids"],(e=>e.filter((e=>e!==r.entrySlug))))}))}case zs:{const r=t.payload,{collection:n,key:o,direction:i}=r,a=e.withMutations((e=>{const t=(0,Qe.OrderedMap)({[o]:(0,Qe.Map)({key:o,direction:i})});e.setIn(["sort",n],t),e.setIn(["pages",n,"isFetching"],!0),e.deleteIn(["pages",n,"page"])}));return Wl(a.get("sort")),a}case Ys:case Vs:case qs:{const r=t.payload,{collection:n,entries:o}=r;Nl=o;const i=e.withMutations((e=>{Nl.forEach((t=>e.setIn(["entities",`${t.collection}.${t.slug}`],(0,Qe.fromJS)(t).set("isFetching",!1)))),e.setIn(["pages",n,"isFetching"],!1);const t=(0,Qe.List)(Nl.map((e=>e.slug)));e.setIn(["pages",n],(0,Qe.Map)({page:1,ids:t}))}));return i}case Ws:{const r=t.payload,{collection:n,key:o}=r,i=e.withMutations((e=>{e.deleteIn(["sort",n,o]),e.setIn(["pages",n,"isFetching"],!1)}));return Wl(i.get("sort")),i}case Hs:{const r=t.payload,{collection:n,filter:o}=r,i=e.withMutations((e=>{const t=e.getIn(["filter",n,o.id],(0,Qe.fromJS)(o));e.setIn(["filter",n,t.get("id")],t.set("active",!t.get("active")))}));return i}case Gs:{const r=t.payload,{collection:n,filter:o}=r,i=e.withMutations((e=>{e.deleteIn(["filter",n,o.id]),e.setIn(["pages",n,"isFetching"],!1)}));return i}case Ks:{const r=t.payload,{collection:n,group:o}=r,i=e.withMutations((e=>{const t=e.getIn(["group",n,o.id],(0,Qe.fromJS)(o));e.deleteIn(["group",n]),e.setIn(["group",n,t.get("id")],t.set("active",!t.get("active")))}));return i}case Js:{const r=t.payload,{collection:n,group:o}=r,i=e.withMutations((e=>{e.deleteIn(["group",n,o.id]),e.setIn(["pages",n,"isFetching"],!1)}));return i}case pl:{const n=t.payload,{style:o}=n,i=e.withMutations((e=>{e.setIn(["viewStyle"],o)}));return(r=i.get("viewStyle"))?localStorage.setItem(zl,r):localStorage.removeItem(zl),i}default:return e}var r},cursors:function(e=(0,Qe.fromJS)({cursorsByType:{collectionEntries:{}}}),t){switch(t.type){case Bs:return e.setIn(["cursorsByType","collectionEntries",t.payload.collection],pr.Cursor.create(t.payload.cursor).store);case Vs:case Ys:case qs:return e.deleteIn(["cursorsByType","collectionEntries",t.payload.collection]);default:return e}},editorialWorkflow:function(e=(0,Qe.Map)(),t){switch(t.type){case vu:return(t.payload&&t.payload.publish_mode)===Zn?(0,Qe.Map)({entities:(0,Qe.Map)(),pages:(0,Qe.Map)()}):e;case ss:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isFetching"],!0);case cs:return e.deleteIn(["entities",`${t.payload.collection}.${t.payload.slug}`]);case ls:return e.setIn(["entities",`${t.payload.collection}.${t.payload.entry.slug}`],(0,Qe.fromJS)(t.payload.entry));case us:return e.setIn(["pages","isFetching"],!0);case fs:return e.withMutations((e=>{t.payload.entries.forEach((t=>e.setIn(["entities",`${t.collection}.${t.slug}`],(0,Qe.fromJS)(t).set("isFetching",!1)))),e.set("pages",(0,Qe.Map)(bf(bf({},t.payload.pages),{},{ids:(0,Qe.List)(t.payload.entries.map((e=>e.slug)))})))}));case ds:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isPersisting"],!0);case hs:return e.withMutations((e=>{e.setIn(["entities",`${t.payload.collection}.${t.payload.entry.get("slug")}`],(0,Qe.fromJS)(t.payload.entry)),e.deleteIn(["entities",`${t.payload.collection}.${t.payload.entry.get("slug")}`,"isPersisting"]),e.updateIn(["pages","ids"],(0,Qe.List)(),(e=>e.push(t.payload.entry.get("slug"))))}));case gs:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isPersisting"],!1);case ms:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isUpdatingStatus"],!0);case ys:return e.withMutations((e=>{e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"status"],t.payload.newStatus),e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isUpdatingStatus"],!1)}));case vs:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isUpdatingStatus"],!1);case bs:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isPublishing"],!0);case ws:case Ss:return e.deleteIn(["entities",`${t.payload.collection}.${t.payload.slug}`]);default:return e}},entryDraft:function(e=(0,Qe.Map)(),t){switch(t.type){case Qs:return e.withMutations((e=>{e.set("entry",(0,Qe.fromJS)(t.payload.entry)),e.setIn(["entry","newRecord"],!1),e.set("fieldsMetaData",(0,Qe.Map)()),e.set("fieldsErrors",(0,Qe.Map)()),e.set("hasChanged",!1),e.set("key",ho())}));case Xs:return e.withMutations((e=>{e.set("entry",(0,Qe.fromJS)(t.payload)),e.setIn(["entry","newRecord"],!0),e.set("fieldsMetaData",(0,Qe.Map)()),e.set("fieldsErrors",(0,Qe.Map)()),e.set("hasChanged",!1),e.set("key",ho())}));case ol:return e.withMutations((e=>{const t=e.get("localBackup").get("entry");e.delete("localBackup"),e.set("entry",t),e.setIn(["entry","newRecord"],!t.get("path")),e.set("fieldsMetaData",(0,Qe.Map)()),e.set("fieldsErrors",(0,Qe.Map)()),e.set("hasChanged",!0),e.set("key",ho())}));case il:return e.withMutations((e=>{e.set("entry",(0,Qe.fromJS)(t.payload)),e.setIn(["entry","newRecord"],!0),e.set("mediaFiles",(0,Qe.List)()),e.set("fieldsMetaData",(0,Qe.Map)()),e.set("fieldsErrors",(0,Qe.Map)()),e.set("hasChanged",!0)}));case Zs:return Ms;case nl:{const{entry:r}=t.payload,n=new Qe.Map({entry:(0,Qe.fromJS)(r)});return e.set("localBackup",n)}case el:return e.withMutations((e=>{const{field:r,value:n,metadata:o,entries:i,i18n:a}=t.payload,s=r.get("name"),l=r.get("meta"),c=a&&zc(a.currentLocale,a.defaultLocale)||["data"];l?e.setIn(["entry","meta",s],n):(e.setIn(["entry",...c,s],n),a&&(e=Jc(e,r,a.locales,a.defaultLocale))),e.mergeDeepIn(["fieldsMetaData"],(0,Qe.fromJS)(o));const u=e.getIn(["entry",...c]),f=e.getIn(["entry","meta"]);e.set("hasChanged",!i.some((e=>u.equals(e.get(...c))))||!i.some((e=>f.equals(e.get("meta")))))}));case tl:return 0===t.payload.errors.length?e.deleteIn(["fieldsErrors",t.payload.uniquefieldId]):e.setIn(["fieldsErrors",t.payload.uniquefieldId],t.payload.errors);case rl:{const{uniqueFieldId:r}=t.payload;return e.deleteIn(["fieldsErrors",r])}case al:case ds:return e.setIn(["entry","isPersisting"],!0);case ll:case gs:return e.deleteIn(["entry","isPersisting"]);case ms:return e.setIn(["entry","isUpdatingStatus"],!0);case vs:case ys:return e.deleteIn(["entry","isUpdatingStatus"]);case bs:return e.setIn(["entry","isPublishing"],!0);case ws:case _s:return e.deleteIn(["entry","isPublishing"]);case sl:case hs:return e.withMutations((e=>{e.deleteIn(["entry","isPersisting"]),e.set("hasChanged",!1),e.getIn(["entry","slug"])||e.setIn(["entry","slug"],t.payload.slug)}));case cl:return e.withMutations((e=>{e.deleteIn(["entry","isPersisting"]),e.set("hasChanged",!1)}));case ul:return e.withMutations((e=>{const r=e.getIn(["entry","mediaFiles"]);e.setIn(["entry","mediaFiles"],r.filterNot((e=>e.get("id")===t.payload.id)).insert(0,(0,Qe.fromJS)(t.payload))),e.set("hasChanged",!0)}));case fl:return e.withMutations((e=>{const r=e.getIn(["entry","mediaFiles"]);e.setIn(["entry","mediaFiles"],r.filterNot((e=>e.get("id")===t.payload.id))),e.set("hasChanged",!0)}));default:return e}},medias:Of,mediaLibrary:function(e=(0,Qe.Map)(za),t){switch(t.type){case aa:return e.withMutations((e=>{e.set("externalLibrary",t.payload),e.set("showMediaButton",t.payload.enableStandalone())}));case oa:{const{controlID:r,forImage:n,privateUpload:o,config:i,field:a,value:s,replaceIndex:l}=t.payload,c=i||(0,Qe.Map)();return e.get("privateUpload")!==o?(0,Qe.Map)({isVisible:!0,forImage:n,controlID:r,canInsert:!!r,privateUpload:o,config:c,controlMedia:(0,Qe.Map)(),displayURLs:(0,Qe.Map)(),field:a,value:s,replaceIndex:l}):e.withMutations((e=>{e.set("isVisible",!0),e.set("forImage",null!=n&&n),e.set("controlID",null!=r?r:""),e.set("canInsert",!!r),e.set("privateUpload",o),e.set("config",c),e.set("field",null!=a?a:""),e.set("value",""==s&&c.get("multiple")?[]:null!=s?s:""),e.set("replaceIndex",null!=l&&l)}))}case ia:return e.set("isVisible",!1);case sa:{const{mediaPath:r}=t.payload,n=e.get("controlID"),o=e.get("value");if(!Array.isArray(o))return e.withMutations((e=>{e.setIn(["controlMedia",n],r)}));const i=e.get("replaceIndex"),a=Array.isArray(r)?r:[r],s=o;return"number"==typeof i?s[i]=a[0]:s.push(...a),e.withMutations((e=>{e.setIn(["controlMedia",n],s)}))}case la:{const r=t.payload.controlID;return e.setIn(["controlMedia",r],"")}case ca:return e.withMutations((e=>{e.set("isLoading",!0),e.set("isPaginating",t.payload.page>1)}));case ua:{const{files:r=[],page:n,canPaginate:o,dynamicSearch:i,dynamicSearchQuery:a,privateUpload:s}=t.payload;if(e.get("privateUpload")!==s)return e;const l=r.map((e=>Ua(Ua({},e),{},{key:ho()})));return e.withMutations((e=>{if(e.set("isLoading",!1),e.set("isPaginating",!1),e.set("page",null!=n?n:1),e.set("hasNextPage",!!(o&&r.length>0)),e.set("dynamicSearch",null!=i&&i),e.set("dynamicSearchQuery",null!=a?a:""),e.set("dynamicSearchActive",!!a),n&&n>1){const t=e.get("files").concat(l);e.set("files",t)}else e.set("files",l)}))}case fa:return e.get("privateUpload")!==t.payload.privateUpload?e:e.set("isLoading",!1);case pa:return e.set("isPersisting",!0);case da:{const{file:r,privateUpload:n}=t.payload;return e.get("privateUpload")!==n?e:e.withMutations((e=>{const t=[Ua(Ua({},r),{},{key:ho()}),...e.get("files")];e.set("files",t),e.set("isPersisting",!1)}))}case ha:return e.get("privateUpload")!==t.payload.privateUpload?e:e.set("isPersisting",!1);case ga:return e.set("isDeleting",!0);case ma:{const{file:r,privateUpload:n}=t.payload,{key:o,id:i}=r;return e.get("privateUpload")!==n?e:e.withMutations((e=>{const t=e.get("files").filter((e=>o?e.key!==o:e.id!==i));e.set("files",t),e.deleteIn(["displayURLs",i]),e.set("isDeleting",!1)}))}case ya:return e.get("privateUpload")!==t.payload.privateUpload?e:e.set("isDeleting",!1);case va:return e.setIn(["displayURLs",t.payload.key,"isFetching"],!0);case ba:{const r=["displayURLs",t.payload.key];return e.setIn([...r,"isFetching"],!1).setIn([...r,"url"],t.payload.url)}case wa:{const r=["displayURLs",t.payload.key];return e.setIn([...r,"isFetching"],!1).setIn([...r,"err"],t.payload.err||!0).deleteIn([...r,"url"])}default:return e}},deploys:jf,globalUI:Af,status:$f,notifications:Uf};function qf(e,t,r){return Jl(e.entries,t,r)}function Wf(e,t){return Ql(e.entries,t)}function Hf(e,t,r){return function(e,t,r){return e[`${t}.${r}`]}(e.deploys,t,r)}function Vf(e,t,r){return function(e,t,r){return e&&e.getIn(["entities",`${t}.${r}`])}(e.editorialWorkflow,t,r)}function Gf(e,t,r){return du(e.integrations,t,r)}function Kf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const Yf=(0,He.MT)((0,He.UY)(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Kf(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kf(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},zf)),(0,Ve.Uo)((0,He.md)(Ye,(({dispatch:e,getState:t})=>{let r=[];return n=>o=>{if(o.type===Je)return r.push(o),null;const i=n(o);return function(n){const o=[],i=[];for(const e of r)e.predicate(n)?o.push(e):i.push(e);r=i;for(const r of o)r.run(e,t,n)}(o),i}}))));var Jf=__webpack_require__(98537),Qf=__webpack_require__.n(Jf);function Xf(e){return Qf()({},Ln("en"),Ln(e))}function Zf(e){var t=null;return function(){return null==t&&(t=e()),t}}function ep(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function tp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var rp=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),tp(this,"entered",[]),tp(this,"isNodeInDocument",void 0),this.isNodeInDocument=t}var t,r;return t=e,r=[{key:"enter",value:function(e){var t=this,r=this.entered.length;return this.entered=function(e,t){var r=new Set,n=function(e){return r.add(e)};e.forEach(n),t.forEach(n);var o=[];return r.forEach((function(e){return o.push(e)})),o}(this.entered.filter((function(r){return t.isNodeInDocument(r)&&(!r.contains||r.contains(e))})),[e]),0===r&&this.entered.length>0}},{key:"leave",value:function(e){var t,r,n=this.entered.length;return this.entered=(t=this.entered.filter(this.isNodeInDocument),r=e,t.filter((function(e){return e!==r}))),n>0&&0===this.entered.length}},{key:"reset",value:function(){this.entered=[]}}],r&&ep(t.prototype,r),e}(),np=Zf((function(){return/firefox/i.test(navigator.userAgent)})),op=Zf((function(){return Boolean(window.safari)}));function ip(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ap(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var sp=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ap(this,"xs",void 0),ap(this,"ys",void 0),ap(this,"c1s",void 0),ap(this,"c2s",void 0),ap(this,"c3s",void 0);for(var n=t.length,o=[],i=0;i<n;i++)o.push(i);o.sort((function(e,r){return t[e]<t[r]?-1:1}));for(var a,s,l=[],c=[],u=[],f=0;f<n-1;f++)a=t[f+1]-t[f],s=r[f+1]-r[f],c.push(a),l.push(s),u.push(s/a);for(var p=[u[0]],d=0;d<c.length-1;d++){var h=u[d],g=u[d+1];if(h*g<=0)p.push(0);else{a=c[d];var m=c[d+1],y=a+m;p.push(3*y/((y+m)/h+(y+a)/g))}}p.push(u[u.length-1]);for(var v,b=[],w=[],_=0;_<p.length-1;_++){v=u[_];var S=p[_],x=1/c[_],O=S+p[_+1]-v-v;b.push((v-S-O)*x),w.push(O*x*x)}this.xs=t,this.ys=r,this.c1s=p,this.c2s=b,this.c3s=w}var t,r;return t=e,r=[{key:"interpolate",value:function(e){var t=this.xs,r=this.ys,n=this.c1s,o=this.c2s,i=this.c3s,a=t.length-1;if(e===t[a])return r[a];for(var s,l=0,c=i.length-1;l<=c;){var u=t[s=Math.floor(.5*(l+c))];if(u<e)l=s+1;else{if(!(u>e))return r[s];c=s-1}}var f=e-t[a=Math.max(0,c)],p=f*f;return r[a]+n[a]*f+o[a]*p+i[a]*f*p}}],r&&ip(t.prototype,r),e}(),lp=1;function cp(e){var t=e.nodeType===lp?e:e.parentElement;if(!t)return null;var r=t.getBoundingClientRect(),n=r.top;return{x:r.left,y:n}}function up(e){return{x:e.clientX,y:e.clientY}}var fp,pp="__NATIVE_FILE__",dp="__NATIVE_URL__",hp="__NATIVE_TEXT__",gp="__NATIVE_HTML__";function mp(e,t,r){var n=t.reduce((function(t,r){return t||e.getData(r)}),"");return null!=n?n:r}function yp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var vp=(yp(fp={},pp,{exposeProperties:{files:function(e){return Array.prototype.slice.call(e.files)},items:function(e){return e.items},dataTransfer:function(e){return e}},matchesTypes:["Files"]}),yp(fp,gp,{exposeProperties:{html:function(e,t){return mp(e,t,"")},dataTransfer:function(e){return e}},matchesTypes:["Html","text/html"]}),yp(fp,dp,{exposeProperties:{urls:function(e,t){return mp(e,t,"").split("\n")},dataTransfer:function(e){return e}},matchesTypes:["Url","text/uri-list"]}),yp(fp,hp,{exposeProperties:{text:function(e,t){return mp(e,t,"")},dataTransfer:function(e){return e}},matchesTypes:["Text","text/plain"]}),fp);function bp(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function wp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var _p=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),wp(this,"item",void 0),wp(this,"config",void 0),this.config=t,this.item={},this.initializeExposedProperties()}var t,r;return t=e,(r=[{key:"initializeExposedProperties",value:function(){var e=this;Object.keys(this.config.exposeProperties).forEach((function(t){Object.defineProperty(e.item,t,{configurable:!0,enumerable:!0,get:function(){return console.warn("Browser doesn't allow reading \"".concat(t,'" until the drop event.')),null}})}))}},{key:"loadDataTransfer",value:function(e){var t=this;if(e){var r={};Object.keys(this.config.exposeProperties).forEach((function(n){r[n]={value:t.config.exposeProperties[n](e,t.config.matchesTypes),configurable:!0,enumerable:!0}})),Object.defineProperties(this.item,r)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(e,t){return t===e.getSourceId()}},{key:"endDrag",value:function(){}}])&&bp(t.prototype,r),e}();function Sp(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(vp).filter((function(e){return vp[e].matchesTypes.some((function(e){return t.indexOf(e)>-1}))}))[0]||null}function xp(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Op(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ep=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Op(this,"ownerDocument",null),Op(this,"globalContext",void 0),Op(this,"optionsArgs",void 0),this.globalContext=t,this.optionsArgs=r}var t,r;return t=e,(r=[{key:"window",get:function(){return this.globalContext?this.globalContext:"undefined"!=typeof window?window:void 0}},{key:"document",get:function(){var e;return null!==(e=this.globalContext)&&void 0!==e&&e.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var e;return(null===(e=this.optionsArgs)||void 0===e?void 0:e.rootElement)||this.window}}])&&xp(t.prototype,r),e}();function kp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Cp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kp(Object(r),!0).forEach((function(t){Pp(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Tp(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Pp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var jp=function(){function t(e,r,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Pp(this,"options",void 0),Pp(this,"actions",void 0),Pp(this,"monitor",void 0),Pp(this,"registry",void 0),Pp(this,"enterLeaveCounter",void 0),Pp(this,"sourcePreviewNodes",new Map),Pp(this,"sourcePreviewNodeOptions",new Map),Pp(this,"sourceNodes",new Map),Pp(this,"sourceNodeOptions",new Map),Pp(this,"dragStartSourceIds",null),Pp(this,"dropTargetIds",[]),Pp(this,"dragEnterTargetIds",[]),Pp(this,"currentNativeSource",null),Pp(this,"currentNativeHandle",null),Pp(this,"currentDragSourceNode",null),Pp(this,"altKeyPressed",!1),Pp(this,"mouseMoveTimeoutTimer",null),Pp(this,"asyncEndDragFrameId",null),Pp(this,"dragOverTargetIds",null),Pp(this,"lastClientOffset",null),Pp(this,"hoverRafId",null),Pp(this,"getSourceClientOffset",(function(e){var t=o.sourceNodes.get(e);return t&&cp(t)||null})),Pp(this,"endDragNativeItem",(function(){o.isDraggingNativeItem()&&(o.actions.endDrag(),o.currentNativeHandle&&o.registry.removeSource(o.currentNativeHandle),o.currentNativeHandle=null,o.currentNativeSource=null)})),Pp(this,"isNodeInDocument",(function(e){return Boolean(e&&o.document&&o.document.body&&o.document.body.contains(e))})),Pp(this,"endDragIfSourceWasRemovedFromDOM",(function(){var e=o.currentDragSourceNode;null==e||o.isNodeInDocument(e)||o.clearCurrentDragSourceNode()&&o.monitor.isDragging()&&o.actions.endDrag()})),Pp(this,"handleTopDragStartCapture",(function(){o.clearCurrentDragSourceNode(),o.dragStartSourceIds=[]})),Pp(this,"handleTopDragStart",(function(e){if(!e.defaultPrevented){var t=o.dragStartSourceIds;o.dragStartSourceIds=null;var r=up(e);o.monitor.isDragging()&&o.actions.endDrag(),o.actions.beginDrag(t||[],{publishSource:!1,getSourceClientOffset:o.getSourceClientOffset,clientOffset:r});var n=e.dataTransfer,i=Sp(n);if(o.monitor.isDragging()){if(n&&"function"==typeof n.setDragImage){var a=o.monitor.getSourceId(),s=o.sourceNodes.get(a),l=o.sourcePreviewNodes.get(a)||s;if(l){var c=o.getCurrentSourcePreviewNodeOptions(),u=function(e,t,r,n,o){var i,a,s="IMG"===(i=t).nodeName&&(np()||!(null!==(a=document.documentElement)&&void 0!==a&&a.contains(i))),l=cp(s?e:t),c={x:r.x-l.x,y:r.y-l.y},u=e.offsetWidth,f=e.offsetHeight,p=n.anchorX,d=n.anchorY,h=function(e,t,r,n){var o=e?t.width:r,i=e?t.height:n;return op()&&e&&(i/=window.devicePixelRatio,o/=window.devicePixelRatio),{dragPreviewWidth:o,dragPreviewHeight:i}}(s,t,u,f),g=h.dragPreviewWidth,m=h.dragPreviewHeight,y=o.offsetX,v=o.offsetY,b=0===v||v;return{x:0===y||y?y:new sp([0,.5,1],[c.x,c.x/u*g,c.x+g-u]).interpolate(p),y:b?v:function(){var e=new sp([0,.5,1],[c.y,c.y/f*m,c.y+m-f]).interpolate(d);return op()&&s&&(e+=(window.devicePixelRatio-1)*m),e}()}}(s,l,r,{anchorX:c.anchorX,anchorY:c.anchorY},{offsetX:c.offsetX,offsetY:c.offsetY});n.setDragImage(l,u.x,u.y)}}try{null==n||n.setData("application/json",{})}catch(e){}o.setCurrentDragSourceNode(e.target),o.getCurrentSourcePreviewNodeOptions().captureDraggingState?o.actions.publishDragSource():setTimeout((function(){return o.actions.publishDragSource()}),0)}else if(i)o.beginDragNativeItem(i);else{if(n&&!n.types&&(e.target&&!e.target.hasAttribute||!e.target.hasAttribute("draggable")))return;e.preventDefault()}}})),Pp(this,"handleTopDragEndCapture",(function(){o.clearCurrentDragSourceNode()&&o.monitor.isDragging()&&o.actions.endDrag()})),Pp(this,"handleTopDragEnterCapture",(function(e){if(o.dragEnterTargetIds=[],o.enterLeaveCounter.enter(e.target)&&!o.monitor.isDragging()){var t=e.dataTransfer,r=Sp(t);r&&o.beginDragNativeItem(r,t)}})),Pp(this,"handleTopDragEnter",(function(e){var t=o.dragEnterTargetIds;o.dragEnterTargetIds=[],o.monitor.isDragging()&&(o.altKeyPressed=e.altKey,t.length>0&&o.actions.hover(t,{clientOffset:up(e)}),t.some((function(e){return o.monitor.canDropOnTarget(e)}))&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=o.getCurrentDropEffect())))})),Pp(this,"handleTopDragOverCapture",(function(){o.dragOverTargetIds=[]})),Pp(this,"handleTopDragOver",(function(e){var t=o.dragOverTargetIds;if(o.dragOverTargetIds=[],!o.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer&&(e.dataTransfer.dropEffect="none"));o.altKeyPressed=e.altKey,o.lastClientOffset=up(e),null===o.hoverRafId&&"undefined"!=typeof requestAnimationFrame&&(o.hoverRafId=requestAnimationFrame((function(){o.monitor.isDragging()&&o.actions.hover(t||[],{clientOffset:o.lastClientOffset}),o.hoverRafId=null}))),(t||[]).some((function(e){return o.monitor.canDropOnTarget(e)}))?(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=o.getCurrentDropEffect())):o.isDraggingNativeItem()?e.preventDefault():(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="none"))})),Pp(this,"handleTopDragLeaveCapture",(function(e){o.isDraggingNativeItem()&&e.preventDefault(),o.enterLeaveCounter.leave(e.target)&&o.isDraggingNativeItem()&&setTimeout((function(){return o.endDragNativeItem()}),0)})),Pp(this,"handleTopDropCapture",(function(e){var t;o.dropTargetIds=[],o.isDraggingNativeItem()?(e.preventDefault(),null===(t=o.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer)):Sp(e.dataTransfer)&&e.preventDefault(),o.enterLeaveCounter.reset()})),Pp(this,"handleTopDrop",(function(e){var t=o.dropTargetIds;o.dropTargetIds=[],o.actions.hover(t,{clientOffset:up(e)}),o.actions.drop({dropEffect:o.getCurrentDropEffect()}),o.isDraggingNativeItem()?o.endDragNativeItem():o.monitor.isDragging()&&o.actions.endDrag()})),Pp(this,"handleSelectStart",(function(e){var t=e.target;"function"==typeof t.dragDrop&&("INPUT"===t.tagName||"SELECT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||(e.preventDefault(),t.dragDrop()))})),this.options=new Ep(r,n),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new rp(this.isNodeInDocument)}var r,n;return r=t,(n=[{key:"profile",value:function(){var e,t;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:(null===(e=this.dragStartSourceIds)||void 0===e?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:(null===(t=this.dragOverTargetIds)||void 0===t?void 0:t.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var e=this.rootElement;if(void 0!==e){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}},{key:"teardown",value:function(){var e,t=this.rootElement;void 0!==t&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId&&(null===(e=this.window)||void 0===e||e.cancelAnimationFrame(this.asyncEndDragFrameId)))}},{key:"connectDragPreview",value:function(e,t,r){var n=this;return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,t),function(){n.sourcePreviewNodes.delete(e),n.sourcePreviewNodeOptions.delete(e)}}},{key:"connectDragSource",value:function(e,t,r){var n=this;this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,r);var o=function(t){return n.handleDragStart(t,e)},i=function(e){return n.handleSelectStart(e)};return t.setAttribute("draggable","true"),t.addEventListener("dragstart",o),t.addEventListener("selectstart",i),function(){n.sourceNodes.delete(e),n.sourceNodeOptions.delete(e),t.removeEventListener("dragstart",o),t.removeEventListener("selectstart",i),t.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(e,t){var r=this,n=function(t){return r.handleDragEnter(t,e)},o=function(t){return r.handleDragOver(t,e)},i=function(t){return r.handleDrop(t,e)};return t.addEventListener("dragenter",n),t.addEventListener("dragover",o),t.addEventListener("drop",i),function(){t.removeEventListener("dragenter",n),t.removeEventListener("dragover",o),t.removeEventListener("drop",i)}}},{key:"addEventListeners",value:function(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var e=this.monitor.getSourceId(),t=this.sourceNodeOptions.get(e);return Cp({dropEffect:this.altKeyPressed?"copy":"move"},t||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var e=this.monitor.getSourceId();return Cp({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}},{key:"isDraggingNativeItem",value:function(){var t=this.monitor.getItemType();return Object.keys(e).some((function(r){return e[r]===t}))}},{key:"beginDragNativeItem",value:function(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=function(e,t){var r=new _p(vp[e]);return r.loadDataTransfer(t),r}(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(e){var t=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.mouseMoveTimeoutTimer=setTimeout((function(){var e;return null===(e=t.rootElement)||void 0===e?void 0:e.addEventListener("mousemove",t.endDragIfSourceWasRemovedFromDOM,!0)}),1e3)}},{key:"clearCurrentDragSourceNode",value:function(){var e;return!!this.currentDragSourceNode&&(this.currentDragSourceNode=null,this.rootElement&&(null===(e=this.window)||void 0===e||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)),this.mouseMoveTimeoutTimer=null,!0)}},{key:"handleDragStart",value:function(e,t){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(t))}},{key:"handleDragEnter",value:function(e,t){this.dragEnterTargetIds.unshift(t)}},{key:"handleDragOver",value:function(e,t){null===this.dragOverTargetIds&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}},{key:"handleDrop",value:function(e,t){this.dropTargetIds.unshift(t)}}])&&Tp(r.prototype,n),t}(),Rp=function(e,t,r){return new jp(e,t,r)};function Mp(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];if(!e){var i;if(void 0===t)i=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;(i=new Error(t.replace(/%s/g,(function(){return n[a++]})))).name="Invariant Violation"}throw i.framesToPop=1,i}}function Ap(e,t,r){var n=r.getRegistry(),o=n.addTarget(e,t);return[o,function(){return n.removeTarget(o)}]}function Ip(e,t,r){var n=r.getRegistry(),o=n.addSource(e,t);return[o,function(){return n.removeSource(o)}]}function Dp(e){var r={};return Object.keys(e).forEach((function(n){var o=e[n];if(n.endsWith("Ref"))r[n]=e[n];else{var i=function(e){return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!(0,t.isValidElement)(r)){var o=r;return e(o,n),o}var i=r;!function(e){if("string"!=typeof e.type){var t=e.type.displayName||e.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(t," into a <div>, or turn it into a ")+"drag source or a drop target itself.")}}(i);var a=n?function(t){return e(t,n)}:e;return function(e,r){var n=e.ref;return Mp("string"!=typeof n,"Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?(0,t.cloneElement)(e,{ref:function(e){Lp(n,e),Lp(r,e)}}):(0,t.cloneElement)(e,{ref:r})}(i,a)}}(o);r[n]=function(){return i}}})),r}function Lp(e,t){"function"==typeof e?e(t):e.current=t}function Np(e){return Np="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Np(e)}function $p(e){return null!==e&&"object"===Np(e)&&Object.prototype.hasOwnProperty.call(e,"current")}function Fp(e,t,r,n){var o=r?r.call(n,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l<i.length;l++){var c=i[l];if(!s(c))return!1;var u=e[c],f=t[c];if(!1===(o=r?r.call(n,u,f,c):void 0)||void 0===o&&u!==f)return!1}return!0}function Bp(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Up(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var zp=function(){function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Up(this,"hooks",Dp({dragSource:function(e,t){r.clearDragSource(),r.dragSourceOptions=t||null,$p(e)?r.dragSourceRef=e:r.dragSourceNode=e,r.reconnectDragSource()},dragPreview:function(e,t){r.clearDragPreview(),r.dragPreviewOptions=t||null,$p(e)?r.dragPreviewRef=e:r.dragPreviewNode=e,r.reconnectDragPreview()}})),Up(this,"handlerId",null),Up(this,"dragSourceRef",null),Up(this,"dragSourceNode",void 0),Up(this,"dragSourceOptionsInternal",null),Up(this,"dragSourceUnsubscribe",void 0),Up(this,"dragPreviewRef",null),Up(this,"dragPreviewNode",void 0),Up(this,"dragPreviewOptionsInternal",null),Up(this,"dragPreviewUnsubscribe",void 0),Up(this,"lastConnectedHandlerId",null),Up(this,"lastConnectedDragSource",null),Up(this,"lastConnectedDragSourceOptions",null),Up(this,"lastConnectedDragPreview",null),Up(this,"lastConnectedDragPreviewOptions",null),Up(this,"backend",void 0),this.backend=t}var t,r;return t=e,(r=[{key:"receiveHandlerId",value:function(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}},{key:"connectTarget",get:function(){return this.dragSource}},{key:"dragSourceOptions",get:function(){return this.dragSourceOptionsInternal},set:function(e){this.dragSourceOptionsInternal=e}},{key:"dragPreviewOptions",get:function(){return this.dragPreviewOptionsInternal},set:function(e){this.dragPreviewOptionsInternal=e}},{key:"reconnect",value:function(){this.reconnectDragSource(),this.reconnectDragPreview()}},{key:"reconnectDragSource",value:function(){var e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();t&&this.disconnectDragSource(),this.handlerId&&(e?t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)):this.lastConnectedDragSource=e)}},{key:"reconnectDragPreview",value:function(){var e=this.dragPreview,t=this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();t&&this.disconnectDragPreview(),this.handlerId&&(e?t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=e,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,e,this.dragPreviewOptions)):this.lastConnectedDragPreview=e)}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didConnectedDragSourceChange",value:function(){return this.lastConnectedDragSource!==this.dragSource}},{key:"didConnectedDragPreviewChange",value:function(){return this.lastConnectedDragPreview!==this.dragPreview}},{key:"didDragSourceOptionsChange",value:function(){return!Fp(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!Fp(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}},{key:"disconnectDragSource",value:function(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}},{key:"disconnectDragPreview",value:function(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}},{key:"dragSource",get:function(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}},{key:"dragPreview",get:function(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}},{key:"clearDragSource",value:function(){this.dragSourceNode=null,this.dragSourceRef=null}},{key:"clearDragPreview",value:function(){this.dragPreviewNode=null,this.dragPreviewRef=null}}])&&Bp(t.prototype,r),e}();function qp(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Wp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Hp=!1,Vp=!1,Gp=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Wp(this,"internalMonitor",void 0),Wp(this,"sourceId",null),this.internalMonitor=t.getMonitor()}var t,r;return t=e,(r=[{key:"receiveHandlerId",value:function(e){this.sourceId=e}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){Mp(!Hp,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Hp=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Hp=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;Mp(!Vp,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Vp=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Vp=!1}}},{key:"subscribeToStateChange",value:function(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}},{key:"isDraggingSource",value:function(e){return this.internalMonitor.isDraggingSource(e)}},{key:"isOverTarget",value:function(e,t){return this.internalMonitor.isOverTarget(e,t)}},{key:"getTargetIds",value:function(){return this.internalMonitor.getTargetIds()}},{key:"isSourcePublic",value:function(){return this.internalMonitor.isSourcePublic()}},{key:"getSourceId",value:function(){return this.internalMonitor.getSourceId()}},{key:"subscribeToOffsetChange",value:function(e){return this.internalMonitor.subscribeToOffsetChange(e)}},{key:"canDragSource",value:function(e){return this.internalMonitor.canDragSource(e)}},{key:"canDropOnTarget",value:function(e){return this.internalMonitor.canDropOnTarget(e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}])&&qp(t.prototype,r),e}();function Kp(e){return Kp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kp(e)}function Yp(e){var t=e.current;return null==t?null:t.decoratedRef?t.decoratedRef.current:t}function Jp(e){return"function"==typeof e}function Qp(){}function Xp(e){if(!function(e){return"object"===Kp(e)&&null!==e}(e))return!1;if(null===Object.getPrototypeOf(e))return!0;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Zp(e,t){return"string"==typeof e||"symbol"===Kp(e)||!!t&&Array.isArray(e)&&e.every((function(e){return Zp(e,!1)}))}var ed=__webpack_require__(52322),td=(0,t.createContext)({dragDropManager:void 0});function rd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function od(e,t,r){return t&&nd(e.prototype,t),r&&nd(e,r),e}function id(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ad=function(){function e(t){rd(this,e),id(this,"isDisposed",!1),id(this,"action",void 0),this.action=Jp(t)?t:Qp}return od(e,[{key:"dispose",value:function(){this.isDisposed||(this.action(),this.isDisposed=!0)}}],[{key:"isDisposable",value:function(e){return Boolean(e&&Jp(e.dispose))}},{key:"_fixup",value:function(t){return e.isDisposable(t)?t:e.empty}},{key:"create",value:function(t){return new e(t)}}]),e}();id(ad,"empty",{dispose:Qp});var sd=function(){function e(){rd(this,e),id(this,"isDisposed",!1),id(this,"disposables",void 0);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];this.disposables=r}return od(e,[{key:"add",value:function(e){this.isDisposed?e.dispose():this.disposables.push(e)}},{key:"remove",value:function(e){var t=!1;if(!this.isDisposed){var r=this.disposables.indexOf(e);-1!==r&&(t=!0,this.disposables.splice(r,1),e.dispose())}return t}},{key:"clear",value:function(){if(!this.isDisposed){for(var e=this.disposables.length,t=new Array(e),r=0;r<e;r++)t[r]=this.disposables[r];this.disposables=[];for(var n=0;n<e;n++)t[n].dispose()}}},{key:"dispose",value:function(){if(!this.isDisposed){this.isDisposed=!0;for(var e=this.disposables.length,t=new Array(e),r=0;r<e;r++)t[r]=this.disposables[r];this.disposables=[];for(var n=0;n<e;n++)t[n].dispose()}}}]),e}(),ld=function(){function e(){rd(this,e),id(this,"isDisposed",!1),id(this,"current",void 0)}return od(e,[{key:"getDisposable",value:function(){return this.current}},{key:"setDisposable",value:function(e){var t=this.isDisposed;if(!t){var r=this.current;this.current=e,r&&r.dispose()}t&&e&&e.dispose()}},{key:"dispose",value:function(){if(!this.isDisposed){this.isDisposed=!0;var e=this.current;this.current=void 0,e&&e.dispose()}}}]),e}();function cd(e){return cd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cd(e)}function ud(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function fd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function pd(e,t){return pd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},pd(e,t)}function dd(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hd(e){return hd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},hd(e)}function gd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function md(e){var r=e.DecoratedComponent,n=e.createHandler,o=e.createMonitor,i=e.createConnector,a=e.registerHandler,s=e.containerDisplayName,l=e.getType,c=e.collect,u=e.options.arePropsEqual,f=void 0===u?Fp:u,p=r,d=r.displayName||r.name||"Component",h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&pd(e,t)}(m,e);var r,s,u,h,g=(u=m,h=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=hd(u);if(h){var r=hd(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===cd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return dd(e)}(this,e)});function m(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,m),gd(dd(r=g.call(this,e)),"decoratedRef",(0,t.createRef)()),gd(dd(r),"handlerId",void 0),gd(dd(r),"manager",void 0),gd(dd(r),"handlerMonitor",void 0),gd(dd(r),"handlerConnector",void 0),gd(dd(r),"handler",void 0),gd(dd(r),"disposable",void 0),gd(dd(r),"currentType",void 0),gd(dd(r),"handleChange",(function(){var e=r.getCurrentState();Fp(e,r.state)||r.setState(e)})),r.disposable=new ld,r.receiveProps(e),r.dispose(),r}return r=m,s=[{key:"getHandlerId",value:function(){return this.handlerId}},{key:"getDecoratedComponentInstance",value:function(){return Mp(this.decoratedRef.current,"In order to access an instance of the decorated component, it must either be a class component or use React.forwardRef()"),this.decoratedRef.current}},{key:"shouldComponentUpdate",value:function(e,t){return!f(e,this.props)||!Fp(t,this.state)}},{key:"componentDidMount",value:function(){this.disposable=new ld,this.currentType=void 0,this.receiveProps(this.props),this.handleChange()}},{key:"componentDidUpdate",value:function(e){f(this.props,e)||(this.receiveProps(this.props),this.handleChange())}},{key:"componentWillUnmount",value:function(){this.dispose()}},{key:"receiveProps",value:function(e){this.handler&&(this.handler.receiveProps(e),this.receiveType(l(e)))}},{key:"receiveType",value:function(e){if(this.handlerMonitor&&this.manager&&this.handlerConnector&&e!==this.currentType){this.currentType=e;var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ud(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ud(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(a(e,this.handler,this.manager),2),r=t[0],n=t[1];this.handlerId=r,this.handlerMonitor.receiveHandlerId(r),this.handlerConnector.receiveHandlerId(r);var o=this.manager.getMonitor().subscribeToStateChange(this.handleChange,{handlerIds:[r]});this.disposable.setDisposable(new sd(new ad(o),new ad(n)))}}},{key:"dispose",value:function(){this.disposable.dispose(),this.handlerConnector&&this.handlerConnector.receiveHandlerId(null)}},{key:"getCurrentState",value:function(){return this.handlerConnector?c(this.handlerConnector.hooks,this.handlerMonitor,this.props):{}}},{key:"render",value:function(){var e=this;return(0,ed.jsx)(td.Consumer,{children:function(t){var r,n,o=t.dragDropManager;return e.receiveDragDropManager(o),"undefined"!=typeof requestAnimationFrame&&requestAnimationFrame((function(){var t;return null===(t=e.handlerConnector)||void 0===t?void 0:t.reconnect()})),(0,ed.jsx)(p,Object.assign({},e.props,e.getCurrentState(),{ref:(r=p,(n=r)&&n.prototype&&"function"==typeof n.prototype.render||function(e){var t;return"Symbol(react.forward_ref)"===(null==e||null===(t=e.$$typeof)||void 0===t?void 0:t.toString())}(r)?e.decoratedRef:null)}),void 0)}},void 0)}},{key:"receiveDragDropManager",value:function(e){void 0===this.manager&&(Mp(void 0!==e,"Could not find the drag and drop manager in the context of %s. Make sure to render a DndProvider component in your top-level component. Read more: http://react-dnd.github.io/react-dnd/docs/troubleshooting#could-not-find-the-drag-and-drop-manager-in-the-context",d,d),void 0!==e&&(this.manager=e,this.handlerMonitor=o(e),this.handlerConnector=i(e.getBackend()),this.handler=n(this.handlerMonitor,this.decoratedRef)))}}],s&&fd(r.prototype,s),m}(t.Component);return gd(h,"DecoratedComponent",r),gd(h,"displayName","".concat(s,"(").concat(d,")")),m()(h,r)}function yd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function vd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var bd=["canDrag","beginDrag","isDragging","endDrag"],wd=["beginDrag"],_d=function(){function e(t,r,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),vd(this,"props",null),vd(this,"spec",void 0),vd(this,"monitor",void 0),vd(this,"ref",void 0),vd(this,"beginDrag",(function(){if(o.props)return o.spec.beginDrag(o.props,o.monitor,o.ref.current)})),this.spec=t,this.monitor=r,this.ref=n}var t,r;return t=e,(r=[{key:"receiveProps",value:function(e){this.props=e}},{key:"canDrag",value:function(){return!!this.props&&(!this.spec.canDrag||this.spec.canDrag(this.props,this.monitor))}},{key:"isDragging",value:function(e,t){return!!this.props&&(this.spec.isDragging?this.spec.isDragging(this.props,this.monitor):t===e.getSourceId())}},{key:"endDrag",value:function(){this.props&&this.spec.endDrag&&this.spec.endDrag(this.props,this.monitor,Yp(this.ref))}}])&&yd(t.prototype,r),e}();function Sd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function xd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Od=!1,Ed=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),xd(this,"internalMonitor",void 0),xd(this,"targetId",null),this.internalMonitor=t.getMonitor()}var t,r;return t=e,(r=[{key:"receiveHandlerId",value:function(e){this.targetId=e}},{key:"getHandlerId",value:function(){return this.targetId}},{key:"subscribeToStateChange",value:function(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}},{key:"canDrop",value:function(){if(!this.targetId)return!1;Mp(!Od,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Od=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Od=!1}}},{key:"isOver",value:function(e){return!!this.targetId&&this.internalMonitor.isOverTarget(this.targetId,e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}])&&Sd(t.prototype,r),e}();function kd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Cd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Td=function(){function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Cd(this,"hooks",Dp({dropTarget:function(e,t){r.clearDropTarget(),r.dropTargetOptions=t,$p(e)?r.dropTargetRef=e:r.dropTargetNode=e,r.reconnect()}})),Cd(this,"handlerId",null),Cd(this,"dropTargetRef",null),Cd(this,"dropTargetNode",void 0),Cd(this,"dropTargetOptionsInternal",null),Cd(this,"unsubscribeDropTarget",void 0),Cd(this,"lastConnectedHandlerId",null),Cd(this,"lastConnectedDropTarget",null),Cd(this,"lastConnectedDropTargetOptions",null),Cd(this,"backend",void 0),this.backend=t}var t,r;return t=e,(r=[{key:"connectTarget",get:function(){return this.dropTarget}},{key:"reconnect",value:function(){var e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();var t=this.dropTarget;this.handlerId&&(t?e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions)):this.lastConnectedDropTarget=t)}},{key:"receiveHandlerId",value:function(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}},{key:"dropTargetOptions",get:function(){return this.dropTargetOptionsInternal},set:function(e){this.dropTargetOptionsInternal=e}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didDropTargetChange",value:function(){return this.lastConnectedDropTarget!==this.dropTarget}},{key:"didOptionsChange",value:function(){return!Fp(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}},{key:"disconnectDropTarget",value:function(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}},{key:"dropTarget",get:function(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}},{key:"clearDropTarget",value:function(){this.dropTargetRef=null,this.dropTargetNode=null}}])&&kd(t.prototype,r),e}();function Pd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function jd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Rd=["canDrop","hover","drop"],Md=function(){function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),jd(this,"props",null),jd(this,"spec",void 0),jd(this,"monitor",void 0),jd(this,"ref",void 0),this.spec=t,this.monitor=r,this.ref=n}var t,r;return t=e,(r=[{key:"receiveProps",value:function(e){this.props=e}},{key:"receiveMonitor",value:function(e){this.monitor=e}},{key:"canDrop",value:function(){return!this.spec.canDrop||this.spec.canDrop(this.props,this.monitor)}},{key:"hover",value:function(){this.spec.hover&&this.props&&this.spec.hover(this.props,this.monitor,Yp(this.ref))}},{key:"drop",value:function(){if(this.spec.drop)return this.spec.drop(this.props,this.monitor,this.ref.current)}}])&&Pd(t.prototype,r),e}();var Ad="dnd-core/INIT_COORDS",Id="dnd-core/BEGIN_DRAG",Dd="dnd-core/PUBLISH_DRAG_SOURCE",Ld="dnd-core/HOVER",Nd="dnd-core/DROP",$d="dnd-core/END_DRAG";function Fd(e,t){return{type:Ad,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}function Bd(e){return Bd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bd(e)}function Ud(e){return"object"===Bd(e)}var zd={type:Ad,payload:{clientOffset:null,sourceClientOffset:null}};function qd(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{publishSource:!0},n=r.publishSource,o=void 0===n||n,i=r.clientOffset,a=r.getSourceClientOffset,s=e.getMonitor(),l=e.getRegistry();e.dispatch(Fd(i)),function(e,t,r){Mp(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach((function(e){Mp(r.getSource(e),"Expected sourceIds to be registered.")}))}(t,s,l);var c=function(e,t){for(var r=null,n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}(t,s);if(null!==c){var u=null;if(i){if(!a)throw new Error("getSourceClientOffset must be defined");!function(e){Mp("function"==typeof e,"When clientOffset is provided, getSourceClientOffset must be a function.")}(a),u=a(c)}e.dispatch(Fd(i,u));var f=l.getSource(c).beginDrag(s,c);if(null!=f){!function(e){Mp(Ud(e),"Item must be an object.")}(f),l.pinSource(c);var p=l.getSourceType(c);return{type:Id,payload:{itemType:p,item:f,sourceId:c,clientOffset:i||null,sourceClientOffset:u||null,isSourcePublic:!!o}}}}else e.dispatch(zd)}}function Wd(e){return function(){if(e.getMonitor().isDragging())return{type:Dd}}}function Hd(e,t){return null===t?null===e:Array.isArray(e)?e.some((function(e){return e===t})):e===t}function Vd(e){return function(t){var r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clientOffset;!function(e){Mp(Array.isArray(e),"Expected targetIds to be an array.")}(t);var n=t.slice(0),o=e.getMonitor(),i=e.getRegistry();return function(e,t,r){Mp(t.isDragging(),"Cannot call hover while not dragging."),Mp(!t.didDrop(),"Cannot call hover after drop.");for(var n=0;n<e.length;n++){var o=e[n];Mp(e.lastIndexOf(o)===n,"Expected targetIds to be unique in the passed array."),Mp(r.getTarget(o),"Expected targetIds to be registered.")}}(n,o,i),function(e,t,r){for(var n=e.length-1;n>=0;n--){var o=e[n];Hd(t.getTargetType(o),r)||e.splice(n,1)}}(n,i,o.getItemType()),function(e,t,r){e.forEach((function(e){r.getTarget(e).hover(t,e)}))}(n,o,i),{type:Ld,payload:{targetIds:n,clientOffset:r||null}}}}function Gd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Kd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gd(Object(r),!0).forEach((function(t){Yd(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Yd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jd(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.getMonitor(),n=e.getRegistry();!function(e){Mp(e.isDragging(),"Cannot call drop while not dragging."),Mp(!e.didDrop(),"Cannot call drop twice during one drag operation.")}(r);var o=function(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}(r);o.forEach((function(o,i){var a=function(e,t,r,n){var o=r.getTarget(e),i=o?o.drop(n,e):void 0;return function(e){Mp(void 0===e||Ud(e),"Drop result must either be an object or undefined.")}(i),void 0===i&&(i=0===t?{}:n.getDropResult()),i}(o,i,n,r),s={type:Nd,payload:{dropResult:Kd(Kd({},t),a)}};e.dispatch(s)}))}}function Qd(e){return function(){var t=e.getMonitor(),r=e.getRegistry();!function(e){Mp(e.isDragging(),"Cannot call endDrag while not dragging.")}(t);var n=t.getSourceId();return null!=n&&(r.getSource(n,!0).endDrag(t,n),r.unpinSource()),{type:$d}}}function Xd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Zd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var eh=function(){function e(t,r){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Zd(this,"store",void 0),Zd(this,"monitor",void 0),Zd(this,"backend",void 0),Zd(this,"isSetUp",!1),Zd(this,"handleRefCountChange",(function(){var e=n.store.getState().refCount>0;n.backend&&(e&&!n.isSetUp?(n.backend.setup(),n.isSetUp=!0):!e&&n.isSetUp&&(n.backend.teardown(),n.isSetUp=!1))})),this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}var t,r;return t=e,r=[{key:"receiveBackend",value:function(e){this.backend=e}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var e=this,t=this.store.dispatch,r=function(e){return{beginDrag:qd(e),publishDragSource:Wd(e),hover:Vd(e),drop:Jd(e),endDrag:Qd(e)}}(this);return Object.keys(r).reduce((function(n,o){var i,a=r[o];return n[o]=(i=a,function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];var a=i.apply(e,n);void 0!==a&&t(a)}),n}),{})}},{key:"dispatch",value:function(e){this.store.dispatch(e)}}],r&&Xd(t.prototype,r),e}(),th=function(e,t){return e===t};function rh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function nh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rh(Object(r),!0).forEach((function(t){oh(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function oh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ih={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function ah(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ih,n=arguments.length>1?arguments[1]:void 0,o=n.payload;switch(n.type){case Ad:case Id:return{initialSourceClientOffset:o.sourceClientOffset,initialClientOffset:o.clientOffset,clientOffset:o.clientOffset};case Ld:return e=r.clientOffset,t=o.clientOffset,!e&&!t||e&&t&&e.x===t.x&&e.y===t.y?r:nh(nh({},r),{},{clientOffset:o.clientOffset});case $d:case Nd:return ih;default:return r}}var sh="dnd-core/ADD_SOURCE",lh="dnd-core/ADD_TARGET",ch="dnd-core/REMOVE_SOURCE",uh="dnd-core/REMOVE_TARGET";function fh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ph(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fh(Object(r),!0).forEach((function(t){dh(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function dh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var hh={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function gh(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:hh,n=arguments.length>1?arguments[1]:void 0,o=n.payload;switch(n.type){case Id:return ph(ph({},r),{},{itemType:o.itemType,item:o.item,sourceId:o.sourceId,isSourcePublic:o.isSourcePublic,dropResult:null,didDrop:!1});case Dd:return ph(ph({},r),{},{isSourcePublic:!0});case Ld:return ph(ph({},r),{},{targetIds:o.targetIds});case uh:return-1===r.targetIds.indexOf(o.targetId)?r:ph(ph({},r),{},{targetIds:(e=r.targetIds,t=o.targetId,e.filter((function(e){return e!==t})))});case Nd:return ph(ph({},r),{},{dropResult:o.dropResult,didDrop:!0,targetIds:[]});case $d:return ph(ph({},r),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return r}}function mh(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;switch((arguments.length>1?arguments[1]:void 0).type){case sh:case lh:return e+1;case ch:case uh:return e-1;default:return e}}var yh=[],vh=[];function bh(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case Ld:break;case sh:case lh:case uh:case ch:return yh;default:return vh}var t=e.payload,r=t.targetIds,n=void 0===r?[]:r,o=t.prevTargetIds,i=void 0===o?[]:o,a=function(e,t){var r=new Map,n=function(e){r.set(e,r.has(e)?r.get(e)+1:1)};e.forEach(n),t.forEach(n);var o=[];return r.forEach((function(e,t){1===e&&o.push(t)})),o}(n,i),s=a.length>0||!function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:th;if(e.length!==t.length)return!1;for(var n=0;n<e.length;++n)if(!r(e[n],t[n]))return!1;return!0}(n,i);if(!s)return yh;var l=i[i.length-1],c=n[n.length-1];return l!==c&&(l&&a.push(l),c&&a.push(c)),a}function wh(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0)+1}function _h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Sh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_h(Object(r),!0).forEach((function(t){xh(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function xh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Oh(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:bh(r.dirtyHandlerIds,{type:n.type,payload:Sh(Sh({},n.payload),{},{prevTargetIds:(e=r,"dragOperation.targetIds",t=[],"dragOperation.targetIds".split(".").reduce((function(e,r){return e&&e[r]?e[r]:t||null}),e))})}),dragOffset:ah(r.dragOffset,n),refCount:mh(r.refCount,n),dragOperation:gh(r.dragOperation,n),stateId:wh(r.stateId)}}function Eh(e,t){return{x:e.x-t.x,y:e.y-t.y}}function kh(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ch(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}yh.__IS_NONE__=!0,vh.__IS_ALL__=!0;var Th,Ph=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ch(this,"store",void 0),Ch(this,"registry",void 0),this.store=t,this.registry=r}var t,r;return t=e,r=[{key:"subscribeToStateChange",value:function(e){var t=this,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{handlerIds:void 0}).handlerIds;Mp("function"==typeof e,"listener must be a function."),Mp(void 0===r||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");var n=this.store.getState().stateId;return this.store.subscribe((function(){var o=t.store.getState(),i=o.stateId;try{var a=i===n||i===n+1&&!function(e,t){if(e===yh)return!1;if(e===vh||void 0===t)return!0;var r,n=(r=e,t.filter((function(e){return r.indexOf(e)>-1})));return n.length>0}(o.dirtyHandlerIds,r);a||e()}finally{n=i}}))}},{key:"subscribeToOffsetChange",value:function(e){var t=this;Mp("function"==typeof e,"listener must be a function.");var r=this.store.getState().dragOffset;return this.store.subscribe((function(){var n=t.store.getState().dragOffset;n!==r&&(r=n,e())}))}},{key:"canDragSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e);return Mp(t,"Expected to find a valid source. sourceId=".concat(e)),!this.isDragging()&&t.canDrag(this,e)}},{key:"canDropOnTarget",value:function(e){if(!e)return!1;var t=this.registry.getTarget(e);return Mp(t,"Expected to find a valid target. targetId=".concat(e)),!(!this.isDragging()||this.didDrop())&&Hd(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e)}},{key:"isDragging",value:function(){return Boolean(this.getItemType())}},{key:"isDraggingSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e,!0);return Mp(t,"Expected to find a valid source. sourceId=".concat(e)),!(!this.isDragging()||!this.isSourcePublic())&&this.registry.getSourceType(e)===this.getItemType()&&t.isDragging(this,e)}},{key:"isOverTarget",value:function(e){if(!e)return!1;var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shallow:!1}).shallow;if(!this.isDragging())return!1;var r=this.registry.getTargetType(e),n=this.getItemType();if(n&&!Hd(r,n))return!1;var o=this.getTargetIds();if(!o.length)return!1;var i=o.indexOf(e);return t?i===o.length-1:i>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return Boolean(this.store.getState().dragOperation.isSourcePublic)}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return t=(e=this.store.getState().dragOffset).clientOffset,r=e.initialClientOffset,n=e.initialSourceClientOffset,t&&r&&n?Eh(function(e,t){return{x:e.x+t.x,y:e.y+t.y}}(t,n),r):null;var e,t,r,n}},{key:"getDifferenceFromInitialOffset",value:function(){return t=(e=this.store.getState().dragOffset).clientOffset,r=e.initialClientOffset,t&&r?Eh(t,r):null;var e,t,r}}],r&&kh(t.prototype,r),e}(),jh=0;function Rh(e){return Rh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rh(e)}function Mh(e,t){t&&Array.isArray(e)?e.forEach((function(e){return Mh(e,!1)})):Mp("string"==typeof e||"symbol"===Rh(e),t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}!function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"}(Th||(Th={}));const Ah="undefined"!=typeof global?global:self,Ih=Ah.MutationObserver||Ah.WebKitMutationObserver;function Dh(e){return function(){const t=setTimeout(n,0),r=setInterval(n,50);function n(){clearTimeout(t),clearInterval(r),e()}}}const Lh="function"==typeof Ih?function(e){let t=1;const r=new Ih(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}:Dh;class Nh{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}}const $h=new class{enqueueTask(e){const{queue:t,requestFlush:r}=this;t.length||(r(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let t=0,r=e.length-this.index;t<r;t++)e[t]=e[t+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=Lh(this.flush),this.requestErrorThrow=Dh((()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()}))}},Fh=new class{create(e){const t=this.freeTasks,r=t.length?t.pop():new Nh(this.onError,(e=>t[t.length]=e));return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}($h.registerPendingError);function Bh(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Uh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return qh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?qh(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qh(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Wh(e){switch(e[0]){case"S":return Th.SOURCE;case"T":return Th.TARGET;default:Mp(!1,"Cannot parse handler ID: ".concat(e))}}function Hh(e,t){var r=e.entries(),n=!1;do{var o=r.next(),i=o.done;if(zh(o.value,2)[1]===t)return!0;n=!!i}while(!n);return!1}var Vh=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Uh(this,"types",new Map),Uh(this,"dragSources",new Map),Uh(this,"dropTargets",new Map),Uh(this,"pinnedSourceId",null),Uh(this,"pinnedSource",null),Uh(this,"store",void 0),this.store=t}var t,r;return t=e,r=[{key:"addSource",value:function(e,t){Mh(e),function(e){Mp("function"==typeof e.canDrag,"Expected canDrag to be a function."),Mp("function"==typeof e.beginDrag,"Expected beginDrag to be a function."),Mp("function"==typeof e.endDrag,"Expected endDrag to be a function.")}(t);var r=this.addHandler(Th.SOURCE,e,t);return this.store.dispatch(function(e){return{type:sh,payload:{sourceId:e}}}(r)),r}},{key:"addTarget",value:function(e,t){Mh(e,!0),function(e){Mp("function"==typeof e.canDrop,"Expected canDrop to be a function."),Mp("function"==typeof e.hover,"Expected hover to be a function."),Mp("function"==typeof e.drop,"Expected beginDrag to be a function.")}(t);var r=this.addHandler(Th.TARGET,e,t);return this.store.dispatch(function(e){return{type:lh,payload:{targetId:e}}}(r)),r}},{key:"containsHandler",value:function(e){return Hh(this.dragSources,e)||Hh(this.dropTargets,e)}},{key:"getSource",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Mp(this.isSourceId(e),"Expected a valid source ID."),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}},{key:"getTarget",value:function(e){return Mp(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}},{key:"getSourceType",value:function(e){return Mp(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}},{key:"getTargetType",value:function(e){return Mp(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}},{key:"isSourceId",value:function(e){return Wh(e)===Th.SOURCE}},{key:"isTargetId",value:function(e){return Wh(e)===Th.TARGET}},{key:"removeSource",value:function(e){var t,r=this;Mp(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(e){return{type:ch,payload:{sourceId:e}}}(e)),t=function(){r.dragSources.delete(e),r.types.delete(e)},$h.enqueueTask(Fh.create(t))}},{key:"removeTarget",value:function(e){Mp(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(e){return{type:uh,payload:{targetId:e}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}},{key:"pinSource",value:function(e){var t=this.getSource(e);Mp(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}},{key:"unpinSource",value:function(){Mp(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(e,t,r){var n=function(e){var t=(jh++).toString();switch(e){case Th.SOURCE:return"S".concat(t);case Th.TARGET:return"T".concat(t);default:throw new Error("Unknown Handler Role: ".concat(e))}}(e);return this.types.set(n,t),e===Th.SOURCE?this.dragSources.set(n,r):e===Th.TARGET&&this.dropTargets.set(n,r),n}}],r&&Bh(t.prototype,r),e}();function Gh(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=(t=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__,(0,He.MT)(Oh,t&&r&&r({name:"dnd-core",instanceId:"dnd-core"}))),a=new Ph(i,new Vh(i)),s=new eh(i,a),l=e(s,n,o);return s.receiveBackend(l),s}var Kh=["children"];function Yh(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Jh=0,Qh=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),Xh=(0,t.memo)((function(e){var r=e.children,n=function(e){if("manager"in e)return[{dragDropManager:e.manager},!1];var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zh(),r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,o=t;return o[Qh]||(o[Qh]={dragDropManager:Gh(e,t,r,n)}),o[Qh]}(e.backend,e.context,e.options,e.debugMode);return[t,!e.context]}(function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,Kh)),o=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Yh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Yh(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(n,2),i=o[0],a=o[1];return(0,t.useEffect)((function(){if(a){var e=Zh();return++Jh,function(){0==--Jh&&(e[Qh]=null)}}}),[]),(0,ed.jsx)(td.Provider,Object.assign({value:i},{children:r}),void 0)}));function Zh(){return void 0!==__webpack_require__.g?__webpack_require__.g:window}const eg=["namespace"],tg=["children","isDragging","connectDragComponent"],rg=["onDrop","namespace"];function ng(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function og(e){let{namespace:t}=e,n=ng(e,eg);const o=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e;"function"!=typeof e&&(Mp(Zp(e),'Expected "type" provided as the first argument to DragSource to be a string, or a function that returns a string given the current props. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',e),o=function(){return e}),Mp(Xp(t),'Expected "spec" provided as the second argument to DragSource to be a plain object. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',t);var i=function(e){return Object.keys(e).forEach((function(t){Mp(bd.indexOf(t)>-1,'Expected the drag source specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',bd.join(", "),t),Mp("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source",t,t,e[t])})),wd.forEach((function(t){Mp("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source",t,t,e[t])})),function(t,r){return new _d(e,t,r)}}(t);return Mp("function"==typeof r,'Expected "collect" provided as the third argument to DragSource to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',r),Mp(Xp(n),'Expected "options" provided as the fourth argument to DragSource to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',r),function(e){return md({containerDisplayName:"DragSource",createHandler:i,registerHandler:Ip,createConnector:function(e){return new zp(e)},createMonitor:function(e){return new Gp(e)},DecoratedComponent:e,getType:o,collect:r,options:n})}}(t,{beginDrag(e){let{children:t,isDragging:r,connectDragComponent:n}=e;return ng(e,tg)}},(e=>({connectDragComponent:e.dragSource()})))((({children:e,connectDragComponent:t})=>e(t)));return r().createElement(o,n,n.children)}function ig(e){let{onDrop:t,namespace:n}=e,o=ng(e,rg);const i=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e;"function"!=typeof e&&(Mp(Zp(e,!0),'Expected "type" provided as the first argument to DropTarget to be a string, an array of strings, or a function that returns either given the current props. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',e),o=function(){return e}),Mp(Xp(t),'Expected "spec" provided as the second argument to DropTarget to be a plain object. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',t);var i=function(e){return Object.keys(e).forEach((function(t){Mp(Rd.indexOf(t)>-1,'Expected the drop target specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',Rd.join(", "),t),Mp("function"==typeof e[t],"Expected %s in the drop target specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target",t,t,e[t])})),function(t,r){return new Md(e,t,r)}}(t);return Mp("function"==typeof r,'Expected "collect" provided as the third argument to DropTarget to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',r),Mp(Xp(n),'Expected "options" provided as the fourth argument to DropTarget to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',r),function(e){return md({containerDisplayName:"DropTarget",createHandler:i,registerHandler:Ap,createMonitor:function(e){return new Ed(e)},createConnector:function(e){return new Td(e)},DecoratedComponent:e,getType:o,collect:r,options:n})}}(n,{drop(e,r){t(r.getItem())}},((e,t)=>({connectDropTarget:e.dropTarget(),isHovered:t.isOver()})))((({children:e,connectDropTarget:t,isHovered:r})=>e(t,{isHovered:r})));return r().createElement(i,o,o.children)}function ag(e){var t=Object.create(null);return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}og.propTypes={namespace:i().any.isRequired,children:i().func.isRequired},ig.propTypes={onDrop:i().func.isRequired,namespace:i().any.isRequired,children:i().func.isRequired};var sg=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,lg=ag((function(e){return sg.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),cg=function(e,t,r){var n=e.key+"-"+t.name;!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles)},ug={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},fg=/[A-Z]|^ms/g,pg=/_EMO_([^_]+?)_([^]*?)_EMO_/g,dg=function(e){return 45===e.charCodeAt(1)},hg=function(e){return null!=e&&"boolean"!=typeof e},gg=ag((function(e){return dg(e)?e:e.replace(fg,"-$&").toLowerCase()})),mg=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(pg,(function(e,t,r){return vg={name:t,styles:r,next:vg},t}))}return 1===ug[e]||dg(e)||"number"!=typeof t||0===t?t:t+"px"};function yg(e,t,r){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return vg={name:r.name,styles:r.styles,next:vg},r.name;if(void 0!==r.styles){var n=r.next;if(void 0!==n)for(;void 0!==n;)vg={name:n.name,styles:n.styles,next:vg},n=n.next;return r.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o++)n+=yg(e,t,r[o])+";";else for(var i in r){var a=r[i];if("object"!=typeof a)null!=t&&void 0!==t[a]?n+=i+"{"+t[a]+"}":hg(a)&&(n+=gg(i)+":"+mg(i,a)+";");else if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var s=yg(e,t,a);switch(i){case"animation":case"animationName":n+=gg(i)+":"+s+";";break;default:n+=i+"{"+s+"}"}}else for(var l=0;l<a.length;l++)hg(a[l])&&(n+=gg(i)+":"+mg(i,a[l])+";")}return n}(e,t,r);case"function":if(void 0!==e){var o=vg,i=r(e);return vg=o,yg(e,t,i)}}if(null==t)return r;var a=t[r];return void 0!==a?a:r}var vg,bg=/label:\s*([^\s;\n{]+)\s*(;|$)/g,wg=!!t.useInsertionEffect&&t.useInsertionEffect,_g=wg||function(e){return e()},Sg=(wg||t.useLayoutEffect,lg),xg=function(e){return"theme"!==e},Og=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?Sg:xg},Eg=function(e,t,r){var n;if(t){var o=t.shouldForwardProp;n=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof n&&r&&(n=e.__emotion_forwardProp),n},kg=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return cg(t,r,n),_g((function(){return function(e,t,r){cg(e,t,r);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do{e.insert(t===o?"."+n:"",o,e.sheet,!0),o=o.next}while(void 0!==o)}}(t,r,n)})),null},Cg=function e(r,n){var o,i,a=r.__emotion_real===r,s=a&&r.__emotion_base||r;void 0!==n&&(o=n.label,i=n.target);var l=Eg(r,n,a),c=l||Og(s),u=!c("as");return function(){var f=arguments,p=a&&void 0!==r.__emotion_styles?r.__emotion_styles.slice(0):[];if(void 0!==o&&p.push("label:"+o+";"),null==f[0]||void 0===f[0].raw)p.push.apply(p,f);else{p.push(f[0][0]);for(var h=f.length,g=1;g<h;g++)p.push(f[g],f[0][g])}var m=(0,xo.withEmotionCache)((function(e,r,n){var o,a,f,d,h=u&&e.as||s,g="",m=[],y=e;if(null==e.theme){for(var v in y={},e)y[v]=e[v];y.theme=t.useContext(xo.ThemeContext)}"string"==typeof e.className?(o=r.registered,a=m,f=e.className,d="",f.split(" ").forEach((function(e){void 0!==o[e]?a.push(o[e]+";"):d+=e+" "})),g=d):null!=e.className&&(g=e.className+" ");var b=function(e,t,r){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var n=!0,o="";vg=void 0;var i=e[0];null==i||void 0===i.raw?(n=!1,o+=yg(r,t,i)):o+=i[0];for(var a=1;a<e.length;a++)o+=yg(r,t,e[a]),n&&(o+=i[a]);bg.lastIndex=0;for(var s,l="";null!==(s=bg.exec(o));)l+="-"+s[1];var c=function(e){for(var t,r=0,n=0,o=e.length;o>=4;++n,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(o){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(o)+l;return{name:c,styles:o,next:vg}}(p.concat(m),r.registered,y);g+=r.key+"-"+b.name,void 0!==i&&(g+=" "+i);var w=u&&void 0===l?Og(h):c,_={};for(var S in e)u&&"as"===S||w(S)&&(_[S]=e[S]);return _.className=g,_.ref=n,t.createElement(t.Fragment,null,t.createElement(kg,{cache:r,serialized:b,isStringTag:"string"==typeof h}),t.createElement(h,_))}));return m.displayName=void 0!==o?o:"Styled("+("string"==typeof s?s:s.displayName||s.name||"Component")+")",m.defaultProps=r.defaultProps,m.__emotion_real=m,m.__emotion_base=s,m.__emotion_styles=p,m.__emotion_forwardProp=l,Object.defineProperty(m,"toString",{value:function(){return"."+i}}),m.withComponent=function(t,r){return e(t,d({},n,r,{shouldForwardProp:Eg(m,r,!0)})).apply(void 0,p)},m}},Tg=__webpack_require__(36585),Pg=__webpack_require__.n(Tg);function jg(e,{target:t=document.body}={}){if("string"!=typeof e)throw new TypeError(`Expected parameter \`text\` to be a \`string\`, got \`${typeof e}\`.`);const r=document.createElement("textarea"),n=document.activeElement;r.value=e,r.setAttribute("readonly",""),r.style.contain="strict",r.style.position="absolute",r.style.left="-9999px",r.style.fontSize="12pt";const o=document.getSelection(),i=o.rangeCount>0&&o.getRangeAt(0);t.append(r),r.select(),r.selectionStart=0,r.selectionEnd=e.length;let a=!1;try{a=document.execCommand("copy")}catch{}return r.remove(),i&&(o.removeAllRanges(),o.addRange(i)),n&&n.focus(),a}var Rg=__webpack_require__(67129);const Mg=/\s+at.*[(\s](.*)\)?/,Ag=/^(?:(?:(?:node|node:[\w/]+|(?:(?:node:)?internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)(?:\.js)?:\d+:\d+)|native)/,Ig=void 0===Rg.homedir?"":Rg.homedir().replace(/\\/g,"/");function Dg(e,{pretty:t=!1,basePath:r}={}){const n=r&&new RegExp(`(at | \\()${function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(r.replace(/\\/g,"/"))}`,"g");if("string"==typeof e)return e.replace(/\\/g,"/").split("\n").filter((e=>{const t=e.match(Mg);if(null===t||!t[1])return!0;const r=t[1];return!(r.includes(".app/Contents/Resources/electron.asar")||r.includes(".app/Contents/Resources/default_app.asar")||r.includes("node_modules/electron/dist/resources/electron.asar")||r.includes("node_modules/electron/dist/resources/default_app.asar")||Ag.test(r))})).filter((e=>""!==e.trim())).map((e=>(n&&(e=e.replace(n,"$1")),t&&(e=e.replace(Mg,((e,t)=>e.replace(t,t.replace(Ig,"~"))))),e))).join("\n")}function Lg(e,t,r){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ng="https://github.com/decaporg/decap-cms/issues/new?";function $g({title:e,config:t}){try{const r=function({config:e}){let t="";"string"==typeof DECAP_CMS_VERSION?t=`decap-cms@${DECAP_CMS_VERSION}`:"string"==typeof DECAP_CMS_APP_VERSION&&(t=`decap-cms-app@${DECAP_CMS_APP_VERSION}`);const r=function({version:e,provider:t,browser:r,config:n}){return`\n**Describe the bug**\n\n**To Reproduce**\n\n**Expected behavior**\n\n**Screenshots**\n\n**Applicable Versions:**\n - Decap CMS version: \`${e}\`\n - Git provider: \`${t}\`\n - Browser version: \`${r}\`\n\n**CMS configuration**\n\`\`\`\n${n}\n\`\`\`\n\n**Additional context**\n`}({version:t,provider:e.backend.name,browser:navigator.userAgent,config:mr().stringify(e)});return r}({config:t}),n=new URLSearchParams;return n.append("title",Pg()(e,{length:100})),n.append("body",Pg()(r,{length:4e3,omission:"\n..."})),n.append("labels","type: bug"),`${Ng}${n.toString()}`}catch(e){return console.log(e),`${Ng}template=bug_report.md`}}const Fg=Cg("div",{target:"emw4gx72",label:"ErrorBoundaryContainer"})("padding:40px;h1{font-size:28px;color:",qe.colors.text,";}h2{font-size:20px;}strong{color:",qe.colors.textLead,";font-weight:500;}hr{width:200px;margin:30px 0;border:0;height:1px;background-color:",qe.colors.text,";}a{color:",qe.colors.active,";}"),Bg=Cg("span",{target:"emw4gx71",label:"PrivacyWarning"})("color:",qe.colors.text,";"),Ug=Cg("button",{target:"emw4gx70",label:"CopyButton"})(qe.buttons.button,";",qe.buttons.default,";",qe.buttons.gray,";display:block;margin:12px 0;");function zg({entry:e,t}){return console.log(e),(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)("hr",null),(0,xo.jsx)("h2",null,t("ui.errorBoundary.recoveredEntry.heading")),(0,xo.jsx)("strong",null,t("ui.errorBoundary.recoveredEntry.warning")),(0,xo.jsx)(Ug,{onClick:()=>jg(e)},t("ui.errorBoundary.recoveredEntry.copyButtonLabel")),(0,xo.jsx)("pre",null,(0,xo.jsx)("code",null,e)))}class qg extends r().Component{constructor(...e){super(...e),Lg(this,"state",{hasError:!1,errorMessage:"",errorTitle:"",backup:""})}static getDerivedStateFromError(e){return console.error(e),{hasError:!0,errorMessage:Dg(e.stack,{basePath:window.location.origin||""}),errorTitle:e.toString()}}shouldComponentUpdate(e,t){return!this.props.showBackup||this.state.errorMessage!==t.errorMessage||this.state.backup!==t.backup}async componentDidUpdate(){if(this.props.showBackup){const e=await pr.localForage.getItem("backup");e&&console.log(e),this.setState({backup:e})}}render(){const{hasError:e,errorMessage:t,backup:n,errorTitle:o}=this.state,{showBackup:i,t:a}=this.props;return e?(0,xo.jsx)(Fg,null,(0,xo.jsx)("h1",null,a("ui.errorBoundary.title")),(0,xo.jsx)("p",null,(0,xo.jsx)("span",null,a("ui.errorBoundary.details")),(0,xo.jsx)("a",{href:$g({title:o,config:this.props.config}),target:"_blank",rel:"noopener noreferrer","data-testid":"issue-url"},a("ui.errorBoundary.reportIt"))),(0,xo.jsx)("p",null,a("ui.errorBoundary.privacyWarning").split("\n").map(((e,t)=>(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(Bg,{key:t},e),(0,xo.jsx)("br",null))))),(0,xo.jsx)("hr",null),(0,xo.jsx)("h2",null,a("ui.errorBoundary.detailsHeading")),(0,xo.jsx)("p",null,t),n&&i&&(0,xo.jsx)(zg,{entry:n,t:a})):this.props.children}}Lg(qg,"propTypes",{children:i().node,t:i().func.isRequired,config:i().object.isRequired});const Wg=(0,We.Iu)()(qg);function Hg({label:e,imagesOnly:t,onChange:r,disabled:n,className:o}){return(0,xo.jsx)("label",{tabIndex:"0",className:`nc-fileUploadButton ${o||""}`},(0,xo.jsx)("span",null,e),(0,xo.jsx)("input",{type:"file",accept:t?"image/*":"*/*",onChange:r,disabled:n}))}Hg.propTypes={className:i().string,label:i().string.isRequired,imagesOnly:i().bool,onChange:i().func.isRequired,disabled:i().bool};var Vg=__webpack_require__(37149),Gg=__webpack_require__.n(Vg),Kg={name:"1o9c9d2-ReactModalGlobalStyles",styles:".ReactModal__Body--open{overflow:hidden;};label:ReactModalGlobalStyles;"};function Yg(){return(0,xo.jsx)(xo.Global,{styles:Kg})}const Jg=`\n ${qe.shadows.dropDeep};\n background-color: #fff;\n border-radius: ${qe.lengths.borderRadius};\n height: 80%;\n text-align: center;\n max-width: 2200px;\n padding: 20px;\n\n &:focus {\n outline: none;\n }\n `,Qg=`\n z-index: ${qe.zIndex.zIndex99999};\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n opacity: 0;\n background-color: rgba(0, 0, 0, 0);\n transition: background-color ${qe.transitions.main}, opacity ${qe.transitions.main};\n `;class Xg extends r().Component{componentDidMount(){Gg().setAppElement("#nc-root")}render(){const{isOpen:e,children:t,className:n,onClose:o}=this.props;return(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(Yg,null),(0,xo.jsx)(xo.ClassNames,null,(({css:r,cx:i})=>(0,xo.jsx)(Gg(),{isOpen:e,onRequestClose:o,closeTimeoutMS:300,className:{base:i(r`
18
18
  ${Jg};
19
19
  `,n),afterOpen:"",beforeClose:""},overlayClassName:{base:r`
20
20
  ${Qg};
@@ -43,5 +43,5 @@
43
43
  ${oS.label};
44
44
  `,classNameLabelActive:i`
45
45
  ${oS.labelActive};
46
- `,controlComponent:$.control,entry:t,collection:r,config:n,field:o,uniqueFieldId:this.uniqueFieldId,value:e,mediaPaths:s,metadata:q,onChange:(e,t)=>{c(o,e,t),S(this.uniqueFieldId)},onValidate:m&&Nb()(m,this.uniqueFieldId),onOpenMediaLibrary:u,onClearMediaControl:f,onRemoveMediaControl:p,onRemoveInsertedMedia:h,onPersistMedia:g,onAddAsset:d,getAsset:l,hasActiveStyle:E||this.state.styleActive,setActiveStyle:()=>this.setState({styleActive:!0}),setInactiveStyle:()=>this.setState({styleActive:!1}),resolveWidget:Tn,widget:$,getEditorComponents:Pn,controlRef:y,editorControl:fS,query:v,loadEntry:x,queryHits:b[this.uniqueFieldId]||[],clearSearch:_,clearFieldErrors:S,isFetching:w,fieldsErrors:a,onValidateObject:z,isEditorComponent:k,isNewEditorComponent:C,parentIds:T,t:P,validateMetaField:j,isDisabled:M,isFieldDuplicate:I,isFieldHidden:D,isLoadingAsset:R,locale:L,isParentListCollapsed:N}),B&&(0,xo.jsx)(lS,{active:E||this.state.styleActive,error:V},(0,xo.jsx)(V_(),{remarkPlugins:[K_()],allowedElements:["a","strong","em","del"],unwrapDisallowed:!0,components:{a:e=>{let{node:t}=e,r=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,Z_);return(0,xo.jsx)("a",rS({},r,{target:"_blank",rel:"noopener noreferrer",style:{color:"inherit"}}))}}},B)))))}}nS(uS,"propTypes",{value:i().oneOfType([i().node,i().object,i().string,i().bool]),field:Vm().map.isRequired,fieldsMetaData:Vm().map,fieldsErrors:Vm().map,mediaPaths:Vm().map.isRequired,boundGetAsset:i().func.isRequired,onChange:i().func.isRequired,openMediaLibrary:i().func.isRequired,addAsset:i().func.isRequired,removeInsertedMedia:i().func.isRequired,persistMedia:i().func.isRequired,onValidate:i().func,controlRef:i().func,query:i().func.isRequired,queryHits:i().object,isFetching:i().bool,clearSearch:i().func.isRequired,clearFieldErrors:i().func.isRequired,loadEntry:i().func.isRequired,t:i().func.isRequired,isEditorComponent:i().bool,isNewEditorComponent:i().bool,parentIds:i().arrayOf(i().string),entry:Vm().map.isRequired,collection:Vm().map.isRequired,isDisabled:i().bool,isHidden:i().bool,isFieldDuplicate:i().func,isFieldHidden:i().func,locale:i().string,isParentListCollapsed:i().bool}),nS(uS,"defaultProps",{parentIds:[]});const fS=H((function(e){const{collections:t,entryDraft:r}=e,n=r.get("entry"),o=t.get(r.getIn(["entry","collection"])),i=xf(e.medias);return{mediaPaths:e.mediaLibrary.get("controlMedia"),isFetching:e.search.isFetching,queryHits:e.search.queryHits,config:e.config,entry:n,collection:o,isLoadingAsset:i,loadEntry:async function(r,n){const o=t.get(r);if(o)return await xl(e,o,n);throw new Error(`Can't find collection '${r}'`)},validateMetaField:(t,r,n)=>function(e,t,r,n,o){if(r.get("meta")&&"path"===r.get("name")){var i;if(!n)return jl(n,"invalidPath",o);const r=n.split("/").map(gi(e.config.slug)).join("/");if(n!==r)return jl(n,"invalidPath",o);const a=As(t,(0,Qe.fromJS)({entry:{meta:{path:n}}})),s=a?function(e,t,r){const n=Ql(e,t),o=n&&n.map((r=>Jl(e,t,r)));return o&&o.find((e=>(null==e?void 0:e.get("path"))===r))}(e.entries,t.get("name"),a):void 0,l=null==s?void 0:s.get("path"),c=null===(i=e.entryDraft)||void 0===i?void 0:i.getIn(["entry","path"]);if(l&&l!==c)return jl(n,"pathExists",o)}return{error:!1}}(e,o,t,r,n)}}),(function(e){return tS(tS({},(0,He.DE)({openMediaLibrary:xa,clearMediaControl:_a,removeMediaControl:Sa,removeInsertedMedia:Ea,persistMedia:Ta,addAsset:Xa,query:qi,clearSearch:zi,clearFieldErrors:wl},e)),{},{boundGetAsset:(t,r)=>ts(e,t,r)})}),(function(e,t,r){return tS(tS(tS(tS({},e),t),r),{},{boundGetAsset:t.boundGetAsset(e.collection,e.entry)})}))((0,We.Iu)()(uS)),pS=fS;function dS(e,t,r){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hS=Cg("div",{target:"e11hw0lx4",label:"ControlPaneContainer"})({name:"1n0x6o4",styles:"max-width:800px;margin:0 auto;padding-bottom:16px;font-size:16px"}),gS=Cg(qe.StyledDropdownButton,{target:"e11hw0lx3",label:"LocaleButton"})(qe.buttons.button,";",qe.buttons.medium,";color:",qe.colors.controlLabel,";background:",qe.colors.textFieldBorder,";height:100%;&:after{top:11px;}"),mS=Cg("div",{target:"e11hw0lx2",label:"LocaleButtonWrapper"})({name:"zjik7",styles:"display:flex"}),yS=Cg("div",{target:"e11hw0lx1",label:"LocaleRowWrapper"})({name:"zjik7",styles:"display:flex"}),vS=Cg(qe.Dropdown,{target:"e11hw0lx0",label:"StyledDropdown"})({name:"1hfmrg2",styles:"width:max-content;margin-top:20px;margin-bottom:20px;margin-right:20px"});function bS({locales:e,dropdownText:t,onLocaleChange:r}){return(0,xo.jsx)(vS,{renderButton:()=>(0,xo.jsx)(mS,null,(0,xo.jsx)(gS,null,t))},e.map((e=>(0,xo.jsx)(qe.DropdownItem,{css:(0,xo.css)(qe.text.fieldLabel,";;label:LocaleDropdown;"),key:e,label:e,onClick:()=>r(e)}))))}function wS({field:e,entry:t,isTranslatable:r,locale:n}){if(e.get("meta"))return t.getIn(["meta",e.get("name")]);if(r){const r=Uc(n);return t.getIn([...r,e.get("name")])}return t.getIn(["data",e.get("name")])}class _S extends r().Component{constructor(...e){super(...e),dS(this,"state",{selectedLocale:this.props.locale}),dS(this,"childRefs",{}),dS(this,"controlRef",((e,t)=>{if(!t)return;const r=e.get("name");this.childRefs[r]=t})),dS(this,"getControlRef",(e=>t=>{this.controlRef(e,t)})),dS(this,"handleLocaleChange",(e=>{this.setState({selectedLocale:e}),this.props.onLocaleChange(e)})),dS(this,"copyFromOtherLocale",(({targetLocale:e,t})=>r=>{if(!window.confirm(t("editor.editorControlPane.i18n.copyFromLocaleConfirm",{locale:r.toUpperCase()})))return;const{entry:n,collection:o}=this.props,{locales:i,defaultLocale:a}=Nc(o),s=this.state.selectedLocale,l=i&&{currentLocale:s,locales:i,defaultLocale:a};this.props.fields.forEach((t=>{if($c(t,e,r)){const e=wS({field:t,entry:n,locale:r,isTranslatable:r!==a});e&&this.props.onChange(t,e,void 0,l)}}))})),dS(this,"validate",(async()=>{this.props.fields.forEach((e=>{var t,r;if("hidden"===e.get("widget"))return;const n=this.childRefs[e.get("name")],o=null!==(t=null==n||null===(r=n.innerWrappedControl)||void 0===r?void 0:r.validate)&&void 0!==t?t:null==n?void 0:n.validate;o&&o()}))})),dS(this,"switchToDefaultLocale",(()=>{if(Lc(this.props.collection)){const{defaultLocale:e}=Nc(this.props.collection);return new Promise((t=>this.setState({selectedLocale:e},t)))}return Promise.resolve()}))}focus(e){const[t,...r]=e.split("."),n=this.childRefs[t];null!=n&&n.focus&&n.focus(r.join("."))}render(){const{collection:e,entry:t,fields:r,fieldsMetaData:n,fieldsErrors:o,onChange:i,onValidate:a,t:s}=this.props;if(!e||!r)return null;if(0===t.size||!0===t.get("partial"))return null;const{locales:l,defaultLocale:c}=Nc(e),u=this.state.selectedLocale,f=l&&{currentLocale:u,locales:l,defaultLocale:c};return(0,xo.jsx)(hS,null,l&&(0,xo.jsx)(yS,null,(0,xo.jsx)(bS,{locales:l,dropdownText:s("editor.editorControlPane.i18n.writingInLocale",{locale:u.toUpperCase()}),onLocaleChange:this.handleLocaleChange}),(0,xo.jsx)(bS,{locales:l.filter((e=>e!==u)),dropdownText:s("editor.editorControlPane.i18n.copyFromLocale"),onLocaleChange:this.copyFromOtherLocale({targetLocale:u,t:s})})),r.filter((e=>"hidden"!==e.get("widget"))).map(((r,s)=>{const l=$c(r,u,c),p=Fc(r,u,c),d=Bc(r,u,c),h=f?`${u}_${s}`:s;return(0,xo.jsx)(pS,{key:h,field:r,value:wS({field:r,entry:t,locale:u,isTranslatable:l}),fieldsMetaData:n,fieldsErrors:o,onChange:(e,t,r)=>{i(e,t,r,f)},onValidate:a,controlRef:this.getControlRef(r),entry:t,collection:e,isDisabled:p,isHidden:d,isFieldDuplicate:e=>Fc(e,u,c),isFieldHidden:e=>Bc(e,u,c),locale:u})})))}}_S.propTypes={collection:Vm().map.isRequired,entry:Vm().map.isRequired,fields:Vm().list.isRequired,fieldsMetaData:Vm().map.isRequired,fieldsErrors:Vm().map.isRequired,onChange:i().func.isRequired,onValidate:i().func.isRequired,locale:i().string};var SS=__webpack_require__(12693),xS={0:8203,1:8204,2:8205,3:8290,4:8291,5:8288,6:65279,7:8289,8:119155,9:119156,a:119157,b:119158,c:119159,d:119160,e:119161,f:119162},OS={0:8203,1:8204,2:8205,3:65279},ES=new Array(4).fill(String.fromCodePoint(OS[0])).join(""),kS=String.fromCharCode(0);var CS=Object.fromEntries(Object.entries(OS).map((e=>e.reverse()))),TS=Object.fromEntries(Object.entries(xS).map((e=>e.reverse()))),PS=`${Object.values(xS).map((e=>`\\u{${e.toString(16)}}`)).join("")}`,jS=new RegExp(`[${PS}]{4,}`,"gu");function RS(e){return Qe.Map.isMap(e)}function MS(e){var t,r;return e?"types"in e?null!==(t=e.types)&&void 0!==t?t:[]:"fields"in e?null!==(r=e.fields)&&void 0!==r?r:[]:"field"in e?e.field?[e.field]:[]:[e]:[]}function AS(e,t){const r=t.toJS(),n=new Map;return function e(t,r,o=""){if(n.get(o)===t)return t;const i={fields:r,path:o,visit:e};let a;return a=function(e){return Qe.List.isList(e)}(t)?function(e,t){let r=e;for(let e=0;e<r.size;e++){const n=r.get(e);if(RS(n)){const o=n.get("type");if("string"==typeof o){const i=t.fields.find((e=>e.name===o)),a=t.visit(n,MS(i),`${t.path}.${e}`);r=r.set(e,a)}else{const o=t.visit(n,t.fields,`${t.path}.${e}`);r=r.set(e,o)}}else{const o=t.fields[0],i=t.visit(n,o?[o]:[],`${t.path}.${e}`);i!==n&&(r=r.set(e,i))}}return r}(t,i):RS(t)?function(e,t){let r=e;for(const[e,n]of r.entrySeq().toArray()){const o=t.fields.find((t=>t.name===e));if(o){const i=MS(o),a=t.visit(n,i,t.path?`${t.path}.${e}`:e);a!==n&&(r=r.set(e,a))}}return r}(t,i):"string"==typeof t?function(e,{fields:t,path:r}){var n;const o=function(e){let t=JSON.stringify(e);return`${ES}${Array.from(t).map((e=>{let r=e.charCodeAt(0);if(r>255)throw new Error(`Only ASCII edit info can be encoded. Error attempting to encode ${t} on character ${e} (${r})`);return Array.from(r.toString(4).padStart(4,"0")).map((e=>String.fromCodePoint(OS[e]))).join("")})).join("")}`}({decap:r});return"markdown"===(null===(n=t[0])||void 0===n?void 0:n.widget)&&e.includes("\n\n")?e.split(/(\n\n+)/).map((e=>e.trim()?e+o:e)).join(""):e+o}(t,i):t,n.set(o,a),a}(e,r)}class IS extends r().Component{constructor(...e){super(...e),function(e,t,r){t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(this,"handleClick",(e=>{var t;const{previewProps:r,onFieldClick:n}=this.props;if(null==r||null===(t=r.collection)||void 0===t?void 0:t.getIn(["editor","visualEditing"],!1))try{const t=function(e){let t=e.match(jS);if(t)return function(e,t=!1){let r=Array.from(e);if(r.length%2!=0)throw new Error("Encoded data has invalid length");if(r.length%4||!e.startsWith(ES))return function(e,t){var r;let n=[];for(let t=.5*e.length;t--;){let r=`${TS[e[2*t].codePointAt(0)]}${TS[e[2*t+1].codePointAt(0)]}`;n.unshift(String.fromCharCode(parseInt(r,16)))}let o=[],i=[n.join("")],a=10;for(;i.length;){let e=i.shift();try{if(o.push(JSON.parse(e)),t)return o}catch(t){if(!a--)throw t;let n=+(null==(r=t.message.match(/\sposition\s(\d+)$/))?void 0:r[1]);if(!n)throw t;i.unshift(e.substring(0,n),e.substring(n))}}return o}(r,t);let n=[];for(let e=.25*r.length;e--;){let t=r.slice(4*e,4*e+4).map((e=>CS[e.codePointAt(0)])).join("");n.unshift(String.fromCharCode(parseInt(t,4)))}if(t){n.shift();let e=n.indexOf(kS);return-1===e&&(e=n.length),[JSON.parse(n.slice(0,e).join(""))]}return n.join("").split(kS).filter(Boolean).map((e=>JSON.parse(e)))}(t[0],!0)[0]}(e.target.textContent);null!=t&&t.decap&&n&&n(t.decap)}catch(e){console.log("Visual editing error:",e)}}))}renderPreview(){const{previewComponent:e,previewProps:t}=this.props;return(0,xo.jsx)("div",{onClick:this.handleClick},(0,Oe.isElement)(e)?r().cloneElement(e,t):r().createElement(e,t))}render(){var e;const{previewProps:t}=this.props,r=!(null==t||null===(e=t.collection)||void 0===e?void 0:e.getIn(["editor","visualEditing"],!1));return(0,xo.jsx)(SS.Kr,null,(e=>{const t=this.renderPreview();return r?(0,xo.jsx)(z_.ScrollSyncPane,{attachTo:e.document.scrollingElement},t):t}))}}IS.propTypes={previewComponent:i().func.isRequired,previewProps:i().object,onFieldClick:i().func};const DS=IS,LS=["previewComponent"];class NS extends r().Component{shouldComponentUpdate(e){return["object","list"].includes(e.field.get("widget"))||this.props.value!==e.value||this.props.fieldsMetaData!==e.fieldsMetaData||this.props.getAsset!==e.getAsset}render(){const e=this.props,{previewComponent:t}=e,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,LS);return r().createElement(t,n)}}NS.propTypes={previewComponent:i().func.isRequired,field:Vm().map.isRequired,value:i().oneOfType([i().node,i().object,i().string,i().bool])};const $S=NS;function FS(e){return"hidden"!==e.get("widget")}const BS=Cg("div",{target:"e1iji6y40",label:"PreviewContainer"})({name:"9bq7s9",styles:"font-family:Roboto,'Helvetica Neue',HelveticaNeue,Helvetica,Arial,sans-serif"});class US extends r().Component{render(){const{collection:e,fields:t,widgetFor:r}=this.props;return e&&t?(0,xo.jsx)(BS,null,t.filter(FS).map((e=>(0,xo.jsx)("div",{key:e.get("name")},r(e.get("name")))))):null}}function zS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function qS(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?zS(Object(r),!0).forEach((function(t){WS(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zS(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function WS(e,t,r){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}US.propTypes={collection:Vm().map.isRequired,entry:Vm().map.isRequired,fields:Vm().list.isRequired,getAsset:i().func.isRequired,widgetFor:i().func.isRequired};const HS=Cg(SS.ZP,{target:"enus48h0",label:"PreviewPaneFrame"})("width:100%;height:100%;border:none;background:#fff;border-radius:",qe.lengths.borderRadius,";");class VS extends r().Component{constructor(...e){super(...e),WS(this,"getWidget",((e,t,r,n,o=null)=>{const{getAsset:i,entry:a}=n,s=Tn(e.get("widget")),l=o?e.get("name")+"_"+o:e.get("name"),c=t&&!s.allowMapValue&&Qe.Map.isMap(t);return s.preview?(0,xo.jsx)($S,{previewComponent:s.preview,key:l,field:e,getAsset:i,value:c?t.get(e.get("name")):t,entry:a,fieldsMetaData:r,resolveWidget:Tn,getRemarkPlugins:jn}):null})),WS(this,"inferredFields",{}),WS(this,"widgetFor",((e,t=this.props.fields,r=this.props.entry.get("data"),n=this.props.fieldsMetaData)=>{let o=t&&t.find((t=>t.get("name")===e)),i=Qe.Map.isMap(r)&&r.get(o.get("name"));o.get("meta")&&(i=this.props.entry.getIn(["meta",o.get("name")]));const a=o.get("fields"),s=o.get("field"),l=n&&n.get(o.get("name"),(0,Qe.Map)());a&&(o=o.set("fields",this.getNestedWidgets(a,i,l))),s&&(o=o.set("field",this.getSingleNested(s,i,l)));const c=Object.entries(this.inferredFields).filter((([e])=>Oc(this.props.collection,e)===o)).map((([,e])=>e))[0];return c?i=c.defaultPreview(i):i&&-1!==["string","text","number"].indexOf(o.get("widget"))&&i.toString().length<50&&(i=(0,xo.jsx)("div",null,(0,xo.jsx)("strong",null,o.get("label",o.get("name")),":")," ",i)),i?this.getWidget(o,i,l,this.props):null})),WS(this,"getNestedWidgets",((e,t,r)=>Qe.List.isList(t)?t.map((t=>this.widgetsForNestedFields(e,t,r))):this.widgetsForNestedFields(e,t,r))),WS(this,"getSingleNested",((e,t,r)=>Qe.List.isList(t)?t.map(((t,n)=>this.getWidget(e,t,r.get(e.get("name")),this.props,n))):this.getWidget(e,t,r.get(e.get("name")),this.props))),WS(this,"widgetsForNestedFields",((e,t,r)=>e.map((n=>this.widgetFor(n.get("name"),e,t,r))))),WS(this,"widgetsFor",(e=>{const{fields:t,entry:r,fieldsMetaData:n}=this.props,o=t.find((t=>t.get("name")===e)),i=o&&o.get("fields"),a=o&&o.get("types"),s=r.getIn(["data",o.get("name")]),l=n.get(o.get("name"),(0,Qe.Map)());return Qe.List.isList(s)&&a?s.map((e=>{const t=a.find((t=>t.get("name")===e.get("type"))),r=t&&t.get("fields"),n=r&&(0,Qe.Map)(r.map(((t,r)=>[t.get("name"),(0,xo.jsx)("div",{key:r},this.getWidget(t,e,l.get(t.get("name")),this.props))])));return(0,Qe.Map)({data:e,widgets:n})})):Qe.List.isList(s)?s.map((e=>{const t=i&&(0,Qe.Map)(i.map(((t,r)=>[t.get("name"),(0,xo.jsx)("div",{key:r},this.getWidget(t,e,l.get(t.get("name")),this.props))])));return(0,Qe.Map)({data:e,widgets:t})})):(0,Qe.Map)({data:s,widgets:i&&(0,Qe.Map)(i.map((e=>[e.get("name"),this.getWidget(e,s,l.get(e.get("name")),this.props)])))})})),WS(this,"getCollection",(async(e,t)=>{const{state:r}=this.props,n=r.collections.get(e);if(void 0===t)return(await ml(r,n)).map((e=>(0,Qe.Map)().set("data",e.data)));const o=await xl(r,n,t);return(0,Qe.Map)().set("data",o.data)}))}inferFields(){const e=Cc(this.props.collection,"title"),t=Cc(this.props.collection,"shortTitle"),r=Cc(this.props.collection,"author");this.inferredFields={},e&&(this.inferredFields[e]=ko.title),t&&(this.inferredFields[t]=ko.shortTitle),r&&(this.inferredFields[r]=ko.author)}render(){const{entry:e,collection:t,config:r}=this.props;if(!e||!e.get("data"))return null;const n=On(function(e,t){return hc[e.get("type")].templateName(e,t)}(t,e.get("slug")))||US;this.inferFields();const o=t.getIn(["editor","visualEditing"],!1)?e.set("data",AS(e.get("data"),this.props.fields)):e,i=qS(qS({},this.props),{},{entry:o,widgetFor:(e,t,r=o.get("data"),n)=>this.widgetFor(e,t,r,n),widgetsFor:this.widgetsFor,getCollection:this.getCollection}),a=xn().map(((e,t)=>e.raw?(0,xo.jsx)("style",{key:t},e.value):(0,xo.jsx)("link",{key:t,href:e.value,type:"text/css",rel:"stylesheet"})));return t||(0,xo.jsx)(HS,{id:"preview-pane",head:a}),(0,xo.jsx)(Wg,{config:r},(0,xo.jsx)(HS,{id:"preview-pane",head:a,initialContent:'\n<!DOCTYPE html>\n<html>\n <head><base target="_blank"/></head>\n <body><div></div></body>\n</html>\n'},(0,xo.jsx)(SS.Kr,null,(({document:e,window:t})=>(0,xo.jsx)(DS,{previewComponent:n,previewProps:qS(qS({},i),{},{document:e,window:t}),onFieldClick:this.props.onFieldClick})))))}}VS.propTypes={collection:Vm().map.isRequired,fields:Vm().list.isRequired,entry:Vm().map.isRequired,fieldsMetaData:Vm().map.isRequired,getAsset:i().func.isRequired,onFieldClick:i().func};const GS=H((function(e){return{isLoadingAsset:xf(e.medias),config:e.config,state:e}}),(function(e){return{boundGetAsset:(t,r)=>ts(e,t,r)}}),(function(e,t,r){return qS(qS(qS(qS({},e),t),r),{},{getAsset:t.boundGetAsset(r.collection,r.entry)})}))(VS);function KS(e,t,r){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const YS={noOverflow:{name:"1ctb18k-noOverflow",styles:"overflow:hidden;white-space:nowrap;text-overflow:ellipsis;label:noOverflow;"},buttonMargin:{name:"bx8mhy-buttonMargin",styles:"margin:0 10px;label:buttonMargin;"},toolbarSection:(0,xo.css)("height:100%;display:flex;align-items:center;border:0 solid ",qe.colors.textFieldBorder,";;label:toolbarSection;"),publishedButton:(0,xo.css)("background-color:",qe.colorsRaw.tealLight,";color:",qe.colorsRaw.tealDark,";;label:publishedButton;")},JS=Cg("div",{target:"e1d2l9mo26",label:"TooltipText"})({name:"1ykbu60",styles:"visibility:hidden;width:321px;background-color:#555;color:#fff;text-align:unset;border-radius:6px;padding:5px;position:absolute;z-index:1;top:145%;left:50%;margin-left:-320px;opacity:0;transition:opacity 0.3s"}),QS=Cg("div",{target:"e1d2l9mo25",label:"Tooltip"})("position:relative;display:inline-block;&:hover+",JS,"{visibility:visible;opacity:0.9;}"),XS=Cg("div",{target:"e1d2l9mo24",label:"TooltipContainer"})({name:"bjn8wh",styles:"position:relative"}),ZS=Cg(qe.StyledDropdownButton,{target:"e1d2l9mo23",label:"DropdownButton"})(YS.noOverflow,"@media (max-width: 1200px){padding-left:10px;}"),ex=Cg("div",{target:"e1d2l9mo22",label:"ToolbarContainer"})("box-shadow:0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1);position:absolute;top:0;left:0;width:100%;min-width:800px;z-index:",qe.zIndex.zIndex300,";background-color:#fff;height:66px;display:flex;justify-content:space-between;"),tx=Cg("div",{target:"e1d2l9mo21",label:"ToolbarSectionMain"})(YS.toolbarSection,";flex:10;display:flex;justify-content:space-between;padding:0 10px;"),rx=Cg("div",{target:"e1d2l9mo20",label:"ToolbarSubSectionFirst"})({name:"s5xdrg",styles:"display:flex;align-items:center"}),nx=Cg(rx,{target:"e1d2l9mo19",label:"ToolbarSubSectionLast"})({name:"1f60if8",styles:"justify-content:flex-end"}),ox=Cg(Wv,{target:"e1d2l9mo18",label:"ToolbarSectionBackLink"})(YS.toolbarSection,";border-right-width:1px;font-weight:normal;padding:0 20px;&:hover,&:focus{background-color:#f1f2f4;}"),ix=Cg("div",{target:"e1d2l9mo17",label:"ToolbarSectionMeta"})(YS.toolbarSection,";border-left-width:1px;padding:0 7px;"),ax=Cg(qe.Dropdown,{target:"e1d2l9mo16",label:"ToolbarDropdown"})(YS.buttonMargin,";",qe.Icon,"{color:",qe.colorsRaw.teal,";}"),sx=Cg("div",{target:"e1d2l9mo15",label:"BackArrow"})("color:",qe.colors.textLead,";font-size:21px;font-weight:600;margin-right:16px;"),lx=Cg("div",{target:"e1d2l9mo14",label:"BackCollection"})("color:",qe.colors.textLead,";font-size:14px;"),cx=Cg("div",{target:"e1d2l9mo13",label:"BackStatus"})({name:"j9a02z",styles:"margin-top:6px"}),ux=Cg(cx,{target:"e1d2l9mo12",label:"BackStatusUnchanged"})(qe.components.textBadgeSuccess,";"),fx=Cg(cx,{target:"e1d2l9mo11",label:"BackStatusChanged"})(qe.components.textBadgeDanger,";"),px=Cg("button",{target:"e1d2l9mo10",label:"ToolbarButton"})(qe.buttons.button,";",qe.buttons.default,";",YS.buttonMargin,";",YS.noOverflow,";display:block;@media (max-width: 1200px){padding:0 10px;}"),dx=Cg(px,{target:"e1d2l9mo9",label:"DeleteButton"})(qe.buttons.lightRed,";"),hx=Cg(px,{target:"e1d2l9mo8",label:"SaveButton"})(qe.buttons.lightBlue,";&[disabled]{",qe.buttons.disabled,";}"),gx=Cg(ZS,{target:"e1d2l9mo7",label:"PublishedToolbarButton"})(YS.publishedButton,";"),mx=Cg(px,{target:"e1d2l9mo6",label:"PublishedButton"})(YS.publishedButton,";"),yx=Cg(ZS,{target:"e1d2l9mo5",label:"PublishButton"})("background-color:",qe.colorsRaw.teal,";"),vx=Cg(ZS,{target:"e1d2l9mo4",label:"StatusButton"})("background-color:",qe.colorsRaw.tealLight,";color:",qe.colorsRaw.teal,";"),bx=Cg("div",{target:"e1d2l9mo3",label:"PreviewButtonContainer"})("margin-right:12px;color:",qe.colorsRaw.blue,";display:flex;align-items:center;a,",qe.Icon,"{color:",qe.colorsRaw.blue,";}",qe.Icon,"{position:relative;top:1px;}"),wx=Cg("button",{target:"e1d2l9mo2",label:"RefreshPreviewButton"})("background:none;border:0;cursor:pointer;color:",qe.colorsRaw.blue,";span{margin-right:6px;}"),_x=wx.withComponent("a",{target:"e1d2l9mo27",label:"PreviewLink"}),Sx=Cg(qe.DropdownItem,{target:"e1d2l9mo1",label:"PublishDropDownItem"})({name:"svxjwj",styles:"min-width:initial"}),xx=Cg(qe.DropdownItem,{target:"e1d2l9mo0",label:"StatusDropdownItem"})(qe.Icon,"{color:",qe.colors.infoText,";}");class Ox extends r().Component{constructor(...e){super(...e),KS(this,"renderSimpleControls",(()=>{const{collection:e,hasChanged:t,isNewEntry:n,showDelete:o,onDelete:i,t:a}=this.props,s=e.get("create");return(0,xo.jsx)(r().Fragment,null,n||t?this.renderNewEntrySimplePublishControls({canCreate:s}):this.renderExistingEntrySimplePublishControls({canCreate:s}),(0,xo.jsx)("div",null,o?(0,xo.jsx)(dx,{onClick:i},a("editor.editorToolbar.deleteEntry")):null))})),KS(this,"renderDeployPreviewControls",(e=>{const{deployPreview:t={},loadDeployPreview:r,t:n}=this.props,{url:o,status:i,isFetching:a}=t;if(!i)return;const s="SUCCESS"===i&&!a;return(0,xo.jsx)(bx,null,s?(0,xo.jsx)(_x,{rel:"noopener noreferrer",target:"_blank",href:o},(0,xo.jsx)("span",null,e),(0,xo.jsx)(qe.Icon,{type:"new-tab",size:"xsmall"})):(0,xo.jsx)(wx,{onClick:r},(0,xo.jsx)("span",null,n("editor.editorToolbar.deployPreviewPendingButtonLabel")),(0,xo.jsx)(qe.Icon,{type:"refresh",size:"xsmall"})))})),KS(this,"renderStatusInfoTooltip",(()=>{const{t:e,currentStatus:t}=this.props,r={[eo.get("DRAFT")]:"statusInfoTooltipDraft",[eo.get("PENDING_REVIEW")]:"statusInfoTooltipInReview"},n=Object.keys(r).find((e=>e===t));return(0,xo.jsx)(XS,null,(0,xo.jsx)(QS,null,(0,xo.jsx)(qe.Icon,{type:"info-circle",size:"small",className:"tooltip"})),n&&(0,xo.jsx)(JS,null,e(`editor.editorToolbar.${r[n]}`)))})),KS(this,"renderWorkflowStatusControls",(()=>{const{isUpdatingStatus:e,onChangeStatus:t,currentStatus:n,t:o,useOpenAuthoring:i}=this.props,a={[eo.get("DRAFT")]:o("editor.editorToolbar.draft"),[eo.get("PENDING_REVIEW")]:o("editor.editorToolbar.inReview"),[eo.get("PENDING_PUBLISH")]:o("editor.editorToolbar.ready")},s=e?o("editor.editorToolbar.updating"):o("editor.editorToolbar.status",{status:a[n]});return(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(ax,{dropdownTopOverlap:"40px",dropdownWidth:"120px",renderButton:()=>(0,xo.jsx)(vx,null,s)},(0,xo.jsx)(xx,{label:o("editor.editorToolbar.draft"),onClick:()=>t("DRAFT"),icon:n===eo.get("DRAFT")?"check":null}),(0,xo.jsx)(xx,{label:o("editor.editorToolbar.inReview"),onClick:()=>t("PENDING_REVIEW"),icon:n===eo.get("PENDING_REVIEW")?"check":null}),i?"":(0,xo.jsx)(xx,{label:o("editor.editorToolbar.ready"),onClick:()=>t("PENDING_PUBLISH"),icon:n===eo.get("PENDING_PUBLISH")?"check":null})),i&&this.renderStatusInfoTooltip())})),KS(this,"renderNewEntryWorkflowPublishControls",(({canCreate:e,canPublish:t})=>{const{isPublishing:n,onPublish:o,onPublishAndNew:i,onPublishAndDuplicate:a,t:s}=this.props;return t?(0,xo.jsx)(ax,{dropdownTopOverlap:"40px",dropdownWidth:"200px",renderButton:()=>(0,xo.jsx)(yx,null,s(n?"editor.editorToolbar.publishing":"editor.editorToolbar.publish"))},(0,xo.jsx)(Sx,{label:s("editor.editorToolbar.publishNow"),icon:"arrow",iconDirection:"right",onClick:o}),e?(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(Sx,{label:s("editor.editorToolbar.publishAndCreateNew"),icon:"add",onClick:i}),(0,xo.jsx)(Sx,{label:s("editor.editorToolbar.publishAndDuplicate"),icon:"add",onClick:a})):null):""})),KS(this,"renderExistingEntryWorkflowPublishControls",(({canCreate:e,canPublish:t,canDelete:r})=>{const{unPublish:n,onDuplicate:o,isPersisting:i,t:a}=this.props;return t||e?(0,xo.jsx)(ax,{dropdownTopOverlap:"40px",dropdownWidth:"150px",key:"td-publish-create",renderButton:()=>(0,xo.jsx)(gx,null,a(i?"editor.editorToolbar.unpublishing":"editor.editorToolbar.published"))},r&&t&&(0,xo.jsx)(qe.DropdownItem,{label:a("editor.editorToolbar.unpublish"),icon:"arrow",iconDirection:"right",onClick:n}),e&&(0,xo.jsx)(qe.DropdownItem,{label:a("editor.editorToolbar.duplicate"),icon:"add",onClick:o})):""})),KS(this,"renderExistingEntrySimplePublishControls",(({canCreate:e})=>{const{onDuplicate:t,t:r}=this.props;return e?(0,xo.jsx)(ax,{dropdownTopOverlap:"40px",dropdownWidth:"150px",renderButton:()=>(0,xo.jsx)(gx,null,r("editor.editorToolbar.published"))},(0,xo.jsx)(qe.DropdownItem,{label:r("editor.editorToolbar.duplicate"),icon:"add",onClick:t})):(0,xo.jsx)(mx,null,r("editor.editorToolbar.published"))})),KS(this,"renderNewEntrySimplePublishControls",(({canCreate:e})=>{const{onPersist:t,onPersistAndNew:n,onPersistAndDuplicate:o,isPersisting:i,t:a}=this.props;return(0,xo.jsx)("div",null,(0,xo.jsx)(ax,{dropdownTopOverlap:"40px",dropdownWidth:"150px",renderButton:()=>(0,xo.jsx)(yx,null,a(i?"editor.editorToolbar.publishing":"editor.editorToolbar.publish"))},(0,xo.jsx)(qe.DropdownItem,{label:a("editor.editorToolbar.publishNow"),icon:"arrow",iconDirection:"right",onClick:t}),e?(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(qe.DropdownItem,{label:a("editor.editorToolbar.publishAndCreateNew"),icon:"add",onClick:n}),(0,xo.jsx)(qe.DropdownItem,{label:a("editor.editorToolbar.publishAndDuplicate"),icon:"add",onClick:o})):null))})),KS(this,"renderSimpleDeployPreviewControls",(()=>{const{hasChanged:e,isNewEntry:t,t:r}=this.props;if(!t&&!e)return this.renderDeployPreviewControls(r("editor.editorToolbar.deployButtonLabel"))})),KS(this,"renderWorkflowControls",(()=>{const{onPersist:e,onDelete:t,onDeleteUnpublishedChanges:n,showDelete:o,hasChanged:i,hasUnpublishedChanges:a,useOpenAuthoring:s,isPersisting:l,isDeleting:c,isNewEntry:u,isModification:f,currentStatus:p,collection:d,t:h}=this.props,g=d.get("create"),m=d.get("publish")&&!s,y=d.get("delete",!0),v=a&&f&&h("editor.editorToolbar.deleteUnpublishedChanges")||a&&(u||!f)&&h("editor.editorToolbar.deleteUnpublishedEntry")||!a&&!f&&h("editor.editorToolbar.deletePublishedEntry");return[(0,xo.jsx)(hx,{disabled:!i,key:"save-button",onClick:()=>i&&e()},h(l?"editor.editorToolbar.saving":"editor.editorToolbar.save")),p?[(0,xo.jsx)(r().Fragment,{key:"workflow-status-controls"},this.renderWorkflowStatusControls(),!i&&this.renderNewEntryWorkflowPublishControls({canCreate:g,canPublish:m}))]:!u&&(0,xo.jsx)(r().Fragment,{key:"existing-entry-workflow-publish-controls"},this.renderExistingEntryWorkflowPublishControls({canCreate:g,canPublish:m,canDelete:y})),o&&!s||a||f?(0,xo.jsx)(dx,{key:"delete-button",onClick:a?n:t},c?h("editor.editorToolbar.deleting"):v):null]})),KS(this,"renderWorkflowDeployPreviewControls",(()=>{const{currentStatus:e,isNewEntry:t,t:r}=this.props;return e?this.renderDeployPreviewControls(r("editor.editorToolbar.deployPreviewButtonLabel")):t?void 0:this.renderDeployPreviewControls(r("editor.editorToolbar.deployButtonLabel"))}))}componentDidMount(){const{isNewEntry:e,loadDeployPreview:t}=this.props;e||t({maxAttempts:3})}componentDidUpdate(e){const{isNewEntry:t,isPersisting:r,loadDeployPreview:n}=this.props;t||!e.isPersisting||r||n({maxAttempts:3})}render(){const{user:e,hasChanged:t,displayUrl:r,collection:n,hasWorkflow:o,onLogoutClick:i,t:a,editorBackLink:s}=this.props;return(0,xo.jsx)(ex,null,(0,xo.jsx)(ox,{to:s},(0,xo.jsx)(sx,null,"←"),(0,xo.jsx)("div",null,(0,xo.jsx)(lx,null,a("editor.editorToolbar.backCollection",{collectionLabel:n.get("label")})),t?(0,xo.jsx)(fx,null,a("editor.editorToolbar.unsavedChanges")):(0,xo.jsx)(ux,null,a("editor.editorToolbar.changesSaved")))),(0,xo.jsx)(tx,null,(0,xo.jsx)(rx,null,o?this.renderWorkflowControls():this.renderSimpleControls()),(0,xo.jsx)(nx,null,o?this.renderWorkflowDeployPreviewControls():this.renderSimpleDeployPreviewControls())),(0,xo.jsx)(ix,null,(0,xo.jsx)(Wm,{displayUrl:r,imageUrl:null==e?void 0:e.avatar_url,onLogoutClick:i})))}}KS(Ox,"propTypes",{isPersisting:i().bool,isPublishing:i().bool,isUpdatingStatus:i().bool,isDeleting:i().bool,onPersist:i().func.isRequired,onPersistAndNew:i().func.isRequired,onPersistAndDuplicate:i().func.isRequired,showDelete:i().bool.isRequired,onDelete:i().func.isRequired,onDeleteUnpublishedChanges:i().func.isRequired,onChangeStatus:i().func.isRequired,onPublish:i().func.isRequired,unPublish:i().func.isRequired,onDuplicate:i().func.isRequired,onPublishAndNew:i().func.isRequired,onPublishAndDuplicate:i().func.isRequired,user:i().object,hasChanged:i().bool,displayUrl:i().string,collection:Vm().map.isRequired,hasWorkflow:i().bool,useOpenAuthoring:i().bool,hasUnpublishedChanges:i().bool,isNewEntry:i().bool,isModification:i().bool,currentStatus:i().string,onLogoutClick:i().func.isRequired,deployPreview:i().object,loadDeployPreview:i().func.isRequired,t:i().func.isRequired,editorBackLink:i().string.isRequired});const Ex=(0,We.Iu)()(Ox);function kx(){return kx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kx.apply(this,arguments)}function Cx(e,t,r){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Tx="cms.preview-visible",Px="cms.scroll-sync-enabled",jx="cms.split-pane-position",Rx="cms.i18n-visible",Mx={splitPane:(0,xo.css)(qe.components.card,";border-radius:0;height:100%;;label:splitPane;"),pane:{name:"1yvxf4n-pane",styles:"height:100%;overflow-y:auto;label:pane;"}},Ax=Cg(qe.IconButton,{target:"e1nx103k7",label:"EditorToggle"})({name:"cn3xcj",styles:"margin-bottom:12px"});function Ix(){return(0,xo.jsx)(xo.Global,{styles:(0,xo.css)(".Resizer.vertical{width:2px;cursor:col-resize;position:relative;background:none;&:before{content:'';width:2px;height:100%;position:relative;background-color:",qe.colors.textFieldBorder,";display:block;z-index:10;transition:background-color ",qe.transitions.main,";}&:hover,&:active{&:before{width:4px;left:-1px;background-color:",qe.colorsRaw.blue,";}}};label:ReactSplitPaneGlobalStyles;")})}const Dx=Cg(U_,{target:"e1nx103k6",label:"StyledSplitPane"})(Mx.splitPane,";.Pane{height:100%;}"),Lx=Cg("div",{target:"e1nx103k5",label:"NoPreviewContainer"})(Mx.splitPane,";"),Nx=Cg("div",{target:"e1nx103k4",label:"EditorContainer"})("width:100%;min-width:800px;height:100%;position:absolute;top:0;left:0;overflow:hidden;padding-top:66px;background-color:",qe.colors.background,";"),$x=Cg("div",{target:"e1nx103k3",label:"Editor"})({name:"yd3x82",styles:"height:100%;margin:0 auto;position:relative"}),Fx=Cg("div",{target:"e1nx103k2",label:"PreviewPaneContainer"})("height:100%;pointer-events:",(e=>e.blockEntry?"none":"auto"),";overflow-y:",(e=>e.overFlow?"auto":"hidden"),";"),Bx=Cg(Fx,{target:"e1nx103k1",label:"ControlPaneContainer"})({name:"b2tic3",styles:"padding:0 16px;position:relative;overflow-x:hidden"}),Ux=Cg("div",{target:"e1nx103k0",label:"ViewControls"})("position:absolute;top:10px;right:10px;z-index:",qe.zIndex.zIndex299,";");function zx({i18nVisible:e,previewVisible:t,editor:r,editorWithEditor:n,editorWithPreview:o}){return e?n:t?o:(0,xo.jsx)(Lx,null,r)}class qx extends t.Component{constructor(...e){super(...e),Cx(this,"state",{showEventBlocker:!1,previewVisible:"false"!==localStorage.getItem(Tx),scrollSyncEnabled:"false"!==localStorage.getItem(Px),i18nVisible:"false"!==localStorage.getItem(Rx)}),Cx(this,"handleFieldClick",(e=>{var t;null===(t=this.controlPaneRef)||void 0===t||t.focus(e)})),Cx(this,"handleSplitPaneDragStart",(()=>{this.setState({showEventBlocker:!0})})),Cx(this,"handleSplitPaneDragFinished",(()=>{this.setState({showEventBlocker:!1})})),Cx(this,"handleOnPersist",(async(e={})=>{const{createNew:t=!1,duplicate:r=!1}=e;await this.controlPaneRef.switchToDefaultLocale(),this.controlPaneRef.validate(),this.props.onPersist({createNew:t,duplicate:r})})),Cx(this,"handleOnPublish",(async(e={})=>{const{createNew:t=!1,duplicate:r=!1}=e;await this.controlPaneRef.switchToDefaultLocale(),this.controlPaneRef.validate(),this.props.onPublish({createNew:t,duplicate:r})})),Cx(this,"handleTogglePreview",(()=>{const e=!this.state.previewVisible;this.setState({previewVisible:e}),localStorage.setItem(Tx,e)})),Cx(this,"handleToggleScrollSync",(()=>{const e=!this.state.scrollSyncEnabled;this.setState({scrollSyncEnabled:e}),localStorage.setItem(Px,e)})),Cx(this,"handleToggleI18n",(()=>{const e=!this.state.i18nVisible;this.setState({i18nVisible:e}),localStorage.setItem(Rx,e)})),Cx(this,"handleLeftPanelLocaleChange",(e=>{this.setState({leftPanelLocale:e})}))}render(){const{collection:e,entry:t,fields:r,fieldsMetaData:n,fieldsErrors:o,onChange:i,showDelete:a,onDelete:s,onDeleteUnpublishedChanges:l,onChangeStatus:c,onPublish:u,unPublish:f,onDuplicate:p,onValidate:d,user:h,hasChanged:g,displayUrl:m,hasWorkflow:y,useOpenAuthoring:v,hasUnpublishedChanges:b,isNewEntry:w,isModification:_,currentStatus:S,onLogoutClick:x,loadDeployPreview:O,deployPreview:E,draftKey:k,editorBackLink:C,t:T}=this.props,{scrollSyncEnabled:P,showEventBlocker:j}=this.state,R=function(e,t){if(e.get("type")===bo){const r=mc(e,t.get("slug")),n=null==r?void 0:r.getIn(["editor","preview"]);if(null!=n)return n}return e.getIn(["editor","preview"],!0)}(e,t),{locales:M,defaultLocale:A}=Nc(this.props.collection),I=Lc(e)&&M.length>1,D={collection:e,entry:t,fields:r,fieldsMetaData:n,fieldsErrors:o,onChange:i,onValidate:d},L=this.state.leftPanelLocale||(null==M?void 0:M[0]),N=(0,xo.jsx)(Bx,{overFlow:!0,blockEntry:j},(0,xo.jsx)(_S,kx({},D,{ref:e=>this.controlPaneRef=e,locale:L,t:T,onLocaleChange:this.handleLeftPanelLocaleChange}))),$=(0,xo.jsx)(Bx,{overFlow:!this.state.scrollSyncEnabled,blockEntry:j},(0,xo.jsx)(_S,kx({},D,{locale:null==M?void 0:M[1],t:T}))),F=I?function(e,t,r){return t===r?e:e.set("data",e.getIn([Ac,t,"data"]))}(t,L,A):t,B=(0,xo.jsx)(z_.ScrollSync,{enabled:this.state.scrollSyncEnabled},(0,xo.jsx)("div",null,(0,xo.jsx)(Ix,null),(0,xo.jsx)(Dx,{maxSize:-100,minSize:400,defaultSize:parseInt(localStorage.getItem(jx),10)||"50%",onChange:e=>localStorage.setItem(jx,e),onDragStarted:this.handleSplitPaneDragStart,onDragFinished:this.handleSplitPaneDragFinished},(0,xo.jsx)(z_.ScrollSyncPane,null,N),(0,xo.jsx)(Fx,{blockEntry:j},(0,xo.jsx)(GS,{collection:e,entry:F,fields:r,fieldsMetaData:n,locale:L,onFieldClick:this.handleFieldClick}))))),U=(0,xo.jsx)(z_.ScrollSync,{enabled:this.state.scrollSyncEnabled},(0,xo.jsx)("div",null,(0,xo.jsx)(Dx,{maxSize:-100,defaultSize:parseInt(localStorage.getItem(jx),10)||"50%",onChange:e=>localStorage.setItem(jx,e),onDragStarted:this.handleSplitPaneDragStart,onDragFinished:this.handleSplitPaneDragFinished},(0,xo.jsx)(z_.ScrollSyncPane,null,N),(0,xo.jsx)(z_.ScrollSyncPane,null,$)))),z=I&&this.state.i18nVisible,q=R&&this.state.previewVisible,W=z||q;return(0,xo.jsx)(Nx,null,(0,xo.jsx)(Ex,{isPersisting:t.get("isPersisting"),isPublishing:t.get("isPublishing"),isUpdatingStatus:t.get("isUpdatingStatus"),isDeleting:t.get("isDeleting"),onPersist:this.handleOnPersist,onPersistAndNew:()=>this.handleOnPersist({createNew:!0}),onPersistAndDuplicate:()=>this.handleOnPersist({createNew:!0,duplicate:!0}),onDelete:s,onDeleteUnpublishedChanges:l,onChangeStatus:c,showDelete:a,onPublish:u,unPublish:f,onDuplicate:p,onPublishAndNew:()=>this.handleOnPublish({createNew:!0}),onPublishAndDuplicate:()=>this.handleOnPublish({createNew:!0,duplicate:!0}),user:h,hasChanged:g,displayUrl:m,collection:e,hasWorkflow:y,useOpenAuthoring:v,hasUnpublishedChanges:b,isNewEntry:w,isModification:_,currentStatus:S,onLogoutClick:x,loadDeployPreview:O,deployPreview:E,editorBackLink:C}),(0,xo.jsx)($x,{key:k},(0,xo.jsx)(Ux,null,I&&(0,xo.jsx)(Ax,{isActive:z,onClick:this.handleToggleI18n,size:"large",type:"page",title:T("editor.editorInterface.toggleI18n"),marginTop:"70px"}),R&&(0,xo.jsx)(Ax,{isActive:q,onClick:this.handleTogglePreview,size:"large",type:"eye",title:T("editor.editorInterface.togglePreview")}),W&&!e.getIn(["editor","visualEditing"])&&(0,xo.jsx)(Ax,{isActive:P,onClick:this.handleToggleScrollSync,size:"large",type:"scroll",title:T("editor.editorInterface.toggleScrollSync")})),(0,xo.jsx)(zx,{i18nVisible:z,previewVisible:q,editor:N,editorWithEditor:U,editorWithPreview:B})))}}qx.propTypes={collection:Vm().map.isRequired,entry:Vm().map.isRequired,fields:Vm().list.isRequired,fieldsMetaData:Vm().map.isRequired,fieldsErrors:Vm().map.isRequired,onChange:i().func.isRequired,onValidate:i().func.isRequired,onPersist:i().func.isRequired,showDelete:i().bool.isRequired,onDelete:i().func.isRequired,onDeleteUnpublishedChanges:i().func.isRequired,onPublish:i().func.isRequired,unPublish:i().func.isRequired,onDuplicate:i().func.isRequired,onChangeStatus:i().func.isRequired,user:i().object,hasChanged:i().bool,displayUrl:i().string,hasWorkflow:i().bool,useOpenAuthoring:i().bool,hasUnpublishedChanges:i().bool,isNewEntry:i().bool,isModification:i().bool,currentStatus:i().string,onLogoutClick:i().func.isRequired,deployPreview:i().object,loadDeployPreview:i().func.isRequired,draftKey:i().string.isRequired,t:i().func.isRequired};const Wx=qx;function Hx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Vx(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Hx(Object(r),!0).forEach((function(t){Gx(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hx(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Gx(e,t,r){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Kx(e,t){const{collections:r}=e,n=e.config.publish_mode===Zn,o=r.get(t.match.params.name),i={isEditorialWorkflow:n,showDelete:!t.newEntry&&Sc(o)};if(n){const r=t.match.params[0],n=Vf(e,o.get("name"),r);n&&(i.unpublishedEntry=!0,i.entry=n)}return i}function Yx(e,t,r){const{isEditorialWorkflow:n,unpublishedEntry:o}=e,{dispatch:i}=t,a={};return n&&(a.loadEntry=(e,t)=>i(Cs(e,t)),a.persistEntry=e=>i(function(e,t){return async(r,n)=>{const o=n(),i=o.entryDraft,a=i.get("fieldsErrors"),s=function(e,t){return function(e,t){return e.get("entities")?e.get("entities").filter(((e,r)=>yf()(r,`${t}.`))).map((e=>e.get("slug"))).valueSeq():null}(e.editorialWorkflow,t)}(o,e.get("name")),l=Wf(o,e.get("name")).concat(s);if(!Qt()(o.editorialWorkflow.toJS(),"pages.ids",!1)&&r(Ts(o.collections)),!a.isEmpty())return a.some((e=>e.some((e=>e.type&&e.type===Ki.PRESENCE))))&&r(ea({message:{key:"ui.toast.missingRequiredField"},type:"error",dismissAfter:8e3})),Promise.reject();const c=rf(o.config),u=i.get("entry"),f=Tl({entry:u}),p=Pl(e,u),d=i.set("entry",p);r(Os(e,u.get("slug")));const h=t?c.persistUnpublishedEntry:c.persistEntry;try{const t=await h.call(c,{config:o.config,collection:e,entryDraft:d,assetProxies:f,usedSlugs:l});r(ea({message:{key:"ui.toast.entrySaved"},type:"success",dismissAfter:4e3})),r(Es(e,p)),u.get("slug")!==t&&(await r(Cs(e,t)),as(e.get("name"),t))}catch(t){return r(ea({message:{key:"ui.toast.onFailToPersist",details:t},type:"error",dismissAfter:8e3})),Promise.reject(r(ks(t,e,u.get("slug"))))}}}(e,o))),Vx(Vx(Vx({},r),e),a)}function Jx(e,t,r){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Qx extends r().Component{constructor(...e){super(...e),Jx(this,"createBackup",w_()((function(e,t){this.props.persistLocalBackup(e,t)}),2e3)),Jx(this,"handleChangeDraftField",((e,t,r,n)=>{const o=[this.props.unPublishedEntry,this.props.publishedEntry].filter(Boolean);this.props.changeDraftField({field:e,value:t,metadata:r,entries:o,i18n:n})})),Jx(this,"handleChangeStatus",(e=>{const{entryDraft:t,updateUnpublishedEntryStatus:r,collection:n,slug:o,currentStatus:i,t:a}=this.props;if(t.get("hasChanged"))return void window.alert(a("editor.editor.onUpdatingWithUnsavedChanges"));const s=eo.get(e);r(n.get("name"),o,i,s)})),Jx(this,"handlePersistEntry",(async(e={})=>{const{createNew:t=!1,duplicate:r=!1}=e,{persistEntry:n,collection:o,currentStatus:i,hasWorkflow:a,loadEntry:s,slug:l,createDraftDuplicateFromEntry:c,entryDraft:u}=this.props;await n(o),this.deleteBackup(),t?(is(o.get("name")),r&&c(u.get("entry"))):l&&a&&!i&&s(o,l)})),Jx(this,"handlePublishEntry",(async(e={})=>{const{createNew:t=!1,duplicate:r=!1}=e,{publishUnpublishedEntry:n,createDraftDuplicateFromEntry:o,entryDraft:i,collection:a,slug:s,currentStatus:l,t:c}=this.props;l===eo.last()?i.get("hasChanged")?window.alert(c("editor.editor.onPublishingWithUnsavedChanges")):window.confirm(c("editor.editor.onPublishing"))&&(await n(a.get("name"),s),this.deleteBackup(),t&&is(a.get("name")),r&&o(i.get("entry"))):window.alert(c("editor.editor.onPublishingNotReady"))})),Jx(this,"handleUnpublishEntry",(async()=>{const{unpublishPublishedEntry:e,collection:t,slug:r,t:n}=this.props;if(window.confirm(n("editor.editor.onUnpublishing")))return await e(t,r),os(t.get("name"))})),Jx(this,"handleDuplicateEntry",(()=>{const{createDraftDuplicateFromEntry:e,collection:t,entryDraft:r}=this.props;is(t.get("name")),e(r.get("entry"))})),Jx(this,"handleDeleteEntry",(()=>{const{entryDraft:e,newEntry:t,collection:r,deleteEntry:n,slug:o,t:i}=this.props;if(e.get("hasChanged")){if(!window.confirm(i("editor.editor.onDeleteWithUnsavedChanges")))return}else if(!window.confirm(i("editor.editor.onDeletePublishedEntry")))return;if(t)return os(r.get("name"));setTimeout((async()=>(await n(r,o),this.deleteBackup(),os(r.get("name")))),0)})),Jx(this,"handleDeleteUnpublishedChanges",(async()=>{const{entryDraft:e,collection:t,slug:r,deleteUnpublishedEntry:n,loadEntry:o,isModification:i,t:a}=this.props;e.get("hasChanged")&&!window.confirm(a("editor.editor.onDeleteUnpublishedChangesWithUnsavedChanges"))||window.confirm(a("editor.editor.onDeleteUnpublishedChanges"))&&(await n(t.get("name"),r),this.deleteBackup(),i?o(t,r):os(t.get("name")))}))}componentDidMount(){const{newEntry:e,collection:t,slug:r,loadEntry:n,createEmptyDraft:o,loadEntries:i,retrieveLocalBackup:a,collectionEntriesLoaded:s,t:l}=this.props;a(t,r),e?o(t,this.props.location.search):n(t,r);const c=l("editor.editor.onLeavePage");this.exitBlocker=e=>{if(this.props.entryDraft.get("hasChanged"))return e.returnValue=c,c},window.addEventListener("beforeunload",this.exitBlocker);const u=ns.block(((e,r)=>{const n=this.props.entryDraft.getIn(["entry","isPersisting"]),o=this.props.entryDraft.getIn(["entry","newRecord"]),i=`/collections/${t.get("name")}/new`;if(!n||!o||this.props.location.pathname!==i||"PUSH"!==r)return this.props.hasChanged?c:void 0}));this.unlisten=ns.listen(((e,r)=>{const n=`/collections/${t.get("name")}/new`,o=`/collections/${t.get("name")}/entries/`,{pathname:i}=e;i.startsWith(n)||i.startsWith(o)&&"PUSH"===r||(this.deleteBackup(),u(),this.unlisten())})),s||i(t)}componentDidUpdate(e){if(!e.localBackup&&this.props.localBackup&&(window.confirm(this.props.t("editor.editor.confirmLoadBackup"))?this.props.loadLocalBackup():this.deleteBackup()),this.props.hasChanged&&this.createBackup(this.props.entryDraft.get("entry"),this.props.collection),e.entry===this.props.entry)return;const{newEntry:t,collection:r}=this.props;t&&e.createEmptyDraft(r,this.props.location.search)}componentWillUnmount(){this.createBackup.flush(),this.props.discardDraft(),window.removeEventListener("beforeunload",this.exitBlocker)}deleteBackup(){const{deleteLocalBackup:e,collection:t,slug:r,newEntry:n}=this.props;this.createBackup.cancel(),e(t,!n&&r)}render(){const{entry:e,entryDraft:t,fields:r,collection:n,changeDraftFieldValidation:o,user:i,hasChanged:a,displayUrl:s,hasWorkflow:l,useOpenAuthoring:c,unpublishedEntry:u,newEntry:f,isModification:p,currentStatus:d,logoutUser:h,deployPreview:g,loadDeployPreview:m,draftKey:y,slug:v,t:b,editorBackLink:w}=this.props,_=!f&&!u;return e&&e.get("error")?(0,xo.jsx)("div",null,(0,xo.jsx)("h3",null,e.get("error"))):null==t||void 0===t.get("entry")||e&&e.get("isFetching")?(0,xo.jsx)(qe.Loader,{active:!0},b("editor.editor.loadingEntry")):(0,xo.jsx)(Wx,{draftKey:y,entry:t.get("entry"),collection:n,fields:r,fieldsMetaData:t.get("fieldsMetaData"),fieldsErrors:t.get("fieldsErrors"),onChange:this.handleChangeDraftField,onValidate:o,onPersist:this.handlePersistEntry,onDelete:this.handleDeleteEntry,onDeleteUnpublishedChanges:this.handleDeleteUnpublishedChanges,onChangeStatus:this.handleChangeStatus,onPublish:this.handlePublishEntry,unPublish:this.handleUnpublishEntry,onDuplicate:this.handleDuplicateEntry,showDelete:this.props.showDelete,user:i,hasChanged:a,displayUrl:s,hasWorkflow:l,useOpenAuthoring:c,hasUnpublishedChanges:u,isNewEntry:f,isModification:p,currentStatus:d,onLogoutClick:h,deployPreview:g,loadDeployPreview:t=>m(n,v,e,_,t),editorBackLink:w,t:b})}}Jx(Qx,"propTypes",{changeDraftField:i().func.isRequired,changeDraftFieldValidation:i().func.isRequired,collection:Vm().map.isRequired,createDraftDuplicateFromEntry:i().func.isRequired,createEmptyDraft:i().func.isRequired,discardDraft:i().func.isRequired,entry:Vm().map,entryDraft:Vm().map.isRequired,loadEntry:i().func.isRequired,persistEntry:i().func.isRequired,deleteEntry:i().func.isRequired,showDelete:i().bool.isRequired,fields:Vm().list.isRequired,slug:i().string,newEntry:i().bool.isRequired,displayUrl:i().string,hasWorkflow:i().bool,useOpenAuthoring:i().bool,unpublishedEntry:i().bool,isModification:i().bool,collectionEntriesLoaded:i().bool,updateUnpublishedEntryStatus:i().func.isRequired,publishUnpublishedEntry:i().func.isRequired,deleteUnpublishedEntry:i().func.isRequired,logoutUser:i().func.isRequired,loadEntries:i().func.isRequired,deployPreview:i().object,loadDeployPreview:i().func.isRequired,currentStatus:i().string,user:i().object,location:i().shape({pathname:i().string,search:i().string}),hasChanged:i().bool,t:i().func.isRequired,retrieveLocalBackup:i().func.isRequired,localBackup:Vm().map,loadLocalBackup:i().func,persistLocalBackup:i().func.isRequired,deleteLocalBackup:i().func});const Xx={changeDraftField:function({field:e,value:t,metadata:r,entries:n,i18n:o}){return{type:el,payload:{field:e,value:t,metadata:r,entries:n,i18n:o}}},changeDraftFieldValidation:function(e,t){return{type:tl,payload:{uniquefieldId:e,errors:t}}},loadEntry:Sl,loadEntries:kl,loadDeployPreview:function(e,t,r,n,o){return async(i,a)=>{const s=a(),l=rf(s.config),c=e.get("name"),u=Hf(s,c,t);if(!u||!u.isFetching){i(function(e,t){return{type:Ef,payload:{collection:e,slug:t}}}(c,t));try{const a=n?l.getDeploy(e,t,r):await l.getDeployPreview(e,t,r,o);return i(a?function(e,t,r){const{url:n,status:o}=r;return{type:kf,payload:{collection:e,slug:t,url:n,status:o}}}(c,t,a):Tf(c,t))}catch(e){console.error(e),i(ea({message:{details:e.message,key:"ui.toast.onFailToLoadDeployPreview"},type:"error",dismissAfter:8e3})),i(Tf(c,t))}}}},loadLocalBackup:function(){return{type:ol}},retrieveLocalBackup:function(e,t){return async(r,n)=>{const o=n(),i=rf(o.config),{entry:a}=await i.getLocalDraftBackup(e,t);if(a){const t=a.mediaFiles||[],o=await Promise.all(t.map((t=>t.file||t.url?Tr({path:t.path,file:t.file,url:t.url,field:t.field}):rs({collection:e,entry:(0,Qe.fromJS)(a),path:t.path,field:t.field})(r,n))));return r(Qa(o)),r(function(e){return{type:nl,payload:{entry:e}}}(a))}}},persistLocalBackup:function(e,t){return(r,n)=>{const o=n();return rf(o.config).persistLocalDraftBackup(e,t)}},deleteLocalBackup:function(e,t){return(r,n)=>{const o=n();return rf(o.config).deleteLocalDraftBackup(e,t)}},createDraftDuplicateFromEntry:function(e){return t=>{t(Yi({predicate:({type:e})=>e===Xs,run:()=>t(function(e){return{type:il,payload:Si(e.get("collection"),"","",{data:e.get("data"),mediaFiles:e.get("mediaFiles").toJS()})}}(e))}))}},createEmptyDraft:function(e,t){return async(r,n)=>{new URLSearchParams(t).forEach(((t,r)=>{e=function(e,r,n){const o=Oc(e,r);if(!o)return e;let i=!1;return e=e.set("fields",Ec(e.get("fields",(0,Qe.List)()),(function(e){const r=e;return r===o?(i=!0,(e=>{return e.set("default",!!["true","True","TRUE"].includes(r=t)||!["false","False","FALSE"].includes(r)&&function(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}(r));var r})(r)):r}),(()=>i))),e}(e,r)}));const o=e.get("fields",(0,Qe.List)()),i=function(e){return e.filter((e=>!e.get("meta"))).toList()}(o),a=Cl(i),s=function(e){return e.filter((e=>!0===e.get("meta"))).toList()}(o),l=Cl(s),c=n(),u=rf(c.config);e.has("media_folder")||await Fa(r,n());const f=function(e,t){if(!Lc(e))return{};return function(e,t){const{locales:r,defaultLocale:n}=Nc(e);return Object.fromEntries(r.filter((e=>e!==n)).map((e=>[e,{data:t}])))}(e,Cl(t,(function(e){return e.get(Ac)!==Dc.DUPLICATE&&e.get(Ac)!==Dc.TRANSLATE})))}(e,i);let p=Si(e.get("name"),"","",{data:a,i18n:f,mediaFiles:[],meta:l});p=await u.processEntry(c,e,p),r({type:Xs,payload:p})}},discardDraft:function(){return{type:Zs}},persistEntry:function(e){return async(t,r)=>{const n=r(),o=n.entryDraft,i=o.get("fieldsErrors"),a=Wf(n,e.get("name"));if(!i.isEmpty())return i.some((e=>e.some((e=>e.type&&e.type===Ki.PRESENCE))))&&t(ea({message:{key:"ui.toast.missingRequiredField"},type:"error",dismissAfter:8e3})),Promise.reject();const s=rf(n.config),l=o.get("entry"),c=Tl({entry:l}),u=Pl(e,l),f=o.set("entry",u);return t(function(e,t){return{type:al,payload:{collectionName:e.get("name"),entrySlug:t.get("slug")}}}(e,u)),s.persistEntry({config:n.config,collection:e,entryDraft:f,assetProxies:c,usedSlugs:a}).then((async r=>{t(ea({message:{key:"ui.toast.entrySaved"},type:"success",dismissAfter:4e3})),c.length>0&&await t(ka()),t(function(e,t,r){return{type:sl,payload:{collectionName:e.get("name"),entrySlug:t.get("slug"),slug:r}}}(e,u,r)),e.has("nested")&&await t(kl(e)),l.get("slug")!==r&&(await t(Sl(e,r)),as(e.get("name"),r))})).catch((r=>(console.error(r),t(ea({message:{details:r,key:"ui.toast.onFailToPersist"},type:"error",dismissAfter:8e3})),Promise.reject(t(function(e,t,r){return{type:ll,error:"Failed to persist entry",payload:{collectionName:e.get("name"),entrySlug:t.get("slug"),error:r.toString()}}}(e,u,r))))))}},deleteEntry:function(e,t){return(r,n)=>{const o=n(),i=rf(o.config);return r(function(e,t){return{type:"ENTRY_DELETE_REQUEST",payload:{collectionName:e.get("name"),entrySlug:t}}}(e,t)),i.deleteEntry(o,e,t).then((()=>r(vl(e,t)))).catch((n=>(r(ea({message:{details:n,key:"ui.toast.onFailToDelete"},type:"error",dismissAfter:8e3})),console.error(n),Promise.reject(r(function(e,t,r){return{type:"ENTRY_DELETE_FAILURE",payload:{collectionName:e.get("name"),entrySlug:t,error:r.toString()}}}(e,t,n))))))}},updateUnpublishedEntryStatus:Ps,publishUnpublishedEntry:Rs,unpublishPublishedEntry:function(e,t){return(r,n)=>{const o=n(),i=rf(o.config),a=qf(o,e.get("name"),t),s=(0,Qe.Map)().set("entry",a);return r(Os(e,t)),i.deleteEntry(o,e,t).then((()=>i.persistEntry({config:o.config,collection:e,entryDraft:s,assetProxies:[],usedSlugs:(0,Qe.List)(),status:eo.get("PENDING_PUBLISH")}))).then((()=>{r(Es(e,a)),r(vl(e,t)),r(Cs(e,t)),r(ea({message:{key:"ui.toast.entryUnpublished"},type:"success",dismissAfter:4e3}))})).catch((t=>{r(ea({message:{key:"ui.toast.onFailToUnpublishEntry",details:t},type:"error",dismissAfter:8e3})),r(ks(t,e,a.get("slug")))}))}},deleteUnpublishedEntry:js,logoutUser:hf},Zx=H((function(e,t){const{collections:r,entryDraft:n,auth:o,config:i,entries:a,globalUI:s}=e,l=t.match.params[0],c=r.get(t.match.params.name),u=c.get("name"),f=!0===t.newRecord,p=yc(c,l),d=f?null:qf(e,u,l),h=o.user,g=n.get("hasChanged"),m=i.display_url,y=i.publish_mode===Zn,v=s.useOpenAuthoring,b=n.getIn(["entry","isModification"]),w=!!a.getIn(["pages",u]),_=Vf(e,u,l),S=qf(e,u,l),x=_&&_.get("status"),O=Hf(e,u,l),E=n.get("localBackup"),k=n.get("key");let C=`/collections/${u}`;if("workflow"===new URLSearchParams(t.location.search).get("ref")&&(C="/workflow"),c.has("nested")&&l){const e=l.split("/");e.length>2&&(C=`${C}/filter/${e.slice(0,-2).join("/")}`)}return{collection:c,collections:r,newEntry:f,entryDraft:n,fields:p,slug:l,entry:d,user:h,hasChanged:g,displayUrl:m,hasWorkflow:y,useOpenAuthoring:v,isModification:b,collectionEntriesLoaded:w,currentStatus:x,deployPreview:O,localBackup:E,draftKey:k,publishedEntry:S,unPublishedEntry:_,editorBackLink:C}}),Xx)(function(e){return H(Kx,null,Yx)(class extends r().Component{render(){return(0,xo.jsx)(e,this.props)}})}((0,We.Iu)()(Qx))),eO=Cg("div",{target:"ew40z3q0",label:"NotFoundContainer"})("margin:",qe.lengths.pageMargin,";");function tO({t:e}){return(0,xo.jsx)(eO,null,(0,xo.jsx)("h2",null,e("app.notFoundPage.header")))}tO.propTypes={t:i().func.isRequired};const rO=(0,We.Iu)()(tO);function nO(e,t,r){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oO(){return oO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},oO.apply(this,arguments)}const iO={buttonActive:(0,xo.css)("color:",qe.colors.active,";;label:buttonActive;")};function aO(e){return(0,xo.jsx)("header",oO({css:(0,xo.css)(qe.shadows.dropMain,";position:sticky;width:100%;top:0;background-color:",qe.colors.foreground,";z-index:",qe.zIndex.zIndex300,";height:",qe.lengths.topBarHeight,";;label:AppHeader;")},e))}const sO=Cg("div",{target:"e1rbzf6g4",label:"AppHeaderContent"})({name:"jxf21e",styles:"display:flex;justify-content:space-between;min-width:800px;max-width:1440px;padding:0 12px;margin:0 auto"}),lO=Cg("button",{target:"e1rbzf6g3",label:"AppHeaderButton"})(qe.buttons.button,";background:none;color:#7b8290;font-family:inherit;font-size:16px;font-weight:500;display:inline-flex;padding:16px 20px;align-items:center;",qe.Icon,"{margin-right:4px;color:#b3b9c4;}&:hover,&:active,&:focus-visible{",iO.buttonActive,";",qe.Icon,"{",iO.buttonActive,";}}",(e=>(0,xo.css)("&.",e.activeClassName,"{",iO.buttonActive,";",qe.Icon,"{",iO.buttonActive,";}};label:AppHeaderButton;")),";"),cO=lO.withComponent(Gv,{target:"e1rbzf6g5",label:"AppHeaderNavLink"}),uO=Cg("div",{target:"e1rbzf6g2",label:"AppHeaderActions"})({name:"8irbms",styles:"display:inline-flex;align-items:center"}),fO=Cg(qe.StyledDropdownButton,{target:"e1rbzf6g1",label:"AppHeaderQuickNewButton"})(qe.buttons.button,";",qe.buttons.medium,";",qe.buttons.gray,";margin-right:8px;&:after{top:11px;}"),pO=Cg("ul",{target:"e1rbzf6g0",label:"AppHeaderNavList"})({name:"1vufzxm",styles:"display:flex;margin:0;list-style:none"});class dO extends r().Component{constructor(...e){super(...e),nO(this,"intervalId",void 0),nO(this,"handleCreatePostClick",(e=>{const{onCreateEntryClick:t}=this.props;t&&t(e)}))}componentDidMount(){this.intervalId=setInterval((()=>{this.props.checkBackendStatus()}),3e5)}componentWillUnmount(){clearInterval(this.intervalId)}render(){const{user:e,collections:t,onLogoutClick:r,openMediaLibrary:n,hasWorkflow:o,displayUrl:i,isTestRepo:a,t:s,showMediaButton:l}=this.props,c=t.filter((e=>e.get("create"))).toList();return(0,xo.jsx)(aO,null,(0,xo.jsx)(sO,null,(0,xo.jsx)("nav",null,(0,xo.jsx)(pO,null,(0,xo.jsx)("li",null,(0,xo.jsx)(cO,{to:"/",activeClassName:"header-link-active",isActive:(e,t)=>t.pathname.startsWith("/collections/")},(0,xo.jsx)(qe.Icon,{type:"page"}),s("app.header.content"))),o&&(0,xo.jsx)("li",null,(0,xo.jsx)(cO,{to:"/workflow",activeClassName:"header-link-active"},(0,xo.jsx)(qe.Icon,{type:"workflow"}),s("app.header.workflow"))),l&&(0,xo.jsx)("li",null,(0,xo.jsx)(lO,{onClick:n},(0,xo.jsx)(qe.Icon,{type:"media-alt"}),s("app.header.media"))))),(0,xo.jsx)(uO,null,c.size>0&&(0,xo.jsx)(qe.Dropdown,{renderButton:()=>(0,xo.jsx)(fO,null," ",s("app.header.quickAdd")),dropdownTopOverlap:"30px",dropdownWidth:"160px",dropdownPosition:"left"},c.map((e=>(0,xo.jsx)(qe.DropdownItem,{key:e.get("name"),label:e.get("label_singular")||e.get("label"),onClick:()=>this.handleCreatePostClick(e.get("name"))})))),(0,xo.jsx)(Wm,{displayUrl:i,isTestRepo:a,imageUrl:null==e?void 0:e.avatar_url,onLogoutClick:r}))))}}nO(dO,"propTypes",{user:i().object.isRequired,collections:Vm().map.isRequired,onCreateEntryClick:i().func.isRequired,onLogoutClick:i().func.isRequired,openMediaLibrary:i().func.isRequired,hasWorkflow:i().bool.isRequired,displayUrl:i().string,isTestRepo:i().bool,t:i().func.isRequired,checkBackendStatus:i().func.isRequired});const hO={checkBackendStatus:function(){return async(e,t)=>{try{const r=t();if(r.status.isFetching)return;e({type:If});const n=rf(r.config),o=await n.status(),i="ui.toast.onBackendDown",a=r.notifications.notifications.filter((e=>{var t;return"string"!=typeof e.message&&(null===(t=e.message)||void 0===t?void 0:t.key)===i}));if(!1===o.api.status)return 0===a.length&&e(ea({message:{details:o.api.statusPage,key:"ui.toast.onBackendDown"},type:"error"})),e(Nf(o));if(!0===o.api.status&&a.length>0&&a.forEach((t=>{e(ta(t.id))})),!1===o.auth.status){const t="ui.toast.onLoggedOut",n=r.notifications.notifications.find((e=>{var r;return"string"!=typeof e.message&&(null===(r=e.message)||void 0===r?void 0:r.key)===t}));n||e(ea({message:{key:"ui.toast.onLoggedOut"},type:"error"}))}e(Nf(o))}catch(t){e(function(e){return{type:Lf,payload:{error:e}}}(t))}}}},gO=H(null,hO)((0,We.Iu)()(dO)),mO=["collections","render"];function yO(){return yO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yO.apply(this,arguments)}Km().config({barColors:{0:qe.colors.active,"1.0":qe.colors.active},shadowBlur:0,barThickness:2});const vO=Cg("div",{target:"eh2m33j2",label:"AppMainContainer"})({name:"y0stlg",styles:"min-width:800px;max-width:1440px;margin:0 auto"}),bO=Cg("div",{target:"eh2m33j1",label:"ErrorContainer"})({name:"3zy121",styles:"margin:20px"}),wO=Cg("pre",{target:"eh2m33j0",label:"ErrorCodeBlock"})({name:"1dps4tx",styles:"margin-left:20px;font-size:15px;line-height:1.5"});function _O(e){const t=e.filter((e=>!0!==e.get("hide"))).first();if(t)return`/collections/${t.get("name")}`;throw new Error("Could not find a non hidden collection")}function SO(e){let{collections:t,render:r}=e,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,mO);const o=_O(t);return(0,xo.jsx)(Ue,yO({},n,{render:e=>t.get(e.match.params.name)?r(e):(0,xo.jsx)(Ne,{to:o})}))}class xO extends r().Component{configError(e){const t=this.props.t;return(0,xo.jsx)(bO,null,(0,xo.jsx)("h1",null,t("app.app.errorHeader")),(0,xo.jsx)("div",null,(0,xo.jsx)("strong",null,t("app.app.configErrors"),":"),(0,xo.jsx)(wO,null,e.error),(0,xo.jsx)("span",null,t("app.app.checkConfigYml"))))}handleLogin(e){this.props.loginUser(e)}authenticating(){const{auth:e,t}=this.props,n=rf(this.props.config);return null==n?(0,xo.jsx)("div",null,(0,xo.jsx)("h1",null,t("app.app.waitingBackend"))):(0,xo.jsx)("div",null,(0,xo.jsx)(Dm,null),r().createElement(n.authComponent(),{onLogin:this.handleLogin.bind(this),error:e.error,inProgress:e.isFetching,siteId:this.props.config.backend.site_domain,base_url:this.props.config.backend.base_url,authEndpoint:this.props.config.backend.auth_endpoint,config:this.props.config,clearHash:()=>ns.replace("/"),t}))}handleLinkClick(e,t,...r){e.preventDefault(),t(...r)}render(){const{user:e,config:t,collections:n,logoutUser:o,isFetching:i,publishMode:a,useMediaLibrary:s,openMediaLibrary:l,t:c,showMediaButton:u}=this.props;if(null===t)return null;if(t.error)return this.configError(t);if(t.isFetching)return(0,xo.jsx)(qe.Loader,{active:!0},c("app.app.loadingConfig"));if(null==e)return this.authenticating(c);const f=_O(n),p=a===Zn;return(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(Dm,null),(0,xo.jsx)(gO,{user:e,collections:n,onCreateEntryClick:Ym,onLogoutClick:o,openMediaLibrary:l,hasWorkflow:p,displayUrl:t.display_url,isTestRepo:"test-repo"===t.backend.name,showMediaButton:u}),(0,xo.jsx)(vO,null,i&&(0,xo.jsx)(Km(),null),(0,xo.jsx)(ze,null,(0,xo.jsx)(Ne,{exact:!0,from:"/",to:f}),(0,xo.jsx)(Ne,{exact:!0,from:"/search/",to:f}),(0,xo.jsx)(SO,{exact:!0,collections:n,path:"/collections/:name/search/",render:({match:e})=>(0,xo.jsx)(Ne,{to:`/collections/${e.params.name}`})}),(0,xo.jsx)(Ne,{from:"/error=access_denied&error_description=Signups+not+allowed+for+this+instance",to:f}),p?(0,xo.jsx)(Ue,{path:"/workflow",component:v_}):null,(0,xo.jsx)(SO,{exact:!0,collections:n,path:"/collections/:name",render:e=>(0,xo.jsx)(Bw,e)}),(0,xo.jsx)(SO,{path:"/collections/:name/new",collections:n,render:e=>(0,xo.jsx)(Zx,yO({},e,{newRecord:!0}))}),(0,xo.jsx)(SO,{path:"/collections/:name/entries/*",collections:n,render:e=>(0,xo.jsx)(Zx,e)}),(0,xo.jsx)(SO,{path:"/collections/:name/search/:searchTerm",collections:n,render:e=>(0,xo.jsx)(Bw,yO({},e,{isSearchResults:!0,isSingleSearchResult:!0}))}),(0,xo.jsx)(SO,{collections:n,path:"/collections/:name/filter/:filterTerm*",render:e=>(0,xo.jsx)(Bw,e)}),(0,xo.jsx)(Ue,{path:"/search/:searchTerm",render:e=>(0,xo.jsx)(Bw,yO({},e,{isSearchResults:!0}))}),(0,xo.jsx)(SO,{path:"/edit/:name/:entryName",collections:n,render:({match:e})=>{const{name:t,entryName:r}=e.params;return(0,xo.jsx)(Ne,{to:`/collections/${t}/entries/${r}`})}}),(0,xo.jsx)(Ue,{component:rO})),s?(0,xo.jsx)($v,null):null))}}!function(e,t,r){t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(xO,"propTypes",{auth:i().object.isRequired,config:i().object.isRequired,collections:Vm().map.isRequired,loginUser:i().func.isRequired,logoutUser:i().func.isRequired,user:i().object,isFetching:i().bool.isRequired,publishMode:i().oneOf([Xn,Zn]),siteId:i().string,useMediaLibrary:i().bool,openMediaLibrary:i().func.isRequired,showMediaButton:i().bool,t:i().func.isRequired});const OO=H((function(e){const{auth:t,config:r,collections:n,globalUI:o,mediaLibrary:i}=e,a=t.user,s=o.isFetching,l=r.publish_mode,c=!i.get("externalLibrary");return{auth:t,config:r,collections:n,user:a,isFetching:s,publishMode:l,showMediaButton:i.get("showMediaButton"),useMediaLibrary:c}}),{openMediaLibrary:xa,loginUser:function(e){return(t,r)=>{const n=r(),o=rf(n.config);return t(uf()),o.authenticate(e).then((e=>{e.useOpenAuthoring&&t(df()),t(ff(e))})).catch((e=>{console.error(e),t(ea({message:{details:e.message,key:"ui.toast.onFailToAuth"},type:"error",dismissAfter:8e3})),t(pf(e))}))}},logoutUser:hf})((0,We.Iu)()(xO));function EO({field:e,t}){return(0,xo.jsx)("div",null,t("editor.editorWidgets.unknownControl.noControl",{widget:e.get("widget")}))}EO.propTypes={field:Vm().map,t:i().func.isRequired};const kO=(0,We.Iu)()(EO);function CO({field:e,t}){return(0,xo.jsx)("div",{className:"nc-widgetPreview"},t("editor.editorWidgets.unknownPreview.noPreview",{widget:e.get("widget")}))}function TO(e){return Yf.dispatch(Oa(e,void 0))}CO.propTypes={field:Vm().map,t:i().func.isRequired},En("unknown",kO,(0,We.Iu)()(CO));const PO=jo()((async function(e,t){const r=An(e);if(r){const e=await r.init({options:t,handleInsert:TO});Yf.dispatch(function(e){const t={show:e.show||(()=>{}),hide:e.hide||(()=>{}),onClearControl:e.onClearControl||(()=>{}),onRemoveControl:e.onRemoveControl||(()=>{}),enableStandalone:e.enableStandalone||(()=>{})};return{type:aa,payload:t}}(e))}else{const t=new Error(`Missing external media library '${e}'. Please use 'registerMediaLibrary' to register it.`);Yf.dispatch(Mu(t))}}));Yf.subscribe((()=>{const e=Yf.getState();if(e){var t;const r=null===(t=e.config.media_library)||void 0===t?void 0:t.name;if(r&&!e.mediaLibrary.get("externalLibrary")){const t=e.config.media_library;PO(r,t)}}})),__webpack_require__(30762);const jO="nc-root",RO=H((function(e){return{locale:Lu(e.config),config:e.config}}))((function({locale:e,config:t}){return(0,xo.jsx)(We.oc,{locale:e,messages:Xf(e)},(0,xo.jsx)(Wg,{showBackup:!0,config:t},(0,xo.jsx)(Re,{history:ns},(0,xo.jsx)(Ue,{component:OO}))))}));function MO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function AO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?MO(Object(r),!0).forEach((function(t){IO(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):MO(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function IO(e,t,r){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const DO=AO(AO({},Sn),{},{init:function(e={}){const{config:t}=e;console.log("decap-cms-core 3.6.1"),Yf.dispatch(Au(t,(function(){Yf.dispatch(((e,t)=>{const r=t(),n=rf(r.config);return e(uf()),Promise.resolve(n.currentUser()).then((t=>{t?(t.useOpenAuthoring&&e(df()),e(ff(t))):e({type:sf})})).catch((t=>{e(pf(t)),e(hf())}))}))}))),(0,n.s)(function(){const e=document.getElementById(jO);if(e)return e;const t=document.createElement("div");return t.id=jO,document.body.appendChild(t),t}()).render((0,xo.jsx)((function(){return(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(qe.GlobalStyles,null),(0,xo.jsx)(p,{store:Yf},(0,xo.jsx)(RO,null)))}),null))}})})(),__webpack_exports__=__webpack_exports__.DecapCmsCore,__webpack_exports__})()));
46
+ `,controlComponent:$.control,entry:t,collection:r,config:n,field:o,uniqueFieldId:this.uniqueFieldId,value:e,mediaPaths:s,metadata:q,onChange:(e,t)=>{c(o,e,t),S(this.uniqueFieldId)},onValidate:m&&Nb()(m,this.uniqueFieldId),onOpenMediaLibrary:u,onClearMediaControl:f,onRemoveMediaControl:p,onRemoveInsertedMedia:h,onPersistMedia:g,onAddAsset:d,getAsset:l,hasActiveStyle:E||this.state.styleActive,setActiveStyle:()=>this.setState({styleActive:!0}),setInactiveStyle:()=>this.setState({styleActive:!1}),resolveWidget:Tn,widget:$,getEditorComponents:Pn,controlRef:y,editorControl:fS,query:v,loadEntry:x,queryHits:b[this.uniqueFieldId]||[],clearSearch:_,clearFieldErrors:S,isFetching:w,fieldsErrors:a,onValidateObject:z,isEditorComponent:k,isNewEditorComponent:C,parentIds:T,t:P,validateMetaField:j,isDisabled:M,isFieldDuplicate:I,isFieldHidden:D,isLoadingAsset:R,locale:L,isParentListCollapsed:N}),B&&(0,xo.jsx)(lS,{active:E||this.state.styleActive,error:V},(0,xo.jsx)(V_(),{remarkPlugins:[K_()],allowedElements:["a","strong","em","del"],unwrapDisallowed:!0,components:{a:e=>{let{node:t}=e,r=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,Z_);return(0,xo.jsx)("a",rS({},r,{target:"_blank",rel:"noopener noreferrer",style:{color:"inherit"}}))}}},B)))))}}nS(uS,"propTypes",{value:i().oneOfType([i().node,i().object,i().string,i().bool]),field:Vm().map.isRequired,fieldsMetaData:Vm().map,fieldsErrors:Vm().map,mediaPaths:Vm().map.isRequired,boundGetAsset:i().func.isRequired,onChange:i().func.isRequired,openMediaLibrary:i().func.isRequired,addAsset:i().func.isRequired,removeInsertedMedia:i().func.isRequired,persistMedia:i().func.isRequired,onValidate:i().func,controlRef:i().func,query:i().func.isRequired,queryHits:i().object,isFetching:i().bool,clearSearch:i().func.isRequired,clearFieldErrors:i().func.isRequired,loadEntry:i().func.isRequired,t:i().func.isRequired,isEditorComponent:i().bool,isNewEditorComponent:i().bool,parentIds:i().arrayOf(i().string),entry:Vm().map.isRequired,collection:Vm().map.isRequired,isDisabled:i().bool,isHidden:i().bool,isFieldDuplicate:i().func,isFieldHidden:i().func,locale:i().string,isParentListCollapsed:i().bool}),nS(uS,"defaultProps",{parentIds:[]});const fS=H((function(e){const{collections:t,entryDraft:r}=e,n=r.get("entry"),o=t.get(r.getIn(["entry","collection"])),i=xf(e.medias);return{mediaPaths:e.mediaLibrary.get("controlMedia"),isFetching:e.search.isFetching,queryHits:e.search.queryHits,config:e.config,entry:n,collection:o,isLoadingAsset:i,loadEntry:async function(r,n){const o=t.get(r);if(o)return await xl(e,o,n);throw new Error(`Can't find collection '${r}'`)},validateMetaField:(t,r,n)=>function(e,t,r,n,o){if(r.get("meta")&&"path"===r.get("name")){var i;if(!n)return jl(n,"invalidPath",o);const r=n.split("/").map(gi(e.config.slug)).join("/");if(n!==r)return jl(n,"invalidPath",o);const a=As(t,(0,Qe.fromJS)({entry:{meta:{path:n}}})),s=a?function(e,t,r){const n=Ql(e,t),o=n&&n.map((r=>Jl(e,t,r)));return o&&o.find((e=>(null==e?void 0:e.get("path"))===r))}(e.entries,t.get("name"),a):void 0,l=null==s?void 0:s.get("path"),c=null===(i=e.entryDraft)||void 0===i?void 0:i.getIn(["entry","path"]);if(l&&l!==c)return jl(n,"pathExists",o)}return{error:!1}}(e,o,t,r,n)}}),(function(e){return tS(tS({},(0,He.DE)({openMediaLibrary:xa,clearMediaControl:_a,removeMediaControl:Sa,removeInsertedMedia:Ea,persistMedia:Ta,addAsset:Xa,query:qi,clearSearch:zi,clearFieldErrors:wl},e)),{},{boundGetAsset:(t,r)=>ts(e,t,r)})}),(function(e,t,r){return tS(tS(tS(tS({},e),t),r),{},{boundGetAsset:t.boundGetAsset(e.collection,e.entry)})}))((0,We.Iu)()(uS)),pS=fS;function dS(e,t,r){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hS=Cg("div",{target:"e11hw0lx4",label:"ControlPaneContainer"})({name:"1n0x6o4",styles:"max-width:800px;margin:0 auto;padding-bottom:16px;font-size:16px"}),gS=Cg(qe.StyledDropdownButton,{target:"e11hw0lx3",label:"LocaleButton"})(qe.buttons.button,";",qe.buttons.medium,";color:",qe.colors.controlLabel,";background:",qe.colors.textFieldBorder,";height:100%;&:after{top:11px;}"),mS=Cg("div",{target:"e11hw0lx2",label:"LocaleButtonWrapper"})({name:"zjik7",styles:"display:flex"}),yS=Cg("div",{target:"e11hw0lx1",label:"LocaleRowWrapper"})({name:"zjik7",styles:"display:flex"}),vS=Cg(qe.Dropdown,{target:"e11hw0lx0",label:"StyledDropdown"})({name:"1hfmrg2",styles:"width:max-content;margin-top:20px;margin-bottom:20px;margin-right:20px"});function bS({locales:e,dropdownText:t,onLocaleChange:r}){return(0,xo.jsx)(vS,{renderButton:()=>(0,xo.jsx)(mS,null,(0,xo.jsx)(gS,null,t))},e.map((e=>(0,xo.jsx)(qe.DropdownItem,{css:(0,xo.css)(qe.text.fieldLabel,";;label:LocaleDropdown;"),key:e,label:e,onClick:()=>r(e)}))))}function wS({field:e,entry:t,isTranslatable:r,locale:n}){if(e.get("meta"))return t.getIn(["meta",e.get("name")]);if(r){const r=Uc(n);return t.getIn([...r,e.get("name")])}return t.getIn(["data",e.get("name")])}class _S extends r().Component{constructor(...e){super(...e),dS(this,"state",{selectedLocale:this.props.locale}),dS(this,"childRefs",{}),dS(this,"controlRef",((e,t)=>{if(!t)return;const r=e.get("name");this.childRefs[r]=t})),dS(this,"getControlRef",(e=>t=>{this.controlRef(e,t)})),dS(this,"handleLocaleChange",(e=>{this.setState({selectedLocale:e}),this.props.onLocaleChange(e)})),dS(this,"copyFromOtherLocale",(({targetLocale:e,t})=>r=>{if(!window.confirm(t("editor.editorControlPane.i18n.copyFromLocaleConfirm",{locale:r.toUpperCase()})))return;const{entry:n,collection:o}=this.props,{locales:i,defaultLocale:a}=Nc(o),s=this.state.selectedLocale,l=i&&{currentLocale:s,locales:i,defaultLocale:a};this.props.fields.forEach((t=>{if($c(t,e,r)){const e=wS({field:t,entry:n,locale:r,isTranslatable:r!==a});e&&this.props.onChange(t,e,void 0,l)}}))})),dS(this,"validate",(async()=>{this.props.fields.forEach((e=>{var t,r;if("hidden"===e.get("widget"))return;const n=this.childRefs[e.get("name")],o=null!==(t=null==n||null===(r=n.innerWrappedControl)||void 0===r?void 0:r.validate)&&void 0!==t?t:null==n?void 0:n.validate;o&&o()}))})),dS(this,"switchToDefaultLocale",(()=>{if(Lc(this.props.collection)){const{defaultLocale:e}=Nc(this.props.collection);return new Promise((t=>this.setState({selectedLocale:e},t)))}return Promise.resolve()}))}focus(e){const[t,...r]=e.split("."),n=this.childRefs[t];null!=n&&n.focus&&n.focus(r.join("."))}render(){const{collection:e,entry:t,fields:r,fieldsMetaData:n,fieldsErrors:o,onChange:i,onValidate:a,t:s}=this.props;if(!e||!r)return null;if(0===t.size||!0===t.get("partial"))return null;const{locales:l,defaultLocale:c}=Nc(e),u=this.state.selectedLocale,f=l&&{currentLocale:u,locales:l,defaultLocale:c};return(0,xo.jsx)(hS,null,l&&(0,xo.jsx)(yS,null,(0,xo.jsx)(bS,{locales:l,dropdownText:s("editor.editorControlPane.i18n.writingInLocale",{locale:u.toUpperCase()}),onLocaleChange:this.handleLocaleChange}),(0,xo.jsx)(bS,{locales:l.filter((e=>e!==u)),dropdownText:s("editor.editorControlPane.i18n.copyFromLocale"),onLocaleChange:this.copyFromOtherLocale({targetLocale:u,t:s})})),r.filter((e=>"hidden"!==e.get("widget"))).map(((r,s)=>{const l=$c(r,u,c),p=Fc(r,u,c),d=Bc(r,u,c),h=f?`${u}_${s}`:s;return(0,xo.jsx)(pS,{key:h,field:r,value:wS({field:r,entry:t,locale:u,isTranslatable:l}),fieldsMetaData:n,fieldsErrors:o,onChange:(e,t,r)=>{i(e,t,r,f)},onValidate:a,controlRef:this.getControlRef(r),entry:t,collection:e,isDisabled:p,isHidden:d,isFieldDuplicate:e=>Fc(e,u,c),isFieldHidden:e=>Bc(e,u,c),locale:u})})))}}_S.propTypes={collection:Vm().map.isRequired,entry:Vm().map.isRequired,fields:Vm().list.isRequired,fieldsMetaData:Vm().map.isRequired,fieldsErrors:Vm().map.isRequired,onChange:i().func.isRequired,onValidate:i().func.isRequired,locale:i().string};var SS=__webpack_require__(12693),xS={0:8203,1:8204,2:8205,3:8290,4:8291,5:8288,6:65279,7:8289,8:119155,9:119156,a:119157,b:119158,c:119159,d:119160,e:119161,f:119162},OS={0:8203,1:8204,2:8205,3:65279},ES=new Array(4).fill(String.fromCodePoint(OS[0])).join(""),kS=String.fromCharCode(0);var CS=Object.fromEntries(Object.entries(OS).map((e=>e.reverse()))),TS=Object.fromEntries(Object.entries(xS).map((e=>e.reverse()))),PS=`${Object.values(xS).map((e=>`\\u{${e.toString(16)}}`)).join("")}`,jS=new RegExp(`[${PS}]{4,}`,"gu");function RS(e){return Qe.Map.isMap(e)}function MS(e){var t,r;return e?"types"in e?null!==(t=e.types)&&void 0!==t?t:[]:"fields"in e?null!==(r=e.fields)&&void 0!==r?r:[]:"field"in e?e.field?[e.field]:[]:[e]:[]}function AS(e,t){const r=t.toJS(),n=new Map;return function e(t,r,o=""){if(n.get(o)===t)return t;const i={fields:r,path:o,visit:e};let a;return a=function(e){return Qe.List.isList(e)}(t)?function(e,t){let r=e;for(let e=0;e<r.size;e++){const n=r.get(e);if(RS(n)){const o=n.get("type");if("string"==typeof o){const i=t.fields.find((e=>e.name===o)),a=t.visit(n,MS(i),`${t.path}.${e}`);r=r.set(e,a)}else{const o=t.visit(n,t.fields,`${t.path}.${e}`);r=r.set(e,o)}}else{const o=t.fields[0],i=t.visit(n,o?[o]:[],`${t.path}.${e}`);i!==n&&(r=r.set(e,i))}}return r}(t,i):RS(t)?function(e,t){let r=e;for(const[e,n]of r.entrySeq().toArray()){const o=t.fields.find((t=>t.name===e));if(o){const i=MS(o),a=t.visit(n,i,t.path?`${t.path}.${e}`:e);a!==n&&(r=r.set(e,a))}}return r}(t,i):"string"==typeof t?function(e,{fields:t,path:r}){var n;const o=function(e){let t=JSON.stringify(e);return`${ES}${Array.from(t).map((e=>{let r=e.charCodeAt(0);if(r>255)throw new Error(`Only ASCII edit info can be encoded. Error attempting to encode ${t} on character ${e} (${r})`);return Array.from(r.toString(4).padStart(4,"0")).map((e=>String.fromCodePoint(OS[e]))).join("")})).join("")}`}({decap:r});return"markdown"===(null===(n=t[0])||void 0===n?void 0:n.widget)&&e.includes("\n\n")?e.split(/(\n\n+)/).map((e=>e.trim()?e+o:e)).join(""):e+o}(t,i):t,n.set(o,a),a}(e,r)}class IS extends r().Component{constructor(...e){super(...e),function(e,t,r){t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(this,"handleClick",(e=>{var t;const{previewProps:r,onFieldClick:n}=this.props;if(null==r||null===(t=r.collection)||void 0===t?void 0:t.getIn(["editor","visualEditing"],!1))try{const t=function(e){let t=e.match(jS);if(t)return function(e,t=!1){let r=Array.from(e);if(r.length%2!=0)throw new Error("Encoded data has invalid length");if(r.length%4||!e.startsWith(ES))return function(e,t){var r;let n=[];for(let t=.5*e.length;t--;){let r=`${TS[e[2*t].codePointAt(0)]}${TS[e[2*t+1].codePointAt(0)]}`;n.unshift(String.fromCharCode(parseInt(r,16)))}let o=[],i=[n.join("")],a=10;for(;i.length;){let e=i.shift();try{if(o.push(JSON.parse(e)),t)return o}catch(t){if(!a--)throw t;let n=+(null==(r=t.message.match(/\sposition\s(\d+)$/))?void 0:r[1]);if(!n)throw t;i.unshift(e.substring(0,n),e.substring(n))}}return o}(r,t);let n=[];for(let e=.25*r.length;e--;){let t=r.slice(4*e,4*e+4).map((e=>CS[e.codePointAt(0)])).join("");n.unshift(String.fromCharCode(parseInt(t,4)))}if(t){n.shift();let e=n.indexOf(kS);return-1===e&&(e=n.length),[JSON.parse(n.slice(0,e).join(""))]}return n.join("").split(kS).filter(Boolean).map((e=>JSON.parse(e)))}(t[0],!0)[0]}(e.target.textContent);null!=t&&t.decap&&n&&n(t.decap)}catch(e){console.log("Visual editing error:",e)}}))}renderPreview(){const{previewComponent:e,previewProps:t}=this.props;return(0,xo.jsx)("div",{onClick:this.handleClick},(0,Oe.isElement)(e)?r().cloneElement(e,t):r().createElement(e,t))}render(){var e;const{previewProps:t}=this.props,r=!(null==t||null===(e=t.collection)||void 0===e?void 0:e.getIn(["editor","visualEditing"],!1));return(0,xo.jsx)(SS.Kr,null,(e=>{const t=this.renderPreview();return r?(0,xo.jsx)(z_.ScrollSyncPane,{attachTo:e.document.scrollingElement},t):t}))}}IS.propTypes={previewComponent:i().func.isRequired,previewProps:i().object,onFieldClick:i().func};const DS=IS,LS=["previewComponent"];class NS extends r().Component{shouldComponentUpdate(e){return["object","list"].includes(e.field.get("widget"))||this.props.value!==e.value||this.props.fieldsMetaData!==e.fieldsMetaData||this.props.getAsset!==e.getAsset}render(){const e=this.props,{previewComponent:t}=e,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,LS);return r().createElement(t,n)}}NS.propTypes={previewComponent:i().func.isRequired,field:Vm().map.isRequired,value:i().oneOfType([i().node,i().object,i().string,i().bool])};const $S=NS;function FS(e){return"hidden"!==e.get("widget")}const BS=Cg("div",{target:"e1iji6y40",label:"PreviewContainer"})({name:"9bq7s9",styles:"font-family:Roboto,'Helvetica Neue',HelveticaNeue,Helvetica,Arial,sans-serif"});class US extends r().Component{render(){const{collection:e,fields:t,widgetFor:r}=this.props;return e&&t?(0,xo.jsx)(BS,null,t.filter(FS).map((e=>(0,xo.jsx)("div",{key:e.get("name")},r(e.get("name")))))):null}}function zS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function qS(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?zS(Object(r),!0).forEach((function(t){WS(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zS(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function WS(e,t,r){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}US.propTypes={collection:Vm().map.isRequired,entry:Vm().map.isRequired,fields:Vm().list.isRequired,getAsset:i().func.isRequired,widgetFor:i().func.isRequired};const HS=Cg(SS.ZP,{target:"enus48h0",label:"PreviewPaneFrame"})("width:100%;height:100%;border:none;background:#fff;border-radius:",qe.lengths.borderRadius,";");class VS extends r().Component{constructor(...e){super(...e),WS(this,"getWidget",((e,t,r,n,o=null)=>{const{getAsset:i,entry:a}=n,s=Tn(e.get("widget")),l=o?e.get("name")+"_"+o:e.get("name"),c=t&&!s.allowMapValue&&Qe.Map.isMap(t);return s.preview?(0,xo.jsx)($S,{previewComponent:s.preview,key:l,field:e,getAsset:i,value:c?t.get(e.get("name")):t,entry:a,fieldsMetaData:r,resolveWidget:Tn,getRemarkPlugins:jn}):null})),WS(this,"inferredFields",{}),WS(this,"widgetFor",((e,t=this.props.fields,r=this.props.entry.get("data"),n=this.props.fieldsMetaData)=>{let o=t&&t.find((t=>t.get("name")===e)),i=Qe.Map.isMap(r)&&r.get(o.get("name"));o.get("meta")&&(i=this.props.entry.getIn(["meta",o.get("name")]));const a=o.get("fields"),s=o.get("field"),l=n&&n.get(o.get("name"),(0,Qe.Map)());a&&(o=o.set("fields",this.getNestedWidgets(a,i,l))),s&&(o=o.set("field",this.getSingleNested(s,i,l)));const c=Object.entries(this.inferredFields).filter((([e])=>Oc(this.props.collection,e)===o)).map((([,e])=>e))[0];return c?i=c.defaultPreview(i):i&&-1!==["string","text","number"].indexOf(o.get("widget"))&&i.toString().length<50&&(i=(0,xo.jsx)("div",null,(0,xo.jsx)("strong",null,o.get("label",o.get("name")),":")," ",i)),i?this.getWidget(o,i,l,this.props):null})),WS(this,"getNestedWidgets",((e,t,r)=>Qe.List.isList(t)?t.map((t=>this.widgetsForNestedFields(e,t,r))):this.widgetsForNestedFields(e,t,r))),WS(this,"getSingleNested",((e,t,r)=>Qe.List.isList(t)?t.map(((t,n)=>this.getWidget(e,t,r.get(e.get("name")),this.props,n))):this.getWidget(e,t,r.get(e.get("name")),this.props))),WS(this,"widgetsForNestedFields",((e,t,r)=>e.map((n=>this.widgetFor(n.get("name"),e,t,r))))),WS(this,"widgetsFor",(e=>{const{fields:t,entry:r,fieldsMetaData:n}=this.props,o=t.find((t=>t.get("name")===e)),i=o&&o.get("fields"),a=o&&o.get("types"),s=r.getIn(["data",o.get("name")]),l=n.get(o.get("name"),(0,Qe.Map)());return Qe.List.isList(s)&&a?s.map((e=>{const t=a.find((t=>t.get("name")===e.get("type"))),r=t&&t.get("fields"),n=r&&(0,Qe.Map)(r.map(((t,r)=>[t.get("name"),(0,xo.jsx)("div",{key:r},this.getWidget(t,e,l.get(t.get("name")),this.props))])));return(0,Qe.Map)({data:e,widgets:n})})):Qe.List.isList(s)?s.map((e=>{const t=i&&(0,Qe.Map)(i.map(((t,r)=>[t.get("name"),(0,xo.jsx)("div",{key:r},this.getWidget(t,e,l.get(t.get("name")),this.props))])));return(0,Qe.Map)({data:e,widgets:t})})):(0,Qe.Map)({data:s,widgets:i&&(0,Qe.Map)(i.map((e=>[e.get("name"),this.getWidget(e,s,l.get(e.get("name")),this.props)])))})})),WS(this,"getCollection",(async(e,t)=>{const{state:r}=this.props,n=r.collections.get(e);if(void 0===t)return(await ml(r,n)).map((e=>(0,Qe.Map)().set("data",e.data)));const o=await xl(r,n,t);return(0,Qe.Map)().set("data",o.data)}))}inferFields(){const e=Cc(this.props.collection,"title"),t=Cc(this.props.collection,"shortTitle"),r=Cc(this.props.collection,"author");this.inferredFields={},e&&(this.inferredFields[e]=ko.title),t&&(this.inferredFields[t]=ko.shortTitle),r&&(this.inferredFields[r]=ko.author)}render(){const{entry:e,collection:t,config:r}=this.props;if(!e||!e.get("data"))return null;const n=On(function(e,t){return hc[e.get("type")].templateName(e,t)}(t,e.get("slug")))||US;this.inferFields();const o=t.getIn(["editor","visualEditing"],!1)?e.set("data",AS(e.get("data"),this.props.fields)):e,i=qS(qS({},this.props),{},{entry:o,widgetFor:(e,t,r=o.get("data"),n)=>this.widgetFor(e,t,r,n),widgetsFor:this.widgetsFor,getCollection:this.getCollection}),a=xn().map(((e,t)=>e.raw?(0,xo.jsx)("style",{key:t},e.value):(0,xo.jsx)("link",{key:t,href:e.value,type:"text/css",rel:"stylesheet"})));return t||(0,xo.jsx)(HS,{id:"preview-pane",head:a}),(0,xo.jsx)(Wg,{config:r},(0,xo.jsx)(HS,{id:"preview-pane",head:a,initialContent:'\n<!DOCTYPE html>\n<html>\n <head><base target="_blank"/></head>\n <body><div></div></body>\n</html>\n'},(0,xo.jsx)(SS.Kr,null,(({document:e,window:t})=>(0,xo.jsx)(DS,{previewComponent:n,previewProps:qS(qS({},i),{},{document:e,window:t}),onFieldClick:this.props.onFieldClick})))))}}VS.propTypes={collection:Vm().map.isRequired,fields:Vm().list.isRequired,entry:Vm().map.isRequired,fieldsMetaData:Vm().map.isRequired,getAsset:i().func.isRequired,onFieldClick:i().func};const GS=H((function(e){return{isLoadingAsset:xf(e.medias),config:e.config,state:e}}),(function(e){return{boundGetAsset:(t,r)=>ts(e,t,r)}}),(function(e,t,r){return qS(qS(qS(qS({},e),t),r),{},{getAsset:t.boundGetAsset(r.collection,r.entry)})}))(VS);function KS(e,t,r){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const YS={noOverflow:{name:"1ctb18k-noOverflow",styles:"overflow:hidden;white-space:nowrap;text-overflow:ellipsis;label:noOverflow;"},buttonMargin:{name:"bx8mhy-buttonMargin",styles:"margin:0 10px;label:buttonMargin;"},toolbarSection:(0,xo.css)("height:100%;display:flex;align-items:center;border:0 solid ",qe.colors.textFieldBorder,";;label:toolbarSection;"),publishedButton:(0,xo.css)("background-color:",qe.colorsRaw.tealLight,";color:",qe.colorsRaw.tealDark,";;label:publishedButton;")},JS=Cg("div",{target:"e1d2l9mo26",label:"TooltipText"})({name:"1ykbu60",styles:"visibility:hidden;width:321px;background-color:#555;color:#fff;text-align:unset;border-radius:6px;padding:5px;position:absolute;z-index:1;top:145%;left:50%;margin-left:-320px;opacity:0;transition:opacity 0.3s"}),QS=Cg("div",{target:"e1d2l9mo25",label:"Tooltip"})("position:relative;display:inline-block;&:hover+",JS,"{visibility:visible;opacity:0.9;}"),XS=Cg("div",{target:"e1d2l9mo24",label:"TooltipContainer"})({name:"bjn8wh",styles:"position:relative"}),ZS=Cg(qe.StyledDropdownButton,{target:"e1d2l9mo23",label:"DropdownButton"})(YS.noOverflow,"@media (max-width: 1200px){padding-left:10px;}"),ex=Cg("div",{target:"e1d2l9mo22",label:"ToolbarContainer"})("box-shadow:0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1);position:absolute;top:0;left:0;width:100%;min-width:800px;z-index:",qe.zIndex.zIndex300,";background-color:#fff;height:66px;display:flex;justify-content:space-between;"),tx=Cg("div",{target:"e1d2l9mo21",label:"ToolbarSectionMain"})(YS.toolbarSection,";flex:10;display:flex;justify-content:space-between;padding:0 10px;"),rx=Cg("div",{target:"e1d2l9mo20",label:"ToolbarSubSectionFirst"})({name:"s5xdrg",styles:"display:flex;align-items:center"}),nx=Cg(rx,{target:"e1d2l9mo19",label:"ToolbarSubSectionLast"})({name:"1f60if8",styles:"justify-content:flex-end"}),ox=Cg(Wv,{target:"e1d2l9mo18",label:"ToolbarSectionBackLink"})(YS.toolbarSection,";border-right-width:1px;font-weight:normal;padding:0 20px;&:hover,&:focus{background-color:#f1f2f4;}"),ix=Cg("div",{target:"e1d2l9mo17",label:"ToolbarSectionMeta"})(YS.toolbarSection,";border-left-width:1px;padding:0 7px;"),ax=Cg(qe.Dropdown,{target:"e1d2l9mo16",label:"ToolbarDropdown"})(YS.buttonMargin,";",qe.Icon,"{color:",qe.colorsRaw.teal,";}"),sx=Cg("div",{target:"e1d2l9mo15",label:"BackArrow"})("color:",qe.colors.textLead,";font-size:21px;font-weight:600;margin-right:16px;"),lx=Cg("div",{target:"e1d2l9mo14",label:"BackCollection"})("color:",qe.colors.textLead,";font-size:14px;"),cx=Cg("div",{target:"e1d2l9mo13",label:"BackStatus"})({name:"j9a02z",styles:"margin-top:6px"}),ux=Cg(cx,{target:"e1d2l9mo12",label:"BackStatusUnchanged"})(qe.components.textBadgeSuccess,";"),fx=Cg(cx,{target:"e1d2l9mo11",label:"BackStatusChanged"})(qe.components.textBadgeDanger,";"),px=Cg("button",{target:"e1d2l9mo10",label:"ToolbarButton"})(qe.buttons.button,";",qe.buttons.default,";",YS.buttonMargin,";",YS.noOverflow,";display:block;@media (max-width: 1200px){padding:0 10px;}"),dx=Cg(px,{target:"e1d2l9mo9",label:"DeleteButton"})(qe.buttons.lightRed,";"),hx=Cg(px,{target:"e1d2l9mo8",label:"SaveButton"})(qe.buttons.lightBlue,";&[disabled]{",qe.buttons.disabled,";}"),gx=Cg(ZS,{target:"e1d2l9mo7",label:"PublishedToolbarButton"})(YS.publishedButton,";"),mx=Cg(px,{target:"e1d2l9mo6",label:"PublishedButton"})(YS.publishedButton,";"),yx=Cg(ZS,{target:"e1d2l9mo5",label:"PublishButton"})("background-color:",qe.colorsRaw.teal,";"),vx=Cg(ZS,{target:"e1d2l9mo4",label:"StatusButton"})("background-color:",qe.colorsRaw.tealLight,";color:",qe.colorsRaw.teal,";"),bx=Cg("div",{target:"e1d2l9mo3",label:"PreviewButtonContainer"})("margin-right:12px;color:",qe.colorsRaw.blue,";display:flex;align-items:center;a,",qe.Icon,"{color:",qe.colorsRaw.blue,";}",qe.Icon,"{position:relative;top:1px;}"),wx=Cg("button",{target:"e1d2l9mo2",label:"RefreshPreviewButton"})("background:none;border:0;cursor:pointer;color:",qe.colorsRaw.blue,";span{margin-right:6px;}"),_x=wx.withComponent("a",{target:"e1d2l9mo27",label:"PreviewLink"}),Sx=Cg(qe.DropdownItem,{target:"e1d2l9mo1",label:"PublishDropDownItem"})({name:"svxjwj",styles:"min-width:initial"}),xx=Cg(qe.DropdownItem,{target:"e1d2l9mo0",label:"StatusDropdownItem"})(qe.Icon,"{color:",qe.colors.infoText,";}");class Ox extends r().Component{constructor(...e){super(...e),KS(this,"renderSimpleControls",(()=>{const{collection:e,hasChanged:t,isNewEntry:n,showDelete:o,onDelete:i,t:a}=this.props,s=e.get("create");return(0,xo.jsx)(r().Fragment,null,n||t?this.renderNewEntrySimplePublishControls({canCreate:s}):this.renderExistingEntrySimplePublishControls({canCreate:s}),(0,xo.jsx)("div",null,o?(0,xo.jsx)(dx,{onClick:i},a("editor.editorToolbar.deleteEntry")):null))})),KS(this,"renderDeployPreviewControls",(e=>{const{deployPreview:t={},loadDeployPreview:r,t:n}=this.props,{url:o,status:i,isFetching:a}=t;if(!i)return;const s="SUCCESS"===i&&!a;return(0,xo.jsx)(bx,null,s?(0,xo.jsx)(_x,{rel:"noopener noreferrer",target:"_blank",href:o},(0,xo.jsx)("span",null,e),(0,xo.jsx)(qe.Icon,{type:"new-tab",size:"xsmall"})):(0,xo.jsx)(wx,{onClick:r},(0,xo.jsx)("span",null,n("editor.editorToolbar.deployPreviewPendingButtonLabel")),(0,xo.jsx)(qe.Icon,{type:"refresh",size:"xsmall"})))})),KS(this,"renderStatusInfoTooltip",(()=>{const{t:e,currentStatus:t}=this.props,r={[eo.get("DRAFT")]:"statusInfoTooltipDraft",[eo.get("PENDING_REVIEW")]:"statusInfoTooltipInReview"},n=Object.keys(r).find((e=>e===t));return(0,xo.jsx)(XS,null,(0,xo.jsx)(QS,null,(0,xo.jsx)(qe.Icon,{type:"info-circle",size:"small",className:"tooltip"})),n&&(0,xo.jsx)(JS,null,e(`editor.editorToolbar.${r[n]}`)))})),KS(this,"renderWorkflowStatusControls",(()=>{const{isUpdatingStatus:e,onChangeStatus:t,currentStatus:n,t:o,useOpenAuthoring:i}=this.props,a={[eo.get("DRAFT")]:o("editor.editorToolbar.draft"),[eo.get("PENDING_REVIEW")]:o("editor.editorToolbar.inReview"),[eo.get("PENDING_PUBLISH")]:o("editor.editorToolbar.ready")},s=e?o("editor.editorToolbar.updating"):o("editor.editorToolbar.status",{status:a[n]});return(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(ax,{dropdownTopOverlap:"40px",dropdownWidth:"120px",renderButton:()=>(0,xo.jsx)(vx,null,s)},(0,xo.jsx)(xx,{label:o("editor.editorToolbar.draft"),onClick:()=>t("DRAFT"),icon:n===eo.get("DRAFT")?"check":null}),(0,xo.jsx)(xx,{label:o("editor.editorToolbar.inReview"),onClick:()=>t("PENDING_REVIEW"),icon:n===eo.get("PENDING_REVIEW")?"check":null}),i?"":(0,xo.jsx)(xx,{label:o("editor.editorToolbar.ready"),onClick:()=>t("PENDING_PUBLISH"),icon:n===eo.get("PENDING_PUBLISH")?"check":null})),i&&this.renderStatusInfoTooltip())})),KS(this,"renderNewEntryWorkflowPublishControls",(({canCreate:e,canPublish:t})=>{const{isPublishing:n,onPublish:o,onPublishAndNew:i,onPublishAndDuplicate:a,t:s}=this.props;return t?(0,xo.jsx)(ax,{dropdownTopOverlap:"40px",dropdownWidth:"200px",renderButton:()=>(0,xo.jsx)(yx,null,s(n?"editor.editorToolbar.publishing":"editor.editorToolbar.publish"))},(0,xo.jsx)(Sx,{label:s("editor.editorToolbar.publishNow"),icon:"arrow",iconDirection:"right",onClick:o}),e?(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(Sx,{label:s("editor.editorToolbar.publishAndCreateNew"),icon:"add",onClick:i}),(0,xo.jsx)(Sx,{label:s("editor.editorToolbar.publishAndDuplicate"),icon:"add",onClick:a})):null):""})),KS(this,"renderExistingEntryWorkflowPublishControls",(({canCreate:e,canPublish:t,canDelete:r})=>{const{unPublish:n,onDuplicate:o,isPersisting:i,t:a}=this.props;return t||e?(0,xo.jsx)(ax,{dropdownTopOverlap:"40px",dropdownWidth:"max-content",key:"td-publish-create",renderButton:()=>(0,xo.jsx)(gx,null,a(i?"editor.editorToolbar.unpublishing":"editor.editorToolbar.published"))},r&&t&&(0,xo.jsx)(qe.DropdownItem,{label:a("editor.editorToolbar.unpublish"),icon:"arrow",iconDirection:"right",onClick:n}),e&&(0,xo.jsx)(qe.DropdownItem,{label:a("editor.editorToolbar.duplicate"),icon:"add",onClick:o})):""})),KS(this,"renderExistingEntrySimplePublishControls",(({canCreate:e})=>{const{onDuplicate:t,t:r}=this.props;return e?(0,xo.jsx)(ax,{dropdownTopOverlap:"40px",dropdownWidth:"max-content",renderButton:()=>(0,xo.jsx)(gx,null,r("editor.editorToolbar.published"))},(0,xo.jsx)(qe.DropdownItem,{label:r("editor.editorToolbar.duplicate"),icon:"add",onClick:t})):(0,xo.jsx)(mx,null,r("editor.editorToolbar.published"))})),KS(this,"renderNewEntrySimplePublishControls",(({canCreate:e})=>{const{onPersist:t,onPersistAndNew:n,onPersistAndDuplicate:o,isPersisting:i,t:a}=this.props;return(0,xo.jsx)("div",null,(0,xo.jsx)(ax,{dropdownTopOverlap:"40px",dropdownWidth:"max-content",renderButton:()=>(0,xo.jsx)(yx,null,a(i?"editor.editorToolbar.publishing":"editor.editorToolbar.publish"))},(0,xo.jsx)(qe.DropdownItem,{label:a("editor.editorToolbar.publishNow"),icon:"arrow",iconDirection:"right",onClick:t}),e?(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(qe.DropdownItem,{label:a("editor.editorToolbar.publishAndCreateNew"),icon:"add",onClick:n}),(0,xo.jsx)(qe.DropdownItem,{label:a("editor.editorToolbar.publishAndDuplicate"),icon:"add",onClick:o})):null))})),KS(this,"renderSimpleDeployPreviewControls",(()=>{const{hasChanged:e,isNewEntry:t,t:r}=this.props;if(!t&&!e)return this.renderDeployPreviewControls(r("editor.editorToolbar.deployButtonLabel"))})),KS(this,"renderWorkflowControls",(()=>{const{onPersist:e,onDelete:t,onDeleteUnpublishedChanges:n,showDelete:o,hasChanged:i,hasUnpublishedChanges:a,useOpenAuthoring:s,isPersisting:l,isDeleting:c,isNewEntry:u,isModification:f,currentStatus:p,collection:d,t:h}=this.props,g=d.get("create"),m=d.get("publish")&&!s,y=d.get("delete",!0),v=a&&f&&h("editor.editorToolbar.deleteUnpublishedChanges")||a&&(u||!f)&&h("editor.editorToolbar.deleteUnpublishedEntry")||!a&&!f&&h("editor.editorToolbar.deletePublishedEntry");return[(0,xo.jsx)(hx,{disabled:!i,key:"save-button",onClick:()=>i&&e()},h(l?"editor.editorToolbar.saving":"editor.editorToolbar.save")),p?[(0,xo.jsx)(r().Fragment,{key:"workflow-status-controls"},this.renderWorkflowStatusControls(),!i&&this.renderNewEntryWorkflowPublishControls({canCreate:g,canPublish:m}))]:!u&&(0,xo.jsx)(r().Fragment,{key:"existing-entry-workflow-publish-controls"},this.renderExistingEntryWorkflowPublishControls({canCreate:g,canPublish:m,canDelete:y})),o&&!s||a||f?(0,xo.jsx)(dx,{key:"delete-button",onClick:a?n:t},c?h("editor.editorToolbar.deleting"):v):null]})),KS(this,"renderWorkflowDeployPreviewControls",(()=>{const{currentStatus:e,isNewEntry:t,t:r}=this.props;return e?this.renderDeployPreviewControls(r("editor.editorToolbar.deployPreviewButtonLabel")):t?void 0:this.renderDeployPreviewControls(r("editor.editorToolbar.deployButtonLabel"))}))}componentDidMount(){const{isNewEntry:e,loadDeployPreview:t}=this.props;e||t({maxAttempts:3})}componentDidUpdate(e){const{isNewEntry:t,isPersisting:r,loadDeployPreview:n}=this.props;t||!e.isPersisting||r||n({maxAttempts:3})}render(){const{user:e,hasChanged:t,displayUrl:r,collection:n,hasWorkflow:o,onLogoutClick:i,t:a,editorBackLink:s}=this.props;return(0,xo.jsx)(ex,null,(0,xo.jsx)(ox,{to:s},(0,xo.jsx)(sx,null,"←"),(0,xo.jsx)("div",null,(0,xo.jsx)(lx,null,a("editor.editorToolbar.backCollection",{collectionLabel:n.get("label")})),t?(0,xo.jsx)(fx,null,a("editor.editorToolbar.unsavedChanges")):(0,xo.jsx)(ux,null,a("editor.editorToolbar.changesSaved")))),(0,xo.jsx)(tx,null,(0,xo.jsx)(rx,null,o?this.renderWorkflowControls():this.renderSimpleControls()),(0,xo.jsx)(nx,null,o?this.renderWorkflowDeployPreviewControls():this.renderSimpleDeployPreviewControls())),(0,xo.jsx)(ix,null,(0,xo.jsx)(Wm,{displayUrl:r,imageUrl:null==e?void 0:e.avatar_url,onLogoutClick:i})))}}KS(Ox,"propTypes",{isPersisting:i().bool,isPublishing:i().bool,isUpdatingStatus:i().bool,isDeleting:i().bool,onPersist:i().func.isRequired,onPersistAndNew:i().func.isRequired,onPersistAndDuplicate:i().func.isRequired,showDelete:i().bool.isRequired,onDelete:i().func.isRequired,onDeleteUnpublishedChanges:i().func.isRequired,onChangeStatus:i().func.isRequired,onPublish:i().func.isRequired,unPublish:i().func.isRequired,onDuplicate:i().func.isRequired,onPublishAndNew:i().func.isRequired,onPublishAndDuplicate:i().func.isRequired,user:i().object,hasChanged:i().bool,displayUrl:i().string,collection:Vm().map.isRequired,hasWorkflow:i().bool,useOpenAuthoring:i().bool,hasUnpublishedChanges:i().bool,isNewEntry:i().bool,isModification:i().bool,currentStatus:i().string,onLogoutClick:i().func.isRequired,deployPreview:i().object,loadDeployPreview:i().func.isRequired,t:i().func.isRequired,editorBackLink:i().string.isRequired});const Ex=(0,We.Iu)()(Ox);function kx(){return kx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kx.apply(this,arguments)}function Cx(e,t,r){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Tx="cms.preview-visible",Px="cms.scroll-sync-enabled",jx="cms.split-pane-position",Rx="cms.i18n-visible",Mx={splitPane:(0,xo.css)(qe.components.card,";border-radius:0;height:100%;;label:splitPane;"),pane:{name:"1yvxf4n-pane",styles:"height:100%;overflow-y:auto;label:pane;"}},Ax=Cg(qe.IconButton,{target:"e1nx103k7",label:"EditorToggle"})({name:"cn3xcj",styles:"margin-bottom:12px"});function Ix(){return(0,xo.jsx)(xo.Global,{styles:(0,xo.css)(".Resizer.vertical{width:2px;cursor:col-resize;position:relative;background:none;&:before{content:'';width:2px;height:100%;position:relative;background-color:",qe.colors.textFieldBorder,";display:block;z-index:10;transition:background-color ",qe.transitions.main,";}&:hover,&:active{&:before{width:4px;left:-1px;background-color:",qe.colorsRaw.blue,";}}};label:ReactSplitPaneGlobalStyles;")})}const Dx=Cg(U_,{target:"e1nx103k6",label:"StyledSplitPane"})(Mx.splitPane,";.Pane{height:100%;}"),Lx=Cg("div",{target:"e1nx103k5",label:"NoPreviewContainer"})(Mx.splitPane,";"),Nx=Cg("div",{target:"e1nx103k4",label:"EditorContainer"})("width:100%;min-width:800px;height:100%;position:absolute;top:0;left:0;overflow:hidden;padding-top:66px;background-color:",qe.colors.background,";"),$x=Cg("div",{target:"e1nx103k3",label:"Editor"})({name:"yd3x82",styles:"height:100%;margin:0 auto;position:relative"}),Fx=Cg("div",{target:"e1nx103k2",label:"PreviewPaneContainer"})("height:100%;pointer-events:",(e=>e.blockEntry?"none":"auto"),";overflow-y:",(e=>e.overFlow?"auto":"hidden"),";"),Bx=Cg(Fx,{target:"e1nx103k1",label:"ControlPaneContainer"})({name:"b2tic3",styles:"padding:0 16px;position:relative;overflow-x:hidden"}),Ux=Cg("div",{target:"e1nx103k0",label:"ViewControls"})("position:absolute;top:10px;right:10px;z-index:",qe.zIndex.zIndex299,";");function zx({i18nVisible:e,previewVisible:t,editor:r,editorWithEditor:n,editorWithPreview:o}){return e?n:t?o:(0,xo.jsx)(Lx,null,r)}class qx extends t.Component{constructor(...e){super(...e),Cx(this,"state",{showEventBlocker:!1,previewVisible:"false"!==localStorage.getItem(Tx),scrollSyncEnabled:"false"!==localStorage.getItem(Px),i18nVisible:"false"!==localStorage.getItem(Rx)}),Cx(this,"handleFieldClick",(e=>{var t;null===(t=this.controlPaneRef)||void 0===t||t.focus(e)})),Cx(this,"handleSplitPaneDragStart",(()=>{this.setState({showEventBlocker:!0})})),Cx(this,"handleSplitPaneDragFinished",(()=>{this.setState({showEventBlocker:!1})})),Cx(this,"handleOnPersist",(async(e={})=>{const{createNew:t=!1,duplicate:r=!1}=e;await this.controlPaneRef.switchToDefaultLocale(),this.controlPaneRef.validate(),this.props.onPersist({createNew:t,duplicate:r})})),Cx(this,"handleOnPublish",(async(e={})=>{const{createNew:t=!1,duplicate:r=!1}=e;await this.controlPaneRef.switchToDefaultLocale(),this.controlPaneRef.validate(),this.props.onPublish({createNew:t,duplicate:r})})),Cx(this,"handleTogglePreview",(()=>{const e=!this.state.previewVisible;this.setState({previewVisible:e}),localStorage.setItem(Tx,e)})),Cx(this,"handleToggleScrollSync",(()=>{const e=!this.state.scrollSyncEnabled;this.setState({scrollSyncEnabled:e}),localStorage.setItem(Px,e)})),Cx(this,"handleToggleI18n",(()=>{const e=!this.state.i18nVisible;this.setState({i18nVisible:e}),localStorage.setItem(Rx,e)})),Cx(this,"handleLeftPanelLocaleChange",(e=>{this.setState({leftPanelLocale:e})}))}render(){const{collection:e,entry:t,fields:r,fieldsMetaData:n,fieldsErrors:o,onChange:i,showDelete:a,onDelete:s,onDeleteUnpublishedChanges:l,onChangeStatus:c,onPublish:u,unPublish:f,onDuplicate:p,onValidate:d,user:h,hasChanged:g,displayUrl:m,hasWorkflow:y,useOpenAuthoring:v,hasUnpublishedChanges:b,isNewEntry:w,isModification:_,currentStatus:S,onLogoutClick:x,loadDeployPreview:O,deployPreview:E,draftKey:k,editorBackLink:C,t:T}=this.props,{scrollSyncEnabled:P,showEventBlocker:j}=this.state,R=function(e,t){if(e.get("type")===bo){const r=mc(e,t.get("slug")),n=null==r?void 0:r.getIn(["editor","preview"]);if(null!=n)return n}return e.getIn(["editor","preview"],!0)}(e,t),{locales:M,defaultLocale:A}=Nc(this.props.collection),I=Lc(e)&&M.length>1,D={collection:e,entry:t,fields:r,fieldsMetaData:n,fieldsErrors:o,onChange:i,onValidate:d},L=this.state.leftPanelLocale||(null==M?void 0:M[0]),N=(0,xo.jsx)(Bx,{overFlow:!0,blockEntry:j},(0,xo.jsx)(_S,kx({},D,{ref:e=>this.controlPaneRef=e,locale:L,t:T,onLocaleChange:this.handleLeftPanelLocaleChange}))),$=(0,xo.jsx)(Bx,{overFlow:!this.state.scrollSyncEnabled,blockEntry:j},(0,xo.jsx)(_S,kx({},D,{locale:null==M?void 0:M[1],t:T}))),F=I?function(e,t,r){return t===r?e:e.set("data",e.getIn([Ac,t,"data"]))}(t,L,A):t,B=(0,xo.jsx)(z_.ScrollSync,{enabled:this.state.scrollSyncEnabled},(0,xo.jsx)("div",null,(0,xo.jsx)(Ix,null),(0,xo.jsx)(Dx,{maxSize:-100,minSize:400,defaultSize:parseInt(localStorage.getItem(jx),10)||"50%",onChange:e=>localStorage.setItem(jx,e),onDragStarted:this.handleSplitPaneDragStart,onDragFinished:this.handleSplitPaneDragFinished},(0,xo.jsx)(z_.ScrollSyncPane,null,N),(0,xo.jsx)(Fx,{blockEntry:j},(0,xo.jsx)(GS,{collection:e,entry:F,fields:r,fieldsMetaData:n,locale:L,onFieldClick:this.handleFieldClick}))))),U=(0,xo.jsx)(z_.ScrollSync,{enabled:this.state.scrollSyncEnabled},(0,xo.jsx)("div",null,(0,xo.jsx)(Dx,{maxSize:-100,defaultSize:parseInt(localStorage.getItem(jx),10)||"50%",onChange:e=>localStorage.setItem(jx,e),onDragStarted:this.handleSplitPaneDragStart,onDragFinished:this.handleSplitPaneDragFinished},(0,xo.jsx)(z_.ScrollSyncPane,null,N),(0,xo.jsx)(z_.ScrollSyncPane,null,$)))),z=I&&this.state.i18nVisible,q=R&&this.state.previewVisible,W=z||q;return(0,xo.jsx)(Nx,null,(0,xo.jsx)(Ex,{isPersisting:t.get("isPersisting"),isPublishing:t.get("isPublishing"),isUpdatingStatus:t.get("isUpdatingStatus"),isDeleting:t.get("isDeleting"),onPersist:this.handleOnPersist,onPersistAndNew:()=>this.handleOnPersist({createNew:!0}),onPersistAndDuplicate:()=>this.handleOnPersist({createNew:!0,duplicate:!0}),onDelete:s,onDeleteUnpublishedChanges:l,onChangeStatus:c,showDelete:a,onPublish:u,unPublish:f,onDuplicate:p,onPublishAndNew:()=>this.handleOnPublish({createNew:!0}),onPublishAndDuplicate:()=>this.handleOnPublish({createNew:!0,duplicate:!0}),user:h,hasChanged:g,displayUrl:m,collection:e,hasWorkflow:y,useOpenAuthoring:v,hasUnpublishedChanges:b,isNewEntry:w,isModification:_,currentStatus:S,onLogoutClick:x,loadDeployPreview:O,deployPreview:E,editorBackLink:C}),(0,xo.jsx)($x,{key:k},(0,xo.jsx)(Ux,null,I&&(0,xo.jsx)(Ax,{isActive:z,onClick:this.handleToggleI18n,size:"large",type:"page",title:T("editor.editorInterface.toggleI18n"),marginTop:"70px"}),R&&(0,xo.jsx)(Ax,{isActive:q,onClick:this.handleTogglePreview,size:"large",type:"eye",title:T("editor.editorInterface.togglePreview")}),W&&!e.getIn(["editor","visualEditing"])&&(0,xo.jsx)(Ax,{isActive:P,onClick:this.handleToggleScrollSync,size:"large",type:"scroll",title:T("editor.editorInterface.toggleScrollSync")})),(0,xo.jsx)(zx,{i18nVisible:z,previewVisible:q,editor:N,editorWithEditor:U,editorWithPreview:B})))}}qx.propTypes={collection:Vm().map.isRequired,entry:Vm().map.isRequired,fields:Vm().list.isRequired,fieldsMetaData:Vm().map.isRequired,fieldsErrors:Vm().map.isRequired,onChange:i().func.isRequired,onValidate:i().func.isRequired,onPersist:i().func.isRequired,showDelete:i().bool.isRequired,onDelete:i().func.isRequired,onDeleteUnpublishedChanges:i().func.isRequired,onPublish:i().func.isRequired,unPublish:i().func.isRequired,onDuplicate:i().func.isRequired,onChangeStatus:i().func.isRequired,user:i().object,hasChanged:i().bool,displayUrl:i().string,hasWorkflow:i().bool,useOpenAuthoring:i().bool,hasUnpublishedChanges:i().bool,isNewEntry:i().bool,isModification:i().bool,currentStatus:i().string,onLogoutClick:i().func.isRequired,deployPreview:i().object,loadDeployPreview:i().func.isRequired,draftKey:i().string.isRequired,t:i().func.isRequired};const Wx=qx;function Hx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Vx(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Hx(Object(r),!0).forEach((function(t){Gx(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hx(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Gx(e,t,r){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Kx(e,t){const{collections:r}=e,n=e.config.publish_mode===Zn,o=r.get(t.match.params.name),i={isEditorialWorkflow:n,showDelete:!t.newEntry&&Sc(o)};if(n){const r=t.match.params[0],n=Vf(e,o.get("name"),r);n&&(i.unpublishedEntry=!0,i.entry=n)}return i}function Yx(e,t,r){const{isEditorialWorkflow:n,unpublishedEntry:o}=e,{dispatch:i}=t,a={};return n&&(a.loadEntry=(e,t)=>i(Cs(e,t)),a.persistEntry=e=>i(function(e,t){return async(r,n)=>{const o=n(),i=o.entryDraft,a=i.get("fieldsErrors"),s=function(e,t){return function(e,t){return e.get("entities")?e.get("entities").filter(((e,r)=>yf()(r,`${t}.`))).map((e=>e.get("slug"))).valueSeq():null}(e.editorialWorkflow,t)}(o,e.get("name")),l=Wf(o,e.get("name")).concat(s);if(!Qt()(o.editorialWorkflow.toJS(),"pages.ids",!1)&&r(Ts(o.collections)),!a.isEmpty())return a.some((e=>e.some((e=>e.type&&e.type===Ki.PRESENCE))))&&r(ea({message:{key:"ui.toast.missingRequiredField"},type:"error",dismissAfter:8e3})),Promise.reject();const c=rf(o.config),u=i.get("entry"),f=Tl({entry:u}),p=Pl(e,u),d=i.set("entry",p);r(Os(e,u.get("slug")));const h=t?c.persistUnpublishedEntry:c.persistEntry;try{const t=await h.call(c,{config:o.config,collection:e,entryDraft:d,assetProxies:f,usedSlugs:l});r(ea({message:{key:"ui.toast.entrySaved"},type:"success",dismissAfter:4e3})),r(Es(e,p)),u.get("slug")!==t&&(await r(Cs(e,t)),as(e.get("name"),t))}catch(t){return r(ea({message:{key:"ui.toast.onFailToPersist",details:t},type:"error",dismissAfter:8e3})),Promise.reject(r(ks(t,e,u.get("slug"))))}}}(e,o))),Vx(Vx(Vx({},r),e),a)}function Jx(e,t,r){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Qx extends r().Component{constructor(...e){super(...e),Jx(this,"createBackup",w_()((function(e,t){this.props.persistLocalBackup(e,t)}),2e3)),Jx(this,"handleChangeDraftField",((e,t,r,n)=>{const o=[this.props.unPublishedEntry,this.props.publishedEntry].filter(Boolean);this.props.changeDraftField({field:e,value:t,metadata:r,entries:o,i18n:n})})),Jx(this,"handleChangeStatus",(e=>{const{entryDraft:t,updateUnpublishedEntryStatus:r,collection:n,slug:o,currentStatus:i,t:a}=this.props;if(t.get("hasChanged"))return void window.alert(a("editor.editor.onUpdatingWithUnsavedChanges"));const s=eo.get(e);r(n.get("name"),o,i,s)})),Jx(this,"handlePersistEntry",(async(e={})=>{const{createNew:t=!1,duplicate:r=!1}=e,{persistEntry:n,collection:o,currentStatus:i,hasWorkflow:a,loadEntry:s,slug:l,createDraftDuplicateFromEntry:c,entryDraft:u}=this.props;await n(o),this.deleteBackup(),t?(is(o.get("name")),r&&c(u.get("entry"))):l&&a&&!i&&s(o,l)})),Jx(this,"handlePublishEntry",(async(e={})=>{const{createNew:t=!1,duplicate:r=!1}=e,{publishUnpublishedEntry:n,createDraftDuplicateFromEntry:o,entryDraft:i,collection:a,slug:s,currentStatus:l,t:c}=this.props;l===eo.last()?i.get("hasChanged")?window.alert(c("editor.editor.onPublishingWithUnsavedChanges")):window.confirm(c("editor.editor.onPublishing"))&&(await n(a.get("name"),s),this.deleteBackup(),t&&is(a.get("name")),r&&o(i.get("entry"))):window.alert(c("editor.editor.onPublishingNotReady"))})),Jx(this,"handleUnpublishEntry",(async()=>{const{unpublishPublishedEntry:e,collection:t,slug:r,t:n}=this.props;if(window.confirm(n("editor.editor.onUnpublishing")))return await e(t,r),os(t.get("name"))})),Jx(this,"handleDuplicateEntry",(()=>{const{createDraftDuplicateFromEntry:e,collection:t,entryDraft:r}=this.props;is(t.get("name")),e(r.get("entry"))})),Jx(this,"handleDeleteEntry",(()=>{const{entryDraft:e,newEntry:t,collection:r,deleteEntry:n,slug:o,t:i}=this.props;if(e.get("hasChanged")){if(!window.confirm(i("editor.editor.onDeleteWithUnsavedChanges")))return}else if(!window.confirm(i("editor.editor.onDeletePublishedEntry")))return;if(t)return os(r.get("name"));setTimeout((async()=>(await n(r,o),this.deleteBackup(),os(r.get("name")))),0)})),Jx(this,"handleDeleteUnpublishedChanges",(async()=>{const{entryDraft:e,collection:t,slug:r,deleteUnpublishedEntry:n,loadEntry:o,isModification:i,t:a}=this.props;e.get("hasChanged")&&!window.confirm(a("editor.editor.onDeleteUnpublishedChangesWithUnsavedChanges"))||window.confirm(a("editor.editor.onDeleteUnpublishedChanges"))&&(await n(t.get("name"),r),this.deleteBackup(),i?o(t,r):os(t.get("name")))}))}componentDidMount(){const{newEntry:e,collection:t,slug:r,loadEntry:n,createEmptyDraft:o,loadEntries:i,retrieveLocalBackup:a,collectionEntriesLoaded:s,t:l}=this.props;a(t,r),e?o(t,this.props.location.search):n(t,r);const c=l("editor.editor.onLeavePage");this.exitBlocker=e=>{if(this.props.entryDraft.get("hasChanged"))return e.returnValue=c,c},window.addEventListener("beforeunload",this.exitBlocker);const u=ns.block(((e,r)=>{const n=this.props.entryDraft.getIn(["entry","isPersisting"]),o=this.props.entryDraft.getIn(["entry","newRecord"]),i=`/collections/${t.get("name")}/new`;if(!n||!o||this.props.location.pathname!==i||"PUSH"!==r)return this.props.hasChanged?c:void 0}));this.unlisten=ns.listen(((e,r)=>{const n=`/collections/${t.get("name")}/new`,o=`/collections/${t.get("name")}/entries/`,{pathname:i}=e;i.startsWith(n)||i.startsWith(o)&&"PUSH"===r||(this.deleteBackup(),u(),this.unlisten())})),s||i(t)}componentDidUpdate(e){if(!e.localBackup&&this.props.localBackup&&(window.confirm(this.props.t("editor.editor.confirmLoadBackup"))?this.props.loadLocalBackup():this.deleteBackup()),this.props.hasChanged&&this.createBackup(this.props.entryDraft.get("entry"),this.props.collection),e.entry===this.props.entry)return;const{newEntry:t,collection:r}=this.props;t&&e.createEmptyDraft(r,this.props.location.search)}componentWillUnmount(){this.createBackup.flush(),this.props.discardDraft(),window.removeEventListener("beforeunload",this.exitBlocker)}deleteBackup(){const{deleteLocalBackup:e,collection:t,slug:r,newEntry:n}=this.props;this.createBackup.cancel(),e(t,!n&&r)}render(){const{entry:e,entryDraft:t,fields:r,collection:n,changeDraftFieldValidation:o,user:i,hasChanged:a,displayUrl:s,hasWorkflow:l,useOpenAuthoring:c,unpublishedEntry:u,newEntry:f,isModification:p,currentStatus:d,logoutUser:h,deployPreview:g,loadDeployPreview:m,draftKey:y,slug:v,t:b,editorBackLink:w}=this.props,_=!f&&!u;return e&&e.get("error")?(0,xo.jsx)("div",null,(0,xo.jsx)("h3",null,e.get("error"))):null==t||void 0===t.get("entry")||e&&e.get("isFetching")?(0,xo.jsx)(qe.Loader,{active:!0},b("editor.editor.loadingEntry")):(0,xo.jsx)(Wx,{draftKey:y,entry:t.get("entry"),collection:n,fields:r,fieldsMetaData:t.get("fieldsMetaData"),fieldsErrors:t.get("fieldsErrors"),onChange:this.handleChangeDraftField,onValidate:o,onPersist:this.handlePersistEntry,onDelete:this.handleDeleteEntry,onDeleteUnpublishedChanges:this.handleDeleteUnpublishedChanges,onChangeStatus:this.handleChangeStatus,onPublish:this.handlePublishEntry,unPublish:this.handleUnpublishEntry,onDuplicate:this.handleDuplicateEntry,showDelete:this.props.showDelete,user:i,hasChanged:a,displayUrl:s,hasWorkflow:l,useOpenAuthoring:c,hasUnpublishedChanges:u,isNewEntry:f,isModification:p,currentStatus:d,onLogoutClick:h,deployPreview:g,loadDeployPreview:t=>m(n,v,e,_,t),editorBackLink:w,t:b})}}Jx(Qx,"propTypes",{changeDraftField:i().func.isRequired,changeDraftFieldValidation:i().func.isRequired,collection:Vm().map.isRequired,createDraftDuplicateFromEntry:i().func.isRequired,createEmptyDraft:i().func.isRequired,discardDraft:i().func.isRequired,entry:Vm().map,entryDraft:Vm().map.isRequired,loadEntry:i().func.isRequired,persistEntry:i().func.isRequired,deleteEntry:i().func.isRequired,showDelete:i().bool.isRequired,fields:Vm().list.isRequired,slug:i().string,newEntry:i().bool.isRequired,displayUrl:i().string,hasWorkflow:i().bool,useOpenAuthoring:i().bool,unpublishedEntry:i().bool,isModification:i().bool,collectionEntriesLoaded:i().bool,updateUnpublishedEntryStatus:i().func.isRequired,publishUnpublishedEntry:i().func.isRequired,deleteUnpublishedEntry:i().func.isRequired,logoutUser:i().func.isRequired,loadEntries:i().func.isRequired,deployPreview:i().object,loadDeployPreview:i().func.isRequired,currentStatus:i().string,user:i().object,location:i().shape({pathname:i().string,search:i().string}),hasChanged:i().bool,t:i().func.isRequired,retrieveLocalBackup:i().func.isRequired,localBackup:Vm().map,loadLocalBackup:i().func,persistLocalBackup:i().func.isRequired,deleteLocalBackup:i().func});const Xx={changeDraftField:function({field:e,value:t,metadata:r,entries:n,i18n:o}){return{type:el,payload:{field:e,value:t,metadata:r,entries:n,i18n:o}}},changeDraftFieldValidation:function(e,t){return{type:tl,payload:{uniquefieldId:e,errors:t}}},loadEntry:Sl,loadEntries:kl,loadDeployPreview:function(e,t,r,n,o){return async(i,a)=>{const s=a(),l=rf(s.config),c=e.get("name"),u=Hf(s,c,t);if(!u||!u.isFetching){i(function(e,t){return{type:Ef,payload:{collection:e,slug:t}}}(c,t));try{const a=n?l.getDeploy(e,t,r):await l.getDeployPreview(e,t,r,o);return i(a?function(e,t,r){const{url:n,status:o}=r;return{type:kf,payload:{collection:e,slug:t,url:n,status:o}}}(c,t,a):Tf(c,t))}catch(e){console.error(e),i(ea({message:{details:e.message,key:"ui.toast.onFailToLoadDeployPreview"},type:"error",dismissAfter:8e3})),i(Tf(c,t))}}}},loadLocalBackup:function(){return{type:ol}},retrieveLocalBackup:function(e,t){return async(r,n)=>{const o=n(),i=rf(o.config),{entry:a}=await i.getLocalDraftBackup(e,t);if(a){const t=a.mediaFiles||[],o=await Promise.all(t.map((t=>t.file||t.url?Tr({path:t.path,file:t.file,url:t.url,field:t.field}):rs({collection:e,entry:(0,Qe.fromJS)(a),path:t.path,field:t.field})(r,n))));return r(Qa(o)),r(function(e){return{type:nl,payload:{entry:e}}}(a))}}},persistLocalBackup:function(e,t){return(r,n)=>{const o=n();return rf(o.config).persistLocalDraftBackup(e,t)}},deleteLocalBackup:function(e,t){return(r,n)=>{const o=n();return rf(o.config).deleteLocalDraftBackup(e,t)}},createDraftDuplicateFromEntry:function(e){return t=>{t(Yi({predicate:({type:e})=>e===Xs,run:()=>t(function(e){return{type:il,payload:Si(e.get("collection"),"","",{data:e.get("data"),i18n:e.get("i18n"),mediaFiles:e.get("mediaFiles").toJS()})}}(e))}))}},createEmptyDraft:function(e,t){return async(r,n)=>{new URLSearchParams(t).forEach(((t,r)=>{e=function(e,r,n){const o=Oc(e,r);if(!o)return e;let i=!1;return e=e.set("fields",Ec(e.get("fields",(0,Qe.List)()),(function(e){const r=e;return r===o?(i=!0,(e=>{return e.set("default",!!["true","True","TRUE"].includes(r=t)||!["false","False","FALSE"].includes(r)&&function(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}(r));var r})(r)):r}),(()=>i))),e}(e,r)}));const o=e.get("fields",(0,Qe.List)()),i=function(e){return e.filter((e=>!e.get("meta"))).toList()}(o),a=Cl(i),s=function(e){return e.filter((e=>!0===e.get("meta"))).toList()}(o),l=Cl(s),c=n(),u=rf(c.config);e.has("media_folder")||await Fa(r,n());const f=function(e,t){if(!Lc(e))return{};return function(e,t){const{locales:r,defaultLocale:n}=Nc(e);return Object.fromEntries(r.filter((e=>e!==n)).map((e=>[e,{data:t}])))}(e,Cl(t,(function(e){return e.get(Ac)!==Dc.DUPLICATE&&e.get(Ac)!==Dc.TRANSLATE})))}(e,i);let p=Si(e.get("name"),"","",{data:a,i18n:f,mediaFiles:[],meta:l});p=await u.processEntry(c,e,p),r({type:Xs,payload:p})}},discardDraft:function(){return{type:Zs}},persistEntry:function(e){return async(t,r)=>{const n=r(),o=n.entryDraft,i=o.get("fieldsErrors"),a=Wf(n,e.get("name"));if(!i.isEmpty())return i.some((e=>e.some((e=>e.type&&e.type===Ki.PRESENCE))))&&t(ea({message:{key:"ui.toast.missingRequiredField"},type:"error",dismissAfter:8e3})),Promise.reject();const s=rf(n.config),l=o.get("entry"),c=Tl({entry:l}),u=Pl(e,l),f=o.set("entry",u);return t(function(e,t){return{type:al,payload:{collectionName:e.get("name"),entrySlug:t.get("slug")}}}(e,u)),s.persistEntry({config:n.config,collection:e,entryDraft:f,assetProxies:c,usedSlugs:a}).then((async r=>{t(ea({message:{key:"ui.toast.entrySaved"},type:"success",dismissAfter:4e3})),c.length>0&&await t(ka()),t(function(e,t,r){return{type:sl,payload:{collectionName:e.get("name"),entrySlug:t.get("slug"),slug:r}}}(e,u,r)),e.has("nested")&&await t(kl(e)),l.get("slug")!==r&&(await t(Sl(e,r)),as(e.get("name"),r))})).catch((r=>(console.error(r),t(ea({message:{details:r,key:"ui.toast.onFailToPersist"},type:"error",dismissAfter:8e3})),Promise.reject(t(function(e,t,r){return{type:ll,error:"Failed to persist entry",payload:{collectionName:e.get("name"),entrySlug:t.get("slug"),error:r.toString()}}}(e,u,r))))))}},deleteEntry:function(e,t){return(r,n)=>{const o=n(),i=rf(o.config);return r(function(e,t){return{type:"ENTRY_DELETE_REQUEST",payload:{collectionName:e.get("name"),entrySlug:t}}}(e,t)),i.deleteEntry(o,e,t).then((()=>r(vl(e,t)))).catch((n=>(r(ea({message:{details:n,key:"ui.toast.onFailToDelete"},type:"error",dismissAfter:8e3})),console.error(n),Promise.reject(r(function(e,t,r){return{type:"ENTRY_DELETE_FAILURE",payload:{collectionName:e.get("name"),entrySlug:t,error:r.toString()}}}(e,t,n))))))}},updateUnpublishedEntryStatus:Ps,publishUnpublishedEntry:Rs,unpublishPublishedEntry:function(e,t){return(r,n)=>{const o=n(),i=rf(o.config),a=qf(o,e.get("name"),t),s=(0,Qe.Map)().set("entry",a);return r(Os(e,t)),i.deleteEntry(o,e,t).then((()=>i.persistEntry({config:o.config,collection:e,entryDraft:s,assetProxies:[],usedSlugs:(0,Qe.List)(),status:eo.get("PENDING_PUBLISH")}))).then((()=>{r(Es(e,a)),r(vl(e,t)),r(Cs(e,t)),r(ea({message:{key:"ui.toast.entryUnpublished"},type:"success",dismissAfter:4e3}))})).catch((t=>{r(ea({message:{key:"ui.toast.onFailToUnpublishEntry",details:t},type:"error",dismissAfter:8e3})),r(ks(t,e,a.get("slug")))}))}},deleteUnpublishedEntry:js,logoutUser:hf},Zx=H((function(e,t){const{collections:r,entryDraft:n,auth:o,config:i,entries:a,globalUI:s}=e,l=t.match.params[0],c=r.get(t.match.params.name),u=c.get("name"),f=!0===t.newRecord,p=yc(c,l),d=f?null:qf(e,u,l),h=o.user,g=n.get("hasChanged"),m=i.display_url,y=i.publish_mode===Zn,v=s.useOpenAuthoring,b=n.getIn(["entry","isModification"]),w=!!a.getIn(["pages",u]),_=Vf(e,u,l),S=qf(e,u,l),x=_&&_.get("status"),O=Hf(e,u,l),E=n.get("localBackup"),k=n.get("key");let C=`/collections/${u}`;if("workflow"===new URLSearchParams(t.location.search).get("ref")&&(C="/workflow"),c.has("nested")&&l){const e=l.split("/");e.length>2&&(C=`${C}/filter/${e.slice(0,-2).join("/")}`)}return{collection:c,collections:r,newEntry:f,entryDraft:n,fields:p,slug:l,entry:d,user:h,hasChanged:g,displayUrl:m,hasWorkflow:y,useOpenAuthoring:v,isModification:b,collectionEntriesLoaded:w,currentStatus:x,deployPreview:O,localBackup:E,draftKey:k,publishedEntry:S,unPublishedEntry:_,editorBackLink:C}}),Xx)(function(e){return H(Kx,null,Yx)(class extends r().Component{render(){return(0,xo.jsx)(e,this.props)}})}((0,We.Iu)()(Qx))),eO=Cg("div",{target:"ew40z3q0",label:"NotFoundContainer"})("margin:",qe.lengths.pageMargin,";");function tO({t:e}){return(0,xo.jsx)(eO,null,(0,xo.jsx)("h2",null,e("app.notFoundPage.header")))}tO.propTypes={t:i().func.isRequired};const rO=(0,We.Iu)()(tO);function nO(e,t,r){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oO(){return oO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},oO.apply(this,arguments)}const iO={buttonActive:(0,xo.css)("color:",qe.colors.active,";;label:buttonActive;")};function aO(e){return(0,xo.jsx)("header",oO({css:(0,xo.css)(qe.shadows.dropMain,";position:sticky;width:100%;top:0;background-color:",qe.colors.foreground,";z-index:",qe.zIndex.zIndex300,";height:",qe.lengths.topBarHeight,";;label:AppHeader;")},e))}const sO=Cg("div",{target:"e1rbzf6g4",label:"AppHeaderContent"})({name:"jxf21e",styles:"display:flex;justify-content:space-between;min-width:800px;max-width:1440px;padding:0 12px;margin:0 auto"}),lO=Cg("button",{target:"e1rbzf6g3",label:"AppHeaderButton"})(qe.buttons.button,";background:none;color:#7b8290;font-family:inherit;font-size:16px;font-weight:500;display:inline-flex;padding:16px 20px;align-items:center;",qe.Icon,"{margin-right:4px;color:#b3b9c4;}&:hover,&:active,&:focus-visible{",iO.buttonActive,";",qe.Icon,"{",iO.buttonActive,";}}",(e=>(0,xo.css)("&.",e.activeClassName,"{",iO.buttonActive,";",qe.Icon,"{",iO.buttonActive,";}};label:AppHeaderButton;")),";"),cO=lO.withComponent(Gv,{target:"e1rbzf6g5",label:"AppHeaderNavLink"}),uO=Cg("div",{target:"e1rbzf6g2",label:"AppHeaderActions"})({name:"8irbms",styles:"display:inline-flex;align-items:center"}),fO=Cg(qe.StyledDropdownButton,{target:"e1rbzf6g1",label:"AppHeaderQuickNewButton"})(qe.buttons.button,";",qe.buttons.medium,";",qe.buttons.gray,";margin-right:8px;&:after{top:11px;}"),pO=Cg("ul",{target:"e1rbzf6g0",label:"AppHeaderNavList"})({name:"1vufzxm",styles:"display:flex;margin:0;list-style:none"});class dO extends r().Component{constructor(...e){super(...e),nO(this,"intervalId",void 0),nO(this,"handleCreatePostClick",(e=>{const{onCreateEntryClick:t}=this.props;t&&t(e)}))}componentDidMount(){this.intervalId=setInterval((()=>{this.props.checkBackendStatus()}),3e5)}componentWillUnmount(){clearInterval(this.intervalId)}render(){const{user:e,collections:t,onLogoutClick:r,openMediaLibrary:n,hasWorkflow:o,displayUrl:i,isTestRepo:a,t:s,showMediaButton:l}=this.props,c=t.filter((e=>e.get("create"))).toList();return(0,xo.jsx)(aO,null,(0,xo.jsx)(sO,null,(0,xo.jsx)("nav",null,(0,xo.jsx)(pO,null,(0,xo.jsx)("li",null,(0,xo.jsx)(cO,{to:"/",activeClassName:"header-link-active",isActive:(e,t)=>t.pathname.startsWith("/collections/")},(0,xo.jsx)(qe.Icon,{type:"page"}),s("app.header.content"))),o&&(0,xo.jsx)("li",null,(0,xo.jsx)(cO,{to:"/workflow",activeClassName:"header-link-active"},(0,xo.jsx)(qe.Icon,{type:"workflow"}),s("app.header.workflow"))),l&&(0,xo.jsx)("li",null,(0,xo.jsx)(lO,{onClick:n},(0,xo.jsx)(qe.Icon,{type:"media-alt"}),s("app.header.media"))))),(0,xo.jsx)(uO,null,c.size>0&&(0,xo.jsx)(qe.Dropdown,{renderButton:()=>(0,xo.jsx)(fO,null," ",s("app.header.quickAdd")),dropdownTopOverlap:"30px",dropdownWidth:"160px",dropdownPosition:"left"},c.map((e=>(0,xo.jsx)(qe.DropdownItem,{key:e.get("name"),label:e.get("label_singular")||e.get("label"),onClick:()=>this.handleCreatePostClick(e.get("name"))})))),(0,xo.jsx)(Wm,{displayUrl:i,isTestRepo:a,imageUrl:null==e?void 0:e.avatar_url,onLogoutClick:r}))))}}nO(dO,"propTypes",{user:i().object.isRequired,collections:Vm().map.isRequired,onCreateEntryClick:i().func.isRequired,onLogoutClick:i().func.isRequired,openMediaLibrary:i().func.isRequired,hasWorkflow:i().bool.isRequired,displayUrl:i().string,isTestRepo:i().bool,t:i().func.isRequired,checkBackendStatus:i().func.isRequired});const hO={checkBackendStatus:function(){return async(e,t)=>{try{const r=t();if(r.status.isFetching)return;e({type:If});const n=rf(r.config),o=await n.status(),i="ui.toast.onBackendDown",a=r.notifications.notifications.filter((e=>{var t;return"string"!=typeof e.message&&(null===(t=e.message)||void 0===t?void 0:t.key)===i}));if(!1===o.api.status)return 0===a.length&&e(ea({message:{details:o.api.statusPage,key:"ui.toast.onBackendDown"},type:"error"})),e(Nf(o));if(!0===o.api.status&&a.length>0&&a.forEach((t=>{e(ta(t.id))})),!1===o.auth.status){const t="ui.toast.onLoggedOut",n=r.notifications.notifications.find((e=>{var r;return"string"!=typeof e.message&&(null===(r=e.message)||void 0===r?void 0:r.key)===t}));n||e(ea({message:{key:"ui.toast.onLoggedOut"},type:"error"}))}e(Nf(o))}catch(t){e(function(e){return{type:Lf,payload:{error:e}}}(t))}}}},gO=H(null,hO)((0,We.Iu)()(dO)),mO=["collections","render"];function yO(){return yO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yO.apply(this,arguments)}Km().config({barColors:{0:qe.colors.active,"1.0":qe.colors.active},shadowBlur:0,barThickness:2});const vO=Cg("div",{target:"eh2m33j2",label:"AppMainContainer"})({name:"y0stlg",styles:"min-width:800px;max-width:1440px;margin:0 auto"}),bO=Cg("div",{target:"eh2m33j1",label:"ErrorContainer"})({name:"3zy121",styles:"margin:20px"}),wO=Cg("pre",{target:"eh2m33j0",label:"ErrorCodeBlock"})({name:"1dps4tx",styles:"margin-left:20px;font-size:15px;line-height:1.5"});function _O(e){const t=e.filter((e=>!0!==e.get("hide"))).first();if(t)return`/collections/${t.get("name")}`;throw new Error("Could not find a non hidden collection")}function SO(e){let{collections:t,render:r}=e,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,mO);const o=_O(t);return(0,xo.jsx)(Ue,yO({},n,{render:e=>t.get(e.match.params.name)?r(e):(0,xo.jsx)(Ne,{to:o})}))}class xO extends r().Component{configError(e){const t=this.props.t;return(0,xo.jsx)(bO,null,(0,xo.jsx)("h1",null,t("app.app.errorHeader")),(0,xo.jsx)("div",null,(0,xo.jsx)("strong",null,t("app.app.configErrors"),":"),(0,xo.jsx)(wO,null,e.error),(0,xo.jsx)("span",null,t("app.app.checkConfigYml"))))}handleLogin(e){this.props.loginUser(e)}authenticating(){const{auth:e,t}=this.props,n=rf(this.props.config);return null==n?(0,xo.jsx)("div",null,(0,xo.jsx)("h1",null,t("app.app.waitingBackend"))):(0,xo.jsx)("div",null,(0,xo.jsx)(Dm,null),r().createElement(n.authComponent(),{onLogin:this.handleLogin.bind(this),error:e.error,inProgress:e.isFetching,siteId:this.props.config.backend.site_domain,base_url:this.props.config.backend.base_url,authEndpoint:this.props.config.backend.auth_endpoint,config:this.props.config,clearHash:()=>ns.replace("/"),t}))}handleLinkClick(e,t,...r){e.preventDefault(),t(...r)}render(){const{user:e,config:t,collections:n,logoutUser:o,isFetching:i,publishMode:a,useMediaLibrary:s,openMediaLibrary:l,t:c,showMediaButton:u}=this.props;if(null===t)return null;if(t.error)return this.configError(t);if(t.isFetching)return(0,xo.jsx)(qe.Loader,{active:!0},c("app.app.loadingConfig"));if(null==e)return this.authenticating(c);const f=_O(n),p=a===Zn;return(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(Dm,null),(0,xo.jsx)(gO,{user:e,collections:n,onCreateEntryClick:Ym,onLogoutClick:o,openMediaLibrary:l,hasWorkflow:p,displayUrl:t.display_url,isTestRepo:"test-repo"===t.backend.name,showMediaButton:u}),(0,xo.jsx)(vO,null,i&&(0,xo.jsx)(Km(),null),(0,xo.jsx)(ze,null,(0,xo.jsx)(Ne,{exact:!0,from:"/",to:f}),(0,xo.jsx)(Ne,{exact:!0,from:"/search/",to:f}),(0,xo.jsx)(SO,{exact:!0,collections:n,path:"/collections/:name/search/",render:({match:e})=>(0,xo.jsx)(Ne,{to:`/collections/${e.params.name}`})}),(0,xo.jsx)(Ne,{from:"/error=access_denied&error_description=Signups+not+allowed+for+this+instance",to:f}),p?(0,xo.jsx)(Ue,{path:"/workflow",component:v_}):null,(0,xo.jsx)(SO,{exact:!0,collections:n,path:"/collections/:name",render:e=>(0,xo.jsx)(Bw,e)}),(0,xo.jsx)(SO,{path:"/collections/:name/new",collections:n,render:e=>(0,xo.jsx)(Zx,yO({},e,{newRecord:!0}))}),(0,xo.jsx)(SO,{path:"/collections/:name/entries/*",collections:n,render:e=>(0,xo.jsx)(Zx,e)}),(0,xo.jsx)(SO,{path:"/collections/:name/search/:searchTerm",collections:n,render:e=>(0,xo.jsx)(Bw,yO({},e,{isSearchResults:!0,isSingleSearchResult:!0}))}),(0,xo.jsx)(SO,{collections:n,path:"/collections/:name/filter/:filterTerm*",render:e=>(0,xo.jsx)(Bw,e)}),(0,xo.jsx)(Ue,{path:"/search/:searchTerm",render:e=>(0,xo.jsx)(Bw,yO({},e,{isSearchResults:!0}))}),(0,xo.jsx)(SO,{path:"/edit/:name/:entryName",collections:n,render:({match:e})=>{const{name:t,entryName:r}=e.params;return(0,xo.jsx)(Ne,{to:`/collections/${t}/entries/${r}`})}}),(0,xo.jsx)(Ue,{component:rO})),s?(0,xo.jsx)($v,null):null))}}!function(e,t,r){t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(xO,"propTypes",{auth:i().object.isRequired,config:i().object.isRequired,collections:Vm().map.isRequired,loginUser:i().func.isRequired,logoutUser:i().func.isRequired,user:i().object,isFetching:i().bool.isRequired,publishMode:i().oneOf([Xn,Zn]),siteId:i().string,useMediaLibrary:i().bool,openMediaLibrary:i().func.isRequired,showMediaButton:i().bool,t:i().func.isRequired});const OO=H((function(e){const{auth:t,config:r,collections:n,globalUI:o,mediaLibrary:i}=e,a=t.user,s=o.isFetching,l=r.publish_mode,c=!i.get("externalLibrary");return{auth:t,config:r,collections:n,user:a,isFetching:s,publishMode:l,showMediaButton:i.get("showMediaButton"),useMediaLibrary:c}}),{openMediaLibrary:xa,loginUser:function(e){return(t,r)=>{const n=r(),o=rf(n.config);return t(uf()),o.authenticate(e).then((e=>{e.useOpenAuthoring&&t(df()),t(ff(e))})).catch((e=>{console.error(e),t(ea({message:{details:e.message,key:"ui.toast.onFailToAuth"},type:"error",dismissAfter:8e3})),t(pf(e))}))}},logoutUser:hf})((0,We.Iu)()(xO));function EO({field:e,t}){return(0,xo.jsx)("div",null,t("editor.editorWidgets.unknownControl.noControl",{widget:e.get("widget")}))}EO.propTypes={field:Vm().map,t:i().func.isRequired};const kO=(0,We.Iu)()(EO);function CO({field:e,t}){return(0,xo.jsx)("div",{className:"nc-widgetPreview"},t("editor.editorWidgets.unknownPreview.noPreview",{widget:e.get("widget")}))}function TO(e){return Yf.dispatch(Oa(e,void 0))}CO.propTypes={field:Vm().map,t:i().func.isRequired},En("unknown",kO,(0,We.Iu)()(CO));const PO=jo()((async function(e,t){const r=An(e);if(r){const e=await r.init({options:t,handleInsert:TO});Yf.dispatch(function(e){const t={show:e.show||(()=>{}),hide:e.hide||(()=>{}),onClearControl:e.onClearControl||(()=>{}),onRemoveControl:e.onRemoveControl||(()=>{}),enableStandalone:e.enableStandalone||(()=>{})};return{type:aa,payload:t}}(e))}else{const t=new Error(`Missing external media library '${e}'. Please use 'registerMediaLibrary' to register it.`);Yf.dispatch(Mu(t))}}));Yf.subscribe((()=>{const e=Yf.getState();if(e){var t;const r=null===(t=e.config.media_library)||void 0===t?void 0:t.name;if(r&&!e.mediaLibrary.get("externalLibrary")){const t=e.config.media_library;PO(r,t)}}})),__webpack_require__(30762);const jO="nc-root",RO=H((function(e){return{locale:Lu(e.config),config:e.config}}))((function({locale:e,config:t}){return(0,xo.jsx)(We.oc,{locale:e,messages:Xf(e)},(0,xo.jsx)(Wg,{showBackup:!0,config:t},(0,xo.jsx)(Re,{history:ns},(0,xo.jsx)(Ue,{component:OO}))))}));function MO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function AO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?MO(Object(r),!0).forEach((function(t){IO(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):MO(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function IO(e,t,r){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const DO=AO(AO({},Sn),{},{init:function(e={}){const{config:t}=e;console.log("decap-cms-core 3.6.3"),Yf.dispatch(Au(t,(function(){Yf.dispatch(((e,t)=>{const r=t(),n=rf(r.config);return e(uf()),Promise.resolve(n.currentUser()).then((t=>{t?(t.useOpenAuthoring&&e(df()),e(ff(t))):e({type:sf})})).catch((t=>{e(pf(t)),e(hf())}))}))}))),(0,n.s)(function(){const e=document.getElementById(jO);if(e)return e;const t=document.createElement("div");return t.id=jO,document.body.appendChild(t),t}()).render((0,xo.jsx)((function(){return(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(qe.GlobalStyles,null),(0,xo.jsx)(p,{store:Yf},(0,xo.jsx)(RO,null)))}),null))}})})(),__webpack_exports__=__webpack_exports__.DecapCmsCore,__webpack_exports__})()));
47
47
  //# sourceMappingURL=decap-cms-core.js.map