",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=c.createElement(n,{is:r.is}):(e=c.createElement(n),"select"===n&&(c=e,r.multiple?c.multiple=!0:r.size&&(c.size=r.size))):e=c.createElementNS(e,n),e[rV]=t,e[rW]=r,a(e,t,!1,!1),t.stateNode=e;e:{switch(c=eD(n,r),n){case"dialog":rg("cancel",e),rg("close",e),i=r;break;case"iframe":case"object":case"embed":rg("load",e),i=r;break;case"video":case"audio":for(i=0;iow&&(t.flags|=128,r=!0,iV(u,!1),t.lanes=4194304)}}else{if(!r){if(null!==(e=lc(c))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),iV(u,!0),null===u.tail&&"hidden"===u.tailMode&&!c.alternate&&!aC)return iW(t),null}else 2*tn()-u.renderingStartTime>ow&&1073741824!==n&&(t.flags|=128,r=!0,iV(u,!1),t.lanes=4194304)}u.isBackwards?(c.sibling=t.child,t.child=c):(null!==(n=u.last)?n.sibling=c:t.child=c,u.last=c)}if(null!==u.tail)return t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=tn(),t.sibling=null,n=lu.current,r2(lu,r?1&n|2:1&n),t;return iW(t),null;case 22:case 23:return oB(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&0!=(1&t.mode)?0!=(1073741824&of)&&(iW(t),6&t.subtreeFlags&&(t.flags|=8192)):iW(t),null;case 24:case 25:return null}throw Error(d(156,t.tag))}(n,t,of))){ou=n;return}}else{if(null!==(n=function(e,t){switch(aw(t),t.tag){case 1:return r9(t.type)&&r7(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return li(),r1(r8),r1(r4),ld(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 5:return ls(t),null;case 13:if(r1(lu),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(d(340));aT()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return r1(lu),null;case 4:return li(),null;case 10:return aK(t.type._context),null;case 22:case 23:return oB(),null;default:return null}}(n,t))){n.flags&=32767,ou=n;return}if(null!==e)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{op=6,ou=null;return}}if(null!==(t=t.sibling)){ou=t;return}ou=t=e}while(null!==t)0===op&&(op=5)}function oG(e,t,n){var r=tS,a=oi.transition;try{oi.transition=null,tS=1,function(e,t,n,r){do oZ();while(null!==o_)if(0!=(6&oo))throw Error(d(327));n=e.finishedWork;var a=e.finishedLanes;if(null!==n){if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(d(177));e.callbackNode=null,e.callbackPriority=0;var l=n.lanes|n.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0r&&(a=r,r=l,l=a),a=nG(n,l);var i=nG(n,r);a&&i&&(1!==e.rangeCount||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&((t=t.createRange()).setStart(a.node,a.offset),e.removeAllRanges(),l>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;ne?16:e,null===o_)var r=!1;else{if(e=o_,o_=null,oL=0,0!=(6&oo))throw Error(d(331));var a=oo;for(oo|=4,iK=e.current;null!==iK;){var l=iK,i=l.child;if(0!=(16&iK.flags)){var o=l.deletions;if(null!==o){for(var s=0;stn()-ok?oH(e,0):ov|=n),oI(e,t)}function o3(e,t){0===t&&(0==(1&e.mode)?t=1:(t=tg,0==(130023424&(tg<<=1))&&(tg=4194304)));var n=oT();null!==(e=a0(e,t))&&(tw(e,t,n),oI(e,n))}function o4(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),o3(e,n)}function o8(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;null!==a&&(n=a.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(d(314))}null!==r&&r.delete(t),o3(e,n)}function o5(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function o6(e,t,n,r){return new o5(e,t,n,r)}function o9(e){return!(!(e=e.prototype)||!e.isReactComponent)}function o7(e,t){var n=e.alternate;return null===n?((n=o6(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function se(e,t,n,r,a,l){var i=2;if(r=e,"function"==typeof e)o9(e)&&(i=1);else if("string"==typeof e)i=5;else e:switch(e){case O:return st(n.children,a,l,t);case z:i=8,a|=8;break;case R:return(e=o6(12,n,t,2|a)).elementType=R,e.lanes=l,e;case I:return(e=o6(13,n,t,a)).elementType=I,e.lanes=l,e;case $:return(e=o6(19,n,t,a)).elementType=$,e.lanes=l,e;case U:return sn(n,a,l,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case T:i=10;break e;case F:i=9;break e;case D:i=11;break e;case M:i=14;break e;case j:i=16,r=null;break e}throw Error(d(130,null==e?e:typeof e,""))}return(t=o6(i,n,t,a)).elementType=e,t.type=r,t.lanes=l,t}function st(e,t,n,r){return(e=o6(7,e,r,t)).lanes=n,e}function sn(e,t,n,r){return(e=o6(22,e,r,t)).elementType=U,e.lanes=n,e.stateNode={isHidden:!1},e}function sr(e,t,n){return(e=o6(6,e,null,t)).lanes=n,e}function sa(e,t,n){return(t=o6(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function sl(e,t,n,r,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=tk(0),this.expirationTimes=tk(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tk(0),this.identifierPrefix=r,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function si(e,t,n,r,a,l,i,o,s){return e=new sl(e,t,n,o,s),1===t?(t=1,!0===l&&(t|=8)):t=0,l=o6(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},a2(l),e}function so(e){if(!e)return r3;e=e._reactInternals;e:{if(e4(e)!==e||1!==e.tag)throw Error(d(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(r9(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t)throw Error(d(171))}if(1===e.tag){var n=e.type;if(r9(n))return at(e,n,t)}return t}function ss(e,t,n,r,a,l,i,o,s){return(e=si(n,r,!0,e,a,l,i,o,s)).context=so(null),n=e.current,(l=a4(r=oT(),a=oF(n))).callback=null!=t?t:null,a8(n,l,a),e.current.lanes=a,tw(e,a,r),oI(e,r),e}function su(e,t,n,r){var a=t.current,l=oT(),i=oF(a);return n=so(n),null===t.context?t.context=n:t.pendingContext=n,(t=a4(l,i)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=a8(a,t,i))&&(oD(e,a,i,l),a5(e,a,i)),i}function sc(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function sf(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n>>1,a=e[r];if(0>>1;ri(s,n))ui(c,s)?(e[r]=c,e[u]=n,r=u):(e[r]=s,e[o]=n,r=o);else if(ui(c,n))e[r]=c,e[u]=n,r=u;else break}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(e(t.exports,"unstable_now",()=>o,e=>o=e),e(t.exports,"unstable_IdlePriority",()=>s,e=>s=e),e(t.exports,"unstable_ImmediatePriority",()=>u,e=>u=e),e(t.exports,"unstable_LowPriority",()=>c,e=>c=e),e(t.exports,"unstable_NormalPriority",()=>f,e=>f=e),e(t.exports,"unstable_Profiling",()=>d,e=>d=e),e(t.exports,"unstable_UserBlockingPriority",()=>p,e=>p=e),e(t.exports,"unstable_cancelCallback",()=>h,e=>h=e),e(t.exports,"unstable_continueExecution",()=>g,e=>g=e),e(t.exports,"unstable_forceFrameRate",()=>m,e=>m=e),e(t.exports,"unstable_getCurrentPriorityLevel",()=>v,e=>v=e),e(t.exports,"unstable_getFirstCallbackNode",()=>y,e=>y=e),e(t.exports,"unstable_next",()=>b,e=>b=e),e(t.exports,"unstable_pauseExecution",()=>k,e=>k=e),e(t.exports,"unstable_requestPaint",()=>w,e=>w=e),e(t.exports,"unstable_runWithPriority",()=>x,e=>x=e),e(t.exports,"unstable_scheduleCallback",()=>S,e=>S=e),e(t.exports,"unstable_shouldYield",()=>C,e=>C=e),e(t.exports,"unstable_wrapCallback",()=>E,e=>E=e),"object"==typeof performance&&"function"==typeof performance.now){var o,s,u,c,f,d,p,h,g,m,v,y,b,k,w,x,S,C,E,N,_=performance;o=function(){return _.now()}}else{var L=Date,P=L.now();o=function(){return L.now()-P}}var O=[],z=[],R=1,T=null,F=3,D=!1,I=!1,$=!1,M="function"==typeof setTimeout?setTimeout:null,j="function"==typeof clearTimeout?clearTimeout:null,U="undefined"!=typeof setImmediate?setImmediate:null;function A(e){for(var t=a(z);null!==t;){if(null===t.callback)l(z);else if(t.startTime<=e)l(z),t.sortIndex=t.expirationTime,r(O,t);else break;t=a(z)}}function V(e){if($=!1,A(e),!I){if(null!==a(O))I=!0,Z(W);else{var t=a(z);null!==t&&ee(V,t.startTime-e)}}}function W(e,t){I=!1,$&&($=!1,j(Q),Q=-1),D=!0;var n=F;try{for(A(t),T=a(O);null!==T&&(!(T.expirationTime>t)||e&&!J());){var r=T.callback;if("function"==typeof r){T.callback=null,F=T.priorityLevel;var i=r(T.expirationTime<=t);t=o(),"function"==typeof i?T.callback=i:T===a(O)&&l(O),A(t)}else l(O);T=a(O)}if(null!==T)var s=!0;else{var u=a(z);null!==u&&ee(V,u.startTime-t),s=!1}return s}finally{T=null,F=n,D=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var B=!1,H=null,Q=-1,K=5,q=-1;function J(){return!(o()-qe||125l?(e.sortIndex=n,r(z,e),null===a(O)&&e===a(z)&&($?(j(Q),Q=-1):$=!0,ee(V,n-l))):(e.sortIndex=i,r(O,e),I||D||(I=!0,Z(W))),e},C=J,E=function(e){var t=F;return function(){var n=F;F=t;try{return e.apply(this,arguments)}finally{F=n}}}});var s=i("1Fezf"),u={};u=i("klg1o");var s=i("1Fezf");let c={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class f{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||c,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=Array(e),n=0;n{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r{let[t,r]=e;for(let e=0;e{let[r,a]=t;for(let t=0;t{e=n,t=r});return n.resolve=e,n.reject=t,n}function g(e){return null==e?"":""+e}let m=/###/g;function v(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(m,"."):e}function a(){return!e||"string"==typeof e}let l="string"!=typeof t?t:t.split("."),i=0;for(;i":">",'"':""","'":"'","/":"/"};function x(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,e=>w[e]):e}let S=[" ",",","?","!",";"],C=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(void 0!==t)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20);function E(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t])return e[t];let r=t.split(n),a=e;for(let e=0;e-1&&i0?e.replace("_","-"):e}class _ extends p{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){let r,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},l=void 0!==a.keySeparator?a.keySeparator:this.options.keySeparator,i=void 0!==a.ignoreJSONStructure?a.ignoreJSONStructure:this.options.ignoreJSONStructure;e.indexOf(".")>-1?r=e.split("."):(r=[e,t],n&&(Array.isArray(n)?r.push(...n):"string"==typeof n&&l?r.push(...n.split(l)):r.push(n)));let o=b(this.data,r);return(!o&&!t&&!n&&e.indexOf(".")>-1&&(e=r[0],t=r[1],n=r.slice(2).join(".")),o||!i||"string"!=typeof n)?o:E(this.data&&this.data[e]&&this.data[e][t],n,l)}addResource(e,t,n,r){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},l=void 0!==a.keySeparator?a.keySeparator:this.options.keySeparator,i=[e,t];n&&(i=i.concat(l?n.split(l):n)),e.indexOf(".")>-1&&(i=e.split("."),r=t,t=i[1]),this.addNamespaces(t),y(this.data,i,r),a.silent||this.emit("added",e,t,n,r)}addResources(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(let r in n)("string"==typeof n[r]||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,a){let l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1,skipCopy:!1},i=[e,t];e.indexOf(".")>-1&&(i=e.split("."),r=n,n=t,t=i[1]),this.addNamespaces(t);let o=b(this.data,i)||{};l.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?function e(t,n,r){for(let a in n)"__proto__"!==a&&"constructor"!==a&&(a in t?"string"==typeof t[a]||t[a]instanceof String||"string"==typeof n[a]||n[a]instanceof String?r&&(t[a]=n[a]):e(t[a],n[a],r):t[a]=n[a]);return t}(o,n,a):o={...o,...n},y(this.data,i,o),l.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return(t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI)?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var L={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,a){return e.forEach(e=>{this.processors[e]&&(t=this.processors[e].process(t,n,r,a))}),t}};let P={};class O extends p{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),function(e,t,n){e.forEach(e=>{t[e]&&(n[e]=t[e])})}(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=d.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;let n=this.resolve(e,t);return n&&void 0!==n.res}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");let r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,a=t.ns||this.options.defaultNS||[],l=n&&e.indexOf(n)>-1,i=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!function(e,t,n){t=t||"",n=n||"";let r=S.filter(e=>0>t.indexOf(e)&&0>n.indexOf(e));if(0===r.length)return!0;let a=C.getRegExp(`(${r.map(e=>"?"===e?"\\?":e).join("|")})`),l=!a.test(e);if(!l){let t=e.indexOf(n);t>0&&!a.test(e.substring(0,t))&&(l=!0)}return l}(e,n,r);if(l&&!i){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:a};let l=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(l[0])>-1)&&(a=l.shift()),e=l.join(r)}return"string"==typeof a&&(a=[a]),{key:e,namespaces:a}}translate(e,t,n){if("object"!=typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof t&&(t={...t}),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);let r=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,a=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:l,namespaces:i}=this.extractFromKey(e[e.length-1],t),o=i[i.length-1],s=t.lng||this.language,u=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(s&&"cimode"===s.toLowerCase()){if(u){let e=t.nsSeparator||this.options.nsSeparator;return r?{res:`${o}${e}${l}`,usedKey:l,exactUsedKey:l,usedLng:s,usedNS:o,usedParams:this.getUsedParamsDetails(t)}:`${o}${e}${l}`}return r?{res:l,usedKey:l,exactUsedKey:l,usedLng:s,usedNS:o,usedParams:this.getUsedParamsDetails(t)}:l}let c=this.resolve(e,t),f=c&&c.res,d=c&&c.usedKey||l,p=c&&c.exactUsedKey||l,h=Object.prototype.toString.apply(f),g=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,m=!this.i18nFormat||this.i18nFormat.handleAsObject,v="string"!=typeof f&&"boolean"!=typeof f&&"number"!=typeof f;if(m&&f&&v&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(h)&&!("string"==typeof g&&Array.isArray(f))){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(d,f,{...t,ns:i}):`key '${l} (${this.language})' returned an object instead of string.`;return r?(c.res=e,c.usedParams=this.getUsedParamsDetails(t),c):e}if(a){let e=Array.isArray(f),n=e?[]:{},r=e?p:d;for(let e in f)if(Object.prototype.hasOwnProperty.call(f,e)){let l=`${r}${a}${e}`;n[e]=this.translate(l,{...t,joinArrays:!1,ns:i}),n[e]===l&&(n[e]=f[e])}f=n}}else if(m&&"string"==typeof g&&Array.isArray(f))(f=f.join(g))&&(f=this.extendTranslation(f,e,t,n));else{let r=!1,i=!1,u=void 0!==t.count&&"string"!=typeof t.count,d=O.hasDefaultValue(t),p=u?this.pluralResolver.getSuffix(s,t.count,t):"",h=t.ordinal&&u?this.pluralResolver.getSuffix(s,t.count,{ordinal:!1}):"",g=u&&!t.ordinal&&0===t.count&&this.pluralResolver.shouldUseIntlApi(),m=g&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${p}`]||t[`defaultValue${h}`]||t.defaultValue;!this.isValidLookup(f)&&d&&(r=!0,f=m),this.isValidLookup(f)||(i=!0,f=l);let v=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&i?void 0:f,y=d&&m!==f&&this.options.updateMissing;if(i||r||y){if(this.logger.log(y?"updateKey":"missingKey",s,o,l,y?m:f),a){let e=this.resolve(l,{...t,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[],n=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&n&&n[0])for(let t=0;t{let a=d&&r!==f?r:v;this.options.missingKeyHandler?this.options.missingKeyHandler(e,o,n,a,y,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(e,o,n,a,y,t),this.emit("missingKey",e,o,n,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&u?e.forEach(e=>{let n=this.pluralResolver.getSuffixes(e,t);g&&t[`defaultValue${this.options.pluralSeparator}zero`]&&0>n.indexOf(`${this.options.pluralSeparator}zero`)&&n.push(`${this.options.pluralSeparator}zero`),n.forEach(n=>{r([e],l+n,t[`defaultValue${n}`]||m)})}):r(e,l,m))}f=this.extendTranslation(f,e,t,c,n),i&&f===l&&this.options.appendNamespaceToMissingKey&&(f=`${o}:${l}`),(i||r)&&this.options.parseMissingKeyHandler&&(f="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${o}:${l}`:l,r?f:void 0):this.options.parseMissingKeyHandler(f))}return r?(c.res=f,c.usedParams=this.getUsedParamsDetails(t),c):f}extendTranslation(e,t,n,r,a){var l=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){let i;n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let o="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(o){let t=e.match(this.interpolator.nestingRegexp);i=t&&t.length}let s=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language,n),o){let t=e.match(this.interpolator.nestingRegexp);i<(t&&t.length)&&(n.nest=!1)}!n.lng&&"v1"!==this.options.compatibilityAPI&&r&&r.res&&(n.lng=r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,function(){for(var e=arguments.length,r=Array(e),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(t))return;let o=this.extractFromKey(e,i),s=o.key;n=s;let u=o.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));let c=void 0!==i.count&&"string"!=typeof i.count,f=c&&!i.ordinal&&0===i.count&&this.pluralResolver.shouldUseIntlApi(),d=void 0!==i.context&&("string"==typeof i.context||"number"==typeof i.context)&&""!==i.context,p=i.lngs?i.lngs:this.languageUtils.toResolveHierarchy(i.lng||this.language,i.fallbackLng);u.forEach(e=>{this.isValidLookup(t)||(l=e,!P[`${p[0]}-${e}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(l)&&(P[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${p.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(n=>{let l;if(this.isValidLookup(t))return;a=n;let o=[s];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(o,s,n,e,i);else{let e;c&&(e=this.pluralResolver.getSuffix(n,i.count,i));let t=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(o.push(s+e),i.ordinal&&0===e.indexOf(r)&&o.push(s+e.replace(r,this.options.pluralSeparator)),f&&o.push(s+t)),d){let n=`${s}${this.options.contextSeparator}${i.context}`;o.push(n),c&&(o.push(n+e),i.ordinal&&0===e.indexOf(r)&&o.push(n+e.replace(r,this.options.pluralSeparator)),f&&o.push(n+t))}}for(;l=o.pop();)this.isValidLookup(t)||(r=l,t=this.getResource(n,e,l,i))}))})}),{res:t,usedKey:n,exactUsedKey:r,usedLng:a,usedNS:l}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.replace&&"string"!=typeof e.replace,n=t?e.replace:e;if(t&&void 0!==e.count&&(n.count=e.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!t)for(let e of(n={...n},["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"]))delete n[e];return n}static hasDefaultValue(e){let t="defaultValue";for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}function z(e){return e.charAt(0).toUpperCase()+e.slice(1)}class R{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=d.create("languageUtils")}getScriptPartFromCode(e){if(!(e=N(e))||0>e.indexOf("-"))return null;let t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase())?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(!(e=N(e))||0>e.indexOf("-"))return e;let t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if("string"==typeof e&&e.indexOf("-")>-1){let t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map(e=>e.toLowerCase()):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=z(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=z(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=z(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){let t;return e?(e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(e=>{if(e===n||!(0>e.indexOf("-")&&0>n.indexOf("-"))&&(e.indexOf("-")>0&&0>n.indexOf("-")&&e.substring(0,e.indexOf("-"))===n||0===e.indexOf(n)&&n.length>1))return e})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],a=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return"string"==typeof e&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&a(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&a(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&a(this.getLanguagePartFromCode(e))):"string"==typeof e&&a(this.formatLanguageCode(e)),n.forEach(e=>{0>r.indexOf(e)&&a(this.formatLanguageCode(e))}),r}}let T=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],F={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},D=["v1","v2","v3"],I=["v4"],$={zero:0,one:1,two:2,few:3,many:4,other:5};class M{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=d.create("pluralResolver"),(!this.options.compatibilityJSON||I.includes(this.options.compatibilityJSON))&&("undefined"==typeof Intl||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=function(){let e={};return T.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:F[t.fc]}})}),e}()}addRule(e,t){this.rules[e]=t}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(N("dev"===e?"en":e),{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((e,t)=>$[e]-$[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):n.numbers.map(n=>this.getSuffix(e,n,t)):[]}getSuffix(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:this.getSuffixRetroCompatible(r,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){let n=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),r=e.numbers[n];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===r?r="plural":1===r&&(r=""));let a=()=>this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString();return"v1"===this.options.compatibilityJSON?1===r?"":"number"==typeof r?`_plural_${r.toString()}`:a():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?a():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!D.includes(this.options.compatibilityJSON)}}function j(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",a=!(arguments.length>4)||void 0===arguments[4]||arguments[4],l=function(e,t,n){let r=b(e,n);return void 0!==r?r:b(t,n)}(e,t,n);return!l&&a&&"string"==typeof n&&void 0===(l=E(e,n,r))&&(l=E(t,n,r)),l}class U{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=d.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:a,prefixEscaped:l,suffix:i,suffixEscaped:o,formatSeparator:s,unescapeSuffix:u,unescapePrefix:c,nestingPrefix:f,nestingPrefixEscaped:d,nestingSuffix:p,nestingSuffixEscaped:h,nestingOptionsSeparator:g,maxReplaces:m,alwaysFormat:v}=e.interpolation;this.escape=void 0!==t?t:x,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=a?k(a):l||"{{",this.suffix=i?k(i):o||"}}",this.formatSeparator=s||",",this.unescapePrefix=u?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=f?k(f):d||k("$t("),this.nestingSuffix=p?k(p):h||k(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==v&&v,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e&&e.source===t?(e.lastIndex=0,e):RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let a,l,i;let o=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function s(e){return e.replace(/\$/g,"$$$$")}let u=e=>{if(0>e.indexOf(this.formatSeparator)){let a=j(t,o,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(a,void 0,n,{...r,...t,interpolationkey:e}):a}let a=e.split(this.formatSeparator),l=a.shift().trim(),i=a.join(this.formatSeparator).trim();return this.format(j(t,o,l,this.options.keySeparator,this.options.ignoreJSONStructure),i,n,{...r,...t,interpolationkey:l})};this.resetRegExp();let c=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,f=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>s(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?s(this.escape(e)):s(e)}].forEach(t=>{for(i=0;a=t.regex.exec(e);){let n=a[1].trim();if(void 0===(l=u(n))){if("function"==typeof c){let t=c(e,a,r);l="string"==typeof t?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))l="";else if(f){l=a[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),l=""}else"string"==typeof l||this.useRawValueToEscape||(l=g(l));let o=t.safeValue(l);if(e=e.replace(a[0],o),f?(t.regex.lastIndex+=l.length,t.regex.lastIndex-=a[0].length):t.regex.lastIndex=0,++i>=this.maxReplaces)break}}),e}nest(e,t){let n,r,a,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function i(e,t){let n=this.nestingOptionsSeparator;if(0>e.indexOf(n))return e;let r=e.split(RegExp(`${n}[ ]*{`)),l=`{${r[1]}`;e=r[0];let i=(l=this.interpolate(l,a)).match(/'/g),o=l.match(/"/g);(i&&i.length%2==0&&!o||o.length%2!=0)&&(l=l.replace(/'/g,'"'));try{a=JSON.parse(l),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${l}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e}for(;n=this.nestingRegexp.exec(e);){let o=[];(a=(a={...l}).replace&&"string"!=typeof a.replace?a.replace:a).applyPostProcessor=!1,delete a.defaultValue;let s=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){let e=n[1].split(this.formatSeparator).map(e=>e.trim());n[1]=e.shift(),o=e,s=!0}if((r=t(i.call(this,n[1].trim(),a),a))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=g(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),r=""),s&&(r=o.reduce((e,t)=>this.format(e,t,l.lng,{...l,interpolationkey:n[1].trim()}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}function A(e){let t={};return function(n,r,a){let l=r+JSON.stringify(a),i=t[l];return i||(i=e(N(r),a),t[l]=i),i(n)}}class V{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=d.create("formatter"),this.options=e,this.formats={number:A((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:A((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:A((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:A((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:A((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})},this.init(e)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=t.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=A(t)}format(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t.split(this.formatSeparator).reduce((e,t)=>{let{formatName:a,formatOptions:l}=function(e){let t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){let r=e.split("(");t=r[0].toLowerCase().trim();let a=r[1].substring(0,r[1].length-1);"currency"===t&&0>a.indexOf(":")?n.currency||(n.currency=a.trim()):"relativetime"===t&&0>a.indexOf(":")?n.range||(n.range=a.trim()):a.split(";").forEach(e=>{if(e){let[t,...r]=e.split(":"),a=r.join(":").trim().replace(/^'+|'+$/g,""),l=t.trim();n[l]||(n[l]=a),"false"===a&&(n[l]=!1),"true"===a&&(n[l]=!0),isNaN(a)||(n[l]=parseInt(a,10))}})}return{formatName:t,formatOptions:n}}(t);if(this.formats[a]){let t=e;try{let i=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},o=i.locale||i.lng||r.locale||r.lng||n;t=this.formats[a](e,o,{...l,...r,...i})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${a}`),e},e)}}class W extends p{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=d.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,r.backend,r)}queueLoad(e,t,n,r){let a={},l={},i={},o={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let i=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[i]=2:this.state[i]<0||(1===this.state[i]?void 0===l[i]&&(l[i]=!0):(this.state[i]=1,r=!1,void 0===l[i]&&(l[i]=!0),void 0===a[i]&&(a[i]=!0),void 0===o[t]&&(o[t]=!0)))}),r||(i[e]=!0)}),(Object.keys(a).length||Object.keys(l).length)&&this.queue.push({pending:l,pendingCount:Object.keys(l).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(a),pending:Object.keys(l),toLoadLanguages:Object.keys(i),toLoadNamespaces:Object.keys(o)}}loaded(e,t,n){let r=e.split("|"),a=r[0],l=r[1];t&&this.emit("failedLoading",a,l,t),n&&this.store.addResourceBundle(a,l,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2;let i={};this.queue.forEach(n=>{(function(e,t,n,r){let{obj:a,k:l}=v(e,t,Object);a[l]=a[l]||[],a[l].push(n)})(n.loaded,[a],l),void 0!==n.pending[e]&&(delete n.pending[e],n.pendingCount--),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{i[e]||(i[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{void 0===i[e][t]&&(i[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",i),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,l=arguments.length>5?arguments[5]:void 0;if(!e.length)return l(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:a,callback:l});return}this.readingCalls++;let i=(i,o)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(i&&o&&r{this.read.call(this,e,t,n,r+1,2*a,l)},a);return}l(i,o)},o=this.backend[n].bind(this.backend);if(2===o.length){try{let n=o(e,t);n&&"function"==typeof n.then?n.then(e=>i(null,e)).catch(i):i(null,n)}catch(e){i(e)}return}return o(e,t,i)}prepareLoading(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);let a=this.queueLoad(e,t,n,r);if(!a.toLoad.length)return a.pending.length||r(),null;a.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e.split("|"),r=n[0],a=n[1];this.read(r,a,"read",void 0,void 0,(n,l)=>{n&&this.logger.warn(`${t}loading namespace ${a} for language ${r} failed`,n),!n&&l&&this.logger.log(`${t}loaded namespace ${a} for language ${r}`,l),this.loaded(e,n,l)})}saveMissing(e,t,n,r,a){let l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(null!=n&&""!==n){if(this.backend&&this.backend.create){let o={...l,isUpdate:a},s=this.backend.create.bind(this.backend);if(s.length<6)try{let a;(a=5===s.length?s(e,t,n,r,o):s(e,t,n,r))&&"function"==typeof a.then?a.then(e=>i(null,e)).catch(i):i(null,a)}catch(e){i(e)}else s(e,t,n,r,i,o)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}function B(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){let t={};if("object"==typeof e[1]&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function H(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&0>e.supportedLngs.indexOf("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function Q(){}class K extends p{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(super(),this.options=H(e),this.services={},this.logger=d,this.modules={external:[]},!function(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))})}(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:0>t.ns.indexOf("translation")&&(t.defaultNS=t.ns[0]));let r=B();function a(e){return e?"function"==typeof e?new e:e:null}if(this.options={...r,...this.options,...H(t)},"v1"!==this.options.compatibilityAPI&&(this.options.interpolation={...r.interpolation,...this.options.interpolation}),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){let t;this.modules.logger?d.init(a(this.modules.logger),this.options):d.init(null,this.options),this.modules.formatter?t=this.modules.formatter:"undefined"!=typeof Intl&&(t=V);let n=new R(this.options);this.store=new _(this.options.resources,this.options);let l=this.services;l.logger=d,l.resourceStore=this.store,l.languageUtils=n,l.pluralResolver=new M(n,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),t&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(l.formatter=a(t),l.formatter.init(l,this.options),this.options.interpolation.format=l.formatter.format.bind(l.formatter)),l.interpolator=new U(this.options),l.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},l.backendConnector=new W(a(this.modules.backend),l.resourceStore,l,this.options),l.backendConnector.on("*",function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),a=1;a1?n-1:0),a=1;a{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Q),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(t=>{this[t]=function(){return e.store[t](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(t=>{this[t]=function(){return e.store[t](...arguments),e}});let l=h(),i=()=>{let e=(e,t)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(t),n(e,t)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initImmediate?i():setTimeout(i,0),l}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Q,n=t,r="string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&"cimode"===r.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return n();let e=[],t=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&0>e.indexOf(t)&&e.push(t)})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload&&this.options.preload.forEach(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=h();return e||(e=this.languages),t||(t=this.options.ns),n||(n=Q),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&L.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let e=0;e-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;let r=h();this.emit("languageChanging",e);let a=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},l=(e,l)=>{l?(a(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,r.resolve(function(){return n.t(...arguments)}),t&&t(e,function(){return n.t(...arguments)})},i=t=>{e||t||!this.services.languageDetector||(t=[]);let n="string"==typeof t?t:this.services.languageUtils.getBestMatchFromCodes(t);n&&(this.language||a(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(n)),this.loadResources(n,e=>{l(e,n)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),r}getFixedT(e,t,n){var r=this;let a=function(e,t){let l,i;if("object"!=typeof t){for(var o=arguments.length,s=Array(o>2?o-2:0),u=2;u`${l.keyPrefix}${c}${e}`):l.keyPrefix?`${l.keyPrefix}${c}${e}`:e,r.t(i,l)};return"string"==typeof e?a.lng=e:a.lngs=e,a.ns=t,a.keyPrefix=n,a}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,a=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;let l=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return -1===n||2===n};if(t.precheck){let e=t.precheck(this,l);if(void 0!==e)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||l(n,e)&&(!r||l(a,e)))}loadNamespaces(e,t){let n=h();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach(e=>{0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=h();"string"==typeof e&&(e=[e]);let r=this.options.preload||[],a=e.filter(e=>0>r.indexOf(e)&&this.services.languageUtils.isSupportedCode(e));return a.length?(this.options.preload=r.concat(a),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){return(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),e)?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf((this.services&&this.services.languageUtils||new R(B())).getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr":"rtl"}static createInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new K(e,t)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Q,n=e.forkResourceStore;n&&delete e.forkResourceStore;let r={...this.options,...e,isClone:!0},a=new K(r);return(void 0!==e.debug||void 0!==e.prefix)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n&&(a.store=new _(this.store.data,r),a.services.resourceStore=a.store),a.translator=new O(a.services,r),a.translator.on("*",function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;rq.t),r=(e,t)=>Math.max(1,Math.floor((e-1)/t+1)),[a,l]=t(s).useState({page:1,total:r(e.data_list[0].items.length,e.page_size),action:e.data_list[0].action,data:e.data_list[0].items.slice(0,e.page_size)}),i=(t,n)=>{let a=e.data_list.filter(e=>e.action===t)[0].items;l({page:n,total:r(a.length,e.page_size),action:t,data:a.slice((n-1)*e.page_size,n*e.page_size)})};return(0,u.jsxs)(s.Fragment,{children:[e.quote&&(0,u.jsx)("blockquote",{children:(0,u.jsxs)("p",{children:[" ",e.quote]})}),e.data_list.length>1&&(0,u.jsx)("div",{className:"idouban-tabs",children:e.data_list.map(t=>(0,u.jsxs)("a",{className:`idouban-tab ${t.action===a.action?"idouban-tab-active":""}`,onClick:()=>i(t.action,1),rel:"external",children:[n(e.type+t.action[0].toUpperCase()+t.action.slice(1)),"(",t.items.length,")"]},t.action))}),a.data.map(t=>(0,u.jsxs)("div",{className:"idouban-item",children:[(0,u.jsx)("div",{className:"idouban-picture",children:(0,u.jsx)("img",{src:t.image,loading:"lazy"})}),(0,u.jsxs)("div",{className:"idouban-info",children:[(0,u.jsx)("div",{children:(0,u.jsx)("a",{href:t.alt,target:"_blank",children:t.title})}),(0,u.jsx)("div",{className:"idouban-meta",style:{WebkitLineClamp:e.max_line},children:t.meta}),(0,u.jsx)("div",{className:"idouban-rating",children:t.rating}),(0,u.jsx)("div",{className:"idouban-comment",children:t.comment})]})]},t.alt)),a.data.length>0&&(0,u.jsxs)("div",{className:"idouban-pagination",children:[(0,u.jsx)("a",{className:"idouban-button",onClick:()=>i(a.action,1),children:n("top")}),(0,u.jsx)("a",{className:"idouban-button",onClick:()=>i(a.action,Math.max(a.page-1,1)),children:n("prev")}),(0,u.jsxs)("span",{className:"idouban-page-num",children:[a.page," / ",a.total]}),(0,u.jsx)("a",{className:"idouban-button",onClick:()=>i(a.action,Math.min(a.page+1,a.total)),children:n("next")}),(0,u.jsx)("a",{className:"idouban-button",onClick:()=>i(a.action,a.total),children:n("end")})]})]})}q.createInstance=K.createInstance,q.createInstance,q.dir,q.init,q.loadResources,q.reloadResources,q.use,q.changeLanguage,q.getFixedT,q.t,q.exists,q.setDefaultNamespace,q.hasLoadedNamespace,q.loadNamespaces,q.loadLanguages;var Y={};!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),n=(Y=i("5Aaoy")).createRoot,Y.hydrateRoot;let X={movieWish:"想看",movieDo:"在看",movieCollect:"已看",bookWish:"想读",bookDo:"在读",bookCollect:"已读",gameWish:"想玩",gameDo:"在玩",gameCollect:"已玩",songWish:"想听",songDo:"在听",songCollect:"已听",prev:"上一页",next:"下一页",top:"首页",end:"尾页",poor:"★☆☆☆☆ 很差",fair:"★★☆☆☆ 较差",good:"★★★☆☆ 还行",great:"★★★★☆ 推荐",best:"★★★★★ 力荐"};q.init({lng:"zh",fallbackLng:"zh",debug:!1,lowerCaseLng:!0,resources:{en:{translation:{movieWish:"Wish",movieDo:"Watching",movieCollect:"Watched",bookWish:"Wish",bookDo:"Reading",bookCollect:"Read",gameWish:"Wish",gameDo:"Playing",gameCollect:"Played",songWish:"Wish",songDo:"Listening",songCollect:"Listened",prev:"Prev",next:"Next",top:"Top",end:"End",poor:"★☆☆☆☆ Poor",fair:"★★☆☆☆ Fair",good:"★★★☆☆ Good",great:"★★★★☆ Great",best:"★★★★★ Best"}},zh:{translation:X},"zh-tw":{translation:{movieWish:"想看",movieDo:"在看",movieCollect:"已看",bookWish:"想讀",bookDo:"在讀",bookCollect:"已讀",gameWish:"想玩",gameDo:"在玩",gameCollect:"已玩",songWish:"想聽",songDo:"在聽",songCollect:"已聽",prev:"上一頁",next:"下一頁",top:"首頁",end:"尾頁",poor:"★☆☆☆☆ 極差",fair:"★★☆☆☆ 較差",good:"★★★☆☆ 平均",great:"★★★★☆ 優質",best:"★★★★★ 極佳"}},"zh-cn":{translation:X},"zh-hans":{translation:X}}});let G=e=>{q.changeLanguage(e)};var Z={};Z=JSON.parse('{"name":"idouban","version":"1.0.7","description":"Inject douban pages in your site.","main":"dist/http.js","targets":{"main":{"source":"src/http.ts","distDir":"dist/","optimize":true},"js":{"source":"src/index.ts","context":"browser","distDir":"dist/","optimize":true},"css":{"source":"src/index.css","context":"browser","distDir":"dist/","optimize":true}},"scripts":{"start":"parcel serve -p 8888 src/index.html --dist-dir build/","build":"parcel build --no-source-maps"},"files":["dist"],"dependencies":{"i18next":"^23.11.5","react":"^18.3.1","react-dom":"^18.3.1"},"devDependencies":{"@types/react":"^18.3.3","@types/react-dom":"^18.3.0","parcel":"^2.12.0","process":"^0.11.10"},"engines":{"node":">= 18"},"bugs":{"url":"https://github.com/mythsman/idouban/issues"},"homepage":"https://github.com/mythsman/idouban/","repository":{"type":"git","url":"git+https://github.com/mythsman/idouban.git"},"keywords":["douban"],"author":"mythsman","license":"MIT"}');let ee=e=>{switch(e){case 1:return q.t("poor");case 2:return q.t("fair");case 3:return q.t("good");case 4:return q.t("great");case 5:return q.t("best");default:return""}},et=async(e,t)=>{try{let n={"User-Agent":`${Z.name}@${Z.version}`};return t&&(n.Referer=t),(await fetch(e,{method:"GET",headers:n})).json()}catch(e){return console.error(e),"OFFLINE"}},en=async(e,t,n,r)=>{switch(r){case"book":return er(e,t,n);case"movie":return ei(e,t,n);case"game":return ea(e,t,n);case"song":return el(e,t,n);default:throw Error(`${r} type not found`)}},er=async(e,t,n)=>{let r=[],a=await et("https://mouban.mythsman.com/guest/user_book?action="+t+"&id="+e,n);if("OFFLINE"===a)return console.warn("Cannot connect to server"),r;for(let e of a.result.comment){let t=[];e.item.author&&t.push(e.item.author),e.item.translator&&t.push(e.item.translator),e.item.press&&t.push(e.item.press),e.item.producer&&t.push(e.item.producer);let n=[];e.mark_date&&n.push(e.mark_date),e.label&&n.push(e.label),e.rate&&n.push(ee(e.rate)),r.push({title:e.item.title,alt:"https://book.douban.com/subject/"+e.item.douban_id+"/",image:e.item.thumbnail,meta:t.join(" / "),rating:n.join(" / "),comment:e.comment})}return r},ea=async(e,t,n)=>{let r=[],a=await et("https://mouban.mythsman.com/guest/user_game?action="+t+"&id="+e,n);if("OFFLINE"===a)return console.warn("Cannot connect to server"),r;for(let e of a.result.comment){let t=[];e.item.platform&&t.push(e.item.platform),e.item.genre&&t.push(e.item.genre),e.item.developer&&t.push(e.item.developer),e.item.publisher&&t.push(e.item.publisher);let n=[];e.mark_date&&n.push(e.mark_date),e.label&&n.push(e.label),e.rate&&n.push(ee(e.rate)),r.push({title:e.item.title,alt:"https://www.douban.com/game/"+e.item.douban_id+"/",image:e.item.thumbnail,meta:t.join(" / "),rating:n.join(" / "),comment:e.comment})}return r},el=async(e,t,n)=>{let r=[],a=await et("https://mouban.mythsman.com/guest/user_song?action="+t+"&id="+e,n);if("OFFLINE"===a)return console.warn("Cannot connect to server"),r;for(let e of a.result.comment){let t=[];e.item.alias&&t.push(e.item.alias),e.item.musician&&t.push(e.item.musician),e.item.album_type&&t.push(e.item.album_type),e.item.genre&&t.push(e.item.genre),e.item.media&&t.push(e.item.media),e.item.publisher&&t.push(e.item.publisher),e.item.publish_date&&t.push(e.item.publish_date);let n=[];e.mark_date&&n.push(e.mark_date),e.label&&n.push(e.label),e.rate&&n.push(ee(e.rate)),r.push({title:e.item.title,alt:"https://music.douban.com/subject/"+e.item.douban_id+"/",image:e.item.thumbnail,meta:t.join(" / "),rating:n.join(" / "),comment:e.comment})}return r},ei=async(e,t,n)=>{let r=[],a=await et("https://mouban.mythsman.com/guest/user_movie?action="+t+"&id="+e,n);if("OFFLINE"===a)return console.warn("Cannot connect to server"),r;for(let e of a.result.comment){let t=[];e.item.style&&t.push(e.item.style),e.item.director&&t.push(e.item.director),e.item.writer&&t.push(e.item.writer),e.item.actor&&t.push(e.item.actor),e.item.publish_date&&t.push(e.item.publish_date);let n=[];e.mark_date&&n.push(e.mark_date),e.label&&n.push(e.label),e.rate&&n.push(ee(e.rate)),r.push({title:e.item.title,alt:"https://movie.douban.com/subject/"+e.item.douban_id+"/",image:e.item.thumbnail,meta:t.join(" / "),rating:n.join(" / "),comment:e.comment})}return r},eo=async(e,t,n,r)=>{let a=await et("https://mouban.mythsman.com/guest/check_user?id="+e,t);if("OFFLINE"===a)return console.warn("Cannot connect to server"),r.map(e=>({action:e,items:[]}));if(!a.success)return console.warn(a.msg),r.map(e=>({action:e,items:[]}));let l=[];for(let a of r){let r=await en(e,a,t,n);l.push({action:a,items:r})}return l},es=e=>{e.lang||(e.lang="zh"),e.page_size||(e.page_size=10),e.max_line||(e.max_line=4);let t=["do","wish","collect"];e.actions&&0!==e.actions.length?(e.actions=e.actions.filter(e=>t.includes(e)),0===e.actions.length&&(e.actions=t)):e.actions=t};window&&(window.idouban={init:async e=>{if(es(e),G(e.lang),!e.data_list){let t=new Date().getTime();e.data_list=await eo(e.douban_id,e.referer,e.type,e.actions);let n=new Date().getTime();console.log(`${e.data_list.map(e=>e.action+"("+e.items.length+")")} book loaded in ${n-t} ms`)}let r=document.querySelector(e.selector);r?n(r).render(t(s).createElement(J,{context:{data_list:e.data_list,quote:e.quote,page_size:e.page_size,max_line:e.max_line,type:e.type}})):console.warn("idouban selector not found")}})})();
/*-->*/
评论