492 lines
5.1 MiB
JavaScript
492 lines
5.1 MiB
JavaScript
|
/*! For license information please see decap-cms.js.LICENSE.txt */
|
||
|
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("DecapCms",[],t):"object"==typeof exports?exports.DecapCms=t():e.DecapCms=t()}(window,(()=>(()=>{var __webpack_modules__={61540:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AutoScrollActivator:()=>_e,DndContext:()=>Ye,DragOverlay:()=>mt,KeyboardCode:()=>oe,KeyboardSensor:()=>ce,MeasuringFrequency:()=>Ce,MeasuringStrategy:()=>Ee,MouseSensor:()=>ye,PointerSensor:()=>me,TouchSensor:()=>we,TraversalOrder:()=>xe,applyModifiers:()=>Ge,closestCenter:()=>A,closestCorners:()=>T,defaultAnnouncements:()=>p,defaultCoordinates:()=>b,defaultDropAnimation:()=>ft,defaultDropAnimationSideEffects:()=>dt,defaultScreenReaderInstructions:()=>f,getClientRect:()=>F,getFirstCollision:()=>C,getScrollableAncestors:()=>z,pointerWithin:()=>D,rectIntersection:()=>P,useDndContext:()=>tt,useDndMonitor:()=>d,useDraggable:()=>et,useDroppable:()=>it,useSensor:()=>v,useSensors:()=>y});var r=n(2784),i=n(28316),o=n(82851);const a={display:"none"};function s(e){let{id:t,value:n}=e;return r.createElement("div",{id:t,style:a},n)}const l={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};function u(e){let{id:t,announcement:n}=e;return r.createElement("div",{id:t,style:l,role:"status","aria-live":"assertive","aria-atomic":!0},n)}const c=(0,r.createContext)(null);function d(e){const t=(0,r.useContext)(c);(0,r.useEffect)((()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)}),[e,t])}const f={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},p={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function h(e){let{announcements:t=p,container:n,hiddenTextDescribedById:a,screenReaderInstructions:l=f}=e;const{announce:c,announcement:h}=function(){const[e,t]=(0,r.useState)("");return{announce:(0,r.useCallback)((e=>{null!=e&&t(e)}),[]),announcement:e}}(),m=(0,o.useUniqueId)("DndLiveRegion"),[g,v]=(0,r.useState)(!1);if((0,r.useEffect)((()=>{v(!0)}),[]),d((0,r.useMemo)((()=>({onDragStart(e){let{active:n}=e;c(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&c(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;c(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;c(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;c(t.onDragCancel({active:n,over:r}))}})),[c,t])),!g)return null;const y=r.createElement(r.Fragment,null,r.createElement(s,{id:a,value:l.draggable}),r.createElement(u,{id:m,announcement:h}));return n?(0,i.createPortal)(y,n):y}var m;function g(){}function v(e,t){return(0,r.useMemo)((()=>({sensor:e,options:null!=t?t:{}})),[e,t])}function y(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,r.useMemo)((()=>[...t].filter((e=>null!=e))),[...t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(m||(m={}));const b=Object.freeze({x:0,y:0});function w(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function _(e,t){const n=(0,o.getEventCoordinates)(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function x(e,t){let{data:{value:n}}=e,{data:
|
||
|
source.repository.full_name = "${this.repo}"
|
||
|
AND state = "${f.OPEN}"
|
||
|
AND destination.branch.name = "${this.branch}"
|
||
|
AND comment_count > 0
|
||
|
AND ${t}
|
||
|
`}}),r=await Promise.all(n.values.map((e=>this.getPullRequestLabel(e.id))));return n.values.filter(((e,t)=>(0,o.isCMSLabel)(r[t],this.cmsLabelPrefix)))}async getBranchPullRequest(e){const t=await this.getPullRequests(e);if(t.length<=0)throw new o.EditorialWorkflowError("content is not under editorial workflow",!0);return t[0]}async listUnpublishedBranches(){return console.log("%c Checking for Unpublished entries","line-height: 30px;text-align: center;font-weight: bold"),(await this.getPullRequests()).map((e=>e.source.branch.name))}async retrieveUnpublishedEntryData(e){const{collection:t,slug:n}=(0,o.parseContentKey)(e),r=(0,o.branchFromContentKey)(e),i=await this.getBranchPullRequest(r),a=await this.getDifferences(r),s=await this.getPullRequestLabel(i.id),l=(0,o.labelToStatus)(s,this.cmsLabelPrefix),u=i.updated_on,c=i.author.display_name;return{collection:t,slug:n,status:l,diffs:a.filter((e=>"deleted"!==e.status)).map((e=>({path:e.path,newFile:e.newFile,id:""}))),updatedAt:u,pullRequestAuthor:c}}async updateUnpublishedEntryStatus(e,t,n){const r=(0,o.generateContentKey)(e,t),i=(0,o.branchFromContentKey)(r),a=await this.getBranchPullRequest(i);await this.addPullRequestComment(a,(0,o.statusToLabel)(n,this.cmsLabelPrefix))}async mergePullRequest(e){await this.requestJSON({method:"POST",url:`${this.repoURL}/pullrequests/${e.id}/merge`,headers:{"Content-Type":m},body:JSON.stringify({message:o.MERGE_COMMIT_MESSAGE,close_source_branch:!0,merge_strategy:this.mergeStrategy})})}async publishUnpublishedEntry(e,t){const n=(0,o.generateContentKey)(e,t),r=(0,o.branchFromContentKey)(n),i=await this.getBranchPullRequest(r);await this.mergePullRequest(i)}async declinePullRequest(e){await this.requestJSON({method:"POST",url:`${this.repoURL}/pullrequests/${e.id}/decline`})}async deleteBranch(e){await this.request({method:"DELETE",url:`${this.repoURL}/refs/branches/${e}`})}async deleteUnpublishedEntry(e,t){const n=(0,o.generateContentKey)(e,t),r=(0,o.branchFromContentKey)(n),i=await this.getBranchPullRequest(r);await this.declinePullRequest(i),await this.deleteBranch(r)}async getPullRequestStatuses(e){return(await this.requestJSON({url:`${this.repoURL}/pullrequests/${e.id}/statuses`,params:{pagelen:100}})).values}async getStatuses(e,t){const n=(0,o.generateContentKey)(e,t),r=(0,o.branchFromContentKey)(n),i=await this.getBranchPullRequest(r);return(await this.getPullRequestStatuses(i)).map((({key:e,state:t,url:n})=>({context:e,state:t===p.Successful?o.PreviewState.Success:o.PreviewState.Other,target_url:n})))}async getUnpublishedEntrySha(e,t){const n=(0,o.generateContentKey)(e,t),r=(0,o.branchFromContentKey)(n);return(await this.getBranchPullRequest(r)).destination.commit.hash}}},8387:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=u(n(70894)),i=u(n(2784)),o=u(n(13980)),a=n(76320),s=n(30762),l=n(28165);function u(e){return e&&e.__esModule?e:{default:e}}function c(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const d=(0,r.default)(s.Icon,{target:"e15sc0jo0",label:"LoginButtonIcon"})({name:"1gnqu05",styles:"margin-right:18px"});class f extends i.default.Component{constructor(...e){super(...e),c(this,"state",{}),c(this,"handleLogin",(e=>{e.preventDefault(),this.auth.authenticate(this.authSettings,((e,t)=>{e?this.setState({loginError:e.toString()}):this.props.onLogin(t)}))}))}componentDidMount(){const{auth_type:e=""}=this.props.config.backend;if("implicit"===e){const{base_url:e="https://bitbucket.org",auth_endpoint:t="site/oauth2/authorize",app_id:n=""}=this.props.config.backend;this.auth=new a.ImplicitAuthenticator({base_url:e,auth_endpoint:t,app_id:n,clearHash:this.props.clearHash}),this.auth.completeAuth(((e,t)=>{e?this.setState({loginE
|
||
|
Repo "${this.repo}" not found.
|
||
|
|
||
|
Please ensure the repo information is spelled correctly.
|
||
|
|
||
|
If the repo is private, make sure you're logged into a Bitbucket account with access.
|
||
|
`,e})))throw new Error("Your BitBucket user account does not have access to this repo.");const t=await this.api.user();return h(h({},t),{},{name:t.display_name,login:t.username,token:e.token,avatar_url:t.links.avatar.href,refresh_token:e.refresh_token})}getRefreshedAccessToken(){if("implicit"===this.authType)throw new a.AccessTokenError("Can't refresh access token when using implicit auth");if(this.refreshedTokenPromise)return this.refreshedTokenPromise;if(!this.authenticator){const e={base_url:this.baseUrl,site_id:this.siteId};this.authenticator=new s.NetlifyAuthenticator(e)}return this.refreshedTokenPromise=this.authenticator.refresh({provider:"bitbucket",refresh_token:this.refreshToken}).then((({token:e,refresh_token:t})=>(this.token=e,this.refreshToken=t,this.refreshedTokenPromise=void 0,this.updateUserCredentials({token:e,refresh_token:t}),e))),this.refreshedTokenPromise}logout(){this.token=null}getToken(){return this.refreshedTokenPromise?this.refreshedTokenPromise:Promise.resolve(this.token)}async entriesByFolder(e,t,n){let r;const i=await this.api.defaultBranchCommitSha(),o=await(0,a.entriesByFolder)((()=>this.api.listFiles(e,n,20,this.branch).then((({entries:e,cursor:n})=>(r=n.mergeMeta({extension:t}),e.filter((e=>(0,a.filterByExtension)(e,t))))))),((e,t)=>this.api.readFile(e,t,{head:i})),this.api.readFileMetadata.bind(this.api),u.API_NAME);return o[a.CURSOR_COMPATIBILITY_SYMBOL]=r,o}async listAllFiles(e,t,n){return(await this.api.listAllFiles(e,n,this.branch)).filter((e=>(0,a.filterByExtension)(e,t)))}async allEntriesByFolder(e,t,n){const r=await this.api.defaultBranchCommitSha();return await(0,a.allEntriesByFolder)({listAllFiles:()=>this.listAllFiles(e,t,n),readFile:(e,t)=>this.api.readFile(e,t,{head:r}),readFileMetadata:this.api.readFileMetadata.bind(this.api),apiName:u.API_NAME,branch:this.branch,localForage:a.localForage,folder:e,extension:t,depth:n,getDefaultBranch:()=>Promise.resolve({name:this.branch,sha:r}),isShaExistsInBranch:this.api.isShaExistsInBranch.bind(this.api),getDifferences:(e,t)=>this.api.getDifferences(e,t),getFileId:e=>Promise.resolve(this.api.getFileId(r,e)),filterFile:e=>(0,a.filterByExtension)(e,t)})}async entriesByFiles(e){const t=await this.api.defaultBranchCommitSha();return(0,a.entriesByFiles)(e,((e,n)=>this.api.readFile(e,n,{head:t})),this.api.readFileMetadata.bind(this.api),u.API_NAME)}getEntry(e){return this.api.readFile(e).then((t=>({file:{path:e,id:null},data:t})))}getMedia(e=this.mediaFolder){return this.api.listAllFiles(e,1,this.branch).then((e=>e.map((({id:e,name:t,path:n})=>({id:e,name:t,path:n,displayURL:{id:e,path:n}})))))}getLargeMediaClient(){return this._largeMediaClientPromise||(this._largeMediaClientPromise=(async()=>{const e=await this.api.readFile(".gitattributes").then((e=>(0,a.getLargeMediaPatternsFromGitAttributesFile)(e))).catch((e=>(404===e.status?console.log("This 404 was expected and handled appropriately."):console.error(e),[])));return new c.GitLfsClient(!!(this.largeMediaURL&&e.length>0),this.largeMediaURL,e,this.requestFunction)})()),this._largeMediaClientPromise}getMediaDisplayURL(e){return this._mediaDisplayURLSem=this._mediaDisplayURLSem||(0,i.default)(10),(0,a.getMediaDisplayURL)(e,this.api.readFile.bind(this.api),this._mediaDisplayURLSem)}async getMediaFile(e){const t=(0,a.basename)(e),n=await(0,a.getMediaAsBlob)(e,null,this.api.readFile.bind(this.api)),r=(0,a.blobToFileObj)(t,n),i=URL.createObjectURL(r);return{id:await(0,a.getBlobSHA)(r),displayURL:i,path:e,name:t,size:r.size,file:r,url:i}}async persistEntry(e,t){const n=await this.getLargeMediaClient();return(0,a.runWithLock)(this.lock,(async()=>this.api.persistFiles(e.dataFiles,n.enabled?await(0,a.getLargeMediaFilteredMediaFiles)(n,e.assets):e.assets,t)),"Failed to acquire persist entry lock")}async persistMedia(e,t){const{fileObj:n,path:r}=e,i=n?URL.createObjectURL(n):"",o=await this.getLargeMediaClient(),s=r.startsWith("/")?r.slice(1):r;if(!o.enabled||!o.matchPath(s))return this._persistMedia(e,t);const l=await(0,a.getPointerFileForMediaFileObj)(o,n,r);return h(h({},await this._persistMe
|
||
|
Repo "${this.repo}" not found.
|
||
|
|
||
|
Please ensure the repo information is spelled correctly.
|
||
|
|
||
|
If the repo is private, make sure you're logged into a Gitea account with access.
|
||
|
|
||
|
If your repo is under an organization, ensure the organization has granted access to Static
|
||
|
CMS.
|
||
|
`,e})))throw new Error("Your Gitea user account does not have access to this repo.");return{name:n.full_name,login:n.login,avatar_url:n.avatar_url,token:e.token}}logout(){if(this.token=null,this.api&&this.api.reset&&"function"==typeof this.api.reset)return this.api.reset()}getToken(){return Promise.resolve(this.token)}async entriesByFolder(e,t,n){const r=this.api.originRepoURL;let i;const o=await(0,a.entriesByFolder)((()=>this.api.listFiles(e,{repoURL:r,depth:n}).then((e=>{const n=e.filter((e=>(0,a.filterByExtension)(e,t))),r=this.getCursorAndFiles(n,1);return i=r.cursor,r.files}))),((e,t)=>this.api.readFile(e,t,{repoURL:r})),this.api.readFileMetadata.bind(this.api),s.API_NAME);return o[a.CURSOR_COMPATIBILITY_SYMBOL]=i,o}async allEntriesByFolder(e,t,n){const r=this.api.originRepoURL;return await(0,a.entriesByFolder)((()=>this.api.listFiles(e,{repoURL:r,depth:n}).then((e=>e.filter((e=>(0,a.filterByExtension)(e,t)))))),((e,t)=>this.api.readFile(e,t,{repoURL:r})),this.api.readFileMetadata.bind(this.api),s.API_NAME)}entriesByFiles(e){const t=this.api.repoURL;return(0,a.entriesByFiles)(e,((e,n)=>this.api.readFile(e,n,{repoURL:t}).catch((()=>""))),this.api.readFileMetadata.bind(this.api),s.API_NAME)}getEntry(e){const t=this.api.originRepoURL;return this.api.readFile(e,null,{repoURL:t}).then((t=>({file:{path:e,id:null},data:t}))).catch((()=>({file:{path:e,id:null},data:""})))}async getMedia(e=this.mediaFolder,t){return e?this.api.listFiles(e,void 0,t).then((e=>e.map((({id:e,name:t,size:n,path:r,type:i})=>({id:e,name:t,size:n,displayURL:{id:e,path:r},path:r,isDirectory:"tree"===i}))))):[]}async getMediaFile(e){const t=await(0,a.getMediaAsBlob)(e,null,this.api.readFile.bind(this.api)),n=(0,a.basename)(e),r=(0,a.blobToFileObj)(n,t),i=URL.createObjectURL(r);return{id:await(0,a.getBlobSHA)(t),displayURL:i,path:e,name:n,size:r.size,file:r,url:i}}getMediaDisplayURL(e){return this._mediaDisplayURLSem=this._mediaDisplayURLSem||(0,o.default)(10),(0,a.getMediaDisplayURL)(e,this.api.readFile.bind(this.api),this._mediaDisplayURLSem)}persistEntry(e,t){return(0,a.runWithLock)(this.lock,(()=>this.api.persistFiles(e.dataFiles,e.assets,t)),"Failed to acquire persist entry lock")}async persistMedia(e,t){try{await this.api.persistFiles([],[e],t);const{sha:n,path:r,fileObj:o}=e,a=URL.createObjectURL(o);return{id:n,name:o.name,size:o.size,displayURL:a,path:(0,i.default)(r,"/")}}catch(e){throw console.error(e),e}}deleteFiles(e,t){return this.api.deleteFiles(e,t)}async traverseCursor(e,t){const n=e.meta,r=e.data.get("files").toJS();let i;switch(t){case"first":default:i=this.getCursorAndFiles(r,1);break;case"last":i=this.getCursorAndFiles(r,n.get("pageCount"));break;case"next":i=this.getCursorAndFiles(r,n.get("page")+1);break;case"prev":i=this.getCursorAndFiles(r,n.get("page")-1)}return{entries:await(0,a.entriesByFiles)(i.files,((e,t)=>this.api.readFile(e,t,{repoURL:this.api.originRepoURL}).catch((()=>""))),this.api.readFileMetadata.bind(this.api),s.API_NAME),cursor:i.cursor}}async unpublishedEntries(){return{}}async unpublishedEntry(){return{}}async unpublishedEntryDataFile(){return{}}async unpublishedEntryMediaFile(){return{}}async updateUnpublishedEntryStatus(){}async publishUnpublishedEntry(){}async deleteUnpublishedEntry(){}async getDeployPreview(){return{}}}},38589:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"API",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"AuthenticationPage",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"GiteaBackend",{enumerable:!0,get:function(){return r.default}});var r=a(n(83972)),i=a(n(66141)),o=a(n(29961));function a(e){return e&&e.__esModule?e:{default:e}}},33870:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.PullRequestState=t.MOCK_PULL_REQUEST=t.API_NAME=void 0;var r=h(n(5648)),i=h(n(93433)),o=h(n(36346)),a=h(n(83465)),s=h(n(56974)),l=h(n(87613)),u=n(95978),c=h(n(63252)),d=n(13856),f=n(33806),p=n(21023);function h(e){return e&&e.__esModule?e:{default:e}}function m(e,
|
||
|
Decap CMS is adding labels to ${t.length} of your Editorial Workflow
|
||
|
entries. The "Workflow" tab will be unavailable during this migration. You may use other
|
||
|
areas of the CMS during this time. Note that closing the CMS will pause the migration.
|
||
|
`)),n+=1,await this.migratePullRequest(e,`${n} of ${t.length}`);e=(await this.getPullRequests(void 0,_.Open,(e=>x(e,this.cmsLabelPrefix)))).map((e=>e.head.ref))}return e}async getStatuses(e,t){const n=this.generateContentKey(e,t),r=(0,f.branchFromContentKey)(n),i=(await this.getBranchPullRequest(r)).head.sha;return(await this.request(`${this.originRepoURL}/commits/${i}/status`)).statuses.map((e=>({context:e.context,target_url:e.target_url,state:e.state===w.Success?f.PreviewState.Success:f.PreviewState.Other})))}async persistFiles(e,t,n){const r=t.concat(e),o=r.map((e=>this.uploadBlob(e)));if(await Promise.all(o),n.useWorkflow){const o=t.map((({sha:e,path:t})=>({path:(0,i.default)(t,"/"),sha:e}))),a=e[0].slug;return this.editorialWorkflowGit(r,a,o,n)}return this.getDefaultBranch().then((e=>this.updateTree(e.commit.sha,r))).then((e=>this.commit(n.commitMessage,e))).then((e=>this.patchBranch(this.branch,e.sha)))}async getFileSha(e,{repoURL:t=this.repoURL,branch:n=this.branch}={}){const r=e.split("/"),i=(0,s.default)(r),o=(0,l.default)(r).join("/"),a=`${t}/git/trees/${n}:${encodeURIComponent(o)}`,u=(await this.request(a)).tree.find((e=>e.path===i));if(u)return u.sha;throw new f.APIError("Not Found",404,y)}async deleteFiles(e,t){if(this.useOpenAuthoring)return Promise.reject("Cannot delete published entries as an Open Authoring user!");const n=await this.getDefaultBranch(),r=e.map((e=>({path:e,sha:null}))),i=await this.updateTree(n.commit.sha,r),o=await this.commit(t,i);await this.patchBranch(this.branch,o.sha)}async createBranchAndPullRequest(e,t,n){return await this.createBranch(e,t),this.createPR(n,e)}async updatePullRequestLabels(e,t){await this.request(`${this.repoURL}/issues/${e}/labels`,{method:"PUT",body:JSON.stringify({labels:t})})}async diffFromFile(e){return{path:e.filename,newFile:"added"===e.status,sha:e.sha,binary:"renamed"!==e.status&&!e.patch||e.filename.endsWith(".svg")}}async editorialWorkflowGit(e,t,n,r){const i=this.generateContentKey(r.collectionName,t),o=(0,f.branchFromContentKey)(i);if(r.unpublished){const{files:t}=await this.getDifferences(this.branch,await this.getHeadReference(o)),i=await Promise.all(t.map((e=>this.diffFromFile(e)))),a=[];for(const e of i.filter((e=>e.binary)))n.some((t=>t.path===e.path))||a.push({path:e.path,sha:null});const s=await this.rebaseBranch(o),l=a.concat(e),u=await this.updateTree(s.sha,l,o),c=await this.commit(r.commitMessage,u);return this.patchBranch(o,c.sha,{force:!0})}{const t=await this.getDefaultBranch(),n=await this.updateTree(t.commit.sha,e),i=await this.commit(r.commitMessage,n);if(this.useOpenAuthoring)await this.createBranch(o,i.sha);else{const e=await this.createBranchAndPullRequest(o,i.sha,r.commitMessage);await this.setPullRequestStatus(e,r.status||this.initialWorkflowStatus)}}}async getDifferences(e,t){const n=this.useOpenAuthoring?10:1;for(let r=1;r<=n;r++)try{return await this.request(`${this.originRepoURL}/compare/${e}...${t}`)}catch(e){if(r===n)throw console.warn(`Reached maximum number of attempts '${n}' for getDifferences`),e;await new Promise((e=>setTimeout(e,500*r)))}throw new f.APIError("Not Found",404,y)}async rebaseSingleCommit(e,t){const n=k((await this.getDifferences(t.parents[0].sha,t.sha)).files);if(n.length>0){const r=await this.updateTree(e.sha,n),{message:i,author:o,committer:a}=t.commit;return await this.createCommit(i,r.sha,[e.sha],o,a)}return t}async rebaseCommits(e,t){return 0===t.length||t[0].parents[0].sha===e.sha?(0,s.default)(t):t.reduce(((e,t)=>e.then((e=>{const n=e,r=t;return this.rebaseSingleCommit(n,r)}))),Promise.resolve(e))}async rebaseBranch(e){try{const{base_commit:t,commits:n}=await this.getDifferences(this.branch,await this.getHeadReference(e));return await this.rebaseCommits(t,n)}catch(e){throw console.error(e),e}}async setPullRequestStatus(e,t){const n=[...e.labels.filter((e=>!(0,f.isCMSLabel)(e.name,this.cmsLabelPrefix))).map((e=>e.name)),(0,f.statusToLabel)(t,this.cmsLabelPrefix)];await this.updatePullRequestLabels(e.number,n)}async updateUnpublishedEntryStatus(e,t,n){const r=this.generateContentKey(e,t),i=
|
||
|
fragment RepositoryParts on Repository {
|
||
|
id
|
||
|
isFork
|
||
|
}
|
||
|
`,o=(t.blobWithText=r.gql`
|
||
|
fragment BlobWithTextParts on Blob {
|
||
|
id
|
||
|
text
|
||
|
is_binary: isBinary
|
||
|
}
|
||
|
`,t.object=r.gql`
|
||
|
fragment ObjectParts on GitObject {
|
||
|
id
|
||
|
sha: oid
|
||
|
}
|
||
|
`);t.branch=r.gql`
|
||
|
fragment BranchParts on Ref {
|
||
|
commit: target {
|
||
|
...ObjectParts
|
||
|
}
|
||
|
id
|
||
|
name
|
||
|
prefix
|
||
|
repository {
|
||
|
...RepositoryParts
|
||
|
}
|
||
|
}
|
||
|
${o}
|
||
|
${i}
|
||
|
`,t.pullRequest=r.gql`
|
||
|
fragment PullRequestParts on PullRequest {
|
||
|
id
|
||
|
baseRefName
|
||
|
baseRefOid
|
||
|
body
|
||
|
headRefName
|
||
|
headRefOid
|
||
|
number
|
||
|
state
|
||
|
title
|
||
|
merged_at: mergedAt
|
||
|
updated_at: updatedAt
|
||
|
user: author {
|
||
|
login
|
||
|
... on User {
|
||
|
name
|
||
|
}
|
||
|
}
|
||
|
repository {
|
||
|
...RepositoryParts
|
||
|
}
|
||
|
labels(last: 100) {
|
||
|
nodes {
|
||
|
name
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
${i}
|
||
|
`,t.treeEntry=r.gql`
|
||
|
fragment TreeEntryParts on TreeEntry {
|
||
|
path: name
|
||
|
sha: oid
|
||
|
type
|
||
|
mode
|
||
|
}
|
||
|
`,t.fileEntry=r.gql`
|
||
|
fragment FileEntryParts on TreeEntry {
|
||
|
name
|
||
|
sha: oid
|
||
|
type
|
||
|
blob: object {
|
||
|
... on Blob {
|
||
|
size: byteSize
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
`},8400:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,p(n(2784));var r=d(n(63252)),i=d(n(93433)),o=n(13856),a=n(33806),s=d(n(99312)),l=p(n(33870)),u=d(n(24759)),c=n(28165);function d(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}function p(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h.apply(this,arguments)}function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function v(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{fetchWithTimeout:y}=a.unsentRequest,b="https://www.githubstatus.com",w=`${b}/api/v2/components.json`,_=["API Requests","Issues, Pull Requests, Projects"];t.default=class{constructor(e,t={}){var n;if(v(this,"lock",void 0),v(this,"api",void 0),v(this,"options",void 0),v(this,"originRepo",void 0),v(this,"isBranchConfigured",void 0),v(this,"repo",void 0),v(this,"openAuthoringEnabled",void 0),v(this,"useOpenAuthoring",void 0),v(this,"alwaysForkEnabled",void 0),v(this,"branch",void 0),v(this,"apiRoot",void 0),v(this,"mediaFolder",void 0),v(this,"previewContext",void 0),v(this,"token",void 0),v(this,"tokenKeyword",void 0),v(this,"squashMerges",void 0),v(this,"cmsLabelPrefix",void 0),v(this,"useGraphql",void 0),v(this,"baseUrl",void 0),v(this,"bypassWriteAccessCheckForAppTokens",!1),v(this,"_currentUserPromise",void 0),v(this,"_userIsOriginMaintainerPromises",void 0),v(this,"_mediaDisplayURLSem",void 0),v(this,"getCursorAndFiles",((e,t)=>{const n=e.length,r=Math.ceil(e.length/20),i=[];return t>1&&(i.push("prev"),i.push("first")),t<r&&(i.push("next"),i.push("last")),{cursor:a.Cursor.create({actions:i,meta:{page:t,count:n,pageSize:20,pageCount:r},data:{files:e}}),files:e.slice(20*(t-1),20*t)}})),this.options=g({proxied:!1,API:null,initialWorkflowStatus:""},t),!this.options.proxied&&(null===e.backend.repo||void 0===e.backend.repo))throw new Error('The GitHub backend needs a "repo" in the backend configuration.');if(this.api=this.options.API||null,this.isBranchConfigured=!!e.backend.branch,this.openAuthoringEnabled=e.backend.open_authoring||!1,this.openAuthoringEnabled){if(!this.options.useWorkflow)throw new Error("backend.open_authoring is true but publish_mode is not set to editorial_workflow.");this.originRepo=e.backend.repo||""}else this.repo=this.originRepo=e.backend.repo||"";this.alwaysForkEnabled=e.backend.always_fork||!1,this.branch=(null===(n=e.backend.branch)||void 0===n?void 0:n.trim())||"master",this.apiRoot=e.backend.api_root||"https://api.github.com",this.token="",this.tokenKeywor
|
||
|
Repo "${this.repo}" not found.
|
||
|
|
||
|
Please ensure the repo information is spelled correctly.
|
||
|
|
||
|
If the repo is private, make sure you're logged into a GitHub account with access.
|
||
|
|
||
|
If your repo is under an organization, ensure the organization has granted access to Decap CMS.
|
||
|
`,e}))&&!this.bypassWriteAccessCheckForAppTokens)throw new Error("Your GitHub user account does not have access to this repo.");return g(g({},n),{},{token:e.token,useOpenAuthoring:this.useOpenAuthoring})}logout(){if(this.token=null,this.api&&this.api.reset&&"function"==typeof this.api.reset)return this.api.reset()}getToken(){return Promise.resolve(this.token)}async entriesByFolder(e,t,n){const r=this.api.originRepoURL;let i;const o=await(0,a.entriesByFolder)((()=>this.api.listFiles(e,{repoURL:r,depth:n}).then((e=>{const n=e.filter((e=>(0,a.filterByExtension)(e,t))),r=this.getCursorAndFiles(n,1);return i=r.cursor,r.files}))),((e,t)=>this.api.readFile(e,t,{repoURL:r})),this.api.readFileMetadata.bind(this.api),l.API_NAME);return o[a.CURSOR_COMPATIBILITY_SYMBOL]=i,o}async allEntriesByFolder(e,t,n,r){const i=this.api.originRepoURL;return await(0,a.entriesByFolder)((()=>this.api.listFiles(e,{repoURL:i,depth:n}).then((e=>e.filter((e=>(!r||r.test(e.path))&&(0,a.filterByExtension)(e,t)))))),((e,t)=>this.api.readFile(e,t,{repoURL:i})),this.api.readFileMetadata.bind(this.api),l.API_NAME)}entriesByFiles(e){const t=this.useOpenAuthoring?this.api.originRepoURL:this.api.repoURL;return(0,a.entriesByFiles)(e,((e,n)=>this.api.readFile(e,n,{repoURL:t}).catch((()=>""))),this.api.readFileMetadata.bind(this.api),l.API_NAME)}getEntry(e){const t=this.api.originRepoURL;return this.api.readFile(e,null,{repoURL:t}).then((t=>({file:{path:e,id:null},data:t}))).catch((()=>({file:{path:e,id:null},data:""})))}getMedia(e=this.mediaFolder){return this.api.listFiles(e).then((e=>e.map((({id:e,name:t,size:n,path:r})=>({id:e,name:t,size:n,displayURL:{id:e,path:r},path:r})))))}async getMediaFile(e){const t=await(0,a.getMediaAsBlob)(e,null,this.api.readFile.bind(this.api)),n=(0,a.basename)(e),r=(0,a.blobToFileObj)(n,t),i=URL.createObjectURL(r);return{id:await(0,a.getBlobSHA)(t),displayURL:i,path:e,name:n,size:r.size,file:r,url:i}}getMediaDisplayURL(e){return this._mediaDisplayURLSem=this._mediaDisplayURLSem||(0,r.default)(10),(0,a.getMediaDisplayURL)(e,this.api.readFile.bind(this.api),this._mediaDisplayURLSem)}persistEntry(e,t){return(0,a.runWithLock)(this.lock,(()=>this.api.persistFiles(e.dataFiles,e.assets,t)),"Failed to acquire persist entry lock")}async persistMedia(e,t){try{await this.api.persistFiles([],[e],t);const{sha:n,path:r,fileObj:o}=e,a=o?URL.createObjectURL(o):"";return{id:n,name:o.name,size:o.size,displayURL:a,path:(0,i.default)(r,"/")}}catch(e){throw console.error(e),e}}deleteFiles(e,t){return this.api.deleteFiles(e,t)}async traverseCursor(e,t){const n=e.meta,r=e.data.get("files").toJS();let i;switch(t){case"first":default:i=this.getCursorAndFiles(r,1);break;case"last":i=this.getCursorAndFiles(r,n.get("pageCount"));break;case"next":i=this.getCursorAndFiles(r,n.get("page")+1);break;case"prev":i=this.getCursorAndFiles(r,n.get("page")-1)}return{entries:await(0,a.entriesByFiles)(i.files,((e,t)=>this.api.readFile(e,t,{repoURL:this.api.originRepoURL}).catch((()=>""))),this.api.readFileMetadata.bind(this.api),l.API_NAME),cursor:i.cursor}}async loadMediaFile(e,t){const n=await(0,a.getMediaAsBlob)(t.path,t.id,((t,n,{parseText:r})=>this.api.readFile(t,n,{branch:e,parseText:r}))),r=(0,a.basename)(t.path),i=(0,a.blobToFileObj)(r,n);return{id:t.id,displayURL:URL.createObjectURL(i),path:t.path,name:r,size:i.size,file:i}}async unpublishedEntries(){return await(0,a.unpublishedEntries)((()=>this.api.listUnpublishedBranches().then((e=>e.map((e=>(0,a.contentKeyFromBranch)(e)))))))}async unpublishedEntry({id:e,collection:t,slug:n}){if(e)return await this.api.retrieveUnpublishedEntryData(e);if(t&&n){const e=this.api.generateContentKey(t,n);return await this.api.retrieveUnpublishedEntryData(e)}throw new Error("Missing unpublished entry id or collection and slug")}getBranch(e,t){const n=this.api.generateContentKey(e,t);return(0,a.branchFromContentKey)(n)}async unpublishedEntryDataFile(e,t,n,r){const i=this.getBranch(e,t);return await this.api.readFile(n,r,{branch:i})}async unpublishedEntryMediaFile(e,t,n,r){const i=this.getBranch(e,t);return await this.loadMed
|
||
|
mutation updateRef($input: UpdateRefInput!) {
|
||
|
updateRef(input: $input) {
|
||
|
branch: ref {
|
||
|
...BranchParts
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
${i.branch}
|
||
|
`;const a="\ndeleteRef(input: $deleteRefInput) {\n clientMutationId\n}\n",s=(t.deleteBranch=r.gql`
|
||
|
mutation deleteRef($deleteRefInput: DeleteRefInput!) {
|
||
|
${a}
|
||
|
}
|
||
|
`,"\nclosePullRequest(input: $closePullRequestInput) {\n clientMutationId\n pullRequest {\n ...PullRequestParts\n }\n}\n"),l=(t.closePullRequest=r.gql`
|
||
|
mutation closePullRequestAndDeleteBranch($closePullRequestInput: ClosePullRequestInput!) {
|
||
|
${s}
|
||
|
}
|
||
|
${i.pullRequest}
|
||
|
`,t.closePullRequestAndDeleteBranch=r.gql`
|
||
|
mutation closePullRequestAndDeleteBranch(
|
||
|
$closePullRequestInput: ClosePullRequestInput!
|
||
|
$deleteRefInput: DeleteRefInput!
|
||
|
) {
|
||
|
${s}
|
||
|
${a}
|
||
|
}
|
||
|
${i.pullRequest}
|
||
|
`,"\n createPullRequest(input: $createPullRequestInput) {\n clientMutationId\n pullRequest {\n ...PullRequestParts\n }\n}\n ");t.createPullRequest=r.gql`
|
||
|
mutation createPullRequest($createPullRequestInput: CreatePullRequestInput!) {
|
||
|
${l}
|
||
|
}
|
||
|
${i.pullRequest}
|
||
|
`,t.createBranch=r.gql`
|
||
|
mutation createBranch($createRefInput: CreateRefInput!) {
|
||
|
createRef(input: $createRefInput) {
|
||
|
branch: ref {
|
||
|
...BranchParts
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
${i.branch}
|
||
|
`,t.createBranchAndPullRequest=r.gql`
|
||
|
mutation createBranchAndPullRequest(
|
||
|
$createRefInput: CreateRefInput!
|
||
|
$createPullRequestInput: CreatePullRequestInput!
|
||
|
) {
|
||
|
createRef(input: $createRefInput) {
|
||
|
branch: ref {
|
||
|
...BranchParts
|
||
|
}
|
||
|
}
|
||
|
${l}
|
||
|
}
|
||
|
${i.branch}
|
||
|
${i.pullRequest}
|
||
|
`,t.reopenPullRequest=r.gql`
|
||
|
mutation reopenPullRequest($reopenPullRequestInput: ReopenPullRequestInput!) {
|
||
|
reopenPullRequest(input: $reopenPullRequestInput) {
|
||
|
clientMutationId
|
||
|
pullRequest {
|
||
|
...PullRequestParts
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
${i.pullRequest}
|
||
|
`},66654:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fileSha=t.branch=t.blob=void 0,t.files=function(e){return r.gql`
|
||
|
query files($owner: String!, $name: String!, $expression: String!) {
|
||
|
repository(owner: $owner, name: $name) {
|
||
|
...RepositoryParts
|
||
|
object(expression: $expression) {
|
||
|
${function(e=1){const t="PLACE_HOLDER";let n=i.oneLine`
|
||
|
...ObjectParts
|
||
|
... on Tree {
|
||
|
entries {
|
||
|
...FileEntryParts
|
||
|
${t}
|
||
|
}
|
||
|
}
|
||
|
`;for(let r=0;r<e-1;r++)n=n.replace(t,i.oneLine`
|
||
|
object {
|
||
|
... on Tree {
|
||
|
entries {
|
||
|
...FileEntryParts
|
||
|
${t}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
`);return n=n.replace(t,""),n}(e)}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
${o.repository}
|
||
|
${o.object}
|
||
|
${o.fileEntry}
|
||
|
`},t.user=t.statues=t.repository=t.repoPermission=t.pullRequests=t.pullRequestAndBranch=t.pullRequest=t.openAuthoringBranches=void 0;var r=n(21488),i=n(13856),o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=a(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}(n(16689));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}t.repoPermission=r.gql`
|
||
|
query repoPermission($owner: String!, $name: String!) {
|
||
|
repository(owner: $owner, name: $name) {
|
||
|
...RepositoryParts
|
||
|
viewerPermission
|
||
|
}
|
||
|
}
|
||
|
${o.repository}
|
||
|
`,t.user=r.gql`
|
||
|
query {
|
||
|
viewer {
|
||
|
id
|
||
|
avatar_url: avatarUrl
|
||
|
name
|
||
|
login
|
||
|
}
|
||
|
}
|
||
|
`,t.blob=r.gql`
|
||
|
query blob($owner: String!, $name: String!, $expression: String!) {
|
||
|
repository(owner: $owner, name: $name) {
|
||
|
...RepositoryParts
|
||
|
object(expression: $expression) {
|
||
|
... on Blob {
|
||
|
...BlobWithTextParts
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
${o.repository}
|
||
|
${o.blobWithText}
|
||
|
`,t.statues=r.gql`
|
||
|
query statues($owner: String!, $name: String!, $sha: GitObjectID!) {
|
||
|
repository(owner: $owner, name: $name) {
|
||
|
...RepositoryParts
|
||
|
object(oid: $sha) {
|
||
|
...ObjectParts
|
||
|
... on Commit {
|
||
|
status {
|
||
|
id
|
||
|
contexts {
|
||
|
id
|
||
|
context
|
||
|
state
|
||
|
target_url: targetUrl
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
${o.repository}
|
||
|
${o.object}
|
||
|
`;const s="\nbranch: ref(qualifiedName: $qualifiedName) {\n ...BranchParts\n}\n",l=(t.branch=r.gql`
|
||
|
query branch($owner: String!, $name: String!, $qualifiedName: String!) {
|
||
|
repository(owner: $owner, name: $name) {
|
||
|
...RepositoryParts
|
||
|
${s}
|
||
|
}
|
||
|
}
|
||
|
${o.repository}
|
||
|
${o.branch}
|
||
|
`,t.openAuthoringBranches=r.gql`
|
||
|
query openAuthoringBranches($owner: String!, $name: String!, $refPrefix: String!) {
|
||
|
repository(owner: $owner, name: $name) {
|
||
|
...RepositoryParts
|
||
|
refs(refPrefix: $refPrefix, last: 100) {
|
||
|
nodes {
|
||
|
...BranchParts
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
${o.repository}
|
||
|
${o.branch}
|
||
|
`,t.repository=r.gql`
|
||
|
query repository($owner: String!, $name: String!) {
|
||
|
repository(owner: $owner, name: $name) {
|
||
|
...RepositoryParts
|
||
|
}
|
||
|
}
|
||
|
${o.repository}
|
||
|
`,"\npullRequest(number: $number) {\n ...PullRequestParts\n}\n");t.pullRequest=r.gql`
|
||
|
query pullRequest($owner: String!, $name: String!, $number: Int!) {
|
||
|
repository(owner: $owner, name: $name) {
|
||
|
id
|
||
|
${l}
|
||
|
}
|
||
|
}
|
||
|
${o.pullRequest}
|
||
|
`,t.pullRequests=r.gql`
|
||
|
query pullRequests($owner: String!, $name: String!, $head: String, $states: [PullRequestState!]) {
|
||
|
repository(owner: $owner, name: $name) {
|
||
|
id
|
||
|
pullRequests(last: 100, headRefName: $head, states: $states) {
|
||
|
nodes {
|
||
|
...PullRequestParts
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
${o.pullRequest}
|
||
|
`,t.pullRequestAndBranch=r.gql`
|
||
|
query pullRequestAndBranch($owner: String!, $name: String!, $originRepoOwner: String!, $originRepoName: String!, $qualifiedName: String!, $number: Int!) {
|
||
|
repository(owner: $owner, name: $name) {
|
||
|
...RepositoryParts
|
||
|
${s}
|
||
|
}
|
||
|
origin: repository(owner: $originRepoOwner, name: $originRepoName) {
|
||
|
...RepositoryParts
|
||
|
${l}
|
||
|
}
|
||
|
}
|
||
|
${o.repository}
|
||
|
${o.branch}
|
||
|
${o.pullRequest}
|
||
|
`,t.fileSha=r.gql`
|
||
|
query fileSha($owner: String!, $name: String!, $expression: String!) {
|
||
|
repository(owner: $owner, name: $name) {
|
||
|
...RepositoryParts
|
||
|
file: object(expression: $expression) {
|
||
|
...ObjectParts
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
${o.repository}
|
||
|
${o.object}
|
||
|
`},22026:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.API_NAME=void 0,t.getMaxAccess=C;var r=v(n(93433)),i=v(n(36346)),o=v(n(83465)),a=v(n(85395)),s=n(34600),l=n(70468),u=n(29206),c=n(96044),d=n(33806),f=n(95978),p=n(46670),h=n(21023),m=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=g(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}(n(31183));function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(g=function(e){return e?n:t})(e)}function v(e){return e&&e.__esModule?e:{default:e}}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){w(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function w(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const _="no-cache",x=t.API_NAME="GitLab";var k=function(e){return e.CREATE="create",e.DELETE="delete",e.MOVE="move",e.UPDATE="update",e}(k||{}),E=function(e){return e.Pending="pending",e.Running="running",e.Success="success",e.Failed="failed",e.Canceled="canceled",e}(E||{});function C(e){return e.reduce(((e,t)=>t.group_access_level>e.group_access_level?t:e),e[0])}function S(e,t,n){for(let r=0;r<e.length;r+=t)n(e.slice(r,r+t))}t.default=class{constructor(e){w(this,"apiRoot",void 0),w(this,"graphQLAPIRoot",void 0),w(this,"token",void 0),w(this,"branch",void 0),w(this,"useOpenAuthoring",void 0),w(this,"repo",void 0),w(this,"repoURL",void 0),w(this,"commitAuthor",void 0),w(this,"squashMerges",void 0),w(this,"initialWorkflowStatus",void 0),w(this,"cmsLabelPrefix",void 0),w(this,"graphQLClient",void 0),w(this,"withAuthorizationHeaders",(e=>{const t=d.unsentRequest.withHeaders(this.token?{Authorization:`Bearer ${this.token}`}:{},e);return Promise.resolve(t)})),w(this,"buildRequest",(async e=>{const t=d.unsentRequest.withRoot(this.apiRoot)(e),n=await this.withAuthorizationHeaders(t);return n.has("cache")?n:d.unsentRequest.withNoCache(n)})),w(this,"request",(async e=>{try{return(0,d.requestWithBackoff)(this,e)}catch(e){throw new d.APIError(e.message,null,x)}})),w(this,"responseToJSON",(0,d.responseParser)({format:"json",apiName:x})),w(this,"responseToBlob",(0,d.responseParser)({format:"blob",apiName:x})),w(this,"responseToText",(0,d.responseParser)({format:"text",apiName:x})),w(this,"requestJSON",(e=>this.request(e).then(this.responseToJSON))),w(this,"requestText",(e=>this.request(e).then(this.responseToText))),w(this,"user",(()=>this.requestJSON("/user"))),w(this,"WRITE_ACCESS",30),w(this,"MAINTAINER_ACCESS",40),w(this,"hasWriteAccess",(async()=>{const{shared_with_groups:e,permissions:t}=await this.requestJSON(this.repoURL),{project_access:n,group_access:r}=t;if(n&&n.access_level>=this.WRITE_ACCESS)return!0;if(r&&r.access_level>=this.WRITE_ACCESS)return!0;if(e&&e.length>0){const t=C(e);if(t.group_access_level>=this.MAINTAINER_ACCESS)return!0;if(t.group_access_level>=this.WRITE_ACCESS)try{const e=await this.getDefaultBranch();if(e.developers_can_merge&&e.d
|
||
|
Repo "${this.repo}" not found.
|
||
|
|
||
|
Please ensure the repo information is spelled correctly.
|
||
|
|
||
|
If the repo is private, make sure you're logged into a GitLab account with access.
|
||
|
`,e})))throw new Error("Your GitLab user account does not have access to this repo.");if(!this.isBranchConfigured){const e=await(0,s.getDefaultBranchName)({backend:"gitlab",repo:this.repo,token:this.token,apiRoot:this.apiRoot});e&&(this.branch=e)}return p(p({},t),{},{login:t.username,token:e.token})}async logout(){this.token=null}getToken(){return Promise.resolve(this.token)}filterFile(e,t,n,i){const o=(0,r.default)(t.path.split(e)[1]||"/","/");return(0,s.filterByExtension)(t,n)&&o.split("/").length<=i}async entriesByFolder(e,t,n){let r;const i=await(0,s.entriesByFolder)((()=>this.api.listFiles(e,n>1).then((({files:i,cursor:o})=>(r=o.mergeMeta({folder:e,extension:t,depth:n}),i.filter((r=>this.filterFile(e,r,t,n))))))),this.api.readFile.bind(this.api),this.api.readFileMetadata.bind(this.api),u.API_NAME);return i[s.CURSOR_COMPATIBILITY_SYMBOL]=r,i}async listAllFiles(e,t,n){return(await this.api.listAllFiles(e,n>1)).filter((r=>this.filterFile(e,r,t,n)))}async allEntriesByFolder(e,t,n){return await(0,s.allEntriesByFolder)({listAllFiles:()=>this.listAllFiles(e,t,n),readFile:this.api.readFile.bind(this.api),readFileMetadata:this.api.readFileMetadata.bind(this.api),apiName:u.API_NAME,branch:this.branch,localForage:s.localForage,folder:e,extension:t,depth:n,getDefaultBranch:()=>this.api.getDefaultBranch().then((e=>({name:e.name,sha:e.commit.id}))),isShaExistsInBranch:this.api.isShaExistsInBranch.bind(this.api),getDifferences:(e,t)=>this.api.getDifferences(e,t),getFileId:e=>this.api.getFileId(e,this.branch),filterFile:r=>this.filterFile(e,r,t,n),customFetch:this.useGraphQL?e=>this.api.readFilesGraphQL(e):void 0})}entriesByFiles(e){return(0,s.entriesByFiles)(e,this.api.readFile.bind(this.api),this.api.readFileMetadata.bind(this.api),u.API_NAME)}getEntry(e){return this.api.readFile(e).then((t=>({file:{path:e,id:null},data:t})))}getMedia(e=this.mediaFolder){return this.api.listAllFiles(e).then((e=>e.map((({id:e,name:t,path:n})=>({id:e,name:t,path:n,displayURL:{id:e,name:t,path:n}})))))}getMediaDisplayURL(e){return this._mediaDisplayURLSem=this._mediaDisplayURLSem||(0,o.default)(10),(0,s.getMediaDisplayURL)(e,this.api.readFile.bind(this.api),this._mediaDisplayURLSem)}async getMediaFile(e){const t=(0,s.basename)(e),n=await(0,s.getMediaAsBlob)(e,null,this.api.readFile.bind(this.api)),r=(0,s.blobToFileObj)(t,n),i=URL.createObjectURL(r);return{id:await(0,s.getBlobSHA)(n),displayURL:i,path:e,name:t,size:r.size,file:r,url:i}}async persistEntry(e,t){return(0,s.runWithLock)(this.lock,(()=>this.api.persistFiles(e.dataFiles,e.assets,t)),"Failed to acquire persist entry lock")}async persistMedia(e,t){const n=e.fileObj,[r]=await Promise.all([(0,s.getBlobSHA)(n),this.api.persistFiles([],[e],t)]),{path:o}=e,a=URL.createObjectURL(n);return{displayURL:a,path:(0,i.default)(o,"/"),name:n.name,size:n.size,file:n,url:a,id:r}}deleteFiles(e,t){return this.api.deleteFiles(e,t)}traverseCursor(e,t){return this.api.traverseCursor(e,t).then((async({entries:t,cursor:n})=>{var r,i,o;const[a,l,c]=[null===(r=e.meta)||void 0===r?void 0:r.get("folder"),null===(i=e.meta)||void 0===i?void 0:i.get("depth"),null===(o=e.meta)||void 0===o?void 0:o.get("extension")];return a&&l&&c&&(t=t.filter((e=>this.filterFile(a,e,c,l))),n=n.mergeMeta({folder:a,extension:c,depth:l})),{entries:await(0,s.entriesByFiles)(t,this.api.readFile.bind(this.api),this.api.readFileMetadata.bind(this.api),u.API_NAME),cursor:n}}))}loadMediaFile(e,t){return(0,s.getMediaAsBlob)(t.path,null,((t,n,{parseText:r})=>this.api.readFile(t,n,{branch:e,parseText:r}))).then((e=>{const n=(0,s.basename)(t.path),r=(0,s.blobToFileObj)(n,e);return{id:t.path,displayURL:URL.createObjectURL(r),path:t.path,name:n,size:r.size,file:r}}))}async loadEntryMediaFiles(e,t){return await Promise.all(t.map((t=>this.loadMediaFile(e,t))))}async unpublishedEntries(){return await(0,s.unpublishedEntries)((()=>this.api.listUnpublishedBranches().then((e=>e.map((e=>(0,s.contentKeyFromBranch)(e)))))))}async unpublishedEntry({id:e,collection:t,slug:n}){if(e)return await this.api.retrieveUnpublishedEntryData(e);if(t&&n){const e=(0,s.ge
|
||
|
tree${t}: tree(ref: $branch, path: "${e}") {
|
||
|
lastCommit {
|
||
|
authorName
|
||
|
authoredDate
|
||
|
author {
|
||
|
id
|
||
|
username
|
||
|
name
|
||
|
publicEmail
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
`)).join("\n");return r.gql`
|
||
|
query lastCommits($repo: ID!, $branch: String!) {
|
||
|
project(fullPath: $repo) {
|
||
|
repository {
|
||
|
${t}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
`};var r=n(21488),i=n(13856);t.files=r.gql`
|
||
|
query files($repo: ID!, $branch: String!, $path: String!, $recursive: Boolean!, $cursor: String) {
|
||
|
project(fullPath: $repo) {
|
||
|
repository {
|
||
|
tree(ref: $branch, path: $path, recursive: $recursive) {
|
||
|
blobs(after: $cursor) {
|
||
|
nodes {
|
||
|
type
|
||
|
id: sha
|
||
|
path
|
||
|
name
|
||
|
}
|
||
|
pageInfo {
|
||
|
endCursor
|
||
|
hasNextPage
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
`,t.blobs=r.gql`
|
||
|
query blobs($repo: ID!, $branch: String!, $paths: [String!]!) {
|
||
|
project(fullPath: $repo) {
|
||
|
repository {
|
||
|
blobs(ref: $branch, paths: $paths) {
|
||
|
nodes {
|
||
|
id
|
||
|
data: rawBlob
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
`},60737:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(70894)),i=l(n(2784)),o=l(n(13980)),a=n(30762),s=n(28165);function l(e){return e&&e.__esModule?e:{default:e}}function u(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const c=(0,r.default)("section",{target:"e1ektlme1",label:"StyledAuthenticationPage"})({name:"8azftg",styles:"display:flex;flex-flow:column nowrap;align-items:center;justify-content:center;height:100vh"}),d=(0,r.default)("button",{target:"e1ektlme0",label:"LoginButton"})(a.buttons.button,";",a.shadows.dropDeep,";",a.buttons.default,";",a.buttons.gray,";padding:0 30px;margin-top:0;display:flex;align-items:center;position:relative;",a.Icon,"{margin-right:18px;}");class f extends i.default.Component{constructor(...e){super(...e),u(this,"handleLogin",(e=>{e.preventDefault(),this.props.onLogin(this.state)}))}render(){const{config:e,inProgress:t,t:n}=this.props;return(0,s.jsx)(c,null,(0,a.renderPageLogo)(e.logo_url),(0,s.jsx)(d,{disabled:t,onClick:this.handleLogin},n(t?"auth.loggingIn":"auth.login")),e.site_url&&(0,s.jsx)(a.GoBackButton,{href:e.site_url,t:n}))}}t.default=f,u(f,"propTypes",{onLogin:o.default.func.isRequired,inProgress:o.default.bool,config:o.default.object.isRequired,t:o.default.func.isRequired})},9189:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=n(33806),o=(r=n(60737))&&r.__esModule?r:{default:r};function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}async function u(e){const t=await e.toBase64();return{path:e.path,content:t,encoding:"base64"}}function c({id:e,content:t,encoding:n,path:r,name:o}){let a=new Uint8Array(0);if("base64"!==n)console.error(`Unsupported encoding '${n}' for file '${r}'`);else{const e=atob(t);a=new Uint8Array(e.length);for(let t=0;t<e.length;t++)a[t]=e.charCodeAt(t)}const s=new Blob([a]),l=(0,i.blobToFileObj)(o,s),u=URL.createObjectURL(l);return{id:e,name:o,path:r,file:l,size:l.size,url:u,displayURL:u}}t.default=class{constructor(e,t={}){if(l(this,"proxyUrl",void 0),l(this,"mediaFolder",void 0),l(this,"options",void 0),l(this,"branch",void 0),l(this,"cmsLabelPrefix",void 0),!e.backend.proxy_url)throw new Error('The Proxy backend needs a "proxy_url" in the backend configuration.');this.branch=e.backend.branch||"master",this.proxyUrl=e.backend.proxy_url,this.mediaFolder=e.media_folder,this.options=t,this.cmsLabelPrefix=e.backend.cms_label_prefix}isGitBackend(){return!1}status(){return Promise.resolve({auth:{status:!0},api:{status:!0,statusPage:""}})}authComponent(){return o.default}restoreUser(){return this.authenticate()}authenticate(){return Promise.resolve()}logout(){return null}getToken(){return Promise.resolve("")}async request(e){const t=await i.unsentRequest.fetchWithTimeout(this.proxyUrl,{me
|
||
|
${K&&O.hidden};
|
||
|
`},ee.globalStyles&&(0,d.jsx)(d.Global,{styles:(0,d.css)(ee.globalStyles,";;label:EditorControl;")}),ae&&(0,d.jsx)(R,null,ae.map((e=>e.message&&"string"==typeof e.message&&(0,d.jsx)("li",{key:e.message.trim().replace(/[^a-z0-9]+/gi,"-")},e.message)))),(0,d.jsx)(M,{field:i,isActive:z||this.state.styleActive,hasErrors:le,uniqueFieldId:this.uniqueFieldId,isFieldOptional:re,t:$}),(0,d.jsx)(x.default,{classNameWrapper:J(a`
|
||
|
${O.widget};
|
||
|
`,{[a`
|
||
|
${O.widgetActive};
|
||
|
`]:z||this.state.styleActive},{[a`
|
||
|
${O.widgetError};
|
||
|
`]:le},{[a`
|
||
|
${O.disabled}
|
||
|
`]:G}),classNameWidget:a`
|
||
|
${O.widget};
|
||
|
`,classNameWidgetActive:a`
|
||
|
${O.widgetActive};
|
||
|
`,classNameLabel:a`
|
||
|
${O.label};
|
||
|
`,classNameLabelActive:a`
|
||
|
${O.labelActive};
|
||
|
`,controlComponent:ee.control,entry:t,collection:n,config:r,field:i,uniqueFieldId:this.uniqueFieldId,value:e,mediaPaths:l,metadata:oe,onChange:(e,t)=>c(i,e,t),onValidate:_&&(0,o.default)(_,this.uniqueFieldId),onOpenMediaLibrary:f,onClearMediaControl:p,onRemoveMediaControl:v,onRemoveInsertedMedia:b,onPersistMedia:w,onAddAsset:y,getAsset:u,hasActiveStyle:z||this.state.styleActive,setActiveStyle:()=>this.setState({styleActive:!0}),setInactiveStyle:()=>this.setState({styleActive:!1}),resolveWidget:g.resolveWidget,widget:ee,getEditorComponents:g.getEditorComponents,ref:E&&(0,o.default)(E,i),controlRef:C,editorControl:L,query:S,loadEntry:F,queryHits:T[this.uniqueFieldId]||[],clearSearch:j,clearFieldErrors:N,isFetching:I,fieldsErrors:s,onValidateObject:ie,isEditorComponent:U,isNewEditorComponent:q,parentIds:W,t:$,validateMetaField:H,isDisabled:G,isFieldDuplicate:Z,isFieldHidden:Y,isLoadingAsset:V,locale:X,isParentListCollapsed:Q}),ne&&(0,d.jsx)(D,{active:z||this.state.styleActive,error:le},(0,d.jsx)(h.default,{remarkPlugins:[m.default],allowedElements:["a","strong","em","del"],unwrapDisallowed:!0,components:{a:e=>{let{node:t}=e,n=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,k);return(0,d.jsx)("a",A({},n,{target:"_blank",rel:"noopener noreferrer",style:{color:"inherit"}}))}}},ne)))))}}T(I,"propTypes",{value:l.default.oneOfType([l.default.node,l.default.object,l.default.string,l.default.bool]),field:u.default.map.isRequired,fieldsMetaData:u.default.map,fieldsErrors:u.default.map,mediaPaths:u.default.map.isRequired,boundGetAsset:l.default.func.isRequired,onChange:l.default.func.isRequired,openMediaLibrary:l.default.func.isRequired,addAsset:l.default.func.isRequired,removeInsertedMedia:l.default.func.isRequired,persistMedia:l.default.func.isRequired,onValidate:l.default.func,processControlRef:l.default.func,controlRef:l.default.func,query:l.default.func.isRequired,queryHits:l.default.object,isFetching:l.default.bool,clearSearch:l.default.func.isRequired,clearFieldErrors:l.default.func.isRequired,loadEntry:l.default.func.isRequired,t:l.default.func.isRequired,isEditorComponent:l.default.bool,isNewEditorComponent:l.default.bool,parentIds:l.default.arrayOf(l.default.string),entry:u.default.map.isRequired,collection:u.default.map.isRequired,isDisabled:l.default.bool,isHidden:l.default.bool,isFieldDuplicate:l.default.func,isFieldHidden:l.default.func,locale:l.default.string,isParentListCollapsed:l.default.bool}),T(I,"defaultProps",{parentIds:[]});const L=(0,f.connect)((function(e){const{collections:t,entryDraft:n}=e,r=n.get("entry"),i=t.get(n.getIn(["entry","collection"])),o=(0,b.selectIsLoadingAsset)(e.medias);return{mediaPaths:e.mediaLibrary.get("controlMedia"),isFetching:e.search.isFetching,queryHits:e.search.queryHits,config:e.config,entry:r,collection:i,isLoadingAsset:o,loadEntry:async function(n,r){const i=t.get(n);if(i)return await(0,v.tryLoadEntry)(e,i,r);throw new Error(`Can't find collection '${n}'`)},validateMetaField:(t,n,r)=>(0,v.validateMetaField)(e,i,t,n,r)}}),(function(e){return S(S({},(0,s.bindActionCreators)({openMediaLibrary:_.openMediaLibrary,clearMediaControl:_.clearMediaControl,removeMediaControl:_.removeMediaControl,removeInsertedMedia:_.removeInsertedMedia,persistMedia:_.persistMedia,addAsset:y.addAsset,query:w.query,clearSearch:w.clearSearch,clearFieldErrors:v.clearFieldErrors},e)),{},{boundGetAsset:(t,n)=>(0,y.boundGetAsset)(e,t,n)})}),(function(e,t,n){return S(S(S(S({},e),t),n),{},{boundGetAsset:t.boundGetAsset(e.collection,e.entry)})}))((0,c.translate)()(I));t.default=L},46776:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=d(n(70894)),i=d(n(2784)),o=d(n(13980)),a=d(n(19155)),s=n(28165),l=n(30762),u=d(n(65886)),c=n(13943);func
|
||
|
this.wrappedControlValid is not a function. Are you sure widget
|
||
|
"${e.get("widget")}" is registered?
|
||
|
`);const r=this.wrappedControlValid();return"boolean"==typeof r?{error:!r}:Object.prototype.hasOwnProperty.call(r,"error")?r:r instanceof Promise?(r.then((()=>{this.validate({error:!1})}),(t=>{const n={type:u.default.CUSTOM,message:`${e.get("label",e.get("name"))} - ${t}.`};this.validate({error:n})})),{error:{type:u.default.CUSTOM,parentIds:n,message:t("editor.editorControlPane.widget.processing",{fieldLabel:e.get("label",e.get("name"))})}}):{error:!1}})),f(this,"getObjectValue",(()=>this.props.value||(0,a.Map)())),f(this,"onChangeObject",((e,t,n)=>{const r=this.getObjectValue().set(e.get("name"),t);return this.props.onChange(r,n&&{[this.props.field.get("name")]:n})})),f(this,"setInactiveStyle",(()=>{this.props.setInactiveStyle(),this.props.field.has("pattern")&&!h(this.getValidateValue())&&this.validate()}))}shouldComponentUpdate(e){return(!this.props.isLoadingAsset||!e.isLoadingAsset)&&(this.wrappedControlShouldComponentUpdate?this.wrappedControlShouldComponentUpdate(e):this.props.value!==e.value||this.props.classNameWrapper!==e.classNameWrapper||this.props.hasActiveStyle!==e.hasActiveStyle)}render(){const{controlComponent:e,entry:t,collection:n,config:r,field:o,value:a,mediaPaths:s,metadata:u,onChange:c,onValidateObject:d,onOpenMediaLibrary:f,onRemoveMediaControl:p,onPersistMedia:h,onClearMediaControl:m,onAddAsset:g,onRemoveInsertedMedia:v,getAsset:y,classNameWrapper:b,classNameWidget:w,classNameWidgetActive:_,classNameLabel:x,classNameLabelActive:k,setActiveStyle:E,hasActiveStyle:C,editorControl:S,uniqueFieldId:A,resolveWidget:T,widget:O,getEditorComponents:P,query:R,queryHits:D,clearSearch:M,clearFieldErrors:I,isFetching:L,loadEntry:j,fieldsErrors:N,controlRef:F,isEditorComponent:B,isNewEditorComponent:z,parentIds:U,t:q,isDisabled:W,isFieldDuplicate:$,isFieldHidden:H,locale:V,isParentListCollapsed:G}=this.props;return i.default.createElement(e,{entry:t,collection:n,config:r,field:o,value:a,mediaPaths:s,metadata:u,onChange:c,onChangeObject:this.onChangeObject,onValidateObject:d,onOpenMediaLibrary:f,onClearMediaControl:m,onRemoveMediaControl:p,onPersistMedia:h,onAddAsset:g,onRemoveInsertedMedia:v,getAsset:y,forID:A,ref:this.processInnerControlRef,validate:this.validate,classNameWrapper:b,classNameWidget:w,classNameWidgetActive:_,classNameLabel:x,classNameLabelActive:k,setActiveStyle:E,setInactiveStyle:()=>this.setInactiveStyle(),hasActiveStyle:C,editorControl:S,resolveWidget:T,widget:O,getEditorComponents:P,getRemarkPlugins:l.getRemarkPlugins,query:R,queryHits:D,clearSearch:M,clearFieldErrors:I,isFetching:L,loadEntry:j,isEditorComponent:B,isNewEditorComponent:z,fieldsErrors:N,controlRef:F,parentIds:U,t:q,isDisabled:W,isFieldDuplicate:$,isFieldHidden:H,locale:V,isParentListCollapsed:G})}}t.default=m,f(m,"propTypes",{controlComponent:r.default.func.isRequired,field:o.default.map.isRequired,hasActiveStyle:r.default.bool,setActiveStyle:r.default.func.isRequired,setInactiveStyle:r.default.func.isRequired,classNameWrapper:r.default.string.isRequired,classNameWidget:r.default.string.isRequired,classNameWidgetActive:r.default.string.isRequired,classNameLabel:r.default.string.isRequired,classNameLabelActive:r.default.string.isRequired,value:r.default.oneOfType([r.default.node,r.default.object,r.default.string,r.default.bool]),mediaPaths:o.default.map.isRequired,metadata:o.default.map,fieldsErrors:o.default.map,onChange:r.default.func.isRequired,onValidate:r.default.func,onOpenMediaLibrary:r.default.func.isRequired,onClearMediaControl:r.default.func.isRequired,onRemoveMediaControl:r.default.func.isRequired,onPersistMedia:r.default.func.isRequired,onAddAsset:r.default.func.isRequired,onRemoveInsertedMedia:r.default.func.isRequired,getAsset:r.default.func.isRequired,resolveWidget:r.default.func.isRequired,widget:r.default.object.isRequired,getEditorComponents:r.default.func.isRequired,isFetching:r.default.bool,controlRef:r.default.func,query:r.default.func.isRequired,clearSearch:r.default.func.isRequired,clearFieldErrors:r.default.func.isRequired,queryHits:r.default.oneOfType([r.default.array,r.default.object]),editorContr
|
||
|
${d};
|
||
|
`,n),afterOpen:"",beforeClose:""},overlayClassName:{base:r`
|
||
|
${f};
|
||
|
`,afterOpen:r`
|
||
|
${"\n background-color: rgba(0, 0, 0, 0.6);\n opacity: 1;\n "};
|
||
|
`,beforeClose:r`
|
||
|
${"\n background-color: rgba(0, 0, 0, 0);\n opacity: 0;\n "};
|
||
|
`}},t))))}}var h,m,g;t.Modal=p,h=p,m="propTypes",g={children:i.default.node.isRequired,isOpen:i.default.bool.isRequired,className:i.default.string,onClose:i.default.func.isRequired},(m=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(m))in h?Object.defineProperty(h,m,{value:g,enumerable:!0,configurable:!0,writable:!0}):h[m]=g},92458:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}(n(2784)),i=n(61116),o=n(48919),a=n(57903),s=n(9316),l=n(5690),u=n(28165);function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}(0,i.injectStyle)(),t.default=(0,a.connect)((function({notifications:e}){return{notifications:e.notifications}}))((function({notifications:e}){const t=(0,s.useTranslate)(),n=(0,a.useDispatch)(),[i,c]=r.default.useState({});return(0,r.useEffect)((()=>{e.filter((e=>!i[e.id])).forEach((e=>{const r=(0,o.toast)("string"==typeof e.message?e.message:t(e.message.key,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){var r,i,o;r=e,i=t,o=n[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e.message)),{autoClose:e.dismissAfter,type:e.type});i[e.id]=r,c(i),e.dismissAfter&&setTimeout((()=>{n((0,l.dismissNotification)(e.id))}),e.dismissAfter)})),Object.entries(i).forEach((([t,n])=>{e.find((e=>e.id===t))||(o.toast.dismiss(n),delete i[t],c(i))}))}),[e]),o.toast.onChange((e=>{if("removed"==e.status){var t;const r=null===(t=Object.entries(i).find((([,t])=>t===e.id)))||void 0===t?void 0:t[0];r&&n((0,l.dismissNotification)(r))}})),(0,u.jsx)(r.default.Fragment,null,(0,u.jsx)(o.ToastContainer,{position:"top-right",theme:"colored",className:"notif__container"}))}))},79708:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=c(n(70894)),i=c(n(2784)),o=c(n(13980)),a=n(28165),s=n(9316),l=n(30762),u=n(9904);function c(e){return e&&e.__esModule?e:{default:e}}const d={name:"m2n7c1-avatarImage",styles:"width:32px;border-radius:32px;label:avatarImage;"},f=(0,r.default)(l.DropdownButton,{target:"e1gt62yu4",label:"AvatarDropdownButton"})({name:"dtukf8",styles:"display:inline-block;padding:8px;cursor:pointer;color:#1e2532;background-color:transparent"}),p=(0,r.default)("img",{target:"e1gt62yu3",label:"AvatarImage"})(d,";"),h=(0,r.default)(l.Icon,{target:"e1gt62yu2",label:"AvatarPlaceholderIcon"})(d,";height:32px;color:#1e2532;background-color:",l.colors.textFieldBorder,";"),m=(0,r.default)("a",{target:"e1gt62yu1",label:"AppHeaderSiteLink"})({name:"1uk00
|
||
|
Collection "${t.get("name")}" configuration error:
|
||
|
\`preview_path_date_field\` must be a field with a valid date. Ignoring \`preview_path\`.
|
||
|
`),s;throw e}return`${s}/${(0,r.default)(k," /")}`},t.slugFormatter=function(e,t,n){const r=e.get("slug")||"{{slug}}",i=t.getIn(b((0,u.selectIdentifier)(e)));if(!i)throw new Error("Collection must have a field name that is a valid entry identifier, or must have `identifier_field` set");const o=E(n),a=new Date,s=g(r,a,i,t,o);if(e.has("path")){const n=k(e.get("path"));return g(n,a,s,t,(e=>e===s?e:o(e)))}return s},t.summaryFormatter=function(e,t,n){let r=t.get("data");const i=v(t,(0,u.selectInferredField)(n,"date"))||null,o=r.getIn(b((0,u.selectIdentifier)(n)));return r=w(t.get("path"),r,n.get("folder")),t.get("author")&&!(0,u.selectField)(n,f.COMMIT_AUTHOR)&&(r=r.set(f.COMMIT_AUTHOR,t.get("author"))),t.get("updatedOn")&&!(0,u.selectField)(n,f.COMMIT_DATE)&&(r=r.set(f.COMMIT_DATE,t.get("updatedOn"))),g(e,i,o,r)};var r=p(n(93433)),i=p(n(1573)),o=p(n(26434)),a=p(n(85395)),s=n(1704),l=n(13856),u=n(45624),c=n(9904),d=n(48781),f=n(93492);function p(e){return e&&e.__esModule?e:{default:e}}function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){var r,i,o;r=e,i=t,o=n[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const{compileStringTemplate:g,parseDateFromEntry:v,SLUG_MISSING_REQUIRED_DATE:y,keyToPathArray:b,addFileTemplateFields:w}=s.stringTemplate,_={create:"Create {{collection}} “{{slug}}”",update:"Update {{collection}} “{{slug}}”",delete:"Delete {{collection}} “{{slug}}”",uploadMedia:"Upload “{{path}}”",deleteMedia:"Delete “{{path}}”",openAuthoring:"{{message}}"},x=/\{\{([^}]+)\}\}/g;function k(e){return e.trim().toLocaleLowerCase().replace(/[']/g,"").replace(/[.]/g,"-")}function E(e,t){return n=>t&&t.includes(n)?n:(0,a.default)([e=>String(e),k,(0,o.default)(c.sanitizeSlug,e)])(n)}},13943:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.I18N_STRUCTURE=t.I18N_FIELD=t.I18N=void 0,t.duplicateDefaultI18nFields=function(e,t){const{locales:n,defaultLocale:r}=m(e);return Object.fromEntries(n.filter((e=>e!==r)).map((e=>[e,{data:t}])))},t.duplicateI18nFields=function e(t,n,r,i,o=[n.get("name")]){const s=t.getIn(["entry","data",...o]);return n.get(d)===p.DUPLICATE&&r.filter((e=>e!==i)).forEach((e=>{t=t.setIn(["entry",...v(e,i),...o],s)})),n.has("field")&&!a.List.isList(s)?[n.get("field")].forEach((n=>{t=e(t,n,r,i,[...o,n.get("name")])})):n.has("fields")&&!a.List.isList(s)&&n.get("fields").toArray().forEach((n=>{t=e(t,n,r,i,[...o,n.get("name")])})),t},t.formatI18nBackup=function(e,t){return Object.entries(e).reduce(((e,[n,{raw:r}])=>{const i=t(r);return c(c({},e),{},{[n]:{data:i.data}})}),{})},t.getDataPath=v,t.getFilePath=y,t.getFilePaths=w,t.getI18nBackup=function(e,t,n){const{locales:r,defaultLocale:i}=m(e);return r.filter((e=>e!==i)).reduce(((e,r)=>{const o=v(r,i),a=t.getIn(o);if(!a)return e;const s=t.set("data",a);return c(c({},e),{},{[r]:{raw:n(s)}})}),{})},t.getI18nDataFiles=function(e,t,n,r,i){const{structure:o}=m(e);if(o===f.SINGLE_FILE)return i;return w(e,t,n,r).reduce(((e,t)=>{const n=i.find((e=>e.path===t));return n?[...e,n]:[...e,{path:t,id:"",newFile:!1}]}),[])},t.getI18nEntry=async function(e,t,n,r,i){const{structure:o,locales:a,defaultLocale:s}=m(e);let l;if(o===f.SINGLE_FILE)l=k(await i(n),s,a);else{const u=(await Promise.all(a.map((a
|
||
|
Multiple widgets registered with name "${t}". Only the last widget registered with
|
||
|
this name will be used.
|
||
|
`),!n)throw Error(`Widget "${t}" registered without \`controlComponent\`.`);h.widgets[t]=c({control:n,preview:r,schema:i,globalStyles:s,allowMapValue:o},u)}else console.error("`registerWidget` failed, called with incorrect arguments.")}function w(e){return h.widgets[e]}function _(){return(0,o.produce)(Object.entries(h.widgets),(e=>e.map((([e,t])=>c({name:e},t)))))}function x(e){return w(e||"string")||w("unknown")}function k(e){const t=(0,s.default)(e);if("code-block"===t.type){const e=h.editorComponents.find((e=>"code-block"===e.type));e&&(console.warn(a.oneLine`
|
||
|
Only one editor component of type "code-block" may be registered. Previously registered code
|
||
|
block component(s) will be overwritten.
|
||
|
`),h.editorComponents=h.editorComponents.delete(e.id))}h.editorComponents=h.editorComponents.set(t.id,t)}function E(){return h.editorComponents}function C(e){h.remarkPlugins.push(e)}function S(){return h.remarkPlugins}function A(e,t){h.widgetValueSerializers[e]=t}function T(e){return h.widgetValueSerializers[e]}function O(e,t){e&&t?h.backends[e]?console.error(`Backend [${e}] already registered. Please choose a different name.`):h.backends[e]={init:(...e)=>new t(...e)}:console.error("Backend parameters invalid. example: CMS.registerBackend('myBackend', BackendClass)")}function P(e){return h.backends[e]}function R(e,t){if(h.mediaLibraries.find((t=>e.name===t.name)))throw new Error(`A media library named ${e.name} has already been registered.`);h.mediaLibraries.push(c(c({},e),{},{options:t}))}function D(e){return h.mediaLibraries.find((t=>t.name===e))}function M(e){if(!f.includes(e))throw new Error(`Invalid event name '${e}'`)}function I(e){return M(e),[...h.eventHandlers[e]]}function L({name:e,handler:t},n={}){M(e),h.eventHandlers[e].push({handler:t,options:n})}async function j({name:e,data:t}){M(e);const n=h.eventHandlers[e];let r=c({},t);for(const{handler:e,options:i}of n){const n=await e(r,i);if(void 0!==n){const e=r.entry.set("data",n);r=c(c({},t),{},{entry:e})}}return r.entry.get("data")}function N({name:e,handler:t}){M(e),h.eventHandlers[e]=t?h.eventHandlers[e].filter((e=>e.handler!==t)):[]}function F(e,t){e&&t?h.locales[e]=t:console.error("Locale parameters invalid. example: CMS.registerLocale('locale', phrases)")}function B(e){return h.locales[e]}function z(e,t,n){h.formats[e]={extension:t,formatter:n}}function U(){return h.formats}function q(){return Object.entries(h.formats).reduce((function(e,[t,{extension:n}]){return c(c({},e),{},{[t]:n})}),{})}function W(){return Object.entries(h.formats).reduce((function(e,[t,{formatter:n}]){return c(c({},e),{},{[t]:n})}),{})}t.default={registerPreviewStyle:m,getPreviewStyles:g,registerPreviewTemplate:v,getPreviewTemplate:y,registerWidget:b,getWidget:w,getWidgets:_,resolveWidget:x,registerEditorComponent:k,getEditorComponents:E,registerRemarkPlugin:C,getRemarkPlugins:S,registerWidgetValueSerializer:A,getWidgetValueSerializer:T,registerBackend:O,getBackend:P,registerMediaLibrary:R,getMediaLibrary:D,registerLocale:F,getLocale:B,registerEventListener:L,removeEventListener:N,getEventListeners:I,invokeEvent:j,registerCustomFormat:z,getCustomFormats:U,getCustomFormatsExtensions:q,getCustomFormatsFormatters:W}},33188:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deserializeValues=function(e,t){return s(e,t,"deserialize")},t.serializeValues=function(e,t){return s(e,t,"serialize")};var r,i=(r=n(1842))&&r.__esModule?r:{default:r},o=n(46670),a=n(41891);function s(e,t,n){let r=t.reduce(((t,r)=>{const l=r.get("name"),u=e.get(l),c=(0,a.getWidgetValueSerializer)(r.get("widget")),d=r.get("fields");return d&&o.List.isList(u)?t.set(l,u.map((e=>s(e,d,n)))):d&&o.Map.isMap(u)?t.set(l,s(u,d,n)):c&&!(0,i.default)(u)?t.set(l,c[n](u)):(0,i.default)(u)?t:t.set(l,u)}),(0,o.Map)());return r=e.mergeDeep(r),r}},9904:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addParams=function(e,t){const n=s.default.parse(e,!0);return n.query=p(p({},n.query),t),s.default.format(n)},t.getCharReplacer=b,t.getCollectionUrl=function(e,t){return h(`/collections/${e}`,t)},t.getNewEntryUrl=function(e,t){return h(`/collections/${e}/new`,t)},t.joinUrlPath=function(e,...t){return(0,l.default)(e,...t)},t.sanitizeChar=function(e,t){const{encoding:n="unicode",sanitize_replacement:r=""}=t||{};return b(n,r)(e)},t.sanitizeSlug=function(e,t){if(!(0,a.default)(e))throw new Error("The input slug must be a string.");const{encoding:n,clean_accents:s,sanitize_replacement:l}=t||{},d=(0,i.default)([...s?[u.default.remove]:[],(0,r.default)(w,{replacement:l,encoding:n}),(0,r.default)(c.default,{replacement:l})])(e),f=new RegExp(`(?:${(0,o.default)(l)})+`,"g"),p=new RegExp(`${(0,o.default)(l)}$`),h=new RegExp(`^${(0,o.default)(l)}`);return d.replace(f,l).replace(h,"").replace(p,"")},
|
||
|
from {
|
||
|
transform: rotate(0deg);
|
||
|
}
|
||
|
|
||
|
to {
|
||
|
transform: rotate(360deg);
|
||
|
}
|
||
|
`},p=(0,r.default)("div",{target:"ep2bezb2",label:"LoaderText"})({name:"xpdb8l",styles:"width:auto!important;height:auto!important;text-align:center;color:#767676;margin-top:55px;line-height:35px"}),h=(0,r.default)("div",{target:"ep2bezb1",label:"LoaderItem"})({name:"12zl32h",styles:"position:absolute;white-space:nowrap;transform:translateX(-50%)"});class m extends i.default.Component{constructor(...e){super(...e),c(this,"state",{currentItem:0}),c(this,"setAnimation",(()=>{if(this.interval)return;const{children:e}=this.props;this.interval=setInterval((()=>{const t=this.state.currentItem===e.length-1?0:this.state.currentItem+1;this.setState({currentItem:t})}),5e3)})),c(this,"renderChild",(()=>{const{children:e}=this.props,{currentItem:t}=this.state;return e?"string"==typeof e?(0,a.jsx)(p,null,e):Array.isArray(e)?(this.setAnimation(),(0,a.jsx)(p,null,(0,a.jsx)(s.CSSTransition,{className:{enter:d.enter,enterActive:d.enterActive,exit:d.exit,exitActive:d.exitActive},timeout:500},(0,a.jsx)(h,{key:t},e[t])))):void 0:null}))}componentWillUnmount(){this.interval&&clearInterval(this.interval)}render(){const{className:e}=this.props;return(0,a.jsx)("div",{className:e},this.renderChild())}}t.Loader=m,c(m,"propTypes",{children:o.default.node,className:o.default.string});const g=(0,r.default)(m,{target:"ep2bezb0",label:"StyledLoader"})("display:",(e=>e.active?"block":"none"),";position:absolute;top:50%;left:50%;margin:0;text-align:center;z-index:",l.zIndex.zIndex1000,";transform:translateX(-50%) translateY(-50%);&:before,&:after{content:'';position:absolute;top:0%;left:50%;width:2.2857rem;height:2.2857rem;margin:0 0 0 -1.1429rem;border-radius:500rem;border-style:solid;border-width:0.2em;}&:before{border-color:rgba(0, 0, 0, 0.1);}&:after{animation:",f.loader," 0.6s linear;animation-iteration-count:infinite;border-color:",l.colors.active," transparent transparent;box-shadow:0 0 0 1px transparent;}");t.default=g},24764:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=f(n(70894)),i=f(n(2784)),o=f(n(13980)),a=n(28165),s=f(n(19155)),l=f(n(10304)),u=n(29309),c=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}(n(87509));function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}function f(e){return e&&e.__esModule?e:{default:e}}const p=(0,r.default)("div",{target:"ekazr9y3",label:"TopBarContainer"})("align-items:center;background-color:",u.colors.textFieldBorder,";display:flex;justify-content:space-between;margin:0 -14px;padding:13px;");var h={name:"5r0eyy-ExpandButtonContainer",styles:"display:flex;align-items:center;font-size:14px;font-weight:500;line-height:1;label:ExpandButtonContainer;"};const m=(0,r.default)("div",{target:"ekazr9y2",label:"ExpandButtonContainer"})((e=>e.hasHeading&&h),";"),g=(0,r.default)("button",{target:"ekazr9y1",label:"ExpandButton"})(u.buttons.button,";padding:4px;background-color:transparent;color:inherit;&:last-of-type{margin-right:4px;}"),v=(0,r.default)("button",{target:"ekazr9y0",label:"AddButton"})(u.buttons.button," ",u.buttons.widget," ",l.default,"{margin-left:6px;}");class y extends i.default.Component{renderAddUI(){return this.props.allowAdd?this.props.types&&this.props.types.size>0?this.renderTypesDropdown(this.props.types):this.renderAddButton():null}renderTypesDropdown(e){return(0,a.jsx)(c.default,{renderButton:()=>(0,a.jsx)(c.StyledDropdownButton,null,this.props.t("editor.editorWidgets.list.addType",{item:this.props.label}))},e.map(((e,t)=>(0,a.jsx)(c.DropdownItem,{key:t,label:e.get("label",e.get("name")),onClick:()=>this.props.onAddType(e.get("name"))}))))}renderAddButton(){return(0,a.jsx
|
||
|
${h.default};
|
||
|
${m.default};
|
||
|
${"\n padding: 0;\n"};
|
||
|
`)},!o&&(0,u.jsx)(v.default,{onClick:this.showSettings}),o&&(0,u.jsx)(g.default,{hideSettings:this.hideSettings,forID:t,modes:C,mode:E(d||k),theme:S.find((e=>e===l)),themes:S,keyMap:{value:a,label:a},keyMaps:this.getKeyMapOptions(),allowLanguageSelection:this.allowLanguageSelection,onChangeLang:e=>this.setState({lang:e}),onChangeTheme:e=>this.setState({theme:e}),onChangeKeyMap:e=>this.setState({keyMap:e})}),(0,u.jsx)(f.UnControlled,{key:s,id:t,className:i`
|
||
|
height: 100%;
|
||
|
border-radius: 0 3px 3px;
|
||
|
overflow: hidden;
|
||
|
|
||
|
.CodeMirror {
|
||
|
height: auto !important;
|
||
|
cursor: text;
|
||
|
min-height: 300px;
|
||
|
}
|
||
|
|
||
|
.CodeMirror-scroll {
|
||
|
min-height: 300px;
|
||
|
}
|
||
|
`,options:w(w({lineNumbers:!0},n.codeMirrorConfig),{},{extraKeys:w({"Shift-Tab":"indentLess",Tab:"indentMore"},n.codeMirrorConfig.extraKeys||{}),theme:l,mode:p,keyMap:a,viewportMargin:1/0}),detach:!0,editorDidMount:e=>{this.cm=e,r&&this.handleFocus()},value:c,onChange:(e,t,n)=>this.handleChange(n),onFocus:this.handleFocus,onBlur:this.handleBlur}))))}}t.default=T,_(T,"propTypes",{field:l.default.map.isRequired,onChange:s.default.func.isRequired,value:s.default.node,forID:s.default.string.isRequired,classNameWrapper:s.default.string.isRequired,widget:s.default.object.isRequired,isParentListCollapsed:s.default.bool})},31595:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(85505)),i=(l(n(2784)),l(n(13980))),o=n(46670),a=n(30762),s=n(28165);function l(e){return e&&e.__esModule?e:{default:e}}function u(e){return(0,s.jsx)(a.WidgetPreviewContainer,null,(0,s.jsx)("pre",null,(0,s.jsx)("code",null,(t=e.value,n=e.field,(0,r.default)(t)?t:o.Map.isMap(t)?t.get(n.getIn(["keys","code"],"code"),""):""))));var t,n}u.propTypes={value:i.default.node},t.default=u},33081:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(70894)),i=(a(n(2784)),n(30762)),o=n(28165);function a(e){return e&&e.__esModule?e:{default:e}}const s=(0,r.default)("button",{target:"epeop3r0",label:"StyledSettingsButton"})(i.buttons.button,";",i.buttons.default,";",i.shadows.drop,";display:block;position:absolute;z-index:",i.zIndex.zIndex100,";right:8px;top:8px;opacity:0.8;padding:2px 4px;line-height:1;height:auto;",i.Icon,"{position:relative;top:1px;}");t.default=function({showClose:e,onClick:t}){return(0,o.jsx)(s,{onClick:t},(0,o.jsx)(i.Icon,{type:e?"close":"settings",size:"small"}))}},8674:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=d(n(70894)),i=d(n(2784)),o=d(n(31776)),a=d(n(87202)),s=n(30762),l=d(n(33081)),u=d(n(15389)),c=n(28165);function d(e){return e&&e.__esModule?e:{default:e}}const f=(0,r.default)("div",{target:"e147sj9s2",label:"SettingsPaneContainer"})("position:absolute;right:0;width:200px;z-index:",s.zIndex.zIndex10,";height:100%;background-color:#fff;overflow:hidden;overflow-y:scroll;padding:12px;border-radius:0 3px 3px 0;",s.shadows.drop,";"),p=(0,r.default)("label",{target:"e147sj9s1",label:"SettingsFieldLabel"})(s.text.fieldLabel,";font-size:11px;display:block;margin-top:8px;margin-bottom:2px;"),h=(0,r.default)("h3",{target:"e147sj9s0",label:"SettingsSectionTitle"})({name:"punfmt",styles:"font-size:14px;margin-top:14px;margin-bottom:0;&:first-of-type{margin-top:4px;}"});function m({value:e,options:t,onChange:n,forID:r,type:i,autoFocus:a}){return(0,c.jsx)(o.default,{inputId:`${r}-select-${i}`,styles:u.default,value:e,options:t,onChange:e=>n(e.value),menuPlacement:"auto",captureMenuScroll:!1,autoFocus:a})}t.default=function({hideSettings:e,forID:t,modes:n,mode:r,theme:o,themes:s,keyMap:u,keyMaps:d,allowLanguageSelection:g,onChangeLang:v,onChangeTheme:y,onChangeKeyMap:b}){return(0,c.jsx)(f,{onKeyDown:t=>(0,a.default)("esc",t)&&e()},(0,c.jsx)(l.default,{onClick:e,showClose:!0}),g&&(0,c.jsx)(i.default.Fragment,null,(0,c.jsx)(h,null,"Field Settings"),(0,c.jsx)(p,{htmlFor:`${t}-select-mode`},"Mode"),(0,c.jsx)(m,{type:"mode",forID:t,value:r,options:n,onChange:v,autoFocus:!0})),(0,c.jsx)(i.default.Fragment,null,(0,c.jsx)(h,null,"Global Settings"),s&&(0,c.jsx)(i.default.Fragment,null,(0,c.jsx)(p,{htmlFor:`${t}-select-theme`},"Theme"),(0,c.jsx)(m,{type:"theme",forID:t,value:{value:o,label:o},options:s.map((e=>({value:e,label:e}))),onChange:y,autoFocus:!g})),(0,c.jsx)(p,{htmlFor:`${t}-select-keymap`},"KeyMap"),(0,c.jsx)(m,{type:"keymap",forID:t,value:u,options:d,onChange:b})))}},15646:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.DecapCmsWidgetCode=void 0;var r=a(n(41740)),i=a(n(31595)),o=a(n(40557));function a(e){return e&&e.__esModule?e:{default:e}}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.fil
|
||
|
Decap CMS config: ${e.get("name")} field: property "options" has been deprecated for the
|
||
|
${e.get("widget")} widget and will be removed in the next major release. Rather than
|
||
|
\`field.options.media_library\`, apply media library options for this widget under
|
||
|
\`field.media_library\`.
|
||
|
`)))},60699:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(70894)),i=(l(n(2784)),l(n(13980))),o=n(46670),a=n(30762),s=n(28165);function l(e){return e&&e.__esModule?e:{default:e}}const u=(0,r.default)((({src:e})=>(0,s.jsx)("img",{src:e||"",role:"presentation"})),{target:"eeuykvb0",label:"StyledImage"})({name:"waguu7",styles:"display:block;max-width:100%;height:auto"});function c({getAsset:e,value:t,field:n}){return(0,s.jsx)(u,{src:e(t,n)})}function d(e){const{value:t,getAsset:n,field:r}=e;return Array.isArray(t)||o.List.isList(t)?t.map(((e,t)=>(0,s.jsx)(c,{key:t,value:e,getAsset:n,field:r}))):(0,s.jsx)(c,e)}function f(e){return(0,s.jsx)(a.WidgetPreviewContainer,null,e.value?(0,s.jsx)(d,e):null)}f.propTypes={getAsset:i.default.func.isRequired,value:i.default.node},t.default=f},79386:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.DecapCmsWidgetImage=void 0;var r=a(n(76889)),i=a(n(60699)),o=a(n(79368));function a(e){return e&&e.__esModule?e:{default:e}}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}const l=r.default.withFileControl({forImage:!0}),u=t.DecapCmsWidgetImage={Widget:function(e={}){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){var r,i,o;r=e,i=t,o=n[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({name:"image",controlComponent:l,previewComponent:i.default,schema:o.default},e)},controlComponent:l,previewComponent:i.default};t.default=u},79368:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={properties:{allow_multiple:{type:"boolean"}}}},11761:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=_(n(70894)),i=_(n(74930)),o=_(n(45455)),a=_(n(83465)),s=_(n(2784)),l=_(n(13980)),u=_(n(19155)),c=n(28165),d=n(46670),f=n(29987),p=_(n(16044)),h=n(61540),m=n(66548),g=n(88366),v=n(82851),y=n(30762),b=n(1704),w=n(95639);function _(e){return e&&e.__esModule?e:{default:e}}function x(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k(){return k=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},k.apply(this,arguments)}const E=p.default.controlComponent,C=(0,r.default)("div",{target:"e11zrb3c2",label:"ListItem"})(""),S=(0,r.default)(y.ListItemTopBar,{target:"e11zrb3c1",label:"StyledListItemTopBar"})("background-color:",y.colors.textFieldBorder,";"),A=(0,r.default)("div",{target:"e11zrb3c0",label:"NestedObjectLabel"})("display:",(e=>e.collapsed?"block":"none"),";border-top:0;color:",(e=>e.error?y.colors.errorText:"inherit"),";background-color:",y.colors.textFieldBorder,";padding:13px;border-radius:0 0 ",y.lengths.borderRadius," ",y.lengths.borderRadius,";"),T=`\n padding: ${y.lengths.objectWidgetTopBarContainerPadding};\n `,O={listControlItem:{name:"1pb8r5b-li
|
||
|
${"\n display: none;\n "};
|
||
|
`]:v}),value:e,field:b,onChangeObject:this.handleChangeFor(t),editorControl:r,resolveWidget:d,metadata:o,forList:!0,onValidateObject:i,clearFieldErrors:s,fieldsErrors:l,ref:this.processControlRef,controlRef:u,validationKey:y,collapsed:v,"data-testid":`object-control-${y}`,hasError:_,parentIds:[...f,p,y]}))))}));const{field:t,value:n}=e,r=t.get("collapsed",!0),s=n&&Array(n.size).fill(r)||[],l=n&&Array.from({length:n.size},(()=>(0,f.v4)()))||[];this.state={listCollapsed:r,itemsCollapsed:s,value:this.valueToString(n),keys:l}}shouldComponentUpdate(){return!0}handleChangeFor(e){return(t,n,r)=>{const{value:i,metadata:o,onChange:a,field:s}=this.props,l=s.get("name"),u="object"===s.getIn(["field","widget"]),c=this.getValueType()!==M||this.getValueType()===M&&u?this.getObjectValue(e).set(t.get("name"),n):n,d={[l]:Object.assign(o?o.toJS():{},r||{})};a(i.set(e,c),d)}}objectLabel(e){const{field:t,entry:n}=this.props;switch(this.getValueType()){case L:{if(!N(t,e))return;const r=(0,w.getTypedFieldForValue)(t,e),i=r.get("label",r.get("name")),o=r.get("summary",t.get("summary"));return o?j(o,n,i,e):i}case M:{const r=t.get("field"),i=r.get("label",r.get("name")),o=t.get("summary"),a=(0,d.fromJS)({[r.get("name")]:e});return o?j(o,n,i,a):i}case I:{if(!N(t,e))return;const r=t.get("fields"),i=r&&r.first(),o=e.get(i.get("name")),a=t.get("summary");return((a?j(a,n,o,e):o)||`No ${i.get("name")}`).toString()}}return""}renderErroneousTypedItem(e,t){const n=this.props.field,r=(0,w.getErrorMessageForTypedFieldAndValue)(n,t),i=`item-${e}`;return(0,c.jsx)(R,{css:[O.listControlItem,O.listControlItemCollapsed,";label:ListControl;"],index:e,key:i},(0,c.jsx)(S,{onCollapseToggle:null,onRemove:(0,a.default)(this.handleRemove,e,i),dragHandle:D,id:i}),(0,c.jsx)(A,{collapsed:!0,error:!0},r))}renderListControl(){const{value:e,forID:t,field:n,classNameWrapper:r,t:i}=this.props,{itemsCollapsed:o,listCollapsed:a,keys:s}=this.state,l=e||(0,d.List)(),u=n.get("label",n.get("name")),f=n.get("label_singular")||n.get("label",n.get("name")),p=1===l.size?f.toLowerCase():u.toLowerCase(),h=n.get("minimize_collapsed",!1),m=o.every((e=>!0===e))&&(a||!h),g=s.map((e=>({id:e})));return(0,c.jsx)(c.ClassNames,null,(({cx:e,css:o})=>(0,c.jsx)("div",{id:t,className:e(r,o`
|
||
|
${T}
|
||
|
`)},(0,c.jsx)(y.ObjectWidgetTopBar,{allowAdd:n.get("allow_add",!0),onAdd:this.handleAdd,types:n.get(w.TYPES_KEY,null),onAddType:e=>this.handleAddType(e,(0,w.resolveFieldKeyType)(n)),heading:`${l.size} ${p}`,label:f.toLowerCase(),onCollapseToggle:this.handleCollapseAllToggle,collapsed:m,t:i}),(!m||!h)&&(0,c.jsx)(P,{items:g,keys:s,onSortEnd:this.onSortEnd},l.map(this.renderItem)))))}renderInput(){const{forID:e,classNameWrapper:t}=this.props,{value:n}=this.state;return(0,c.jsx)("input",{type:"text",id:e,value:n,onChange:this.handleChange,onFocus:this.handleFocus,onBlur:this.handleBlur,className:t})}render(){return null!==this.getValueType()?this.renderListControl():this.renderInput()}}t.default=B,x(B,"propTypes",{metadata:u.default.map,onChange:l.default.func.isRequired,onChangeObject:l.default.func.isRequired,onValidateObject:l.default.func.isRequired,validate:l.default.func.isRequired,value:u.default.list,field:l.default.object,forID:l.default.string,controlRef:l.default.func,mediaPaths:u.default.map.isRequired,getAsset:l.default.func.isRequired,onOpenMediaLibrary:l.default.func.isRequired,onAddAsset:l.default.func.isRequired,onRemoveInsertedMedia:l.default.func.isRequired,classNameWrapper:l.default.string.isRequired,setActiveStyle:l.default.func.isRequired,setInactiveStyle:l.default.func.isRequired,editorControl:l.default.elementType.isRequired,resolveWidget:l.default.func.isRequired,clearFieldErrors:l.default.func.isRequired,fieldsErrors:u.default.map.isRequired,entry:u.default.map.isRequired,t:l.default.func}),x(B,"defaultProps",{value:(0,d.List)(),parentIds:[]})},57677:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.DecapCmsWidgetList=void 0;var r=a(n(16044)),i=a(n(11761)),o=a(n(25698));function a(e){return e&&e.__esModule?e:{default:e}}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}const l=r.default.previewComponent,u=t.DecapCmsWidgetList={Widget:function(e={}){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){var r,i,o;r=e,i=t,o=n[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({name:"list",controlComponent:i.default,previewComponent:l,schema:o.default},e)},controlComponent:i.default,previewComponent:l};t.default=u},25698:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={properties:{allow_add:{type:"boolean"},collapsed:{type:"boolean"},summary:{type:"string"},minimize_collapsed:{type:"boolean"},label_singular:{type:"string"},i18n:{type:"boolean"},min:{type:"number"},max:{type:"number"}}}},95639:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TYPE_KEY=t.TYPES_KEY=t.DEFAULT_TYPE_KEY=void 0,t.getErrorMessageForTypedFieldAndValue=function(e,t){const n=o(e),r=t.get(n);let i;return i=r?`Error: item has illegal '${n}' property: '${r}'`:`Error: item has no '${n}' property`,i},t.getTypedFieldForValue=function(e,t){const r=o(e),i=e.get(n),a=t.get(r);return i.find((e=>e.get("name")===a))},t.resolveFieldKeyType=o,t.resolveFunctionForTypedField=function(e){const t=o(e),r=e.get(n);return e=>{const n=e.get(t);return r.find((e=>e.get("name")===n))}};const n=t.TYPES_KEY="types",r=t.TYPE_KEY="typeKey",i=t.DEFAULT_TYPE_KEY="type";function o(e){return e.get(r,i)}},50017:(e,t,n)=>{"use strict";Object.defineProperty
|
||
|
${a.default};
|
||
|
padding: 0;
|
||
|
overflow: hidden;
|
||
|
height: ${e};
|
||
|
`),ref:this.mapContainer})))}},"propTypes",{onChange:i.default.func.isRequired,field:i.default.object.isRequired,height:i.default.string,value:i.default.node}),g(n,"defaultProps",{value:"",height:"400px"}),n};var r=m(n(2784)),i=m(n(13980)),o=n(28165),a=m(n(64552)),s=m(n(18529)),l=m(n(66319)),u=m(n(85738)),c=m(n(78369)),d=m(n(10608)),f=m(n(2247)),p=m(n(64127)),h=m(n(29820));function m(e){return e&&e.__esModule?e:{default:e}}function g(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const v={dataProjection:"EPSG:4326",featureProjection:"EPSG:3857"}},75988:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=g(n(70894)),i=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=m(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}(n(2784)),o=g(n(13980)),a=g(n(19155)),s=n(28165),l=n(30762),u=n(72056),c=n(77713),d=n(20672),f=n(98685),p=g(n(76912)),h=g(n(13598));function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(m=function(e){return e?n:t})(e)}function g(e){return e&&e.__esModule?e:{default:e}}function v({minimal:e}){return`\n position: relative;\n overflow: hidden;\n overflow-x: auto;\n min-height: ${e?"auto":l.lengths.richTextEditorMinHeight};\n font-family: ${l.fonts.mono};\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n border-top: 0;\n margin-top: -${f.editorStyleVars.stickyDistanceBottom};\n`}const y=(0,r.default)("div",{target:"e12tj7710",label:"RawEditorContainer"})({name:"bjn8wh",styles:"position:relative"});function b(e){const{className:t,field:n,isShowModeToggle:r,t:o,onChange:a}=e,l=(0,i.useMemo)((()=>(0,c.withReact)((0,d.withHistory)((0,u.createEditor)()))),[]),[m,g]=(0,i.useState)(e.value?e.value.split("\n").map((e=>(0,h.default)(e))):[(0,h.default)()]);function b(e){a(e.map((e=>e.children[0].text)).join("\n")),g(e)}return(0,i.useEffect)((()=>{e.pendingFocus&&c.ReactEditor.focus(l)}),[]),(0,s.jsx)(c.Slate,{editor:l,value:m,onChange:b},(0,s.jsx)(y,null,(0,s.jsx)(f.EditorControlBar,null,(0,s.jsx)(p.default,{onToggleMode:function(){e.onMode("rich_text")},buttons:n.get("buttons"),disabled:!0,rawMode:!0,isShowModeToggle:r,t:o})),(0,s.jsx)(s.ClassNames,null,(({css:e,cx:r})=>(0,s.jsx)(c.Editable,{className:r(t,e`
|
||
|
${v({minimal:n.get("minimal")})}
|
||
|
`),value:m,onChange:b})))))}b.propTypes={onChange:o.default.func.isRequired,onMode:o.default.func.isRequired,className:o.default.string.isRequired,value:o.default.string,field:a.default.map.isRequired,isShowModeToggle:o.default.bool.isRequired,t:o.default.func.isRequired},t.default=b},76912:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=d(n(70894)),i=d(n(2784)),o=d(n(13980)),a=d(n(19155)),s=n(28165),l=n(46670),u=n(30762),c=d(n(15388));function d(e){return e&&e.__esModule?e:{default:e}}function f(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const p=(0,r.default)("div",{target:"e11cox783",label:"ToolbarContainer"})("background-color:",u.colors.textFieldBorder,";border-top-right-radius:",u.lengths.borderRadius,";position:relative;display:flex;justify-content:space-between;align-items:center;padding:11px 14px;min-height:58px;transition:background-color ",u.transitions.main,",color ",u.transitions.main,";color:",u.colors.text,";"),h=(0,r.default)("div",{target:"e11cox782",label:"ToolbarDropdownWrapper"})({name:"11ffxfj",styles:"display:inline-block;position:relative"}),m=(0,r.default)("div",{target:"e11cox781",label:"ToolbarToggle"})({name:"1qi6e7n",styles:"flex-shrink:0;display:flex;align-items:center;font-size:14px;margin:0 10px"}),g=m.withComponent(u.Toggle,{target:"e11cox784",label:"StyledToggle"}),v=(0,r.default)("span",{target:"e11cox780",label:"ToolbarToggleLabel"})("display:inline-block;text-align:center;white-space:nowrap;line-height:20px;min-width:",(e=>e.offPosition?"62px":"70px"),";",(e=>e.isActive&&(0,s.css)("font-weight:600;color:",u.colors.active,";;label:ToolbarToggleLabel;")),";");class y extends i.default.Component{constructor(...e){super(...e),f(this,"isVisible",(e=>{const{buttons:t}=this.props;return!l.List.isList(t)||t.includes(e)})),f(this,"handleBlockClick",((e,t)=>{e&&e.preventDefault(),this.props.onBlockClick(t)})),f(this,"handleMarkClick",((e,t)=>{e.preventDefault(),this.props.onMarkClick(t)}))}render(){const{onLinkClick:e,onToggleMode:t,rawMode:n,isShowModeToggle:r,plugins:i,disabled:o,onSubmit:a,hasMark:d=(()=>{}),hasInline:f=(()=>{}),hasBlock:y=(()=>{}),hasQuote:b=(()=>{}),hasListItems:w=(()=>{}),editorComponents:_,t:x}=this.props,k=this.isVisible,E=!_||_.size>=1,C=i?i.toList().filter((function({id:e}){return!_||_.includes(e)})):(0,l.List)(),S={"heading-one":x("editor.editorWidgets.headingOptions.headingOne"),"heading-two":x("editor.editorWidgets.headingOptions.headingTwo"),"heading-three":x("editor.editorWidgets.headingOptions.headingThree"),"heading-four":x("editor.editorWidgets.headingOptions.headingFour"),"heading-five":x("editor.editorWidgets.headingOptions.headingFive"),"heading-six":x("editor.editorWidgets.headingOptions.headingSix")};return(0,s.jsx)(p,null,(0,s.jsx)("div",null,k("bold")&&(0,s.jsx)(c.default,{type:"bold",label:x("editor.editorWidgets.markdown.bold"),icon:"bold",onClick:this.handleMarkClick,isActive:d("bold"),disabled:o}),k("italic")&&(0,s.jsx)(c.default,{type:"italic",label:x("editor.editorWidgets.markdown.italic"),icon:"italic",onClick:this.handleMarkClick,isActive:d("italic"),disabled:o}),k("code")&&(0,s.jsx)(c.default,{type:"code",label:x("editor.editorWidgets.markdown.code"),icon:"code",onClick:this.handleMarkClick,isActive:d("code"),disabled:o}),k("link")&&(0,s.jsx)(c.default,{type:"link",label:x("editor.editorWidgets.markdown.link"),icon:"link",onClick:e,isActive:f("link"),disabled:o}),Object.keys(S).some(k)&&(0,s.jsx)(h,null,(0,s.jsx)(u.Dropdown,{dropdownWidth:"max-content",dropdownTopOverlap:"36px",renderButton:()=>(0,s.jsx)(u.DropdownButton,null,(0,s.jsx)(c.default,{type:"headings",label:x("editor.editorWidgets.markdown.headings"),icon:"hOptions",d
|
||
|
${D({minimal:a.get("minimal")})}
|
||
|
`)},0!==q.length&&(0,l.jsx)(d.Editable,{className:e`
|
||
|
padding: 16px 20px 0;
|
||
|
`,renderElement:$,renderLeaf:H,onKeyDown:V,autoFocus:!1}),(0,l.jsx)(M,{onClick:G}))))))}j.propTypes={onAddAsset:a.default.func.isRequired,getAsset:a.default.func.isRequired,onChange:a.default.func.isRequired,onMode:a.default.func.isRequired,className:a.default.string.isRequired,value:a.default.string,field:s.default.map.isRequired,getEditorComponents:a.default.func.isRequired,getRemarkPlugins:a.default.func.isRequired,isShowModeToggle:a.default.bool.isRequired,t:a.default.func.isRequired},t.default=j},69076:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(17620))&&r.__esModule?r:{default:r},o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}(n(2784)),a=n(28165),s=n(46670),l=n(77713),u=n(72056),c=n(64767);function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){h(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function h(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var m={name:"1xfnuhy-Shortcode",styles:"margin-top:0;margin-bottom:16px;&:first-of-type{margin-top:0;};label:Shortcode;"};t.default=function(e){const t=(0,l.useSlate)(),{element:n,dataKey:r="shortcodeData",children:d}=e,f=(0,c.getEditorControl)(),h=(0,c.getEditorComponents)().get(n.data.shortcode),g=(0,s.fromJS)((0,i.default)(h,["id","fromBlock","toBlock","toPreview","pattern","icon"])),[v,y]=(0,o.useState)((0,s.fromJS)(n.data[r]));function b(){const e=l.ReactEditor.findPath(t,n);u.Transforms.select(t,e)}const w=l.ReactEditor.findPath(t,n),_=t.selection&&w&&u.Range.isRange(t.selection)&&u.Range.includes(t.selection,w);return!g.isEmpty()&&(0,a.jsx)("div",{onClick:b,onFocus:b},(0,a.jsx)(f,{css:m,value:v,field:g,onChange:function(e,i,o){const a=l.ReactEditor.findPath(t,n),s={data:p(p({},n.data),{},{[r]:i.toJS(),metadata:o})};u.Transforms.setNodes(t,s,{at:a}),y(i)},isEditorComponent:!0,onValidateObject:()=>{},isNewEditorComponent:n.data.shortcodeNew,isSelected:_}),d)}},4611:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,l(n(2784));var r=n(28165),i=n(30762),o=n(77713),a=n(72056),s=l(n(13598));function l(e){return e&&e.__esModule?e:{default:e}}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(this,arguments)}function c(e){return(0,r.jsx)("div",u({css:(0,r.css)("height:32px;cursor:text;position:relative;z-index:",i.zIndex.zIndex1,";margin-top:-16px;;label:InsertionPoint;")},e))}t.default=function({attributes:e,children:t,element:n}){const i=(0,o.useSlate)(),l=o.ReactEditor.findPath(i,n);function d(e){a.Transforms.insertNodes(i,(0,s.default)(),{select:!0,at:e})}c
|
||
|
${f}
|
||
|
`,{[e`
|
||
|
${"\n padding: 6px 14px 14px;\n border-top: 0;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n "}
|
||
|
`]:r},{[e`
|
||
|
border-color: ${l.colors.textFieldBorder};
|
||
|
`]:!!r&&!i})},r?null:(0,a.jsx)(l.ObjectWidgetTopBar,{collapsed:s,onCollapseToggle:this.handleCollapseToggle,heading:s&&this.objectLabel(),t:o}),(0,a.jsx)("div",{className:d({[e`
|
||
|
${"\n display: none;\n "}
|
||
|
`]:s})},this.renderFields(u,c))))):(0,a.jsx)("h3",null,"No field(s) defined for this widget")}}t.default=p,d(p,"propTypes",{onChangeObject:i.default.func.isRequired,onValidateObject:i.default.func,value:i.default.oneOfType([i.default.node,i.default.object,i.default.bool]),field:i.default.object,forID:i.default.string,classNameWrapper:i.default.string.isRequired,forList:i.default.bool,controlRef:i.default.func,editorControl:i.default.elementType.isRequired,resolveWidget:i.default.func.isRequired,clearFieldErrors:i.default.func.isRequired,fieldsErrors:o.default.map,hasError:i.default.bool,t:i.default.func,locale:i.default.string,collapsed:i.default.bool}),d(p,"defaultProps",{value:(0,s.Map)()})},5186:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(n(2784));var r=a(n(13980)),i=n(30762),o=n(28165);function a(e){return e&&e.__esModule?e:{default:e}}function s({field:e}){return(0,o.jsx)(i.WidgetPreviewContainer,null,e&&e.get("fields")||e.get("field")||null)}s.propTypes={field:r.default.node},t.default=s},16044:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.DecapCmsWidgetObject=void 0;var r=a(n(53998)),i=a(n(5186)),o=a(n(18551));function a(e){return e&&e.__esModule?e:{default:e}}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}const l=t.DecapCmsWidgetObject={Widget:function(e={}){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){var r,i,o;r=e,i=t,o=n[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({name:"object",controlComponent:r.default,previewComponent:i.default,schema:o.default},e)},controlComponent:r.default,previewComponent:i.default};t.default=l},18551:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={properties:{collapsed:{type:"boolean"},i18n:{type:"boolean"}}}},89869:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=E(n(84636)),i=E(n(56974)),o=E(n(45455)),a=E(n(72579)),s=E(n(17452)),l=E(n(54073)),u=E(n(2784)),c=E(n(13980)),d=E(n(19155)),f=n(31776),p=E(n(81209)),h=n(46670),m=n(30762),g=n(1704),v=n(50166),y=n(61540),b=n(66548),w=n(88366),_=n(82851),x=n(29987),k=n(28165);function E(e){return e&&e.__esModule?e:{default:e}}function C(){return C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},C.apply(this,arguments)}function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach((function(t){T(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function T(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive m
|
||
|
|| (${s} == "string" && ${i} && ${i} == +${i})`).assign(l,a._`+${i}`);case"integer":return void r.elseIf(a._`${s} === "boolean" || ${i} === null
|
||
|
|| (${s} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(l,a._`+${i}`);case"boolean":return void r.elseIf(a._`${i} === "false" || ${i} === 0 || ${i} === null`).assign(l,!1).elseIf(a._`${i} === "true" || ${i} === 1`).assign(l,!0);case"null":return r.elseIf(a._`${i} === "" || ${i} === 0 || ${i} === false`),void r.assign(l,null);case"array":r.elseIf(a._`${s} === "string" || ${s} === "number"
|
||
|
|| ${s} === "boolean" || ${i} === null`).assign(l,a._`[${i}]`)}}r.else(),h(e),r.endIf(),r.if(a._`${l} !== undefined`,(()=>{r.assign(i,l),function({gen:e,parentData:t,parentDataProperty:n},r){e.if(a._`${t} !== undefined`,(()=>e.assign(a._`${t}[${n}]`,r)))}(e,l)}))}(e,t,s):h(e)}))}return u};const c=new Set(["string","number","integer","boolean","null"]);function d(e,t,n,r=l.Correct){const i=r===l.Correct?a.operators.EQ:a.operators.NEQ;let o;switch(e){case"null":return a._`${t} ${i} null`;case"array":o=a._`Array.isArray(${t})`;break;case"object":o=a._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=s(a._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=s();break;default:return a._`typeof ${t} ${i} ${e}`}return r===l.Correct?o:(0,a.not)(o);function s(e=a.nil){return(0,a.and)(a._`typeof ${t} == "number"`,e,n?a._`isFinite(${t})`:a.nil)}}function f(e,t,n,r){if(1===e.length)return d(e[0],t,n,r);let i;const o=(0,s.toHash)(e);if(o.array&&o.object){const e=a._`typeof ${t} != "object"`;i=o.null?e:a._`!${t} || ${e}`,delete o.null,delete o.array,delete o.object}else i=a.nil;o.number&&delete o.integer;for(const e in o)i=(0,a.and)(i,d(e,t,n,r));return i}t.checkDataType=d,t.checkDataTypes=f;const p={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?a._`{type: ${e}}`:a._`{type: ${t}}`};function h(e){const t=function(e){const{gen:t,data:n,schema:r}=e,i=(0,s.schemaRefOrVal)(e,r,"type");return{gen:t,keyword:"type",data:n,schema:r.type,schemaCode:i,schemaValue:i,parentSchema:r,params:{},it:e}}(e);(0,o.reportError)(t,p)}t.reportTypeError=h},2332:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const r=n(36313),i=n(22500);function o(e,t,n){const{gen:o,compositeRule:a,data:s,opts:l}=e;if(void 0===n)return;const u=r._`${s}${(0,r.getProperty)(t)}`;if(a)return void(0,i.checkStrictMode)(e,`default is ignored for: ${u}`);let c=r._`${u} === undefined`;"empty"===l.useDefaults&&(c=r._`${c} || ${u} === null || ${u} === ""`),o.if(c,r._`${u} = ${(0,r.stringify)(n)}`)}t.assignDefaults=function(e,t){const{properties:n,items:r}=e.schema;if("object"===t&&n)for(const t in n)o(e,t,n[t].default);else"array"===t&&Array.isArray(r)&&r.forEach(((t,n)=>o(e,n,t.default)))}},49029:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const r=n(61525),i=n(28051),o=n(74312),a=n(28051),s=n(2332),l=n(78716),u=n(69456),c=n(36313),d=n(73861),f=n(40195),p=n(22500),h=n(84101);function m({gen:e,validateName:t,schema:n,schemaEnv:r,opts:i},o){i.code.es5?e.func(t,c._`${d.default.data}, ${d.default.valCxt}`,r.$async,(()=>{e.code(c._`"use strict"; ${g(n,i)}`),function(e,t){e.if(d.default.valCxt,(()=>{e.var(d.default.instancePath,c._`${d.default.valCxt}.${d.default.instancePath}`),e.var(d.default.parentData,c._`${d.default.valCxt}.${d.default.parentData}`),e.var(d.default.parentDataProperty,c._`${d.default.valCxt}.${d.default.parentDataProperty}`),e.var(d.default.rootData,c._`${d.default.valCxt}.${d.default.rootData}`),t.dynamicRef&&e.var(d.default.dynamicAnchors,c._`${d.default.valCxt}.${d.default.dynamicAnchors}`)}),(()=>{e.var(d.default.instancePath,c._`""`),e.var(d.default.parentData,c._`undefined`),e.var(d.default.parentDataProperty,c._`undefined`),e.var(d.default.rootData,d.default.data),t.dynamicRef&&e.var(d.default.dynamicAnchors,c._`{}`)}))}(e,i),e.code(o)})):e.func(t,c._`${d.default.data}, ${function(e){return c._`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${e.dynamicRef?c._`, ${d.default.dynamicAnchors}={}`:c.nil}}={}`}(i)}`,r.$async,(()=>e.code(g(n,i)).code(o)))}function g(e,t){const n="object"==typeof e&&e[t.schemaId];return n&&(t.code.source||t.code.process)?c._`/*# sourceURL=${n} */`:c.nil}function v({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const n in e)if(t.RULES.all[n])return!0;return!1}function y(e){return"boolean"!=typeof e.schema}function b(e){(0,p.checkUnknownRule
|
||
|
missingProperty: ${i},
|
||
|
depsCount: ${t},
|
||
|
deps: ${n}}`};const a={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,n]=function({schema:e}){const t={},n={};for(const r in e)"__proto__"!==r&&((Array.isArray(e[r])?t:n)[r]=e[r]);return[t,n]}(e);s(e,t),l(e,n)}};function s(e,t=e.schema){const{gen:n,data:i,it:a}=e;if(0===Object.keys(t).length)return;const s=n.let("missing");for(const l in t){const u=t[l];if(0===u.length)continue;const c=(0,o.propertyInData)(n,i,l,a.opts.ownProperties);e.setParams({property:l,depsCount:u.length,deps:u.join(", ")}),a.allErrors?n.if(c,(()=>{for(const t of u)(0,o.checkReportMissingProp)(e,t)})):(n.if(r._`${c} && (${(0,o.checkMissingProp)(e,u,s)})`),(0,o.reportMissingProp)(e,s),n.else())}}function l(e,t=e.schema){const{gen:n,data:r,keyword:a,it:s}=e,l=n.name("valid");for(const u in t)(0,i.alwaysValidSchema)(s,t[u])||(n.if((0,o.propertyInData)(n,r,u,s.opts.ownProperties),(()=>{const t=e.subschema({keyword:a,schemaProp:u},l);e.mergeValidEvaluated(t,l)}),(()=>n.var(l,!0))),e.ok(l))}t.validatePropertyDeps=s,t.validateSchemaDeps=l,t.default=a},88681:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(36313),i=n(22500),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>r.str`must match "${e.ifClause}" schema`,params:({params:e})=>r._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:n,it:o}=e;void 0===n.then&&void 0===n.else&&(0,i.checkStrictMode)(o,'"if" without "then" and "else" is ignored');const s=a(o,"then"),l=a(o,"else");if(!s&&!l)return;const u=t.let("valid",!0),c=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},c);e.mergeEvaluated(t)}(),e.reset(),s&&l){const n=t.let("ifClause");e.setParams({ifClause:n}),t.if(c,d("then",n),d("else",n))}else s?t.if(c,d("then")):t.if((0,r.not)(c),d("else"));function d(n,i){return()=>{const o=e.subschema({keyword:n},c);t.assign(u,c),e.mergeValidEvaluated(o,u),i?t.assign(i,r._`${n}`):e.setParams({ifClause:n})}}e.pass(u,(()=>e.error(!0)))}};function a(e,t){const n=e.schema[t];return void 0!==n&&!(0,i.alwaysValidSchema)(e,n)}t.default=o},88650:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(55469),i=n(36550),o=n(70744),a=n(76553),s=n(19175),l=n(69181),u=n(26739),c=n(77275),d=n(4441),f=n(21540),p=n(58516),h=n(49637),m=n(42561),g=n(79376),v=n(88681),y=n(7451);t.default=function(e=!1){const t=[p.default,h.default,m.default,g.default,v.default,y.default,u.default,c.default,l.default,d.default,f.default];return e?t.push(i.default,a.default):t.push(r.default,o.default),t.push(s.default),t}},70744:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;const r=n(36313),i=n(22500),o=n(78213),a={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return s(e,"additionalItems",t);n.items=!0,(0,i.alwaysValidSchema)(n,t)||e.ok((0,o.validateArray)(e))}};function s(e,t,n=e.schema){const{gen:o,parentSchema:a,data:s,keyword:l,it:u}=e;!function(e){const{opts:r,errSchemaPath:o}=u,a=n.length,s=a===e.minItems&&(a===e.maxItems||!1===e[t]);if(r.strictTuples&&!s){const e=`"${l}" is ${a}-tuple, but minItems or maxItems/${t} are not specified or different at path "${o}"`;(0,i.checkStrictMode)(u,e,r.strictTuples)}}(a),u.opts.unevaluated&&n.length&&!0!==u.items&&(u.items=i.mergeEvaluated.items(o,n.length,u.items));const c=o.name("valid"),d=o.const("len",r._`${s}.length`);n.forEach(((t,n)=>{(0,i.alwaysValidSchema)(u,t)||(o.if(r._`${d} > ${n}`,(()=>e.subschema({keyword:l,schemaProp:n,dataProp:n},c))),e.ok(c))}))}t.validateTuple=s,t.default=a},76553:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(36313),i=n(22500),o=n(78213),a=n(55469),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>r.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>r._`{limit: ${e}}`},code(e){const{schema
|
||
|
//# sourceMappingURL=decap-cms.js.map
|