decap-cms-backend-forgejo 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/LICENSE +22 -0
- package/dist/decap-cms-backend-forgejo.js +12 -0
- package/dist/decap-cms-backend-forgejo.js.LICENSE.txt +18 -0
- package/dist/decap-cms-backend-forgejo.js.map +1 -0
- package/dist/esm/API.js +821 -0
- package/dist/esm/AuthenticationPage.js +233 -0
- package/dist/esm/implementation.js +539 -0
- package/dist/esm/index.js +9 -0
- package/dist/esm/types.js +1 -0
- package/package.json +38 -0
- package/src/API.ts +1054 -0
- package/src/AuthenticationPage.js +207 -0
- package/src/__tests__/API.spec.js +1479 -0
- package/src/__tests__/implementation.spec.js +530 -0
- package/src/implementation.tsx +652 -0
- package/src/index.ts +10 -0
- package/src/types.ts +344 -0
- package/webpack.config.js +3 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
# 3.4.0 (2026-07-23)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package decap-cms-backend-forgejo
|
|
9
|
+
|
|
10
|
+
# Change Log
|
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Copyright (c) 2016 Netlify <decap@p-m.si>
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*! For license information please see decap-cms-backend-forgejo.js.LICENSE.txt */
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("decap-cms-lib-util"),require("@emotion/react"),require("react"),require("prop-types"),require("decap-cms-lib-auth"),require("decap-cms-ui-default")):"function"==typeof define&&define.amd?define("DecapCmsBackendForgejo",["decap-cms-lib-util","@emotion/react","react","prop-types","decap-cms-lib-auth","decap-cms-ui-default"],t):"object"==typeof exports?exports.DecapCmsBackendForgejo=t(require("decap-cms-lib-util"),require("@emotion/react"),require("react"),require("prop-types"),require("decap-cms-lib-auth"),require("decap-cms-ui-default")):e.DecapCmsBackendForgejo=t(e.DecapCmsLibUtil,e.DecapCmsDefaultExports.EmotionCore,e.React,e.DecapCmsDefaultExports.PropTypes,e.DecapCmsLibAuth,e.DecapCmsUiDefault)}(window,(e,t,r,n,i,o)=>(()=>{var a={5985(e,t,r){"use strict";var n=r(524),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function c(e){return n.isMemo(e)?a:s[e.$$typeof]||i}s[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[n.Memo]=a;var u=Object.defineProperty,l=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,d=Object.prototype;e.exports=function e(t,r,n){if("string"!=typeof r){if(d){var i=f(r);i&&i!==d&&e(t,i,n)}var a=l(r);h&&(a=a.concat(h(r)));for(var s=c(t),g=c(r),y=0;y<a.length;++y){var m=a[y];if(!(o[m]||n&&n[m]||g&&g[m]||s&&s[m])){var v=p(r,m);try{u(t,m,v)}catch(e){}}}}return t}},5098(e,t,r){var n=r(3305),i=r(9361),o=r(1112),a=r(5276),s=r(7452);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=i,c.prototype.get=o,c.prototype.has=a,c.prototype.set=s,e.exports=c},7553(e,t,r){var n=r(9747),i=r(5962);function o(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}o.prototype=n(i.prototype),o.prototype.constructor=o,e.exports=o},1386(e,t,r){var n=r(2393),i=r(2049),o=r(7144),a=r(5071),s=r(3964);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=i,c.prototype.get=o,c.prototype.has=a,c.prototype.set=s,e.exports=c},528(e,t,r){var n=r(9747),i=r(5962);function o(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}o.prototype=n(i.prototype),o.prototype.constructor=o,e.exports=o},9770(e,t,r){var n=r(4715)(r(8942),"Map");e.exports=n},8250(e,t,r){var n=r(9753),i=r(5681),o=r(88),a=r(4732),s=r(9068);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=i,c.prototype.get=o,c.prototype.has=a,c.prototype.set=s,e.exports=c},5650(e,t,r){var n=r(8942).Symbol;e.exports=n},9270(e,t,r){var n=r(4715)(r(8942),"WeakMap");e.exports=n},6912(e){e.exports=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}},9968(e){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}},9756(e,t,r){var n=r(2478);e.exports=function(e,t){return!(null==e||!e.length)&&n(e,t,0)>-1}},5111(e){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}},2837(e){e.exports=function(e){return e.split("")}},7034(e,t,r){var n=r(6285);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},9747(e,t,r){var n=r(1580),i=Object.create,o=function(){function e(){}return function(t){if(!n(t))return{};if(i)return i(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=o},7250(e){e.exports=function(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}},7379(e,t,r){var n=r(5650),i=r(8870),o=r(9005),a=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},2478(e,t,r){var n=r(7250),i=r(9454),o=r(7706);e.exports=function(e,t,r){return t==t?o(e,t,r):n(e,i,r)}},9454(e){e.exports=function(e){return e!=e}},9624(e,t,r){var n=r(3655),i=r(4759),o=r(1580),a=r(4066),s=/^\[object .+?Constructor\]$/,c=Function.prototype,u=Object.prototype,l=c.toString,h=u.hasOwnProperty,p=RegExp("^"+l.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(n(e)?p:s).test(a(e))}},5962(e){e.exports=function(){}},3945(e,t,r){var n=r(2053),i=r(5234),o=r(796);e.exports=function(e,t){return o(i(e,t,n),e+"")}},4943(e,t,r){var n=r(2053),i=r(6065),o=i?function(e,t){return i.set(e,t),e}:n;e.exports=o},7403(e,t,r){var n=r(2619),i=r(2532),o=r(2053),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:o;e.exports=a},3501(e){e.exports=function(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(i);++n<i;)o[n]=e[n+t];return o}},2291(e,t,r){var n=r(5650),i=r(5111),o=r(3142),a=r(1187),s=n?n.prototype:void 0,c=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(a(t))return c?c.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r}},6403(e,t,r){var n=r(2945),i=/^\s+/;e.exports=function(e){return e?e.slice(0,n(e)+1).replace(i,""):e}},3526(e,t,r){var n=r(3142),i=r(5187),o=r(6493),a=r(5243);e.exports=function(e,t){return n(e)?e:i(e,t)?[e]:o(a(e))}},8931(e,t,r){var n=r(3501);e.exports=function(e,t,r){var i=e.length;return r=void 0===r?i:r,!t&&r>=i?e:n(e,t,r)}},8774(e,t,r){var n=r(2478);e.exports=function(e,t){for(var r=e.length;r--&&n(t,e[r],0)>-1;);return r}},7905(e,t,r){var n=r(2478);e.exports=function(e,t){for(var r=-1,i=e.length;++r<i&&n(t,e[r],0)>-1;);return r}},4977(e){var t=Math.max;e.exports=function(e,r,n,i){for(var o=-1,a=e.length,s=n.length,c=-1,u=r.length,l=t(a-s,0),h=Array(u+l),p=!i;++c<u;)h[c]=r[c];for(;++o<s;)(p||o<a)&&(h[n[o]]=e[o]);for(;l--;)h[c++]=e[o++];return h}},5755(e){var t=Math.max;e.exports=function(e,r,n,i){for(var o=-1,a=e.length,s=-1,c=n.length,u=-1,l=r.length,h=t(a-c,0),p=Array(h+l),f=!i;++o<h;)p[o]=e[o];for(var d=o;++u<l;)p[d+u]=r[u];for(;++s<c;)(f||o<a)&&(p[d+n[s]]=e[o++]);return p}},4354(e){e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}},1950(e,t,r){var n=r(8942)["__core-js_shared__"];e.exports=n},3816(e){e.exports=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}},6713(e,t,r){var n=r(4364),i=r(8942);e.exports=function(e,t,r){var o=1&t,a=n(e);return function t(){return(this&&this!==i&&this instanceof t?a:e).apply(o?r:this,arguments)}}},4364(e,t,r){var n=r(9747),i=r(1580);e.exports=function(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=n(e.prototype),o=e.apply(r,t);return i(o)?o:r}}},2443(e,t,r){var n=r(6912),i=r(4364),o=r(3504),a=r(4216),s=r(6850),c=r(8813),u=r(8942);e.exports=function(e,t,r){var l=i(e);return function i(){for(var h=arguments.length,p=Array(h),f=h,d=s(i);f--;)p[f]=arguments[f];var g=h<3&&p[0]!==d&&p[h-1]!==d?[]:c(p,d);return(h-=g.length)<r?a(e,t,o,i.placeholder,void 0,p,g,void 0,void 0,r-h):n(this&&this!==u&&this instanceof i?l:e,this,p)}}},3504(e,t,r){var n=r(4977),i=r(5755),o=r(3816),a=r(4364),s=r(4216),c=r(6850),u=r(6591),l=r(8813),h=r(8942);e.exports=function e(t,r,p,f,d,g,y,m,v,b){var w=128&r,x=1&r,_=2&r,k=24&r,R=512&r,A=_?void 0:a(t);return function P(){for(var S=arguments.length,C=Array(S),F=S;F--;)C[F]=arguments[F];if(k)var O=c(P),E=o(C,O);if(f&&(C=n(C,f,d,k)),g&&(C=i(C,g,y,k)),S-=E,k&&S<b){var $=l(C,O);return s(t,r,e,P.placeholder,p,C,$,m,v,b-S)}var L=x?p:this,U=_?L[t]:t;return S=C.length,m?C=u(C,m):R&&S>1&&C.reverse(),w&&v<S&&(C.length=v),this&&this!==h&&this instanceof P&&(U=A||a(U)),U.apply(L,C)}}},6341(e,t,r){var n=r(6912),i=r(4364),o=r(8942);e.exports=function(e,t,r,a){var s=1&t,c=i(e);return function t(){for(var i=-1,u=arguments.length,l=-1,h=a.length,p=Array(h+u),f=this&&this!==o&&this instanceof t?c:e;++l<h;)p[l]=a[l];for(;u--;)p[l++]=arguments[++i];return n(f,s?r:this,p)}}},4216(e,t,r){var n=r(6648),i=r(5512),o=r(5620);e.exports=function(e,t,r,a,s,c,u,l,h,p){var f=8&t;t|=f?32:64,4&(t&=~(f?64:32))||(t&=-4);var d=[e,t,s,f?c:void 0,f?u:void 0,f?void 0:c,f?void 0:u,l,h,p],g=r.apply(void 0,d);return n(e)&&i(g,d),g.placeholder=a,o(g,e,t)}},8638(e,t,r){var n=r(4943),i=r(6713),o=r(2443),a=r(3504),s=r(6341),c=r(5196),u=r(7028),l=r(5512),h=r(5620),p=r(7642),f=Math.max;e.exports=function(e,t,r,d,g,y,m,v){var b=2&t;if(!b&&"function"!=typeof e)throw new TypeError("Expected a function");var w=d?d.length:0;if(w||(t&=-97,d=g=void 0),m=void 0===m?m:f(p(m),0),v=void 0===v?v:p(v),w-=g?g.length:0,64&t){var x=d,_=g;d=g=void 0}var k=b?void 0:c(e),R=[e,t,r,d,g,x,_,y,m,v];if(k&&u(R,k),e=R[0],t=R[1],r=R[2],d=R[3],g=R[4],!(v=R[9]=void 0===R[9]?b?0:e.length:f(R[9]-w,0))&&24&t&&(t&=-25),t&&1!=t)A=8==t||16==t?o(e,t,v):32!=t&&33!=t||g.length?a.apply(void 0,R):s(e,t,r,d);else var A=i(e,t,r);return h((k?n:l)(A,R),e,t)}},2532(e,t,r){var n=r(4715),i=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},4967(e,t,r){var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},5196(e,t,r){var n=r(6065),i=r(9071),o=n?function(e){return n.get(e)}:i;e.exports=o},961(e,t,r){var n=r(3476),i=Object.prototype.hasOwnProperty;e.exports=function(e){for(var t=e.name+"",r=n[t],o=i.call(n,t)?r.length:0;o--;){var a=r[o],s=a.func;if(null==s||s==e)return a.name}return t}},6850(e){e.exports=function(e){return e.placeholder}},4700(e,t,r){var n=r(9067);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},4715(e,t,r){var n=r(9624),i=r(155);e.exports=function(e,t){var r=i(e,t);return n(r)?r:void 0}},8870(e,t,r){var n=r(5650),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=a.call(e);return n&&(t?e[s]=r:delete e[s]),i}},155(e){e.exports=function(e,t){return null==e?void 0:e[t]}},8788(e){var t=/\{\n\/\* \[wrapped with (.+)\] \*/,r=/,? & /;e.exports=function(e){var n=e.match(t);return n?n[1].split(r):[]}},3417(e){var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},3305(e,t,r){var n=r(4497);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},9361(e){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},1112(e,t,r){var n=r(4497),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return i.call(t,e)?t[e]:void 0}},5276(e,t,r){var n=r(4497),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:i.call(t,e)}},7452(e,t,r){var n=r(4497);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},9141(e){var t=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;e.exports=function(e,r){var n=r.length;if(!n)return e;var i=n-1;return r[i]=(n>1?"& ":"")+r[i],r=r.join(n>2?", ":" "),e.replace(t,"{\n/* [wrapped with "+r+"] */\n")}},9632(e){var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=r??9007199254740991)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}},5187(e,t,r){var n=r(3142),i=r(1187),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(n(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!i(e))||a.test(e)||!o.test(e)||null!=t&&e in Object(t)}},9067(e){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},6648(e,t,r){var n=r(7553),i=r(5196),o=r(961),a=r(3321);e.exports=function(e){var t=o(e),r=a[t];if("function"!=typeof r||!(t in n.prototype))return!1;if(e===r)return!0;var s=i(r);return!!s&&e===s[0]}},4759(e,t,r){var n,i=r(1950),o=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!o&&o in e}},2393(e){e.exports=function(){this.__data__=[],this.size=0}},2049(e,t,r){var n=r(7034),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0||(r==t.length-1?t.pop():i.call(t,r,1),--this.size,0))}},7144(e,t,r){var n=r(7034);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},5071(e,t,r){var n=r(7034);e.exports=function(e){return n(this.__data__,e)>-1}},3964(e,t,r){var n=r(7034);e.exports=function(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}},9753(e,t,r){var n=r(5098),i=r(1386),o=r(9770);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(o||i),string:new n}}},5681(e,t,r){var n=r(4700);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},88(e,t,r){var n=r(4700);e.exports=function(e){return n(this,e).get(e)}},4732(e,t,r){var n=r(4700);e.exports=function(e){return n(this,e).has(e)}},9068(e,t,r){var n=r(4700);e.exports=function(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}},6853(e,t,r){var n=r(9011);e.exports=function(e){var t=n(e,function(e){return 500===r.size&&r.clear(),e}),r=t.cache;return t}},7028(e,t,r){var n=r(4977),i=r(5755),o=r(8813),a="__lodash_placeholder__",s=Math.min;e.exports=function(e,t){var r=e[1],c=t[1],u=r|c,l=u<131,h=128==c&&8==r||128==c&&256==r&&e[7].length<=t[8]||384==c&&t[7].length<=t[8]&&8==r;if(!l&&!h)return e;1&c&&(e[2]=t[2],u|=1&r?0:4);var p=t[3];if(p){var f=e[3];e[3]=f?n(f,p,t[4]):p,e[4]=f?o(e[3],a):t[4]}return(p=t[5])&&(f=e[5],e[5]=f?i(f,p,t[6]):p,e[6]=f?o(e[5],a):t[6]),(p=t[7])&&(e[7]=p),128&c&&(e[8]=null==e[8]?t[8]:s(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=u,e}},6065(e,t,r){var n=r(9270),i=n&&new n;e.exports=i},4497(e,t,r){var n=r(4715)(Object,"create");e.exports=n},9005(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5234(e,t,r){var n=r(6912),i=Math.max;e.exports=function(e,t,r){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,s=i(o.length-t,0),c=Array(s);++a<s;)c[a]=o[t+a];a=-1;for(var u=Array(t+1);++a<t;)u[a]=o[a];return u[t]=r(c),n(e,this,u)}}},3476(e){e.exports={}},6591(e,t,r){var n=r(4354),i=r(9632),o=Math.min;e.exports=function(e,t){for(var r=e.length,a=o(t.length,r),s=n(e);a--;){var c=t[a];e[a]=i(c,r)?s[c]:void 0}return e}},8813(e){var t="__lodash_placeholder__";e.exports=function(e,r){for(var n=-1,i=e.length,o=0,a=[];++n<i;){var s=e[n];s!==r&&s!==t||(e[n]=t,a[o++]=n)}return a}},8942(e,t,r){var n=r(4967),i="object"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function("return this")();e.exports=o},5512(e,t,r){var n=r(4943),i=r(3316)(n);e.exports=i},796(e,t,r){var n=r(7403),i=r(3316)(n);e.exports=i},5620(e,t,r){var n=r(8788),i=r(9141),o=r(796),a=r(33);e.exports=function(e,t,r){var s=t+"";return o(e,i(s,a(n(s),r)))}},3316(e){var t=Date.now;e.exports=function(e){var r=0,n=0;return function(){var i=t(),o=16-(i-n);if(n=i,o>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}},7706(e){e.exports=function(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}},2237(e,t,r){var n=r(2837),i=r(3417),o=r(2013);e.exports=function(e){return i(e)?o(e):n(e)}},6493(e,t,r){var n=r(6853),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=n(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,function(e,r,n,i){t.push(n?i.replace(o,"$1"):r||e)}),t});e.exports=a},6040(e,t,r){var n=r(1187);e.exports=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},4066(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},2945(e){var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},2013(e){var t="\\ud800-\\udfff",r="["+t+"]",n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="[^"+t+"]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",c="(?:"+n+"|"+i+")?",u="[\\ufe0e\\ufe0f]?",l=u+c+"(?:\\u200d(?:"+[o,a,s].join("|")+")"+u+c+")*",h="(?:"+[o+n+"?",n,a,s,r].join("|")+")",p=RegExp(i+"(?="+i+")|"+h+l,"g");e.exports=function(e){return e.match(p)||[]}},33(e,t,r){var n=r(9968),i=r(9756),o=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];e.exports=function(e,t){return n(o,function(r){var n="_."+r[0];t&r[1]&&!i(e,n)&&e.push(n)}),e.sort()}},3410(e,t,r){var n=r(7553),i=r(528),o=r(4354);e.exports=function(e){if(e instanceof n)return e.clone();var t=new i(e.__wrapped__,e.__chain__);return t.__actions__=o(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}},2619(e){e.exports=function(e){return function(){return e}}},6285(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},2053(e){e.exports=function(e){return e}},3142(e){var t=Array.isArray;e.exports=t},3655(e,t,r){var n=r(7379),i=r(1580);e.exports=function(e){if(!i(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1580(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},547(e){e.exports=function(e){return null!=e&&"object"==typeof e}},1187(e,t,r){var n=r(7379),i=r(547);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==n(e)}},9011(e,t,r){var n=r(8250);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(i.Cache||n),r}i.Cache=n,e.exports=i},9071(e){e.exports=function(){}},578(e,t,r){var n=r(3945),i=r(8638),o=r(6850),a=r(8813),s=n(function(e,t){var r=a(t,o(s));return i(e,32,void 0,t,r)});s.placeholder={},e.exports=s},1034(e,t,r){var n=r(3526),i=r(3655),o=r(6040);e.exports=function(e,t,r){var a=-1,s=(t=n(t,e)).length;for(s||(s=1,e=void 0);++a<s;){var c=null==e?void 0:e[o(t[a])];void 0===c&&(a=s,c=r),e=i(c)?c.call(e):c}return e}},3301(e,t,r){var n=r(6131),i=1/0;e.exports=function(e){return e?(e=n(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},7642(e,t,r){var n=r(3301);e.exports=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}},6131(e,t,r){var n=r(6403),i=r(1580),o=r(1187),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=s.test(e);return r||c.test(e)?u(e.slice(2),r?2:8):a.test(e)?NaN:+e}},5243(e,t,r){var n=r(2291);e.exports=function(e){return null==e?"":n(e)}},107(e,t,r){var n=r(2291),i=r(6403),o=r(8931),a=r(8774),s=r(7905),c=r(2237),u=r(5243);e.exports=function(e,t,r){if((e=u(e))&&(r||void 0===t))return i(e);if(!e||!(t=n(t)))return e;var l=c(e),h=c(t),p=s(l,h),f=a(l,h)+1;return o(l,p,f).join("")}},959(e,t,r){var n=r(2291),i=r(8931),o=r(7905),a=r(2237),s=r(5243),c=/^\s+/;e.exports=function(e,t,r){if((e=s(e))&&(r||void 0===t))return e.replace(c,"");if(!e||!(t=n(t)))return e;var u=a(e),l=o(u,a(t));return i(u,l).join("")}},3321(e,t,r){var n=r(7553),i=r(528),o=r(5962),a=r(3142),s=r(547),c=r(3410),u=Object.prototype.hasOwnProperty;function l(e){if(s(e)&&!a(e)&&!(e instanceof n)){if(e instanceof i)return e;if(u.call(e,"__wrapped__"))return c(e)}return new i(e)}l.prototype=o.prototype,l.prototype.constructor=l,e.exports=l},320(e,t){"use strict";var r="function"==typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,o=r?Symbol.for("react.fragment"):60107,a=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,u=r?Symbol.for("react.context"):60110,l=r?Symbol.for("react.async_mode"):60111,h=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,f=r?Symbol.for("react.suspense"):60113,d=r?Symbol.for("react.suspense_list"):60120,g=r?Symbol.for("react.memo"):60115,y=r?Symbol.for("react.lazy"):60116,m=r?Symbol.for("react.block"):60121,v=r?Symbol.for("react.fundamental"):60117,b=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case l:case h:case o:case s:case a:case f:return e;default:switch(e=e&&e.$$typeof){case u:case p:case y:case g:case c:return e;default:return t}}case i:return t}}}function _(e){return x(e)===h}t.AsyncMode=l,t.ConcurrentMode=h,t.ContextConsumer=u,t.ContextProvider=c,t.Element=n,t.ForwardRef=p,t.Fragment=o,t.Lazy=y,t.Memo=g,t.Portal=i,t.Profiler=s,t.StrictMode=a,t.Suspense=f,t.isAsyncMode=function(e){return _(e)||x(e)===l},t.isConcurrentMode=_,t.isContextConsumer=function(e){return x(e)===u},t.isContextProvider=function(e){return x(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return x(e)===p},t.isFragment=function(e){return x(e)===o},t.isLazy=function(e){return x(e)===y},t.isMemo=function(e){return x(e)===g},t.isPortal=function(e){return x(e)===i},t.isProfiler=function(e){return x(e)===s},t.isStrictMode=function(e){return x(e)===a},t.isSuspense=function(e){return x(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===h||e===s||e===a||e===f||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===g||e.$$typeof===c||e.$$typeof===u||e.$$typeof===p||e.$$typeof===v||e.$$typeof===b||e.$$typeof===w||e.$$typeof===m)},t.typeOf=x},524(e,t,r){"use strict";e.exports=r(320)},1197(e,t){"use strict";var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(e,t,n){var i=null;if(void 0!==n&&(i=""+n),void 0!==t.key&&(i=""+t.key),"key"in t)for(var o in n={},t)"key"!==o&&(n[o]=t[o]);else n=t;return t=n.ref,{$$typeof:r,type:e,key:i,ref:void 0!==t?t:null,props:n}}t.Fragment=n,t.jsx=i,t.jsxs=i},1085(e,t,r){"use strict";e.exports=r(1197)},3554(e){!function(){"use strict";var t=function(e){setTimeout(e,0)};"undefined"!=typeof process&&process&&"function"==typeof process.nextTick&&(t=process.nextTick),e.exports=function(e){var r={capacity:e||1,current:0,queue:[],firstHere:!1,take:function(){if(!1===r.firstHere){r.current++,r.firstHere=!0;var e=1}else e=0;var t={n:1};"function"==typeof arguments[0]?t.task=arguments[0]:t.n=arguments[0],arguments.length>=2&&("function"==typeof arguments[1]?t.task=arguments[1]:t.n=arguments[1]);var n=t.task;if(t.task=function(){n(r.leave)},r.current+t.n-e>r.capacity)return 1===e&&(r.current--,r.firstHere=!1),r.queue.push(t);r.current+=t.n-e,t.task(r.leave),1===e&&(r.firstHere=!1)},leave:function(e){if(e=e||1,r.current-=e,r.queue.length){var n=r.queue[0];n.n+r.current>r.capacity||(r.queue.shift(),r.current+=n.n,t(n.task))}else if(r.current<0)throw new Error("leave called too many times.")},available:function(e){return e=e||1,r.current+e<=r.capacity}};return r}}()},4119(e){"use strict";e.exports=r},8110(e){"use strict";e.exports=t},7434(e){"use strict";e.exports=n},7125(e){"use strict";e.exports=i},3135(t){"use strict";t.exports=e},6171(e){"use strict";e.exports=o}};const s={};function c(e){const t=s[e];if(void 0!==t)return t.exports;const r=s[e]={exports:{}};return a[e].call(r.exports,r,r.exports,c),r.exports}c.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return c.d(t,{a:t}),t},c.d=(e,t)=>{if(Array.isArray(t))for(var r=0;r<t.length;){var n=t[r++],i=t[r++];c.o(e,n)?0===i&&r++:0===i?Object.defineProperty(e,n,{enumerable:!0,value:t[r++]}):Object.defineProperty(e,n,{enumerable:!0,get:i})}else for(var n in t)c.o(t,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);let u={};return(()=>{"use strict";c.d(u,{DecapCmsBackendForgejo:()=>cr});var e,t,r=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),n=(e=["",""],t=["",""],Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))),i=function(){function e(){for(var t=this,r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tag=function(e){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return"function"==typeof e?t.interimTag.bind(t,e):"string"==typeof e?t.transformEndResult(e):(e=e.map(t.transformString.bind(t)),t.transformEndResult(e.reduce(t.processSubstitutions.bind(t,n))))},n.length>0&&Array.isArray(n[0])&&(n=n[0]),this.transformers=n.map(function(e){return"function"==typeof e?e():e}),this.tag}return r(e,[{key:"interimTag",value:function(e,t){for(var r=arguments.length,i=Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return this.tag(n,e.apply(void 0,[t].concat(i)))}},{key:"processSubstitutions",value:function(e,t,r){var n=this.transformSubstitution(e.shift(),t);return"".concat(t,n,r)}},{key:"transformString",value:function(e){return this.transformers.reduce(function(e,t){return t.onString?t.onString(e):e},e)}},{key:"transformSubstitution",value:function(e,t){return this.transformers.reduce(function(e,r){return r.onSubstitution?r.onSubstitution(e,t):e},e)}},{key:"transformEndResult",value:function(e){return this.transformers.reduce(function(e,t){return t.onEndResult?t.onEndResult(e):e},e)}}]),e}();const o=i,a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"initial";return{onEndResult:function(t){if("initial"===e){var r=t.match(/^[^\S\n]*(?=\S)/gm),n=r&&Math.min.apply(Math,function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}(r.map(function(e){return e.length})));if(n){var i=new RegExp("^.{"+n+"}","gm");return t.replace(i,"")}return t}if("all"===e)return t.replace(/^[^\S\n]+/gm,"");throw new Error("Unknown type: "+e)}}};var s={separator:"",conjunction:"",serial:!1};const l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s;return{onSubstitution:function(t,r){if(Array.isArray(t)){var n=t.length,i=e.separator,o=e.conjunction,a=e.serial,s=r.match(/(\n?[^\S\n]+)$/);if(t=s?t.join(i+s[1]):t.join(i+" "),o&&n>1){var c=t.lastIndexOf(i);t=t.slice(0,c)+(a?i:"")+" "+o+t.slice(c+1)}}return t}}},h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{onEndResult:function(t){if(""===e)return t.trim();if("start"===(e=e.toLowerCase())||"left"===e)return t.replace(/^\s*/,"");if("end"===e||"right"===e)return t.replace(/\s*$/,"");throw new Error("Side not supported: "+e)}}};new o(l({separator:","}),a,h),new o(l({separator:",",conjunction:"and"}),a,h),new o(l({separator:",",conjunction:"or"}),a,h);const p=function(e){return{onSubstitution:function(t,r){if(null==e||"string"!=typeof e)throw new Error("You need to specify a string character to split by.");return"string"==typeof t&&t.includes(e)&&(t=t.split(e)),t}}};var f=function(e){return null!=e&&!Number.isNaN(e)&&"boolean"!=typeof e};new o(p("\n"),function(){return{onSubstitution:function(e){return Array.isArray(e)?e.filter(f):f(e)?e:""}}},l,a,h);const d=function(e,t){return{onSubstitution:function(r,n){if(null==e||null==t)throw new Error("replaceSubstitutionTransformer requires at least 2 arguments.");return null==r?r:r.toString().replace(e,t)}}};new o(p("\n"),l,a,h,d(/&/g,"&"),d(/</g,"<"),d(/>/g,">"),d(/"/g,"""),d(/'/g,"'"),d(/`/g,"`"));const g=function(e,t){return{onEndResult:function(r){if(null==e||null==t)throw new Error("replaceResultTransformer requires at least 2 arguments.");return r.replace(e,t)}}};new o(g(/(?:\n(?:\s*))+/g," "),h),new o(g(/(?:\n\s*)/g,""),h),new o(l({separator:","}),g(/(?:\s+)/g," "),h),new o(l({separator:",",conjunction:"or"}),g(/(?:\s+)/g," "),h),new o(l({separator:",",conjunction:"and"}),g(/(?:\s+)/g," "),h),new o(l,a,h),new o(l,g(/(?:\s+)/g," "),h);const y=new o(a,h);new o(a("all"),h);var m=c(959),v=c.n(m),b=c(3554),w=c.n(b),x=c(3135);const _="3.9.1",k=_,R="function"==typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0}):void 0,A="function"==typeof TextEncoder?new TextEncoder:void 0,P=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),S=(e=>{let t={};return e.forEach((e,r)=>t[e]=r),t})(P),C=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,F=String.fromCharCode.bind(String),O="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),E=e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_"),$=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),L=e=>{let t,r,n,i,o="";const a=e.length%3;for(let a=0;a<e.length;){if((r=e.charCodeAt(a++))>255||(n=e.charCodeAt(a++))>255||(i=e.charCodeAt(a++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|i,o+=P[t>>18&63]+P[t>>12&63]+P[t>>6&63]+P[63&t]}return a?o.slice(0,a-3)+"===".substring(a):o},U="function"==typeof btoa?e=>btoa(e):L,j="function"==typeof Uint8Array.prototype.toBase64?e=>e.toBase64():e=>{let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(F.apply(null,e.subarray(r,r+4096)));return U(t.join(""))},T=(e,t=!1)=>t?E(j(e)):j(e),q=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?F(192|t>>>6)+F(128|63&t):F(224|t>>>12&15)+F(128|t>>>6&63)+F(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return F(240|t>>>18&7)+F(128|t>>>12&63)+F(128|t>>>6&63)+F(128|63&t)},M=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,B=e=>e.replace(M,q),I=A?e=>j(A.encode(e)):e=>U(B(e)),D=(e,t=!1)=>t?E(I(e)):I(e),z=e=>D(e,!0),W=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,N=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return F((t>>>10)+55296)+F(56320+(1023&t));case 3:return F((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return F((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},H=e=>e.replace(W,N),K=e=>{if(e=e.replace(/\s+/g,""),!C.test(e))throw new TypeError("malformed base64.");let t,r,n;e+="==".slice(2-(3&e.length));let i=[];for(let o=0;o<e.length;)t=S[e.charAt(o++)]<<18|S[e.charAt(o++)]<<12|(r=S[e.charAt(o++)])<<6|(n=S[e.charAt(o++)]),64===r?i.push(F(t>>16&255)):64===n?i.push(F(t>>16&255,t>>8&255)):i.push(F(t>>16&255,t>>8&255,255&t));return i.join("")},G="function"==typeof atob?e=>atob($(e)):K,J="function"==typeof Uint8Array.fromBase64?e=>Uint8Array.fromBase64(e):e=>O(G(e).split("").map(e=>e.charCodeAt(0))),Y=e=>J(X(e)),V=R?e=>R.decode(J(e)):e=>H(G(e)),X=e=>$(e.replace(/[-_]/g,e=>"-"==e?"+":"/")),Z=e=>V(X(e)),Q=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),ee=function(){const e=(e,t)=>Object.defineProperty(String.prototype,e,Q(t));e("fromBase64",function(){return Z(this)}),e("toBase64",function(e){return D(this,e)}),e("toBase64URI",function(){return D(this,!0)}),e("toBase64URL",function(){return D(this,!0)}),e("toUint8Array",function(){return Y(this)})},te=function(){const e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,Q(t));e("toBase64",function(e){return T(this,e)}),e("toBase64URI",function(){return T(this,!0)}),e("toBase64URL",function(){return T(this,!0)})},re={version:_,VERSION:k,atob:G,atobPolyfill:K,btoa:U,btoaPolyfill:L,fromBase64:Z,toBase64:D,encode:D,encodeURI:z,encodeURL:z,utob:B,btou:H,decode:Z,isValid:e=>{if("string"!=typeof e)return!1;const t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},fromUint8Array:T,toUint8Array:Y,extendString:ee,extendUint8Array:te,extendBuiltins:()=>{ee(),te()}};var ne=c(107),ie=c.n(ne),oe=c(1034),ae=c.n(oe),se=c(578),ce=c.n(se);const ue="Forgejo",le=-1;var he=function(e){return e.CREATE="create",e.DELETE="delete",e.UPDATE="update",e}(he||{});class pe{constructor(e){if(!e.apiRoot)throw new Error("API root is required");this.apiRoot=e.apiRoot,this.token=e.token||"",this.branch=e.branch||"master",this.repo=e.repo||"",this.originRepo=e.originRepo||this.repo,this.useOpenAuthoring=!!e.useOpenAuthoring,this.cmsLabelPrefix=e.cmsLabelPrefix||"",this.initialWorkflowStatus=e.initialWorkflowStatus||"draft",this.repoURL=`/repos/${this.repo}`,this.originRepoURL=`/repos/${this.originRepo}`;const[t,r]=[this.repo.split("/"),this.originRepo.split("/")];this.repoOwner=t[0],this.repoName=t[1],this.originRepoOwner=r[0],this.originRepoName=r[1]}static DEFAULT_COMMIT_MESSAGE="Automatically generated by Static CMS";user(){return this._userPromise||(this._userPromise=this.getUser()),this._userPromise}getUser(){return this.request("/user")}async hasWriteAccess(){try{const e=await this.request(this.repoURL);return this.repoOwner=e.owner.login,e.permissions.push}catch(e){throw console.error("Problem fetching repo data from Forgejo"),e}}reset(){}requestHeaders(e={}){const t={"Content-Type":"application/json; charset=utf-8",...e};return this.token?(t.Authorization=`token ${this.token}`,Promise.resolve(t)):Promise.resolve(t)}async parseJsonResponse(e){const t=await e.json();return e.ok?t:Promise.reject(t)}urlFor(e,t){const r=[];if(t.params)for(const e in t.params)r.push(`${e}=${encodeURIComponent(t.params[e])}`);return r.length&&(e+=`?${r.join("&")}`),this.apiRoot+e}parseResponse(e){const t=e.headers.get("Content-Type");return t&&t.match(/json/)?this.parseJsonResponse(e):e.text().then(t=>e.ok?t:Promise.reject(t))}handleRequestError(e,t){throw new x.APIError(e.message,t,ue)}buildRequest(e){return e}async request(e,t={},r=e=>this.parseResponse(e)){t={cache:"no-cache",...t};const n=await this.requestHeaders(t.headers||{}),i=this.urlFor(e,t);let o=500;try{const e=x.unsentRequest.fromFetchArguments(i,{...t,headers:n}),a=await(0,x.requestWithBackoff)(this,e);return o=a.status,await r(a)}catch(e){return this.handleRequestError(e,o)}}nextUrlProcessor(){return e=>e}async requestAllPages(e,t={}){t={cache:"no-cache",...t};const r=await this.requestHeaders(t.headers||{}),n=this.urlFor(e,t),i=await(0,x.getAllResponses)(n,{...t,headers:r},"next",this.nextUrlProcessor()),o=await Promise.all(i.map(e=>this.parseResponse(e)));return[].concat(...o)}generateContentKey(e,t){const r=(0,x.generateContentKey)(e,t);return this.useOpenAuthoring?`${this.repo}/${r}`:r}parseContentKey(e){if(!this.useOpenAuthoring)return(0,x.parseContentKey)(e);const t=`${this.repo}/`,r=this.originRepo?`${this.originRepo}/`:null;let n=e;return e.startsWith(t)?n=e.slice(t.length):r&&e.startsWith(r)&&(n=e.slice(r.length)),(0,x.parseContentKey)(n)}async readFile(e,t,{branch:r=this.branch,repoURL:n=this.repoURL,parseText:i=!0}={}){return t||(t=await this.getFileSha(e,{repoURL:n,branch:r})),await this.fetchBlobContent({sha:t,repoURL:n,parseText:i})}async readFileMetadata(e,t){const r=await(0,x.readFileMetadata)(t,async()=>{try{const t=await this.request(`${this.originRepoURL}/commits`,{params:{path:e,sha:this.branch,stat:"false"}}),{commit:r}=t[0];return{author:r.author.name||r.author.email,updatedOn:r.author.date}}catch(e){return{author:"",updatedOn:""}}},x.localForage);return r}async fetchBlobContent({sha:e,repoURL:t,parseText:r}){const n=await this.request(`${t}/git/blobs/${e}`,{cache:"force-cache"});if(r)return re.decode(n.content);{const e=re.atob(n.content),t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return new Blob([t])}}async listFiles(e,{repoURL:t=this.repoURL,branch:r=this.branch,depth:n=1}={},i){const o=ie()(e,"/"),a=Boolean(o);try{const e=(await this.request(`${t}/branches/${encodeURIComponent(r)}`)).commit.id,s=n>1||a;return(await this.request(`${t}/git/trees/${encodeURIComponent(e)}`,{params:s?{recursive:1}:{}})).tree.filter(e=>{if((i||"blob"===e.type)&&e.path){if(!a)return e.path.split("/").length<=n;if(!e.path.startsWith(`${o}/`))return!1;const t=e.path.slice(o.length+1);return!!t&&t.split("/").length<=n}return!1}).map(e=>{const t=a&&e.path.startsWith(`${o}/`)?e.path.slice(o.length+1):e.path;return{type:e.type,id:e.sha,name:(0,x.basename)(e.path),path:a?`${o}/${t}`:e.path,size:e.size}})}catch(e){if(e&&404===e.status)return console.info("[StaticCMS] This 404 was expected and handled appropriately."),[];throw e}}async persistFiles(e,t,r){const n=[...t,...e],i=await this.getChangeFileOperations(n,this.branch);return this.changeFiles(i,r)}async changeFiles(e,t){return await this.request(`${this.repoURL}/contents`,{method:"POST",body:JSON.stringify({branch:this.branch,files:e,message:t.commitMessage})})}async getChangeFileOperations(e,t){return await Promise.all(e.map(async e=>{const r=await ae()(e,"toBase64",ce()(this.toBase64,e.raw));let n,i,o,a=v()(e.path,"/");try{n=await this.getFileSha(e.path,{branch:t}),i=he.UPDATE;const r="newPath"in e?e.newPath:void 0;o=r&&a,a=r?v()(r,"/"):a}catch{n=void 0,i=he.CREATE}return{operation:i,content:r,path:a,from_path:o,sha:n}}))}async getFileSha(e,{repoURL:t=this.repoURL,branch:r=this.branch}={}){const n=(e.startsWith("/")?e.slice(1):e).split("/").map(e=>encodeURIComponent(e)).join("/"),i=await this.request(`${t}/contents/${n}`,{params:{ref:r}});if(i?.sha)return i.sha;throw new x.APIError("Not Found",404,ue)}async deleteFiles(e,t){if(this.useOpenAuthoring)throw new x.APIError("Cannot delete published entries as an Open Authoring user!",403,ue);const r=await Promise.all(e.map(async e=>{const t=await this.getFileSha(e);return{operation:he.DELETE,path:e,sha:t}}));return this.changeFiles(r,{commitMessage:t})}toBase64(e){return Promise.resolve(re.encode(e))}async getBranch(e){return this.request(`${this.repoURL}/branches/${encodeURIComponent(e)}`)}async getDefaultBranch(){return this.getBranch(this.branch)}async createBranch(e,t=this.branch){return this.request(`${this.repoURL}/branches`,{method:"POST",body:JSON.stringify({new_branch_name:e,old_ref_name:t})})}async deleteBranch(e){await this.request(`${this.repoURL}/branches/${encodeURIComponent(e)}`,{method:"DELETE"})}async getPullRequests(e="open",t){const r=await this.requestAllPages(`${this.originRepoURL}/pulls`,{params:{state:e,base:this.branch,limit:100}});return t?r.filter(e=>{const r=e.head?.label;if(r)return r===t;const n=e.head?.repo?.owner?.login,i=e.head?.ref;return!(!n||!i)&&`${n}:${i}`===t}):r}async getOpenAuthoringPullRequest(e,t){const r=await this.getBranch(e).catch(()=>{throw new x.EditorialWorkflowError("content is not under editorial workflow",!0)}),n=t.filter(e=>e.head.sha===r.commit.id)[0];if(!n)return{pullRequest:{number:le,state:"open",labels:[{name:(0,x.statusToLabel)(this.initialWorkflowStatus,this.cmsLabelPrefix)}],head:{ref:e,sha:r.commit.id}},branch:r};const i=n.labels.filter(e=>!(0,x.isCMSLabel)(e.name,this.cmsLabelPrefix)),o="closed"===n.state?{name:(0,x.statusToLabel)(this.initialWorkflowStatus,this.cmsLabelPrefix)}:{name:(0,x.statusToLabel)("pending_review",this.cmsLabelPrefix)};return{pullRequest:{...n,labels:[...i,o]},branch:r}}async getBranchPullRequest(e){if(this.useOpenAuthoring){const t=await this.getHeadReference(e),r=await this.getPullRequests("all",t);return(await this.getOpenAuthoringPullRequest(e,r)).pullRequest}const t=(await this.getPullRequests("open",`${this.repoOwner}:${e}`)).filter(e=>e.labels.some(e=>(0,x.isCMSLabel)(e.name,this.cmsLabelPrefix)));if(t.length>0)return t[0];throw new x.EditorialWorkflowError("content is not under editorial workflow",!0)}async getHeadReference(e){return`${this.repoOwner}:${e}`}async createPR(e,t,r=x.DEFAULT_PR_BODY){return this.request(`${this.originRepoURL}/pulls`,{method:"POST",body:JSON.stringify({title:e,head:await this.getHeadReference(t),base:this.branch,body:r})})}async updatePR(e,t){return this.request(`${this.originRepoURL}/pulls/${e}`,{method:"PATCH",body:JSON.stringify({state:t})})}async closePR(e){return this.updatePR(e,"closed")}async mergePR(e){await this.request(`${this.originRepoURL}/pulls/${e.number}/merge`,{method:"POST",body:JSON.stringify({Do:"merge",MergeMessageField:x.MERGE_COMMIT_MESSAGE})})}async getPullRequestFiles(e){return e===le?[]:this.request(`${this.originRepoURL}/pulls/${e}/files`)}async getDifferences(e,t){const r=this.useOpenAuthoring?this.repoURL:this.originRepoURL;try{return await this.request(`${r}/compare/${encodeURIComponent(e)}...${encodeURIComponent(t)}`)}catch(r){if(this.useOpenAuthoring)return this.request(`${this.originRepoURL}/compare/${encodeURIComponent(e)}...${encodeURIComponent(t)}`);throw r}}async updatePullRequestLabels(e,t){return this.request(`${this.originRepoURL}/issues/${e}/labels`,{method:"PUT",body:JSON.stringify({labels:t})})}async getLabels(){return this.requestAllPages(`${this.originRepoURL}/labels`,{params:{limit:100}})}async createLabel(e,t="0052cc"){return this.request(`${this.originRepoURL}/labels`,{method:"POST",body:JSON.stringify({name:e,color:t})})}async getOrCreateLabel(e){return(await this.getLabels()).find(t=>t.name===e)||this.createLabel(e)}async setPullRequestStatus(e,t){if(this.useOpenAuthoring||e.number===le)return;const r=(0,x.statusToLabel)(t,this.cmsLabelPrefix),n=await this.getOrCreateLabel(r);if("number"!=typeof n.id)throw new Error(`Status label "${n.name}" returned from getOrCreateLabel is missing a numeric id`);const i=e.labels.filter(e=>!(0,x.isCMSLabel)(e.name,this.cmsLabelPrefix)).filter(e=>"number"==typeof e.id).map(e=>e.id);await this.updatePullRequestLabels(e.number,[...i,n.id])}async getOpenAuthoringBranches(){const e=await this.requestAllPages(`${this.repoURL}/branches`),t=`${x.CMS_BRANCH_PREFIX}/${this.repo}/`;return e.filter(e=>e.name.startsWith(t))}filterOpenAuthoringBranches=async e=>{try{const t=await this.getBranchPullRequest(e),{state:r,merged_at:n}=t;return t.number!==le&&"closed"===r&&n?(await this.deleteBranch(e),{branch:e,filter:!1}):{branch:e,filter:!0}}catch(t){return t instanceof x.APIError&&404===t.status||t instanceof x.EditorialWorkflowError?{branch:e,filter:!1}:{branch:e,filter:!0}}};async listUnpublishedBranches(){if(this.useOpenAuthoring){let e=(await this.getOpenAuthoringBranches()).map(e=>e.name);const t=await Promise.all(e.map(e=>this.filterOpenAuthoringBranches(e)));return e=t.filter(e=>e.filter).map(e=>e.branch),e}return(await this.getPullRequests("open")).filter(e=>e.head.ref.startsWith(`${x.CMS_BRANCH_PREFIX}/`)&&e.labels.some(e=>(0,x.isCMSLabel)(e.name,this.cmsLabelPrefix))).map(e=>e.head.ref)}async retrieveUnpublishedEntryData(e){const t=(0,x.branchFromContentKey)(e);let r,n,i=null;if(this.useOpenAuthoring){const e=await this.getHeadReference(t),n=await this.getPullRequests("all",e),o=await this.getOpenAuthoringPullRequest(t,n);r=o.pullRequest,i=o.branch}else r=await this.getBranchPullRequest(t);try{const e=await this.getHeadReference(t);n=(await this.getDifferences(this.branch,e)).files.map(e=>({path:e.filename,newFile:"added"===e.status,id:e.sha||""}))}catch(e){n=(await this.getPullRequestFiles(r.number)).map(e=>({path:e.filename,newFile:"added"===e.status,id:""}))}const o=r.labels.find(e=>(0,x.isCMSLabel)(e.name,this.cmsLabelPrefix)),a=o?(0,x.labelToStatus)(o.name,this.cmsLabelPrefix):this.initialWorkflowStatus,{collection:s,slug:c}=this.parseContentKey(e);return{collection:s,slug:c,status:a,diffs:n,updatedAt:r?.updated_at||i?.commit?.author?.date||i?.commit?.committer?.date||(new Date).toISOString(),pullRequestAuthor:r?.user?.login||i?.commit?.author?.name||"Unknown"}}async updateUnpublishedEntryStatus(e,t,r){const n=this.generateContentKey(e,t),i=(0,x.branchFromContentKey)(n),o=await this.getBranchPullRequest(i);if(this.useOpenAuthoring){if("pending_publish"===r)throw new Error('Open Authoring entries may not be set to the status "pending_publish".');if(o.number!==le){const{state:e}=o;"open"===e&&"draft"===r&&await this.closePR(o.number),"closed"===e&&"pending_review"===r&&await this.updatePR(o.number,"open")}else if("pending_review"===r){const e=await this.getDifferences(this.branch,await this.getHeadReference(i)),t=e.commits[0]?.commit?.message||pe.DEFAULT_COMMIT_MESSAGE;await this.createPR(t,i)}}else await this.setPullRequestStatus(o,r)}async deleteUnpublishedEntry(e,t){const r=this.generateContentKey(e,t),n=(0,x.branchFromContentKey)(r);try{const e=await this.getBranchPullRequest(n);e.number!==le&&await this.closePR(e.number)}catch(e){if(!(e instanceof x.EditorialWorkflowError||e instanceof x.APIError&&404===e.status))throw e}await this.deleteBranch(n)}async publishUnpublishedEntry(e,t){const r=this.generateContentKey(e,t),n=(0,x.branchFromContentKey)(r),i=await this.getBranchPullRequest(n);if(i.number===le)throw new x.APIError("Cannot publish entry without a pull request",400,ue);await this.mergePR(i),await this.deleteBranch(n)}async editorialWorkflowGit(e,t,r,n){const i=this.generateContentKey(r,t),o=(0,x.branchFromContentKey)(i);let a=!1;try{await this.getBranch(o),a=!0}catch(e){if(!(e instanceof x.APIError&&404===e.status))throw e}a||await this.createBranch(o,this.branch);const s=await this.getChangeFileOperations(e,o);if(await this.changeFilesOnBranch(s,n,o),!a&&!this.useOpenAuthoring){const e=await this.createPR(n.commitMessage,o),t=n.status||this.initialWorkflowStatus;await this.setPullRequestStatus(e,t)}}async changeFilesOnBranch(e,t,r){return await this.request(`${this.repoURL}/contents`,{method:"POST",body:JSON.stringify({branch:r,files:e,message:t.commitMessage})})}async forkExists(){try{const e=this.originRepo.split("/")[1],t=`/repos/${this.repoOwner}/${e}`,r=await this.request(t);return!0===r.fork&&!!r.parent&&r.parent.full_name.toLowerCase()===this.originRepo.toLowerCase()}catch{return!1}}async createFork(){return this.request(`${this.originRepoURL}/forks`,{method:"POST"})}async mergeUpstream(){try{await this.request(`${this.repoURL}/sync_fork`,{method:"POST"})}catch(e){console.warn("Failed to sync fork with upstream:",e)}}}function fe(){return fe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fe.apply(null,arguments)}var de=c(8110),ge={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function ye(e){var t=Object.create(null);return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}var me=/[A-Z]|^ms/g,ve=/_EMO_([^_]+?)_([^]*?)_EMO_/g,be=function(e){return 45===e.charCodeAt(1)},we=function(e){return null!=e&&"boolean"!=typeof e},xe=ye(function(e){return be(e)?e:e.replace(me,"-$&").toLowerCase()}),_e=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(ve,function(e,t,r){return Re={name:t,styles:r,next:Re},t})}return 1===ge[e]||be(e)||"number"!=typeof t||0===t?t:t+"px"};function ke(e,t,r){if(null==r)return"";var n=r;if(void 0!==n.__emotion_styles)return n;switch(typeof r){case"boolean":return"";case"object":var i=r;if(1===i.anim)return Re={name:i.name,styles:i.styles,next:Re},i.name;var o=r;if(void 0!==o.styles){var a=o.next;if(void 0!==a)for(;void 0!==a;)Re={name:a.name,styles:a.styles,next:Re},a=a.next;return o.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=ke(e,t,r[i])+";";else for(var o in r){var a=r[o];if("object"!=typeof a){var s=a;null!=t&&void 0!==t[s]?n+=o+"{"+t[s]+"}":we(s)&&(n+=xe(o)+":"+_e(o,s)+";")}else if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var c=ke(e,t,a);switch(o){case"animation":case"animationName":n+=xe(o)+":"+c+";";break;default:n+=o+"{"+c+"}"}}else for(var u=0;u<a.length;u++)we(a[u])&&(n+=xe(o)+":"+_e(o,a[u])+";")}return n}(e,t,r);case"function":if(void 0!==e){var s=Re,c=r(e);return Re=s,ke(e,t,c)}}var u=r;if(null==t)return u;var l=t[u];return void 0!==l?l:u}var Re,Ae=/label:\s*([^\s;{]+)\s*(;|$)/g;function Pe(e,t,r){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var n=!0,i="";Re=void 0;var o=e[0];null==o||void 0===o.raw?(n=!1,i+=ke(r,t,o)):i+=o[0];for(var a=1;a<e.length;a++)i+=ke(r,t,e[a]),n&&(i+=o[a]);Ae.lastIndex=0;for(var s,c="";null!==(s=Ae.exec(i));)c+="-"+s[1];var u=function(e){for(var t,r=0,n=0,i=e.length;i>=4;++n,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(i){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(i)+c;return{name:u,styles:i,next:Re}}var Se=c(4119),Ce=c.n(Se),Fe=!!Se.useInsertionEffect&&Se.useInsertionEffect,Oe=Fe||function(e){return e()};function Ee(e,t,r){var n="";return r.split(" ").forEach(function(r){void 0!==e[r]?t.push(e[r]+";"):r&&(n+=r+" ")}),n}Fe||Se.useLayoutEffect;var $e=function(e,t,r){var n=e.key+"-"+t.name;!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles)},Le=function(e,t,r){$e(e,t,r);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var i=t;do{e.insert(t===i?"."+n:"",i,e.sheet,!0),i=i.next}while(void 0!==i)}},Ue=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,je=ye(function(e){return Ue.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),Te=function(e){return"theme"!==e},qe=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?je:Te},Me=function(e,t,r){var n;if(t){var i=t.shouldForwardProp;n=e.__emotion_forwardProp&&i?function(t){return e.__emotion_forwardProp(t)&&i(t)}:i}return"function"!=typeof n&&r&&(n=e.__emotion_forwardProp),n},Be=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return $e(t,r,n),Oe(function(){return Le(t,r,n)}),null},Ie=function e(t,r){var n,i,o=t.__emotion_real===t,a=o&&t.__emotion_base||t;void 0!==r&&(n=r.label,i=r.target);var s=Me(t,r,o),c=s||qe(a),u=!c("as");return function(){var l=arguments,h=o&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==n&&h.push("label:"+n+";"),null==l[0]||void 0===l[0].raw)h.push.apply(h,l);else{var p=l[0];h.push(p[0]);for(var f=l.length,d=1;d<f;d++)h.push(l[d],p[d])}var g=(0,de.withEmotionCache)(function(e,t,r){var n=u&&e.as||a,o="",l=[],p=e;if(null==e.theme){for(var f in p={},e)p[f]=e[f];p.theme=Se.useContext(de.ThemeContext)}"string"==typeof e.className?o=Ee(t.registered,l,e.className):null!=e.className&&(o=e.className+" ");var d=Pe(h.concat(l),t.registered,p);o+=t.key+"-"+d.name,void 0!==i&&(o+=" "+i);var g=u&&void 0===s?qe(n):c,y={};for(var m in e)u&&"as"===m||g(m)&&(y[m]=e[m]);return y.className=o,r&&(y.ref=r),Se.createElement(Se.Fragment,null,Se.createElement(Be,{cache:t,serialized:d,isStringTag:"string"==typeof n}),Se.createElement(n,y))});return g.displayName=void 0!==n?n:"Styled("+("string"==typeof a?a:a.displayName||a.name||"Component")+")",g.defaultProps=t.defaultProps,g.__emotion_real=g,g.__emotion_base=a,g.__emotion_styles=h,g.__emotion_forwardProp=s,Object.defineProperty(g,"toString",{value:function(){return"."+i}}),g.withComponent=function(t,n){return e(t,fe({},r,n,{shouldForwardProp:Me(g,n,!0)})).apply(void 0,h)},g}},De=c(7434),ze=c.n(De),We=c(7125),Ne=c(6171),He=c(1085),Ke=function(){function e(e){var t=this;this._insertTag=function(e){var r;r=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,r),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var r=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{r.insertRule(e,r.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),Ge=Math.abs,Je=String.fromCharCode,Ye=Object.assign;function Ve(e){return e.trim()}function Xe(e,t,r){return e.replace(t,r)}function Ze(e,t){return e.indexOf(t)}function Qe(e,t){return 0|e.charCodeAt(t)}function et(e,t,r){return e.slice(t,r)}function tt(e){return e.length}function rt(e){return e.length}function nt(e,t){return t.push(e),e}var it=1,ot=1,at=0,st=0,ct=0,ut="";function lt(e,t,r,n,i,o,a){return{value:e,root:t,parent:r,type:n,props:i,children:o,line:it,column:ot,length:a,return:""}}function ht(e,t){return Ye(lt("",null,null,"",null,null,0),e,{length:-e.length},t)}function pt(){return ct=st>0?Qe(ut,--st):0,ot--,10===ct&&(ot=1,it--),ct}function ft(){return ct=st<at?Qe(ut,st++):0,ot++,10===ct&&(ot=1,it++),ct}function dt(){return Qe(ut,st)}function gt(){return st}function yt(e,t){return et(ut,e,t)}function mt(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function vt(e){return it=ot=1,at=tt(ut=e),st=0,[]}function bt(e){return ut="",e}function wt(e){return Ve(yt(st-1,kt(91===e?e+2:40===e?e+1:e)))}function xt(e){for(;(ct=dt())&&ct<33;)ft();return mt(e)>2||mt(ct)>3?"":" "}function _t(e,t){for(;--t&&ft()&&!(ct<48||ct>102||ct>57&&ct<65||ct>70&&ct<97););return yt(e,gt()+(t<6&&32==dt()&&32==ft()))}function kt(e){for(;ft();)switch(ct){case e:return st;case 34:case 39:34!==e&&39!==e&&kt(ct);break;case 40:41===e&&kt(e);break;case 92:ft()}return st}function Rt(e,t){for(;ft()&&e+ct!==57&&(e+ct!==84||47!==dt()););return"/*"+yt(t,st-1)+"*"+Je(47===e?e:ft())}function At(e){for(;!mt(dt());)ft();return yt(e,st)}var Pt="-ms-",St="-moz-",Ct="-webkit-",Ft="comm",Ot="rule",Et="decl",$t="@keyframes";function Lt(e,t){for(var r="",n=rt(e),i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}function Ut(e,t,r,n){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case Et:return e.return=e.return||e.value;case Ft:return"";case $t:return e.return=e.value+"{"+Lt(e.children,n)+"}";case Ot:e.value=e.props.join(",")}return tt(r=Lt(e.children,n))?e.return=e.value+"{"+r+"}":""}function jt(e){return bt(Tt("",null,null,null,[""],e=vt(e),0,[0],e))}function Tt(e,t,r,n,i,o,a,s,c){for(var u=0,l=0,h=a,p=0,f=0,d=0,g=1,y=1,m=1,v=0,b="",w=i,x=o,_=n,k=b;y;)switch(d=v,v=ft()){case 40:if(108!=d&&58==Qe(k,h-1)){-1!=Ze(k+=Xe(wt(v),"&","&\f"),"&\f")&&(m=-1);break}case 34:case 39:case 91:k+=wt(v);break;case 9:case 10:case 13:case 32:k+=xt(d);break;case 92:k+=_t(gt()-1,7);continue;case 47:switch(dt()){case 42:case 47:nt(Mt(Rt(ft(),gt()),t,r),c);break;default:k+="/"}break;case 123*g:s[u++]=tt(k)*m;case 125*g:case 59:case 0:switch(v){case 0:case 125:y=0;case 59+l:-1==m&&(k=Xe(k,/\f/g,"")),f>0&&tt(k)-h&&nt(f>32?Bt(k+";",n,r,h-1):Bt(Xe(k," ","")+";",n,r,h-2),c);break;case 59:k+=";";default:if(nt(_=qt(k,t,r,u,l,i,s,b,w=[],x=[],h),o),123===v)if(0===l)Tt(k,t,_,_,w,o,h,s,x);else switch(99===p&&110===Qe(k,3)?100:p){case 100:case 108:case 109:case 115:Tt(e,_,_,n&&nt(qt(e,_,_,0,0,i,s,b,i,w=[],h),x),i,x,h,s,n?w:x);break;default:Tt(k,_,_,_,[""],x,0,s,x)}}u=l=f=0,g=m=1,b=k="",h=a;break;case 58:h=1+tt(k),f=d;default:if(g<1)if(123==v)--g;else if(125==v&&0==g++&&125==pt())continue;switch(k+=Je(v),v*g){case 38:m=l>0?1:(k+="\f",-1);break;case 44:s[u++]=(tt(k)-1)*m,m=1;break;case 64:45===dt()&&(k+=wt(ft())),p=dt(),l=h=tt(b=k+=At(gt())),v++;break;case 45:45===d&&2==tt(k)&&(g=0)}}return o}function qt(e,t,r,n,i,o,a,s,c,u,l){for(var h=i-1,p=0===i?o:[""],f=rt(p),d=0,g=0,y=0;d<n;++d)for(var m=0,v=et(e,h+1,h=Ge(g=a[d])),b=e;m<f;++m)(b=Ve(g>0?p[m]+" "+v:Xe(v,/&\f/g,p[m])))&&(c[y++]=b);return lt(e,t,r,0===i?Ot:s,c,u,l)}function Mt(e,t,r){return lt(e,t,r,Ft,Je(ct),et(e,2,-2),0)}function Bt(e,t,r,n){return lt(e,t,r,Et,et(e,0,n),et(e,n+1,-1),n)}var It=function(e,t,r){for(var n=0,i=0;n=i,i=dt(),38===n&&12===i&&(t[r]=1),!mt(i);)ft();return yt(e,st)},Dt=new WeakMap,zt=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Dt.get(r))&&!n){Dt.set(e,!0);for(var i=[],o=function(e,t){return bt(function(e,t){var r=-1,n=44;do{switch(mt(n)){case 0:38===n&&12===dt()&&(t[r]=1),e[r]+=It(st-1,t,r);break;case 2:e[r]+=wt(n);break;case 4:if(44===n){e[++r]=58===dt()?"&\f":"",t[r]=e[r].length;break}default:e[r]+=Je(n)}}while(n=ft());return e}(vt(e),t))}(t,i),a=r.props,s=0,c=0;s<o.length;s++)for(var u=0;u<a.length;u++,c++)e.props[c]=i[s]?o[s].replace(/&\f/g,a[u]):a[u]+" "+o[s]}}},Wt=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function Nt(e,t){switch(function(e,t){return 45^Qe(e,0)?(((t<<2^Qe(e,0))<<2^Qe(e,1))<<2^Qe(e,2))<<2^Qe(e,3):0}(e,t)){case 5103:return Ct+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ct+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ct+e+St+e+Pt+e+e;case 6828:case 4268:return Ct+e+Pt+e+e;case 6165:return Ct+e+Pt+"flex-"+e+e;case 5187:return Ct+e+Xe(e,/(\w+).+(:[^]+)/,Ct+"box-$1$2"+Pt+"flex-$1$2")+e;case 5443:return Ct+e+Pt+"flex-item-"+Xe(e,/flex-|-self/,"")+e;case 4675:return Ct+e+Pt+"flex-line-pack"+Xe(e,/align-content|flex-|-self/,"")+e;case 5548:return Ct+e+Pt+Xe(e,"shrink","negative")+e;case 5292:return Ct+e+Pt+Xe(e,"basis","preferred-size")+e;case 6060:return Ct+"box-"+Xe(e,"-grow","")+Ct+e+Pt+Xe(e,"grow","positive")+e;case 4554:return Ct+Xe(e,/([^-])(transform)/g,"$1"+Ct+"$2")+e;case 6187:return Xe(Xe(Xe(e,/(zoom-|grab)/,Ct+"$1"),/(image-set)/,Ct+"$1"),e,"")+e;case 5495:case 3959:return Xe(e,/(image-set\([^]*)/,Ct+"$1$`$1");case 4968:return Xe(Xe(e,/(.+:)(flex-)?(.*)/,Ct+"box-pack:$3"+Pt+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ct+e+e;case 4095:case 3583:case 4068:case 2532:return Xe(e,/(.+)-inline(.+)/,Ct+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(tt(e)-1-t>6)switch(Qe(e,t+1)){case 109:if(45!==Qe(e,t+4))break;case 102:return Xe(e,/(.+:)(.+)-([^]+)/,"$1"+Ct+"$2-$3$1"+St+(108==Qe(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Ze(e,"stretch")?Nt(Xe(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==Qe(e,t+1))break;case 6444:switch(Qe(e,tt(e)-3-(~Ze(e,"!important")&&10))){case 107:return Xe(e,":",":"+Ct)+e;case 101:return Xe(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ct+(45===Qe(e,14)?"inline-":"")+"box$3$1"+Ct+"$2$3$1"+Pt+"$2box$3")+e}break;case 5936:switch(Qe(e,t+11)){case 114:return Ct+e+Pt+Xe(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ct+e+Pt+Xe(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ct+e+Pt+Xe(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Ct+e+Pt+e+e}return e}var Ht=[function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case Et:e.return=Nt(e.value,e.length);break;case $t:return Lt([ht(e,{value:Xe(e.value,"@","@"+Ct)})],n);case Ot:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,function(t){switch(function(e){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return Lt([ht(e,{props:[Xe(t,/:(read-\w+)/,":-moz-$1")]})],n);case"::placeholder":return Lt([ht(e,{props:[Xe(t,/:(plac\w+)/,":"+Ct+"input-$1")]}),ht(e,{props:[Xe(t,/:(plac\w+)/,":-moz-$1")]}),ht(e,{props:[Xe(t,/:(plac\w+)/,Pt+"input-$1")]})],n)}return""})}}],Kt=function(e){var t=e.key;if("css"===t){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var n,i,o=e.stylisPlugins||Ht,a={},s=[];n=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),r=1;r<t.length;r++)a[t[r]]=!0;s.push(e)});var c,u,l,h,p=[Ut,(h=function(e){c.insert(e)},function(e){e.root||(e=e.return)&&h(e)})],f=(u=[zt,Wt].concat(o,p),l=rt(u),function(e,t,r,n){for(var i="",o=0;o<l;o++)i+=u[o](e,t,r,n)||"";return i});i=function(e,t,r,n){c=r,Lt(jt(e?e+"{"+t.styles+"}":t.styles),f),n&&(d.inserted[t.name]=!0)};var d={key:t,sheet:new Ke({key:t,container:n,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:i};return d.sheet.hydrate(s),d},Gt=Se.createContext("undefined"!=typeof HTMLElement?Kt({key:"css"}):null),Jt=(Gt.Provider,function(e){return(0,Se.forwardRef)(function(t,r){var n=(0,Se.useContext)(Gt);return e(t,n,r)})}),Yt=Se.createContext({}),Vt={}.hasOwnProperty,Xt="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Zt=function(e,t){var r={};for(var n in t)Vt.call(t,n)&&(r[n]=t[n]);return r[Xt]=e,r},Qt=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return $e(t,r,n),Oe(function(){return Le(t,r,n)}),null},er=Jt(function(e,t,r){var n=e.css;"string"==typeof n&&void 0!==t.registered[n]&&(n=t.registered[n]);var i=e[Xt],o=[n],a="";"string"==typeof e.className?a=Ee(t.registered,o,e.className):null!=e.className&&(a=e.className+" ");var s=Pe(o,void 0,Se.useContext(Yt));a+=t.key+"-"+s.name;var c={};for(var u in e)Vt.call(e,u)&&"css"!==u&&u!==Xt&&(c[u]=e[u]);return c.className=a,r&&(c.ref=r),Se.createElement(Se.Fragment,null,Se.createElement(Qt,{cache:t,serialized:s,isStringTag:"string"==typeof i}),Se.createElement(i,c))}),tr=(c(5985),He.Fragment,function(e,t,r){return Vt.call(t,"css")?He.jsx(er,Zt(e,t),r):He.jsx(e,t,r)}),rr=function(e,t,r){return Vt.call(t,"css")?He.jsxs(er,Zt(e,t),r):He.jsxs(e,t,r)};const nr=Ie(Ne.Icon,{target:"e1szyeam2",label:"LoginButtonIcon"})({name:"1gnqu05",styles:"margin-right:18px"}),ir=Ie("div",{target:"e1szyeam1",label:"ForkApprovalContainer"})({name:"13alw87",styles:"display:flex;flex-flow:column nowrap;justify-content:space-around;flex-grow:0.2"}),or=Ie("div",{target:"e1szyeam0",label:"ForkButtonsContainer"})({name:"125bg8c",styles:"display:flex;flex-flow:column nowrap;justify-content:space-around;align-items:center"});class ar extends Ce().Component{static propTypes={inProgress:ze().bool,config:ze().object.isRequired,onLogin:ze().func.isRequired,t:ze().func.isRequired,backend:ze().object};state={};componentDidMount(){ze().checkPropTypes(ar.propTypes,this.props,"prop","ForgejoAuthenticationPage");const{api_root:e,app_id:t=""}=this.props.config.backend,r=e?e.replace(/\/api\/[^/]+\/?$/,""):"";r?(this.auth=new We.PkceAuthenticator({base_url:r,auth_endpoint:"login/oauth/authorize",app_id:t,auth_token_endpoint:"login/oauth/access_token",auth_token_endpoint_content_type:"application/json; charset=utf-8"}),this.auth.completeAuth((e,t)=>{if(e)this.setState({loginError:e.toString()});else if(t){const{open_authoring:e=!1}=this.props.config.backend;if(e)return this.loginWithOpenAuthoring(t).then(()=>this.props.onLogin(t)).catch(e=>{this.setState({loginError:e&&e.toString?e.toString():String(e),findingFork:!1,requestingFork:!1})});this.props.onLogin(t)}})):this.setState({loginError:'Forgejo backend requires "api_root" to be set in the backend configuration.'})}getPermissionToFork=()=>new Promise((e,t)=>{this.setState({requestingFork:!0,approveFork:()=>{this.setState({requestingFork:!1}),e()},refuseFork:()=>{this.setState({requestingFork:!1}),t(new Error("User declined to create a fork"))}})});loginWithOpenAuthoring(e){const{backend:t}=this.props;if(!t){const e=new Error("Backend prop is required for open authoring login flow");return Promise.reject(e)}return this.setState({findingFork:!0}),t.authenticateWithFork({userData:e,getPermissionToFork:this.getPermissionToFork}).catch(e=>{throw console.error(e),e}).finally(()=>{this.setState({findingFork:!1,requestingFork:!1,approveFork:void 0,refuseFork:void 0})})}handleLogin=e=>{if(e.preventDefault(),!this.auth)return;const{open_authoring:t=!1}=this.props.config.backend;this.auth.authenticate({scope:"repository"},(e,r)=>{if(!e)return t?this.loginWithOpenAuthoring(r).then(()=>this.props.onLogin(r)).catch(e=>{this.setState({loginError:e&&e.toString?e.toString():String(e),findingFork:!1,requestingFork:!1})}):void this.props.onLogin(r);this.setState({loginError:e.toString()})})};renderLoginButton=()=>{const{inProgress:e,t}=this.props;return e||this.state.findingFork?t("auth.loggingIn"):rr(Ce().Fragment,{children:[tr(nr,{type:"forgejo"}),t("auth.loginWithForgejo")]})};getAuthenticationPageRenderArgs(){const{requestingFork:e}=this.state;if(e){const{approveFork:e,refuseFork:t}=this.state;return{renderPageContent:({LoginButton:r,TextButton:n,showAbortButton:i})=>rr(ir,{children:[tr("p",{children:"Open Authoring is enabled: we need to use a fork on your Forgejo account. (If a fork already exists, we'll use that.)"}),rr(or,{children:[tr(r,{onClick:e,children:"Fork the repo"}),i&&tr(n,{onClick:t,children:"Don't fork the repo"})]})]})}}return{renderButtonContent:this.renderLoginButton}}render(){const{config:e,t}=this.props,r=this.getAuthenticationPageRenderArgs();return tr(Ne.AuthenticationPage,{onLogin:this.handleLogin,loginDisabled:this.props.inProgress||this.state.findingFork||this.state.requestingFork,loginErrorMessage:this.state.loginError,logoUrl:e.logo_url,logo:e.logo,siteUrl:e.site_url,t,...r})}}const{fetchWithTimeout:sr}=x.unsentRequest,cr={ForgejoBackend:class{constructor(e,t={}){if(this.options={proxied:!1,API:null,useWorkflow:!1,initialWorkflowStatus:"",...t},!this.options.proxied&&(null===e.backend.repo||void 0===e.backend.repo))throw new Error('The Forgejo backend needs a "repo" in the backend configuration.');if(!e.backend.api_root)throw new Error('The Forgejo backend needs an "api_root" in the backend configuration when not proxied.');if(this.api=this.options.API||null,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=e.backend.branch?.trim()||"main",this.apiRoot=e.backend.api_root,this.token="",this.mediaFolder=e.media_folder,this.cmsLabelPrefix=e.backend.cms_label_prefix||"",this.initialWorkflowStatus=this.options.initialWorkflowStatus||"draft",this.lock=(0,x.asyncLock)()}isGitBackend(){return!0}async status(){return{auth:{status:await(this.api?.user().then(e=>!!e).catch(e=>(console.warn("[StaticCMS] Failed getting Forgejo user",e),!1)))||!1},api:{status:!0,statusPage:""}}}authComponent(){const e=e=>tr(ar,{...e,backend:this});return e.displayName="AuthenticationPage",e}async currentUser({token:e}){return this._currentUserPromise||(this._currentUserPromise=sr(`${this.apiRoot}/user`,{headers:{Authorization:`token ${e}`}}).then(e=>e.json())),this._currentUserPromise}async userIsOriginMaintainer({username:e,token:t}){const r=e||(await this.currentUser({token:t})).login;return this._userIsOriginMaintainerPromises=this._userIsOriginMaintainerPromises||{},this._userIsOriginMaintainerPromises[r]||(this._userIsOriginMaintainerPromises[r]=sr(`${this.apiRoot}/repos/${this.originRepo}/collaborators/${r}/permission`,{headers:{Authorization:`token ${t}`}}).then(e=>e.json()).then(({permission:e})=>"admin"===e||"write"===e)),this._userIsOriginMaintainerPromises[r]}async pollUntilForkExists({repo:e,token:t}){const r=Date.now();let n=250,i=!1;for(;!i&&Date.now()-r<6e4;){const r=await sr(`${this.apiRoot}${e}`,{headers:{Authorization:`token ${t}`}});if(r.ok)i=!0;else{if(404!==r.status)throw new Error(`Error while checking for fork existence: ${r.status} ${r.statusText}`);i=!1}i||(await new Promise(e=>setTimeout(e,n)),n=Math.min(2*n,2e3))}if(!i)throw new Error("Timed out waiting for fork to be created.")}async authenticateWithFork({userData:e,getPermissionToFork:t}){if(!this.openAuthoringEnabled)throw new Error("Cannot authenticate with fork; Open Authoring is turned off.");const r=e.token;if(this._currentUserPromise=void 0,this._userIsOriginMaintainerPromises={},!this.alwaysForkEnabled&&await this.userIsOriginMaintainer({token:r}))return this.repo=this.originRepo,this.useOpenAuthoring=!1,Promise.resolve();const n=await this.currentUser({token:r}),i=this.originRepo.split("/")[1];if(this.repo=`${n.login}/${i}`,this.useOpenAuthoring=!0,!this.options.API){const e=pe;this.api=new e({token:r,branch:this.branch,repo:this.repo,originRepo:this.originRepo,apiRoot:this.apiRoot,useOpenAuthoring:this.useOpenAuthoring,cmsLabelPrefix:this.cmsLabelPrefix,initialWorkflowStatus:this.initialWorkflowStatus})}if(await this.api.forkExists())return await this.api.mergeUpstream(),Promise.resolve();{await t();const e=await this.api.createFork();return this.pollUntilForkExists({repo:`/repos/${e.full_name}`,token:r})}}restoreUser(e){return this.openAuthoringEnabled?this.authenticateWithFork({userData:e,getPermissionToFork:()=>{}}).then(()=>this.authenticate(e)):this.authenticate(e)}async authenticate(e){this.token=e.token,this._currentUserPromise=void 0,this._userIsOriginMaintainerPromises={};const t=pe;this.api=new t({token:this.token,branch:this.branch,repo:this.repo,originRepo:this.originRepo,apiRoot:this.apiRoot,useOpenAuthoring:this.useOpenAuthoring,cmsLabelPrefix:this.cmsLabelPrefix,initialWorkflowStatus:this.initialWorkflowStatus});const r=await this.api.user();if(!await this.api.hasWriteAccess().catch(e=>{throw e.message=y`
|
|
3
|
+
Repo "${this.repo}" not found.
|
|
4
|
+
|
|
5
|
+
Please ensure the repo information is spelled correctly.
|
|
6
|
+
|
|
7
|
+
If the repo is private, make sure you're logged into a Forgejo account with access.
|
|
8
|
+
|
|
9
|
+
If your repo is under an organization, ensure the organization has granted access to Static
|
|
10
|
+
CMS.
|
|
11
|
+
`,e}))throw new Error("Your Forgejo user account does not have access to this repo.");return{name:r.full_name,login:r.login,email:r.email,avatar_url:r.avatar_url,token:e.token,useOpenAuthoring:this.useOpenAuthoring}}logout(){if(this.token=null,this._currentUserPromise=void 0,this._userIsOriginMaintainerPromises={},this.api&&this.api.reset&&"function"==typeof this.api.reset)return this.api.reset()}getToken(){return Promise.resolve(this.token)}getCursorAndFiles=(e,t)=>{const r=e.length,n=Math.ceil(e.length/20),i=[];return t>1&&(i.push("prev"),i.push("first")),t<n&&(i.push("next"),i.push("last")),{cursor:x.Cursor.create({actions:i,meta:{page:t,count:r,pageSize:20,pageCount:n},data:{files:e}}),files:e.slice(20*(t-1),20*t)}};async entriesByFolder(e,t,r){const n=this.api.originRepoURL;let i;const o=await(0,x.entriesByFolder)(()=>this.api.listFiles(e,{repoURL:n,depth:r}).then(e=>{const r=e.filter(e=>(0,x.filterByExtension)(e,t)),n=this.getCursorAndFiles(r,1);return i=n.cursor,n.files}),(e,t)=>this.api.readFile(e,t,{repoURL:n}),this.api.readFileMetadata.bind(this.api),ue);return o[x.CURSOR_COMPATIBILITY_SYMBOL]=i,o}async allEntriesByFolder(e,t,r){const n=this.api.originRepoURL;return await(0,x.entriesByFolder)(()=>this.api.listFiles(e,{repoURL:n,depth:r}).then(e=>e.filter(e=>(0,x.filterByExtension)(e,t))),(e,t)=>this.api.readFile(e,t,{repoURL:n}),this.api.readFileMetadata.bind(this.api),ue)}entriesByFiles(e){const t=this.useOpenAuthoring?this.api.originRepoURL:this.api.repoURL;return(0,x.entriesByFiles)(e,(e,r)=>this.api.readFile(e,r,{repoURL:t}).catch(()=>""),this.api.readFileMetadata.bind(this.api),ue)}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:r,path:n,type:i})=>({id:e,name:t,size:r,displayURL:{id:e,path:n},path:n,isDirectory:"tree"===i}))):[]}async getMediaFile(e){const t=await(0,x.getMediaAsBlob)(e,null,this.api.readFile.bind(this.api)),r=(0,x.basename)(e),n=(0,x.blobToFileObj)(r,t),i=URL.createObjectURL(n);return{id:await(0,x.getBlobSHA)(t),displayURL:i,path:e,name:r,size:n.size,file:n,url:i}}getMediaDisplayURL(e){return this._mediaDisplayURLSem=this._mediaDisplayURLSem||w()(10),(0,x.getMediaDisplayURL)(e,this.api.readFile.bind(this.api),this._mediaDisplayURLSem)}persistEntry(e,t){return(0,x.runWithLock)(this.lock,()=>{if(t.useWorkflow){const r=e.dataFiles[0].slug,n=t.collectionName,i=[...e.dataFiles,...e.assets];return this.api.editorialWorkflowGit(i,r,n,t)}return 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:r,path:n,fileObj:i}=e,o=URL.createObjectURL(i);return{id:r,name:i.name,size:i.size,displayURL:o,path:v()(n,"/")}}catch(e){throw console.error(e),e}}async deleteFiles(e,t){await this.api.deleteFiles(e,t)}async traverseCursor(e,t){const r=e.meta,n=e.data.get("files").toJS();let i;switch(t){case"first":default:i=this.getCursorAndFiles(n,1);break;case"last":i=this.getCursorAndFiles(n,r.get("pageCount"));break;case"next":i=this.getCursorAndFiles(n,r.get("page")+1);break;case"prev":i=this.getCursorAndFiles(n,r.get("page")-1)}return{entries:await(0,x.entriesByFiles)(i.files,(e,t)=>this.api.readFile(e,t,{repoURL:this.api.originRepoURL}).catch(()=>""),this.api.readFileMetadata.bind(this.api),ue),cursor:i.cursor}}async unpublishedEntries(){return await(0,x.unpublishedEntries)(()=>this.api.listUnpublishedBranches().then(e=>e.map(e=>(0,x.contentKeyFromBranch)(e))))}async unpublishedEntry({id:e,collection:t,slug:r}){if(e)return await this.api.retrieveUnpublishedEntryData(e);if(t&&r){const e=this.api.generateContentKey(t,r);return await this.api.retrieveUnpublishedEntryData(e)}throw new Error("Missing unpublished entry id or collection and slug")}async unpublishedEntryDataFile(e,t,r,n){const i=this.api.generateContentKey(e,t),o=(0,x.branchFromContentKey)(i);return await this.api.readFile(r,n,{branch:o})}async unpublishedEntryMediaFile(e,t,r,n){const i=this.api.generateContentKey(e,t),o=(0,x.branchFromContentKey)(i),a=await this.api.readFile(r,n,{branch:o,parseText:!1}),s=(0,x.basename)(r),c=(0,x.blobToFileObj)(s,a);return{id:n,name:s,path:r,size:c.size,displayURL:URL.createObjectURL(c),file:c}}updateUnpublishedEntryStatus(e,t,r){return(0,x.runWithLock)(this.lock,()=>this.api.updateUnpublishedEntryStatus(e,t,r),"Failed to acquire update entry status lock")}publishUnpublishedEntry(e,t){return(0,x.runWithLock)(this.lock,()=>this.api.publishUnpublishedEntry(e,t),"Failed to acquire publish entry lock")}deleteUnpublishedEntry(e,t){return(0,x.runWithLock)(this.lock,()=>this.api.deleteUnpublishedEntry(e,t),"Failed to acquire delete entry lock")}async getDeployPreview(){return null}},API:pe,AuthenticationPage:ar}})(),u=u.DecapCmsBackendForgejo,u})());
|
|
12
|
+
//# sourceMappingURL=decap-cms-backend-forgejo.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/** @license React v16.13.1
|
|
12
|
+
* react-is.production.min.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/
|