generaltranslation 3.2.0 โ 3.3.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/codes/emojis.d.ts +1 -0
- package/dist/index.cjs.min.cjs +1 -1
- package/dist/index.cjs.min.cjs.map +1 -1
- package/dist/index.d.ts +72 -1
- package/dist/index.esm.min.mjs +1 -1
- package/dist/index.esm.min.mjs.map +1 -1
- package/dist/projects/_getProjectLanguages.d.ts +1 -0
- package/dist/projects/_updateProjectDictionary.d.ts +1 -0
- package/dist/settings/defaultAPIRoutes.d.ts +5 -4
- package/package.json +1 -1
- /package/dist/{dictionaries/_updateDictionary.d.ts โ codes/_getLanguageNames.d.ts} +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
export declare const defaultLanguageEmoji = "\uD83C\uDF0D";
|
package/dist/index.cjs.min.cjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=function(){return t=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},t.apply(this,arguments)};function n(t,n,e,r){return new(e||(e=Promise))((function(o,a){function i(t){try{c(r.next(t))}catch(t){a(t)}}function u(t){try{c(r.throw(t))}catch(t){a(t)}}function c(t){var n;t.done?o(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(i,u)}c((r=r.apply(t,n||[])).next())}))}function e(t,n){var e,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=u(0),i.throw=u(1),i.return=u(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(e=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=n.call(t,a)}catch(t){u=[6,t],r=0}finally{e=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}"function"==typeof SuppressedError&&SuppressedError;var r="/translate/v1/batch",o="/translate/v1/react",a="/translate/v1/content",i="/dictionaries/v1/update";function u(t,o){return n(this,void 0,void 0,(function(){var n,a,i,u,c,s,l,f,p;return e(this,(function(e){switch(e.label){case 0:return n=new AbortController,a=n.signal,(null===(p=null===(f=null===(l=o[0])||void 0===l?void 0:l.data)||void 0===f?void 0:f.metadata)||void 0===p?void 0:p.timeout)&&setTimeout((function(){return n.abort()}),o[0].data.metadata.timeout),[4,fetch("".concat(t.baseURL).concat(r),{method:"POST",headers:{"Content-Type":"application/json","gtx-api-key":t.apiKey},body:JSON.stringify(o),signal:a})];case 1:return(i=e.sent()).ok?[3,3]:(u=Error.bind,s=(c="".concat(i.status,": ")).concat,[4,i.text()]);case 2:throw new(u.apply(Error,[void 0,s.apply(c,[e.sent()])]));case 3:return[4,i.json()];case 4:return[2,e.sent()]}}))}))}var c="en",s=function(t){try{return new Intl.Locale(t).toString()}catch(t){return""}};function l(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{var e=t.flat().map((function(t){return new Intl.Locale(t).language}));return e.every((function(t){return t===e[0]}))}catch(t){return console.error(t),!1}}function f(t,r,o,i){return n(this,void 0,void 0,(function(){var n,u,c,s,l,f;return e(this,(function(e){switch(e.label){case 0:return n=new AbortController,u=n.signal,i.timeout&&setTimeout((function(){return n.abort()}),i.timeout),[4,fetch("".concat(t.baseURL).concat(a),{method:"POST",headers:{"Content-Type":"application/json","gtx-api-key":t.apiKey},body:JSON.stringify({content:r,targetLanguage:o,metadata:i}),signal:u})];case 1:return(c=e.sent()).ok?[3,3]:(s=Error.bind,f=(l="".concat(c.status,": ")).concat,[4,c.text()]);case 2:throw new(s.apply(Error,[void 0,f.apply(l,[e.sent()])]));case 3:return[4,c.json()];case 4:return[2,e.sent()]}}))}))}function p(t,r,a,i){return n(this,void 0,void 0,(function(){var n,u,c,s,l,f;return e(this,(function(e){switch(e.label){case 0:return n=new AbortController,u=n.signal,i.timeout&&setTimeout((function(){return n.abort()}),i.timeout),[4,fetch("".concat(t.baseURL).concat(o),{method:"POST",headers:{"Content-Type":"application/json","gtx-api-key":t.apiKey},body:JSON.stringify({children:r,targetLanguage:a,metadata:i}),signal:u})];case 1:return(c=e.sent()).ok?[3,3]:(s=Error.bind,f=(l="".concat(c.status,": ")).concat,[4,c.text()]);case 2:throw new(s.apply(Error,[void 0,f.apply(l,[e.sent()])]));case 3:return[4,c.json()];case 4:return[2,e.sent()]}}))}))}function v(t,r,o,a){return n(this,void 0,void 0,(function(){var n,u,c,s,l;return e(this,(function(e){switch(e.label){case 0:return[4,fetch("".concat(t.baseURL).concat(i),{method:"POST",headers:{"Content-Type":"application/json","gtx-api-key":t.apiKey},body:JSON.stringify({updates:r,languages:o,options:a})})];case 1:return(n=e.sent()).ok?[3,3]:(u=Error.bind,s=(c="".concat(n.status,": ")).concat,[4,n.text()]);case 2:throw new(u.apply(Error,[void 0,s.apply(c,[e.sent()])]));case 3:return[4,n.json()];case 4:return[2,null==(l=e.sent())?void 0:l.languages]}}))}))}function d(n){var e=n.value,r=n.languages,o=void 0===r?[c]:r,a=n.options,i=void 0===a?{}:a;return new Intl.NumberFormat(o,t({numberingSystem:"latn"},i)).format(e)}function g(n){var e=n.value,r=n.languages,o=void 0===r?[c]:r,a=n.options,i=void 0===a?{}:a;return new Intl.DateTimeFormat(o,t({calendar:"gregory",numberingSystem:"latn"},i)).format(e)}function y(n){var e=n.value,r=n.languages,o=void 0===r?[c]:r,a=n.currency,i=void 0===a?"USD":a,u=n.options,s=void 0===u?{}:u;return new Intl.NumberFormat(o,t({style:"currency",currency:i,numberingSystem:"latn"},s)).format(e)}function h(n){var e=n.value,r=n.languages,o=void 0===r?[c]:r,a=n.options,i=void 0===a?{}:a;return new Intl.ListFormat(o,t({type:"conjunction",style:"long"},i)).format(e)}var m={var:"variable",num:"number",datetime:"datetime",currency:"currency"};function b(n){if("string"!=typeof n)throw new Error("splitStringToContent: ".concat(n," is not a string!"));for(var e,r=[],o=/{([^}]+)}/g,a=0;null!==(e=o.exec(n));){var i=e[0],u=e[1],c=e.index;if("^"!==n[c-1]){c>a&&r.push(n.slice(a,c));var s=u.split(",").map((function(t){return t.trim()})),l=s[0],f=s[1]?m[s[1]]:void 0,p=t({key:l},f&&{variable:f});r.push(p),a=c+i.length}else c-1>a&&r.push(n.slice(a,c-1)),r.push(i),a=c+i.length}return a<n.length&&r.push(n.slice(a)),r}var w=function(t){return"undefined"!=typeof process&&process.env&&process.env[t]||""},x=function(){function r(t){var n=void 0===t?{}:t,e=n.apiKey,r=void 0===e?"":e,o=n.defaultLanguage,a=void 0===o?c:o,i=n.projectID,u=void 0===i?"":i,s=n.baseURL,l=void 0===s?"https://prod.gtx.dev":s;this.apiKey=r||w("GT_API_KEY"),this.projectID=u||w("GT_PROJECT_ID"),this.defaultLanguage=a.toLowerCase(),this.baseURL=l}return r.prototype.translate=function(r,o,a){return n(this,void 0,void 0,(function(){return e(this,(function(n){switch(n.label){case 0:return[4,f(this,r,o,t({defaultLanguage:this.defaultLanguage},a))];case 1:return[2,n.sent()]}}))}))},r.prototype.translateReact=function(r,o,a){return n(this,void 0,void 0,(function(){return e(this,(function(n){switch(n.label){case 0:return[4,p(this,r,o,t({defaultLanguage:this.defaultLanguage},a))];case 1:return[2,n.sent()]}}))}))},r.prototype.translateBatch=function(t){return n(this,void 0,void 0,(function(){return e(this,(function(n){return[2,u(this,t)]}))}))},r.prototype.updateDictionary=function(t){return n(this,arguments,void 0,(function(t,n,r){return void 0===n&&(n=[]),void 0===r&&(r={}),e(this,(function(e){return[2,v(this,t,n,r)]}))}))},r}();exports.default=x,exports.determineLanguage=function(t,n){return function(t,n){if("string"==typeof t&&(t=[t]),!n)return t[0];for(var e=function(t){var e=n.find((function(n){return n===t}));if(e)return{value:e};var r=n.find((function(n){return l(n,t)}));return r?{value:r}:void 0},r=0,o=t;r<o.length;r++){var a=e(o[r]);if("object"==typeof a)return a.value}}(t,n)},exports.formatCurrency=function(t){return y(t)},exports.formatDateTime=function(t){return g(t)},exports.formatList=function(t){return h(t)},exports.formatNum=function(t){return d(t)},exports.formatRelativeTime=function(n){return r=(e=n).value,o=e.unit,a=e.languages,i=void 0===a?[c]:a,u=e.options,s=void 0===u?{}:u,new Intl.RelativeTimeFormat(i,t({style:"long",numeric:"auto"},s)).format(r,o);var e,r,o,a,i,u,s},exports.getLanguageDirection=function(t){return function(t){var n;try{var e=new Intl.Locale(t);return"rtl"===(null===(n=null==e?void 0:e.textInfo)||void 0===n?void 0:n.direction)?"rtl":"ltr"}catch(t){return"ltr"}}(t)},exports.getLanguageName=function(t,n){return function(t,n){void 0===n&&(n=c);try{var e=new Intl.DisplayNames([n],{type:"language"});return"string"==typeof t?e.of(t)||"":Array.isArray(t)?t.map((function(t){return e.of(t)||""})):""}catch(n){return"string"==typeof t?"":Array.isArray(t)?t.map((function(){return""})):""}}(t,n)},exports.isSameLanguage=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return l.apply(void 0,t)},exports.isValidLanguageCode=function(t){return function(t){try{var n=new Intl.Locale(t),e=n.language,r=n.region,o=n.script;return new Intl.DisplayNames([c],{type:"language"}).of(e)!==e&&((!r||new Intl.DisplayNames([c],{type:"region"}).of(r)!==r)&&(!o||new Intl.DisplayNames([c],{type:"script"}).of(o)!==o))}catch(t){return!1}}(t)},exports.renderContentToString=function(n,e,r,o){return function(n,e,r,o){if(void 0===e&&(e=c),void 0===r&&(r={}),void 0===o&&(o={}),"string"==typeof n&&(n=b(n)),"string"==typeof n)return n;if(!Array.isArray(n))throw new Error("renderContentToString: content ".concat(n," is invalid"));return n.map((function(n){var a;if("string"==typeof n)return n;if("object"==typeof n){var i=r[n.key];return n.variable?"number"===n.variable?d({value:i,languages:e,options:o[n.key]}):"currency"===n.variable?y(t(t({value:i,languages:e},o[n.key]&&{options:o[n.key]}),(null===(a=o[n.key])||void 0===a?void 0:a.currency)&&{currency:o[n.key].currency})):"datetime"===n.variable?g(t({value:i,languages:e},o[n.key]&&{options:o[n.key]})):"list"===n.variable?h(t({value:i,languages:e},o[n.key]&&{options:o[n.key]})):i:i}})).join("")}(n,e,r,o)},exports.requiresTranslation=function(t,n,e){return function(t,n,e){if(!n)return!1;if(s(n)===s(t))return!1;var r=new Intl.Locale(t),o=r.language,a=r.region,i=new Intl.Locale(n),u=i.language,c=i.region;return!(!(a&&c||!l(o,u))||e&&!e.some((function(t){return l(n,t)})))}(t,n,e)},exports.splitStringToContent=function(t){return b(t)},exports.standardizeLanguageCode=function(t){return s(t)};
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=function(){return t=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var a in e=arguments[n])Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t},t.apply(this,arguments)};function e(t,e,n,r){return new(n||(n=Promise))((function(a,o){function i(t){try{c(r.next(t))}catch(t){o(t)}}function u(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?a(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,u)}c((r=r.apply(t,e||[])).next())}))}function n(t,e){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=u(0),i.throw=u(1),i.return=u(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(c){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(6===u[0]&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=e.call(t,o)}catch(t){u=[6,t],r=0}finally{n=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}"function"==typeof SuppressedError&&SuppressedError;var r="/v1/translate/batch",a="/v1/translate/react",o="/v1/translate/content",i="/v1/project/dictionary/update",u="/v1/project/languages";function c(t,a){return e(this,void 0,void 0,(function(){var e,o,i,u,c,s,l,f,p;return n(this,(function(n){switch(n.label){case 0:return e=new AbortController,o=e.signal,(null===(p=null===(f=null===(l=a[0])||void 0===l?void 0:l.data)||void 0===f?void 0:f.metadata)||void 0===p?void 0:p.timeout)&&setTimeout((function(){return e.abort()}),a[0].data.metadata.timeout),[4,fetch("".concat(t.baseURL).concat(r),{method:"POST",headers:{"Content-Type":"application/json","gtx-api-key":t.apiKey},body:JSON.stringify(a),signal:o})];case 1:return(i=n.sent()).ok?[3,3]:(u=Error.bind,s=(c="".concat(i.status,": ")).concat,[4,i.text()]);case 2:throw new(u.apply(Error,[void 0,s.apply(c,[n.sent()])]));case 3:return[4,i.json()];case 4:return[2,n.sent()]}}))}))}var s="en",l=["Cham","Jamo","Kawi","Lisu","Toto","Thai"],f=function(t){try{var e=new Intl.Locale(t),n=e.language,r=e.region,a=e.script;if(new Intl.DisplayNames([s],{type:"language"}).of(n)===n)return!1;if(r)if(new Intl.DisplayNames([s],{type:"region"}).of(r)===r)return!1;if(a)if(new Intl.DisplayNames([s],{type:"script"}).of(a)===a&&!l.includes(a))return!1;return!0}catch(t){return!1}},p=function(t){try{return Intl.getCanonicalLocales(t)[0]}catch(t){return""}};function g(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];try{var n=t.flat().map((function(t){return new Intl.Locale(t).language}));return n.every((function(t){return t===n[0]}))}catch(t){return console.error(t),!1}}function d(t,r,a,i){return e(this,void 0,void 0,(function(){var e,u,c,s,l,f;return n(this,(function(n){switch(n.label){case 0:return e=new AbortController,u=e.signal,i.timeout&&setTimeout((function(){return e.abort()}),i.timeout),[4,fetch("".concat(t.baseURL).concat(o),{method:"POST",headers:{"Content-Type":"application/json","gtx-api-key":t.apiKey},body:JSON.stringify({content:r,targetLanguage:a,metadata:i}),signal:u})];case 1:return(c=n.sent()).ok?[3,3]:(s=Error.bind,f=(l="".concat(c.status,": ")).concat,[4,c.text()]);case 2:throw new(s.apply(Error,[void 0,f.apply(l,[n.sent()])]));case 3:return[4,c.json()];case 4:return[2,n.sent()]}}))}))}function v(t,r,o,i){return e(this,void 0,void 0,(function(){var e,u,c,s,l,f;return n(this,(function(n){switch(n.label){case 0:return e=new AbortController,u=e.signal,i.timeout&&setTimeout((function(){return e.abort()}),i.timeout),[4,fetch("".concat(t.baseURL).concat(a),{method:"POST",headers:{"Content-Type":"application/json","gtx-api-key":t.apiKey},body:JSON.stringify({children:r,targetLanguage:o,metadata:i}),signal:u})];case 1:return(c=n.sent()).ok?[3,3]:(s=Error.bind,f=(l="".concat(c.status,": ")).concat,[4,c.text()]);case 2:throw new(s.apply(Error,[void 0,f.apply(l,[n.sent()])]));case 3:return[4,c.json()];case 4:return[2,n.sent()]}}))}))}function y(t,r,a,o){return e(this,void 0,void 0,(function(){var e,u,c,s,l;return n(this,(function(n){switch(n.label){case 0:return[4,fetch("".concat(t.baseURL).concat(i),{method:"POST",headers:{"Content-Type":"application/json","gtx-api-key":t.apiKey},body:JSON.stringify({updates:r,languages:a,options:o})})];case 1:return(e=n.sent()).ok?[3,3]:(u=Error.bind,s=(c="".concat(e.status,": ")).concat,[4,e.text()]);case 2:throw new(u.apply(Error,[void 0,s.apply(c,[n.sent()])]));case 3:return[4,e.json()];case 4:return[2,null==(l=n.sent())?void 0:l.languages]}}))}))}function m(t,r){return e(this,void 0,void 0,(function(){var e,a,o,i,c;return n(this,(function(n){switch(n.label){case 0:return[4,fetch("".concat(t.baseURL).concat(u,"?projectID=").concat(r),{method:"GET",headers:{"Content-Type":"application/json","gtx-api-key":t.apiKey}})];case 1:return(e=n.sent()).ok?[3,3]:(a=Error.bind,i=(o="".concat(e.status,": ")).concat,[4,e.text()]);case 2:throw new(a.apply(Error,[void 0,i.apply(o,[n.sent()])]));case 3:return[4,e.json()];case 4:return[2,null==(c=n.sent())?void 0:c.languages]}}))}))}function h(e){var n=e.value,r=e.languages,a=void 0===r?[s]:r,o=e.options,i=void 0===o?{}:o;return new Intl.NumberFormat(a,t({numberingSystem:"latn"},i)).format(n)}function b(e){var n=e.value,r=e.languages,a=void 0===r?[s]:r,o=e.options,i=void 0===o?{}:o;return new Intl.DateTimeFormat(a,t({calendar:"gregory",numberingSystem:"latn"},i)).format(n)}function N(e){var n=e.value,r=e.languages,a=void 0===r?[s]:r,o=e.currency,i=void 0===o?"USD":o,u=e.options,c=void 0===u?{}:u;return new Intl.NumberFormat(a,t({style:"currency",currency:i,numberingSystem:"latn"},c)).format(n)}function w(e){var n=e.value,r=e.languages,a=void 0===r?[s]:r,o=e.options,i=void 0===o?{}:o;return new Intl.ListFormat(a,t({type:"conjunction",style:"long"},i)).format(n)}var L={var:"variable",num:"number",datetime:"datetime",currency:"currency"};function C(e){if("string"!=typeof e)throw new Error("splitStringToContent: ".concat(e," is not a string!"));for(var n,r=[],a=/{([^}]+)}/g,o=0;null!==(n=a.exec(e));){var i=n[0],u=n[1],c=n.index;if("^"!==e[c-1]){c>o&&r.push(e.slice(o,c));var s=u.split(",").map((function(t){return t.trim()})),l=s[0],f=s[1]?L[s[1]]:void 0,p=t({key:l},f&&{variable:f});r.push(p),o=c+i.length}else c-1>o&&r.push(e.slice(o,c-1)),r.push(i),o=c+i.length}return o<e.length&&r.push(e.slice(o)),r}function S(t,e){if(void 0===e&&(e={}),!f(t))return I;var n=new Intl.Locale(t);if(e[t=n.toString()])return e[t];var r=n.region;if(r&&M[r])return M[r];var a=n.maximize(),o=a.region||"";return x[a.language]||M[o]||I}var T="๐",I=T,x={ca:T,eu:T,ku:T,bo:"๐",ug:"๐",gd:"๐ด๓ ง๓ ข๓ ณ๓ ฃ๓ ด๓ ฟ",cy:"๐ด๓ ง๓ ข๓ ท๓ ฌ๓ ณ๓ ฟ",gv:"๐ฎ๐ฒ",grc:"๐บ"},M={AF:"๐ฆ๐ซ",AX:"๐ฆ๐ฝ",AL:"๐ฆ๐ฑ",DZ:"๐ฉ๐ฟ",AS:"๐ฆ๐ธ",AD:"๐ฆ๐ฉ",AO:"๐ฆ๐ด",AI:"๐ฆ๐ฎ",AQ:"๐ฆ๐ถ",AG:"๐ฆ๐ฌ",AR:"๐ฆ๐ท",AM:"๐ฆ๐ฒ",AW:"๐ฆ๐ผ",AU:"๐ฆ๐บ",AT:"๐ฆ๐น",AZ:"๐ฆ๐ฟ",BS:"๐ง๐ธ",BH:"๐ง๐ญ",BD:"๐ง๐ฉ",BB:"๐ง๐ง",BY:"๐ง๐พ",BE:"๐ง๐ช",BZ:"๐ง๐ฟ",BJ:"๐ง๐ฏ",BM:"๐ง๐ฒ",BT:"๐ง๐น",BO:"๐ง๐ด",BQ:"๐ง๐ถ",BA:"๐ง๐ฆ",BW:"๐ง๐ผ",BV:"๐ง๐ป",BR:"๐ง๐ท",IO:"๐ฎ๐ด",BN:"๐ง๐ณ",BG:"๐ง๐ฌ",BF:"๐ง๐ซ",BI:"๐ง๐ฎ",CV:"๐จ๐ป",KH:"๐ฐ๐ญ",CM:"๐จ๐ฒ",CA:"๐จ๐ฆ",KY:"๐ฐ๐พ",CF:"๐จ๐ซ",TD:"๐น๐ฉ",CL:"๐จ๐ฑ",CN:"๐จ๐ณ",CX:"๐จ๐ฝ",CC:"๐จ๐จ",CO:"๐จ๐ด",KM:"๐ฐ๐ฒ",CD:"๐จ๐ฉ",CG:"๐จ๐ฌ",CK:"๐จ๐ฐ",CR:"๐จ๐ท",CI:"๐จ๐ฎ",HR:"๐ญ๐ท",CU:"๐จ๐บ",CW:"๐จ๐ผ",CY:"๐จ๐พ",CZ:"๐จ๐ฟ",DK:"๐ฉ๐ฐ",DJ:"๐ฉ๐ฏ",DM:"๐ฉ๐ฒ",DO:"๐ฉ๐ด",EC:"๐ช๐จ",EG:"๐ช๐ฌ",SV:"๐ธ๐ป",GQ:"๐ฌ๐ถ",ER:"๐ช๐ท",EE:"๐ช๐ช",SZ:"๐ธ๐ฟ",ET:"๐ช๐น",FK:"๐ซ๐ฐ",FO:"๐ซ๐ด",FJ:"๐ซ๐ฏ",FI:"๐ซ๐ฎ",FR:"๐ซ๐ท",GF:"๐ฌ๐ซ",PF:"๐ต๐ซ",TF:"๐น๐ซ",GA:"๐ฌ๐ฆ",GM:"๐ฌ๐ฒ",GE:"๐ฌ๐ช",DE:"๐ฉ๐ช",GH:"๐ฌ๐ญ",GI:"๐ฌ๐ฎ",GR:"๐ฌ๐ท",GL:"๐ฌ๐ฑ",GD:"๐ฌ๐ฉ",GP:"๐ฌ๐ต",GU:"๐ฌ๐บ",GT:"๐ฌ๐น",GG:"๐ฌ๐ฌ",GN:"๐ฌ๐ณ",GW:"๐ฌ๐ผ",GY:"๐ฌ๐พ",HT:"๐ญ๐น",HM:"๐ญ๐ฒ",VA:"๐ป๐ฆ",HN:"๐ญ๐ณ",HK:"๐ญ๐ฐ",HU:"๐ญ๐บ",IS:"๐ฎ๐ธ",IN:"๐ฎ๐ณ",ID:"๐ฎ๐ฉ",IR:"๐ฎ๐ท",IQ:"๐ฎ๐ถ",IE:"๐ฎ๐ช",IM:"๐ฎ๐ฒ",IL:"๐ฎ๐ฑ",IT:"๐ฎ๐น",JM:"๐ฏ๐ฒ",JP:"๐ฏ๐ต",JE:"๐ฏ๐ช",JO:"๐ฏ๐ด",KZ:"๐ฐ๐ฟ",KE:"๐ฐ๐ช",KI:"๐ฐ๐ฎ",KP:"๐ฐ๐ต",KR:"๐ฐ๐ท",KW:"๐ฐ๐ผ",KG:"๐ฐ๐ฌ",LA:"๐ฑ๐ฆ",LV:"๐ฑ๐ป",LB:"๐ฑ๐ง",LS:"๐ฑ๐ธ",LR:"๐ฑ๐ท",LY:"๐ฑ๐พ",LI:"๐ฑ๐ฎ",LT:"๐ฑ๐น",LU:"๐ฑ๐บ",MO:"๐ฒ๐ด",MG:"๐ฒ๐ฌ",MW:"๐ฒ๐ผ",MY:"๐ฒ๐พ",MV:"๐ฒ๐ป",ML:"๐ฒ๐ฑ",MT:"๐ฒ๐น",MH:"๐ฒ๐ญ",MQ:"๐ฒ๐ถ",MR:"๐ฒ๐ท",MU:"๐ฒ๐บ",YT:"๐พ๐น",MX:"๐ฒ๐ฝ",FM:"๐ซ๐ฒ",MD:"๐ฒ๐ฉ",MC:"๐ฒ๐จ",MN:"๐ฒ๐ณ",ME:"๐ฒ๐ช",MS:"๐ฒ๐ธ",MA:"๐ฒ๐ฆ",MZ:"๐ฒ๐ฟ",MM:"๐ฒ๐ฒ",NA:"๐ณ๐ฆ",NR:"๐ณ๐ท",NP:"๐ณ๐ต",NL:"๐ณ๐ฑ",NC:"๐ณ๐จ",NZ:"๐ณ๐ฟ",NI:"๐ณ๐ฎ",NE:"๐ณ๐ช",NG:"๐ณ๐ฌ",NU:"๐ณ๐บ",NF:"๐ณ๐ซ",MK:"๐ฒ๐ฐ",MP:"๐ฒ๐ต",NO:"๐ณ๐ด",OM:"๐ด๐ฒ",PK:"๐ต๐ฐ",PW:"๐ต๐ผ",PS:"๐ต๐ธ",PA:"๐ต๐ฆ",PG:"๐ต๐ฌ",PY:"๐ต๐พ",PE:"๐ต๐ช",PH:"๐ต๐ญ",PN:"๐ต๐ณ",PL:"๐ต๐ฑ",PT:"๐ต๐น",PR:"๐ต๐ท",QA:"๐ถ๐ฆ",RE:"๐ท๐ช",RO:"๐ท๐ด",RU:"๐ท๐บ",RW:"๐ท๐ผ",BL:"๐ง๐ฑ",SH:"๐ธ๐ญ",KN:"๐ฐ๐ณ",LC:"๐ฑ๐จ",MF:"๐ฒ๐ซ",PM:"๐ต๐ฒ",VC:"๐ป๐จ",WS:"๐ผ๐ธ",SM:"๐ธ๐ฒ",ST:"๐ธ๐น",SA:"๐ธ๐ฆ",SN:"๐ธ๐ณ",RS:"๐ท๐ธ",SC:"๐ธ๐จ",SL:"๐ธ๐ฑ",SG:"๐ธ๐ฌ",SX:"๐ธ๐ฝ",SK:"๐ธ๐ฐ",SI:"๐ธ๐ฎ",SB:"๐ธ๐ง",SO:"๐ธ๐ด",ZA:"๐ฟ๐ฆ",GS:"๐ฌ๐ธ",SS:"๐ธ๐ธ",ES:"๐ช๐ธ",LK:"๐ฑ๐ฐ",SD:"๐ธ๐ฉ",SR:"๐ธ๐ท",SJ:"๐ธ๐ฏ",SE:"๐ธ๐ช",CH:"๐จ๐ญ",SY:"๐ธ๐พ",TW:"๐น๐ผ",TJ:"๐น๐ฏ",TZ:"๐น๐ฟ",TH:"๐น๐ญ",TL:"๐น๐ฑ",TG:"๐น๐ฌ",TK:"๐น๐ฐ",TO:"๐น๐ด",TT:"๐น๐น",TN:"๐น๐ณ",TR:"๐น๐ท",TM:"๐น๐ฒ",TC:"๐น๐จ",TV:"๐น๐ป",UG:"๐บ๐ฌ",UA:"๐บ๐ฆ",AE:"๐ฆ๐ช",GB:"๐ฌ๐ง",US:"๐บ๐ธ",UM:"๐บ๐ฒ",UY:"๐บ๐พ",UZ:"๐บ๐ฟ",VU:"๐ป๐บ",VE:"๐ป๐ช",VN:"๐ป๐ณ",VG:"๐ป๐ฌ",VI:"๐ป๐ฎ",WF:"๐ผ๐ซ",EH:"๐ช๐ญ",YE:"๐พ๐ช",ZM:"๐ฟ๐ฒ",ZW:"๐ฟ๐ผ",EU:"๐ช๐บ"};var E=function(t){return"undefined"!=typeof process&&process.env&&process.env[t]||""},A=function(){function r(t){var e=void 0===t?{}:t,n=e.apiKey,r=void 0===n?"":n,a=e.defaultLanguage,o=void 0===a?s:a,i=e.projectID,u=void 0===i?"":i,c=e.baseURL,l=void 0===c?"https://prod.gtx.dev":c;this.apiKey=r||E("GT_API_KEY"),this.projectID=u||E("GT_PROJECT_ID"),this.defaultLanguage=o.toLowerCase(),this.baseURL=l}return r.prototype.translate=function(r,a,o){return e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,d(this,r,a,t({defaultLanguage:this.defaultLanguage},o))];case 1:return[2,e.sent()]}}))}))},r.prototype.translateReact=function(r,a,o){return e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,v(this,r,a,t({defaultLanguage:this.defaultLanguage},o))];case 1:return[2,e.sent()]}}))}))},r.prototype.translateBatch=function(t){return e(this,void 0,void 0,(function(){return n(this,(function(e){return[2,c(this,t)]}))}))},r.prototype.updateProjectDictionary=function(t){return e(this,arguments,void 0,(function(t,e,r){return void 0===e&&(e=[]),void 0===r&&(r={}),n(this,(function(n){return[2,y(this,t,e,r)]}))}))},r.prototype.getProjectLanguages=function(t){return e(this,void 0,void 0,(function(){return n(this,(function(e){return[2,m(this,t||this.projectID)]}))}))},r}();exports.default=A,exports.determineLanguage=function(t,e){return function(t,e){if("string"==typeof t&&(t=[t]),!e)return t[0];for(var n=function(t){var n=e.find((function(e){return e===t}));if(n)return{value:n};var r=e.find((function(e){return g(e,t)}));return r?{value:r}:void 0},r=0,a=t;r<a.length;r++){var o=n(a[r]);if("object"==typeof o)return o.value}}(t,e)},exports.formatCurrency=function(t){return N(t)},exports.formatDateTime=function(t){return b(t)},exports.formatList=function(t){return w(t)},exports.formatNum=function(t){return h(t)},exports.formatRelativeTime=function(e){return r=(n=e).value,a=n.unit,o=n.languages,i=void 0===o?[s]:o,u=n.options,c=void 0===u?{}:u,new Intl.RelativeTimeFormat(i,t({style:"long",numeric:"auto"},c)).format(r,a);var n,r,a,o,i,u,c},exports.getLanguageDirection=function(t){return function(t){var e;try{var n=new Intl.Locale(t);return"rtl"===(null===(e=null==n?void 0:n.textInfo)||void 0===e?void 0:e.direction)?"rtl":"ltr"}catch(t){return"ltr"}}(t)},exports.getLanguageEmoji=function(t,e){return S(t,e)},exports.getLanguageName=function(t,e){return function(t,e){void 0===e&&(e=s);try{var n=new Intl.DisplayNames([e,s],{type:"language"});return"string"==typeof t?n.of(t)||"":Array.isArray(t)?t.map((function(t){return n.of(t)||""})):""}catch(e){return"string"==typeof t?"":Array.isArray(t)?t.map((function(){return""})):""}}(t,e)},exports.getLanguageNames=function(t,e){return function(t,e){void 0===e&&(e=s);try{var n=new Intl.Locale(t);t=n.toString();var r=n.language,a=n.region,o=new Intl.Locale(t).maximize(),i=o.toString(),u=o.region||"",c=o.script||"",l=new Intl.Locale(t).minimize().toString(),f=new Intl.DisplayNames([e,t,s],{type:"language"}),p=new Intl.DisplayNames([t,e,s],{type:"language"}),g=f.of(t)||t,d=p.of(t)||t,v=f.of(i)||t,y=p.of(i)||t,m=f.of(l)||t,h=p.of(l)||t,b=f.of(r)||t,N=p.of(r)||t,w=a?"".concat(b," (").concat(a,")"):b,L=a?"".concat(N," (").concat(a,")"):N,C=new Intl.DisplayNames([e,t,s],{type:"region"}),T=new Intl.DisplayNames([t,e,s],{type:"region"}),I=C.of(u)||"",x=T.of(u)||"",M=new Intl.DisplayNames([e,t,s],{type:"script"}),E=new Intl.DisplayNames([t,e,s],{type:"script"});return{code:t,name:g,nativeName:d,maximizedCode:i,maximizedName:v,nativeMaximizedName:y,minimizedCode:l,minimizedName:m,nativeMinimizedName:h,languageCode:r,languageName:b,nativeLanguageName:N,nameWithRegionCode:w,nativeNameWithRegionCode:L,regionCode:u,regionName:I,nativeRegionName:x,scriptCode:c,scriptName:M.of(c)||"",nativeScriptName:E.of(c)||"",emoji:S(t)}}catch(e){t||(t="");var A=null==t?void 0:t.split("-");return{code:t,name:t,nativeName:t,maximizedCode:t,maximizedName:t,nativeMaximizedName:t,minimizedCode:t,minimizedName:t,nativeMinimizedName:t,languageCode:r=(null==A?void 0:A[0])||t||"",languageName:r,nativeLanguageName:r,regionCode:u=A.length>2?null==A?void 0:A[2]:(null==A?void 0:A[1])||"",regionName:u,nativeRegionName:u,scriptCode:c=(null==A?void 0:A[3])||"",scriptName:c,nativeScriptName:c,nameWithRegionCode:w=r?u?"".concat(r," (").concat(u,")"):r:"",nativeNameWithRegionCode:t,emoji:S(t)}}}(t,e)},exports.isSameLanguage=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return g.apply(void 0,t)},exports.isValidLanguageCode=function(t){return f(t)},exports.renderContentToString=function(e,n,r,a){return function(e,n,r,a){if(void 0===n&&(n=s),void 0===r&&(r={}),void 0===a&&(a={}),"string"==typeof e&&(e=C(e)),"string"==typeof e)return e;if(!Array.isArray(e))throw new Error("renderContentToString: content ".concat(e," is invalid"));return e.map((function(e){var o;if("string"==typeof e)return e;if("object"==typeof e){var i=r[e.key];return e.variable?"number"===e.variable?h({value:i,languages:n,options:a[e.key]}):"currency"===e.variable?N(t(t({value:i,languages:n},a[e.key]&&{options:a[e.key]}),(null===(o=a[e.key])||void 0===o?void 0:o.currency)&&{currency:a[e.key].currency})):"datetime"===e.variable?b(t({value:i,languages:n},a[e.key]&&{options:a[e.key]})):"list"===e.variable?w(t({value:i,languages:n},a[e.key]&&{options:a[e.key]})):i:i}})).join("")}(e,n,r,a)},exports.requiresTranslation=function(t,e,n){return function(t,e,n){if(!e)return!1;if(p(e)===p(t))return!1;var r=new Intl.Locale(t),a=r.language,o=r.region,i=new Intl.Locale(e),u=i.language,c=i.region;return!(!(o&&c||!g(a,u))||n&&!n.some((function(t){return g(e,t)})))}(t,e,n)},exports.splitStringToContent=function(t){return C(t)},exports.standardizeLanguageCode=function(t){return p(t)};
|
2
2
|
//# sourceMappingURL=index.cjs.min.cjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.cjs.min.cjs","sources":["../node_modules/tslib/tslib.es6.js","../src/settings/defaultAPIRoutes.ts","../src/translation/batch/_translateBatch.ts","../src/settings/libraryDefaultLanguage.ts","../src/codes/codes.ts","../src/codes/_isSameLanguage.ts","../src/translation/translate/_translate.ts","../src/translation/react/_translateReact.ts","../src/dictionaries/_updateDictionary.ts","../src/formatting/format.ts","../src/formatting/string_content.ts","../src/index.ts","../src/codes/_determineLanguage.ts","../src/codes/_requiresTranslation.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","const defaultAPIRoutes = {\n \"translateBatch\": \"/translate/v1/batch\",\n \"translateReact\": \"/translate/v1/react\",\n \"translateContent\": \"/translate/v1/content\",\n \"updateDictionary\": \"/dictionaries/v1/update\"\n} as const;\n\nexport default defaultAPIRoutes;","import { ContentTranslationResult, ReactTranslationResult, Request } from '../../types/types'\nimport defaultAPIRoutes from '../../settings/defaultAPIRoutes';\n\n/**\n * @internal\n */\nexport default async function _translateBatch(\n gt: { baseURL: string, apiKey: string },\n requests: Request[]\n): Promise<Array<ReactTranslationResult | ContentTranslationResult>> {\n const controller = new AbortController();\n const signal = controller.signal;\n if (requests[0]?.data?.metadata?.timeout) {\n setTimeout(() => controller.abort(), requests[0].data.metadata.timeout);\n }\n const response = await fetch(`${gt.baseURL}${defaultAPIRoutes.translateBatch}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'gtx-api-key': gt.apiKey,\n },\n body: JSON.stringify(requests),\n signal\n });\n if (!response.ok) {\n throw new Error(`${response.status}: ${await response.text()}`);\n }\n const resultArray = await response.json();\n return resultArray as Array<ReactTranslationResult | ContentTranslationResult>;\n}","const libraryDefaultLanguage = \"en\";\nexport default libraryDefaultLanguage;","import libraryDefaultLanguage from \"../settings/libraryDefaultLanguage\";\n\n/**\n * Checks if a given BCP 47 language code is valid.\n * @param {string} code - The BCP 47 language code to validate.\n * @returns {boolean} True if the BCP 47 code is valid, false otherwise.\n * @internal\n */\nexport const _isValidLanguageCode = (code: string): boolean => {\n try {\n const { language, region, script } = new Intl.Locale(code);\n const displayLanguageNames = new Intl.DisplayNames([libraryDefaultLanguage], { type: 'language' });\n if (displayLanguageNames.of(language) === language) return false;\n if (region) {\n const displayRegionNames = new Intl.DisplayNames([libraryDefaultLanguage], { type: 'region' });\n if (displayRegionNames.of(region) === region) return false;\n }\n if (script) {\n const displayScriptNames = new Intl.DisplayNames([libraryDefaultLanguage], { type: 'script' });\n if (displayScriptNames.of(script) === script) return false;\n }\n return true;\n } catch {\n return false;\n }\n};\n\n/**\n * Standardizes a BCP 47 language code to ensure correct formatting.\n * @param {string} code - The BCP 47 language code to standardize.\n * @returns {string} The standardized BCP 47 language code, or an empty string if invalid.\n * @internal\n */\nexport const _standardizeLanguageCode = (code: string): string => {\n try {\n return new Intl.Locale(code).toString();\n } catch {\n // Return empty string instead of throwing an error\n return '';\n }\n};\n\n/**\n * Retrieves the display name(s) of language code(s) using Intl.DisplayNames.\n *\n * @param {string | string[]} code - A language code or an array of codes.\n * @param {string} [defaultLanguage=libraryDefaultLanguage] - The language for display names.\n * @returns {string | string[]} The display name(s) corresponding to the code(s), or empty string(s) if invalid.\n * @internal\n */\nexport function _getLanguageName(code: string | string[], defaultLanguage: string = libraryDefaultLanguage): string | string[] {\n try {\n const displayNames = new Intl.DisplayNames([defaultLanguage], { type: 'language' });\n if (typeof code === 'string') {\n // Handle the case where it's a single language code\n const name = displayNames.of(code);\n return name || '';\n } else if (Array.isArray(code)) {\n // Handle the case where it's an array of language codes\n return code.map((c) => displayNames.of(c) || '');\n }\n // If code is neither string nor array, return empty string\n return '';\n } catch {\n // In case Intl.DisplayNames construction fails, return empty string(s)\n if (typeof code === 'string') {\n return '';\n } else if (Array.isArray(code)) {\n return code.map(() => '');\n }\n return '';\n }\n}\n\n/**\n * Get the text direction for a given language code using the Intl.Locale API.\n * \n * @param {string} code - The language code to check.\n * @returns {string} - 'rtl' if the language is right-to-left, otherwise 'ltr'.\n * @internal\n */\nexport function _getLanguageDirection(code: string): string {\n try {\n const locale = new Intl.Locale(code);\n // Return 'rtl' if the text direction of the language is right-to-left, otherwise 'ltr'\n return (locale as any)?.textInfo?.direction === 'rtl' ? 'rtl' : 'ltr';\n } catch {\n // If the code is invalid or causes an error, fallback to 'ltr'\n return 'ltr';\n }\n}\n","/**\n * @internal\n */\nexport default function _isSameLanguage(...codes: (string | string[])[]): boolean {\n try {\n const flattenedCodes = codes.flat();\n // Get the language for each code\n const languages = flattenedCodes.map(code => new Intl.Locale(code).language);\n return languages.every(language => language === languages[0]);\n } catch (error) {\n console.error(error);\n return false;\n }\n}\n\n","import { Content, ContentTranslationResult } from \"src/types/types\";\nimport defaultAPIRoutes from \"../../settings/defaultAPIRoutes\";\n\n/**\n * @internal\n**/\nexport default async function _translate(\n gt: { baseURL: string; apiKey: string },\n content: Content,\n targetLanguage: string,\n metadata: { [key: string]: any }\n): Promise<ContentTranslationResult> {\n const controller = new AbortController();\n const signal = controller.signal;\n if (metadata.timeout) {\n setTimeout(() => controller.abort(), metadata.timeout);\n }\n const response = await fetch(`${gt.baseURL}${defaultAPIRoutes.translateContent}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'gtx-api-key': gt.apiKey,\n },\n body: JSON.stringify({\n content, targetLanguage, metadata\n }),\n signal\n });\n if (!response.ok) {\n throw new Error(`${response.status}: ${await response.text()}`);\n }\n const result = await response.json();\n return result as ContentTranslationResult;\n}\n\n","import { ReactChildrenAsObject, ReactTranslationResult } from \"src/types/types\";\nimport defaultAPIRoutes from \"../../settings/defaultAPIRoutes\";\n\n/**\n * @internal\n**/\nexport default async function _translateReact(\n gt: { baseURL: string, apiKey: string },\n content: ReactChildrenAsObject,\n targetLanguage: string,\n metadata: { [key: string]: any }\n): Promise<ReactTranslationResult> {\n const controller = new AbortController();\n const signal = controller.signal;\n if (metadata.timeout) {\n setTimeout(() => controller.abort(), metadata.timeout);\n }\n const response = await fetch(`${gt.baseURL}${defaultAPIRoutes.translateReact}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'gtx-api-key': gt.apiKey,\n },\n body: JSON.stringify({\n children: content,\n targetLanguage: targetLanguage,\n metadata: metadata\n }),\n signal\n });\n if (!response.ok) {\n throw new Error(`${response.status}: ${await response.text()}`);\n }\n return await response.json() as ReactTranslationResult;\n}","import { Content, Update } from '../types/types'\nimport defaultAPIRoutes from '../settings/defaultAPIRoutes';\n\n/**\n * @internal\n */\nexport default async function _updateDictionary(\n gt: { baseURL: string, apiKey: string },\n updates: Update[],\n languages: string[],\n options: Record<string, any>\n): Promise<string[]> {\n const response = await fetch(`${gt.baseURL}${defaultAPIRoutes.updateDictionary}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'gtx-api-key': gt.apiKey,\n },\n body: JSON.stringify({\n updates, languages, options\n })\n });\n if (!response.ok) {\n throw new Error(`${response.status}: ${await response.text()}`);\n }\n const result = await response.json();\n return (result as { languages: string[] })?.languages;\n}","import libraryDefaultLanguage from '../settings/libraryDefaultLanguage'\n\n/**\n * Formats a number according to the specified languages and options.\n * \n * @param {Object} params - The parameters for the number formatting.\n * @param {number} params.value - The number to format.\n * @param {string | string[]} [params.languages=['en']] - The languages to use for formatting.\n * @param {Intl.NumberFormatOptions} [params.options={}] - Additional options for number formatting.\n * \n * @returns {string} The formatted number.\n * @internal\n */\nexport function _formatNum({\n value,\n languages = [libraryDefaultLanguage],\n options = {}\n}: {\n value: number, languages?: string | string[]\n options?: Intl.NumberFormatOptions\n}): string {\n return new Intl.NumberFormat(languages, { numberingSystem: 'latn', ...options }).format(value);\n}\n\n/**\n * Formats a date according to the specified languages and options.\n * \n * @param {Object} params - The parameters for the date formatting.\n * @param {Date} params.value - The date to format.\n * @param {string | string[]} [params.languages=['en']] - The languages to use for formatting.\n * @param {Intl.DateTimeFormatOptions} [params.options={}] - Additional options for date formatting.\n * \n * @returns {string} The formatted date.\n * @internal\n */\nexport function _formatDateTime({\n value,\n languages = [libraryDefaultLanguage],\n options = {}\n}: {\n value: Date, languages?: string | string[]\n options?: Intl.DateTimeFormatOptions\n}): string {\n return new Intl.DateTimeFormat(languages, { calendar: \"gregory\", numberingSystem: \"latn\", ...options }).format(value);\n}\n\n/**\n * Formats a currency value according to the specified languages, currency, and options.\n * \n * @param {Object} params - The parameters for the currency formatting.\n * @param {number} params.value - The currency value to format.\n * @param {string} params.currency - The currency code (e.g., 'USD').\n * @param {string | string[]} [params.languages=['en']] - The languages to use for formatting.\n * @param {Intl.NumberFormatOptions} [params.options={}] - Additional options for currency formatting.\n * \n * @returns {string} The formatted currency value.\n * @internal\n */\n\nexport function _formatCurrency({\n value,\n languages = [libraryDefaultLanguage],\n currency = 'USD',\n options = {}\n}: {\n value: number, \n currency?: string,\n languages?: string | string[]\n options?: Intl.NumberFormatOptions\n}): string {\n return new Intl.NumberFormat(languages, { style: 'currency', currency, numberingSystem: 'latn', ...options }).format(value);\n}\n\n/**\n * Formats a list of items according to the specified languages and options.\n * \n * @param {Object} params - The parameters for the list formatting.\n * @param {Array<string | number>} params.value - The list of items to format.\n * @param {string | string[]} [params.languages=['en']] - The languages to use for formatting.\n * @param {Intl.ListFormatOptions} [params.options={}] - Additional options for list formatting.\n * \n * @returns {string} The formatted list.\n * @internal\n */\nexport function _formatList({\n value,\n languages = [libraryDefaultLanguage],\n options = {}\n}: {\n value: Array<any>,\n languages?: string | string[],\n options?: Intl.ListFormatOptions\n}): string {\n return new Intl.ListFormat(languages, { \n type: 'conjunction', // Default type, can be overridden via options\n style: 'long', // Default style, can be overridden via options\n ...options \n }).format(value);\n}\n\n/**\n * Formats a relative time value according to the specified languages and options.\n * \n * @param {Object} params - The parameters for the relative time formatting.\n * @param {number} params.value - The relative time value to format.\n * @param {Intl.RelativeTimeFormatUnit} params.unit - The unit of time (e.g., 'second', 'minute', 'hour', 'day', 'week', 'month', 'year').\n * @param {string | string[]} [params.languages=['en']] - The languages to use for formatting.\n * @param {Intl.RelativeTimeFormatOptions} [params.options={}] - Additional options for relative time formatting.\n * \n * @returns {string} The formatted relative time string.\n * @internal\n */\nexport function _formatRelativeTime({\n value,\n unit,\n languages = [libraryDefaultLanguage],\n options = {}\n}: {\n value: number,\n unit: Intl.RelativeTimeFormatUnit,\n languages?: string | string[],\n options?: Intl.RelativeTimeFormatOptions\n}): string {\n return new Intl.RelativeTimeFormat(languages, { style: \"long\", numeric: 'auto', ...options }).format(value, unit);\n}","import libraryDefaultLanguage from '../settings/libraryDefaultLanguage';\nimport { Content, VariableObject } from '../types/types'\nimport { _formatCurrency, _formatDateTime, _formatNum, _formatList, _formatRelativeTime } from './format'\n\n// Variable types mapping\nconst variableTypeMap: { [key: string]: string } = {\n var: \"variable\",\n num: \"number\",\n datetime: \"datetime\",\n currency: \"currency\"\n};\n\n/** \n* @internal\n*/\n/** \n * @internal\n */\nexport function _splitStringToContent(string: string): Content {\n if (typeof string !== 'string')\n throw new Error(`splitStringToContent: ${string} is not a string!`)\n\n const result: (string | VariableObject)[] = [];\n const regex = /{([^}]+)}/g;\n let lastIndex = 0;\n let match: RegExpExecArray | null;\n\n while ((match = regex.exec(string)) !== null) {\n const [fullMatch, content] = match;\n const startIndex = match.index;\n\n // Check for escaped braces with '^' right before the opening brace\n if (string[startIndex - 1] === \"^\") {\n // Add text before the escape sequence\n if (startIndex - 1 > lastIndex) {\n result.push(string.slice(lastIndex, startIndex - 1));\n }\n // Add the escaped content as literal text\n result.push(fullMatch);\n lastIndex = startIndex + fullMatch.length;\n continue;\n }\n\n // Add text before the match\n if (startIndex > lastIndex) {\n result.push(string.slice(lastIndex, startIndex));\n }\n\n // Handle the variable substitution inside the braces\n const parts = content.split(\",\").map(part => part.trim());\n const key = parts[0];\n const variableType = parts[1] ? variableTypeMap[parts[1]] : undefined;\n\n const variableObject: VariableObject = {\n key,\n ...(variableType && { variable: variableType })\n };\n result.push(variableObject);\n\n lastIndex = startIndex + fullMatch.length;\n }\n\n // Add the remaining part of the string after the last match\n if (lastIndex < string.length) {\n result.push(string.slice(lastIndex));\n }\n\n return result;\n}\n\n\n/** \n* @internal\n*/\nexport function _renderContentToString(content: Content, languages: string | string[] = libraryDefaultLanguage, variables: Record<string, any> = {}, variableOptions: Record<string, any> = {}): string {\n if (typeof content === 'string')\n content = _splitStringToContent(content);\n if (typeof content === 'string')\n return content;\n if (!Array.isArray(content))\n throw new Error(`renderContentToString: content ${content} is invalid`);\n return content.map(item => {\n if (typeof item === 'string') return item;\n if (typeof item === 'object') {\n const value = variables[item.key]\n if (!item.variable) return value;\n else if (item.variable === \"number\") {\n return _formatNum({\n value, languages, \n options: variableOptions[item.key]\n })\n }\n else if (item.variable === \"currency\") {\n return _formatCurrency({\n value, languages, \n ...(variableOptions[item.key] && { options: variableOptions[item.key]}),\n ...(variableOptions[item.key]?.currency && { currency: variableOptions[item.key].currency })\n })\n }\n else if (item.variable === \"datetime\") {\n return _formatDateTime({\n value, languages, \n ...(variableOptions[item.key] && { options: variableOptions[item.key]}),\n })\n }\n else if (item.variable === \"list\") {\n return _formatList({\n value, languages, \n ...(variableOptions[item.key] && { options: variableOptions[item.key]}),\n })\n }\n return value;\n }\n }).join('') \n}","// `generaltranslation` language toolkit\n// ยฉ 2024, General Translation, Inc.\n\n// ----- IMPORTS ----- //\n\nimport _translateBatch from './translation/batch/_translateBatch';\nimport _requiresTranslation from './codes/_requiresTranslation';\nimport _translate from './translation/translate/_translate';\nimport _translateReact from './translation/react/_translateReact';\nimport _updateDictionary from './dictionaries/_updateDictionary';\nimport _determineLanguage from './codes/_determineLanguage';\nimport { _formatNum, _formatCurrency, _formatList, _formatRelativeTime, _formatDateTime } from './formatting/format';\nimport { _splitStringToContent, _renderContentToString } from './formatting/string_content'\nimport { Content, Update, Request, ReactChildrenAsObject, ReactTranslationResult, ContentTranslationResult } from './types/types'\nimport { _getLanguageName, _isValidLanguageCode, _getLanguageDirection, _standardizeLanguageCode } from './codes/codes';\nimport _isSameLanguage from './codes/_isSameLanguage'\nimport libraryDefaultLanguage from './settings/libraryDefaultLanguage';\n\n// ----- CORE CLASS ----- // \n\nconst getDefaultFromEnv = (VARIABLE: string): string => {\n if (typeof process !== 'undefined' && process.env) {\n return process.env[VARIABLE] || '';\n }\n return '';\n}\n\n/**\n * Type representing the constructor parameters for the GT class.\n */\ntype GTConstructorParams = {\n apiKey?: string;\n defaultLanguage?: string;\n projectID?: string;\n baseURL?: string;\n};\n\n/**\n * GT is the core driver for the General Translation library.\n */\nclass GT {\n apiKey: string;\n defaultLanguage: string;\n projectID: string;\n baseURL: string;\n\n /**\n * Constructs an instance of the GT class.\n * \n * @param {GTConstructorParams} [params] - The parameters for initializing the GT instance.\n * @param {string} [params.apiKey=''] - The API key for accessing the translation service.\n * @param {string} [params.defaultLanguage='en'] - The default language for translations.\n * @param {string} [params.projectID=''] - The project ID for the translation service.\n * @param {string} [params.baseURL='https://prod.gtx.dev'] - The base URL for the translation service.\n */\n constructor({\n apiKey = '',\n defaultLanguage = libraryDefaultLanguage,\n projectID = '',\n baseURL = 'https://prod.gtx.dev'\n }: GTConstructorParams = {}) {\n this.apiKey = apiKey || getDefaultFromEnv('GT_API_KEY');\n this.projectID = projectID || getDefaultFromEnv('GT_PROJECT_ID');\n this.defaultLanguage = defaultLanguage.toLowerCase();\n this.baseURL = baseURL;\n }\n\n /**\n * Translates a string or an array of strings/variables into a target language.\n * If `metadata.save` is provided, the translation is cached for use in a public project.\n * \n * @param {Content} content - The string or array of strings/variables to be translated.\n * @param {string} language - The target language code (e.g., 'en', 'fr') for the translation.\n * @param {{ context?: string, save?: boolean, [key: string]: any }} [metadata] - Additional metadata for the translation request.\n * @param {string} [metadata.context] - Contextual information to assist with the translation.\n * @param {boolean} [metadata.save] - Whether to cache the translation for use in a public project.\n * \n * @returns {Promise<ContentTranslationResult>} A promise that resolves to the translated content, or an error if the translation fails.\n */\n async translate(content: Content, language: string, metadata?: { \n context?: string,\n save?: boolean, \n [key: string]: any \n }): Promise<{ translation: Content, language: string }> {\n return await _translate(this, content, language, { defaultLanguage: this.defaultLanguage, ...metadata })\n }\n\n /**\n * Translates the content of React children elements.\n * \n * @param {Object} params - The parameters for the translation.\n * @param {ReactChildrenAsObject} params.children - The React children content to be translated.\n * @param {string} params.language - The target language for the translation.\n * @param {Object} params.metadata - Additional metadata for the translation process.\n * \n * @returns {Promise<ReactTranslationResult>} - A promise that resolves to the translated content.\n */\n async translateReact(children: ReactChildrenAsObject, language: string, metadata?: { context?: string, save?: boolean, [key: string]: any }): Promise<ReactTranslationResult> {\n return await _translateReact(this, children, language, { defaultLanguage: this.defaultLanguage, ...metadata });\n }\n\n /**\n * Batches multiple translation requests and sends them to the server.\n * @param requests - Array of requests to be processed and sent.\n * @returns A promise that resolves to an array of processed results.\n */\n async translateBatch(requests: Request[]): Promise<Array<ReactTranslationResult | ContentTranslationResult>> {\n return _translateBatch(this, requests);\n }\n\n /**\n * Pushes updates to a remotely cached translation dictionary.\n * @param {Update[]} updates - Array of updates.\n * @param {string[]} [languages] - Array of languages to be updated.\n * @param {string} [projectID=this.projectID] - The ID of the project. Defaults to the instance's projectID.\n * @param {Record<string, any>} [object] - Options, such as whether to replace the existing dictionary. Defaults to false.\n * @returns {Promise<string[]>} A promise that resolves to an array of strings indicating the languages which have been updated.\n */\n async updateDictionary(\n updates: Update[], \n languages: string[] = [], \n options: {\n replace?: boolean,\n retranslate?: boolean,\n projectID?: string;\n [key: string]: any\n } = {}\n ): Promise<string[]> {\n return _updateDictionary(this, updates, languages, options);\n }\n\n}\n\n// ----- EXPORTS ----- //\n\n/**\n * Get the text direction for a given language code using the Intl.Locale API.\n * \n * @param {string} code - The language code to check.\n * @returns {string} - 'rtl' if the language is right-to-left, otherwise 'ltr'.\n */\nexport function getLanguageDirection(code: string): string {\n return _getLanguageDirection(code);\n};\n\n/**\n * Retrieves the display name(s) of language code(s) using Intl.DisplayNames.\n *\n * @param {string | string[]} code - A language code or an array of codes.\n * @param {string} [language = 'en'] - The language for display names.\n * @returns {string | string[]} The display name(s) corresponding to the code(s), or empty string(s) if invalid.\n */\nexport function getLanguageName(code: string | string[], language?: string): string | string[] {\n return _getLanguageName(code, language)\n};\n\n/**\n * Checks if a given BCP 47 language code is valid.\n * @param {string} code - The BCP 47 language code to validate.\n * @returns {boolean} True if the BCP 47 code is valid, false otherwise.\n */\nexport function isValidLanguageCode(code: string): boolean {\n return _isValidLanguageCode(code);\n};\n\n/**\n * Standardizes a BCP 47 language code to ensure correct formatting.\n * @param {string} code - The BCP 47 language code to standardize.\n * @returns {string} The standardized BCP 47 language code. \n */\nexport function standardizeLanguageCode(code: string): string {\n return _standardizeLanguageCode(code);\n};\n\n/**\n * Checks if multiple BCP 47 language codes represent the same language.\n * @param {string[]} codes - The BCP 47 language codes to compare.\n * @returns {boolean} True if all BCP 47 codes represent the same language, false otherwise.\n */\nexport function isSameLanguage(...codes: (string | string[])[]): boolean {\n return _isSameLanguage(...codes)\n};\n\n/**\n * Formats a number according to the specified languages and options.\n * @param {Object} params - The parameters for the number formatting.\n * @param {number} params.value - The number to format.\n * @param {string | string[]} [params.languages=['en']] - The languages to use for formatting.\n * @param {Intl.NumberFormatOptions} [params.options={}] - Additional options for number formatting.\n * @returns {string} The formatted number.\n */\nexport function formatNum(params: { value: number; languages?: string | string[]; options?: Intl.NumberFormatOptions }): string {\n return _formatNum(params);\n};\n\n/**\n * Formats a date according to the specified languages and options.\n * @param {Object} params - The parameters for the date formatting.\n * @param {Date} params.value - The date to format.\n * @param {string | string[]} [params.languages=['en']] - The languages to use for formatting.\n * @param {Intl.DateTimeFormatOptions} [params.options={}] - Additional options for date formatting.\n * @returns {string} The formatted date.\n */\nexport function formatDateTime(params: { value: Date; languages?: string | string[]; options?: Intl.DateTimeFormatOptions }): string {\n return _formatDateTime(params);\n};\n\n/**\n * Formats a currency value according to the specified languages, currency, and options.\n * @param {Object} params - The parameters for the currency formatting.\n * @param {number} params.value - The currency value to format.\n * @param {string} params.currency - The currency code (e.g., 'USD').\n * @param {string | string[]} [params.languages=['en']] - The languages to use for formatting.\n * @param {Intl.NumberFormatOptions} [params.options={}] - Additional options for currency formatting.\n * @returns {string} The formatted currency value.\n */\nexport function formatCurrency(params: { value: number; currency: string; languages?: string | string[]; options?: Intl.NumberFormatOptions }): string {\n return _formatCurrency(params);\n};\n\n/**\n * Formats a list of items according to the specified languages and options.\n * @param {Object} params - The parameters for the list formatting.\n * @param {Array<string | number>} params.value - The list of items to format.\n * @param {string | string[]} [params.languages=['en']] - The languages to use for formatting.\n * @param {Intl.ListFormatOptions} [params.options={}] - Additional options for list formatting.\n * @returns {string} The formatted list.\n */\nexport function formatList(params: { value: Array<string | number>; languages?: string | string[]; options?: Intl.ListFormatOptions }) {\n return _formatList(params);\n};\n\n/**\n * Formats a relative time value according to the specified languages and options.\n * @param {Object} params - The parameters for the relative time formatting.\n * @param {number} params.value - The relative time value to format.\n * @param {Intl.RelativeTimeFormatUnit} params.unit - The unit of time (e.g., 'second', 'minute', 'hour', 'day', 'week', 'month', 'year').\n * @param {string | string[]} [params.languages=['en']] - The languages to use for formatting.\n * @param {Intl.RelativeTimeFormatOptions} [params.options={}] - Additional options for relative time formatting.\n * @returns {string} The formatted relative time string.\n */\nexport function formatRelativeTime(params: { value: number; unit: Intl.RelativeTimeFormatUnit; languages?: string | string[]; options?: Intl.RelativeTimeFormatOptions }): string {\n return _formatRelativeTime(params);\n};\n\n/**\n * Splits a string into an array of text and variable objects.\n * @param {string} string - The input string to split.\n * @returns {Content} - An array containing strings and VariableObjects.\n */\nexport function splitStringToContent(string: string): Content {\n return _splitStringToContent(string);\n};\n\n/**\n * Renders content to a string by replacing variables with their formatted values.\n * @param {Content} content - The content to render.\n * @param {string | string[]} [languages='en'] - The language(s) to use for formatting.\n * @param {Record<string, any>} [variables={}] - An object containing variable values.\n * @param {Record<string, any>} [variableOptions={}] - An object containing options for formatting variables.\n * @returns {string} - The rendered string with variables replaced by their formatted values.\n */\nexport function renderContentToString(content: Content, languages?: string | string[], variables?: Record<string, any>, variableOptions?: Record<string, any>): string {\n return _renderContentToString(content, languages, variables, variableOptions)\n};\n\n/**\n * Determines the best matching language from the approved languages list based on a provided list of preferred languages.\n * @param {string | string[]} languages - A single language or an array of languages sorted in preference order.\n * @param {string[]} approvedLanguages - An array of approved languages, also sorted by preference.\n * @returns {string | undefined} - The best matching language from the approvedLanguages list, or undefined if no match is found.\n */\nexport function determineLanguage(languages: string | string[], approvedLanguages: string[]): string | undefined {\n return _determineLanguage(languages, approvedLanguages);\n};\n\n/**\n * Determines whether a translation is required based on the source and target language.\n * \n * - If the target language is not specified, the function returns `false`, as translation is not needed.\n * - If the source and target language are the same, returns `false`, indicating that no translation is necessary.\n * - If the `approvedLanguages` array is provided, and the target language is not within that array, the function also returns `false`.\n * - Otherwise, it returns `true`, meaning that a translation is required.\n * \n * @param {string} sourceLanguage - The language of the original content (BCP 47 language code).\n * @param {string} targetLanguage - The language to translate the content into (BCP 47 language code).\n * @param {string[]} [approvedLanguages] - An optional array of approved target languages.\n * \n * @returns {boolean} - Returns `true` if translation is required, otherwise `false`.\n */\nexport function requiresTranslation(sourceLanguage: string, targetLanguage: string, approvedLanguages?: string[]): boolean {\n return _requiresTranslation(sourceLanguage, targetLanguage, approvedLanguages);\n};\n\n// DEFAULT EXPORT\n\nexport default GT;","import isSameLanguage from './_isSameLanguage'\n\n/**\n * Given a list of language and a list of approved language, sorted in preference order\n * Determines which language of the given languages is the best match in the approvedLanguages, prioritizing exact matches and falling back to dialects of the same language\n* @internal\n*/\nexport default function _determineLanguage(\n languages: string | string[], approvedLanguages: string[]\n): string | undefined {\n if (typeof languages === 'string')\n languages = [languages];\n if (!approvedLanguages) return languages[0];\n for (const language of languages) {\n const exactMatch = approvedLanguages.find(approvedLanguage => approvedLanguage === language)\n if (exactMatch) return exactMatch;\n const sameLanguage = approvedLanguages.find(approvedLanguage => isSameLanguage(approvedLanguage, language));\n if (sameLanguage) return sameLanguage;\n }\n return undefined;\n}","import { _standardizeLanguageCode } from \"./codes\";\nimport _isSameLanguage from \"./_isSameLanguage\";\n\n/**\n * Given a target language and a source language, determines whether a translation is required\n * If the target language and the source language are the same, returns false, otherwise returns true\n * If a translation is not possible due to the target language being outside of the optional approvedLanguages scope, also returns false\n* @internal\n*/\nexport default function _requiresTranslation(\n sourceLanguage: string, targetLanguage: string, approvedLanguages?: string[]\n): boolean {\n\n // if no target\n if (!targetLanguage) return false;\n\n // if the codes are exactly the same\n if (_standardizeLanguageCode(targetLanguage) === _standardizeLanguageCode(sourceLanguage)) return false;\n\n // if the codes are more/less specific versions of each other, e.g. en and en-US\n const { language: sourceLanguageCode, region: sourceRegion } = new Intl.Locale(sourceLanguage);\n const { language: targetLanguageCode, region: targetRegion } = new Intl.Locale(targetLanguage);\n if ((!sourceRegion || !targetRegion) && _isSameLanguage(sourceLanguageCode, targetLanguageCode)) return false;\n\n // if no translation is possible\n if (approvedLanguages && !approvedLanguages.some(approvedLanguage => _isSameLanguage(targetLanguage, approvedLanguage))) return false;\n \n // otherwise, a translation is required!\n return true;\n}"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","__generator","body","f","y","_","label","sent","trys","ops","g","create","Iterator","verb","Symbol","iterator","v","op","TypeError","pop","push","SuppressedError","defaultAPIRoutes","_translateBatch","gt","requests","controller","AbortController","signal","_f","_e","_d","data","metadata","timeout","setTimeout","abort","fetch","concat","baseURL","method","headers","apiKey","JSON","stringify","response","_g","ok","Error","bind","_c","_b","status","text","json","libraryDefaultLanguage","_standardizeLanguageCode","code","Intl","Locale","toString","_a","_isSameLanguage","codes","_i","languages_1","flat","map","language","every","error","console","_translate","content","targetLanguage","_translateReact","children","_updateDictionary","updates","languages","options","_formatNum","NumberFormat","numberingSystem","format","_formatDateTime","DateTimeFormat","calendar","_formatCurrency","currency","style","_formatList","ListFormat","type","variableTypeMap","var","num","datetime","_splitStringToContent","string","match","regex","lastIndex","exec","fullMatch","startIndex","index","slice","parts","split","part","trim","key","variableType","undefined","variableObject","variable","getDefaultFromEnv","VARIABLE","process","env","GT","defaultLanguage","projectID","toLowerCase","translate","translateReact","translateBatch","updateDictionary","updates_1","approvedLanguages","exactMatch","find","approvedLanguage","sameLanguage","isSameLanguage","_determineLanguage","params","unit","RelativeTimeFormat","numeric","locale","textInfo","direction","_getLanguageDirection","displayNames_1","DisplayNames","of","Array","isArray","c","_getLanguageName","region","script","_isValidLanguageCode","variables","variableOptions","item","join","_renderContentToString","sourceLanguage","sourceLanguageCode","sourceRegion","targetLanguageCode","targetRegion","some","_requiresTranslation"],"mappings":"oEA+BO,IAAIA,EAAW,WAQlB,OAPAA,EAAWC,OAAOC,QAAU,SAAkBC,GAC1C,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAKL,EAAEK,IAE9E,OAAON,CACV,EACMH,EAASa,MAAMC,KAAMP,UAChC,EA0EO,SAASQ,EAAUC,EAASC,EAAYC,EAAGC,GAE9C,OAAO,IAAKD,IAAMA,EAAIE,WAAU,SAAUC,EAASC,GAC/C,SAASC,EAAUC,GAAS,IAAMC,EAAKN,EAAUO,KAAKF,GAAQ,CAAG,MAAOG,GAAKL,EAAOK,GAAO,CAC3F,SAASC,EAASJ,GAAS,IAAMC,EAAKN,EAAiB,MAAEK,GAAU,CAAC,MAAOG,GAAKL,EAAOK,GAAO,CAC9F,SAASF,EAAKI,GAJlB,IAAeL,EAIaK,EAAOC,KAAOT,EAAQQ,EAAOL,QAJ1CA,EAIyDK,EAAOL,MAJhDA,aAAiBN,EAAIM,EAAQ,IAAIN,GAAE,SAAUG,GAAWA,EAAQG,EAAO,KAIhBO,KAAKR,EAAWK,EAAY,CAC9GH,GAAMN,EAAYA,EAAUN,MAAMG,EAASC,GAAc,KAAKS,OACtE,GACA,CAEO,SAASM,EAAYhB,EAASiB,GACjC,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AAgBC,EAAK7C,QAGlEvH,EA1BoBA,CA2B9B,CACL,IAAGqK,KAAK,GACZ,CCqJWC,CAAuBtF,EAASM,EAAW4E,EAAWC,EACjE,uCA0BoCI,EAAwBtF,EAAwBwD,GAChF,OE1RoB,SACpB8B,EAAwBtF,EAAwBwD,GAIhD,IAAKxD,EAAgB,OAAO,EAG5B,GAAIlB,EAAyBkB,KAAoBlB,EAAyBwG,GAAiB,OAAO,EAG5F,IAAAnG,EAAyD,IAAIH,KAAKC,OAAOqG,GAA7DC,EAAkBpG,EAAAO,SAAU8F,WACxC/G,EAAyD,IAAIO,KAAKC,OAAOe,GAA7DyF,EAAkBhH,EAAAiB,SAAUgG,WAC9C,UAAMF,GAAiBE,IAAiBtG,EAAgBmG,EAAoBE,KAGxEjC,IAAsBA,EAAkBmC,MAAK,SAAAhC,GAAoB,OAAAvE,EAAgBY,EAAgB2D,EAAiB,IAI1H,CFsQWiC,CAAqBN,EAAgBtF,EAAgBwD,EAChE,+BA1CM,SAA+B/B,GACjC,OAAOD,EAAsBC,EACjC,kCAlFM,SAAkC1C,GACpC,OAAOD,EAAyBC,EACpC","x_google_ignoreList":[0]}
|
1
|
+
{"version":3,"file":"index.cjs.min.cjs","sources":["../node_modules/tslib/tslib.es6.js","../src/settings/defaultAPIRoutes.ts","../src/translation/batch/_translateBatch.ts","../src/settings/libraryDefaultLanguage.ts","../src/codes/codes.ts","../src/codes/_isSameLanguage.ts","../src/translation/translate/_translate.ts","../src/translation/react/_translateReact.ts","../src/projects/_updateProjectDictionary.ts","../src/projects/_getProjectLanguages.ts","../src/formatting/format.ts","../src/formatting/string_content.ts","../src/codes/emojis.ts","../src/index.ts","../src/codes/_determineLanguage.ts","../src/codes/_getLanguageNames.ts","../src/codes/_requiresTranslation.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","const defaultAPIRoutes = {\n \"translateBatch\": \"/v1/translate/batch\",\n \"translateReact\": \"/v1/translate/react\",\n \"translateContent\": \"/v1/translate/content\",\n \"updateProjectDictionary\": \"/v1/project/dictionary/update\",\n \"getProjectLanguages\": \"/v1/project/languages\"\n} as const;\n\nexport default defaultAPIRoutes;","import { ContentTranslationResult, ReactTranslationResult, Request } from '../../types/types'\nimport defaultAPIRoutes from '../../settings/defaultAPIRoutes';\n\n/**\n * @internal\n */\nexport default async function _translateBatch(\n gt: { baseURL: string, apiKey: string },\n requests: Request[]\n): Promise<Array<ReactTranslationResult | ContentTranslationResult>> {\n const controller = new AbortController();\n const signal = controller.signal;\n if (requests[0]?.data?.metadata?.timeout) {\n setTimeout(() => controller.abort(), requests[0].data.metadata.timeout);\n }\n const response = await fetch(`${gt.baseURL}${defaultAPIRoutes.translateBatch}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'gtx-api-key': gt.apiKey,\n },\n body: JSON.stringify(requests),\n signal\n });\n if (!response.ok) {\n throw new Error(`${response.status}: ${await response.text()}`);\n }\n const resultArray = await response.json();\n return resultArray as Array<ReactTranslationResult | ContentTranslationResult>;\n}","const libraryDefaultLanguage = \"en\";\nexport default libraryDefaultLanguage;","import libraryDefaultLanguage from \"../settings/libraryDefaultLanguage\";\n\nconst scriptExceptions = [\n \"Cham\",\n \"Jamo\",\n \"Kawi\",\n \"Lisu\",\n \"Toto\",\n \"Thai\"\n];\n\n/**\n * Checks if a given BCP 47 language code is valid.\n * @param {string} code - The BCP 47 language code to validate.\n * @returns {boolean} True if the BCP 47 code is valid, false otherwise.\n * @internal\n */\nexport const _isValidLanguageCode = (code: string): boolean => {\n try {\n const { language, region, script } = new Intl.Locale(code);\n const displayLanguageNames = new Intl.DisplayNames([libraryDefaultLanguage], { type: 'language' });\n if (displayLanguageNames.of(language) === language) return false;\n if (region) {\n const displayRegionNames = new Intl.DisplayNames([libraryDefaultLanguage], { type: 'region' });\n if (displayRegionNames.of(region) === region) return false;\n }\n if (script) {\n const displayScriptNames = new Intl.DisplayNames([libraryDefaultLanguage], { type: 'script' });\n if (displayScriptNames.of(script) === script && !scriptExceptions.includes(script)) return false;\n }\n return true;\n } catch {\n return false;\n }\n};\n\n/**\n * Standardizes a BCP 47 language code to ensure correct formatting.\n * @param {string} code - The BCP 47 language code to standardize.\n * @returns {string} The standardized BCP 47 language code, or an empty string if invalid.\n * @internal\n */\nexport const _standardizeLanguageCode = (code: string): string => {\n try {\n return Intl.getCanonicalLocales(code)[0];\n } catch {\n // Return empty string instead of throwing an error\n return '';\n }\n};\n\n/**\n * Retrieves the display name(s) of language code(s) using Intl.DisplayNames.\n *\n * @param {string | string[]} code - A language code or an array of codes.\n * @param {string} [defaultLanguage=libraryDefaultLanguage] - The language for display names.\n * @returns {string | string[]} The display name(s) corresponding to the code(s), or empty string(s) if invalid.\n * @internal\n*/\nexport function _getLanguageName(code: string | string[], defaultLanguage: string = libraryDefaultLanguage): string | string[] {\n try {\n const displayNames = new Intl.DisplayNames([defaultLanguage, libraryDefaultLanguage], { type: 'language' });\n if (typeof code === 'string') {\n // Handle the case where it's a single language code\n const name = displayNames.of(code);\n return name || '';\n } else if (Array.isArray(code)) {\n // Handle the case where it's an array of language codes\n return code.map((c) => displayNames.of(c) || '');\n }\n // If code is neither string nor array, return empty string\n return '';\n } catch {\n // In case Intl.DisplayNames construction fails, return empty string(s)\n if (typeof code === 'string') {\n return '';\n } else if (Array.isArray(code)) {\n return code.map(() => '');\n }\n return '';\n }\n}\n\n/**\n * Get the text direction for a given language code using the Intl.Locale API.\n * \n * @param {string} code - The language code to check.\n * @returns {string} - 'rtl' if the language is right-to-left, otherwise 'ltr'.\n * @internal\n */\nexport function _getLanguageDirection(code: string): string {\n try {\n const locale = new Intl.Locale(code);\n // Return 'rtl' if the text direction of the language is right-to-left, otherwise 'ltr'\n return (locale as any)?.textInfo?.direction === 'rtl' ? 'rtl' : 'ltr';\n } catch {\n // If the code is invalid or causes an error, fallback to 'ltr'\n return 'ltr';\n }\n}\n","/**\n * @internal\n */\nexport default function _isSameLanguage(...codes: (string | string[])[]): boolean {\n try {\n const flattenedCodes = codes.flat();\n // Get the language for each code\n const languages = flattenedCodes.map(code => new Intl.Locale(code).language);\n return languages.every(language => language === languages[0]);\n } catch (error) {\n console.error(error);\n return false;\n }\n}\n\n","import { Content, ContentTranslationResult } from \"src/types/types\";\nimport defaultAPIRoutes from \"../../settings/defaultAPIRoutes\";\n\n/**\n * @internal\n**/\nexport default async function _translate(\n gt: { baseURL: string; apiKey: string },\n content: Content,\n targetLanguage: string,\n metadata: { [key: string]: any }\n): Promise<ContentTranslationResult> {\n const controller = new AbortController();\n const signal = controller.signal;\n if (metadata.timeout) {\n setTimeout(() => controller.abort(), metadata.timeout);\n }\n const response = await fetch(`${gt.baseURL}${defaultAPIRoutes.translateContent}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'gtx-api-key': gt.apiKey,\n },\n body: JSON.stringify({\n content, targetLanguage, metadata\n }),\n signal\n });\n if (!response.ok) {\n throw new Error(`${response.status}: ${await response.text()}`);\n }\n const result = await response.json();\n return result as ContentTranslationResult;\n}\n\n","import { ReactChildrenAsObject, ReactTranslationResult } from \"src/types/types\";\nimport defaultAPIRoutes from \"../../settings/defaultAPIRoutes\";\n\n/**\n * @internal\n**/\nexport default async function _translateReact(\n gt: { baseURL: string, apiKey: string },\n content: ReactChildrenAsObject,\n targetLanguage: string,\n metadata: { [key: string]: any }\n): Promise<ReactTranslationResult> {\n const controller = new AbortController();\n const signal = controller.signal;\n if (metadata.timeout) {\n setTimeout(() => controller.abort(), metadata.timeout);\n }\n const response = await fetch(`${gt.baseURL}${defaultAPIRoutes.translateReact}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'gtx-api-key': gt.apiKey,\n },\n body: JSON.stringify({\n children: content,\n targetLanguage: targetLanguage,\n metadata: metadata\n }),\n signal\n });\n if (!response.ok) {\n throw new Error(`${response.status}: ${await response.text()}`);\n }\n return await response.json() as ReactTranslationResult;\n}","import { Content, Update } from '../types/types'\nimport defaultAPIRoutes from '../settings/defaultAPIRoutes';\n\n/**\n * @internal\n */\nexport default async function _updateProjectDictionary(\n gt: { baseURL: string, apiKey: string },\n updates: Update[],\n languages: string[],\n options: Record<string, any>\n): Promise<string[]> {\n const response = await fetch(`${gt.baseURL}${defaultAPIRoutes.updateProjectDictionary}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'gtx-api-key': gt.apiKey,\n },\n body: JSON.stringify({\n updates, languages, options\n })\n });\n if (!response.ok) {\n throw new Error(`${response.status}: ${await response.text()}`);\n }\n const result = await response.json();\n return (result as { languages: string[] })?.languages;\n}","import defaultAPIRoutes from '../settings/defaultAPIRoutes';\n\n/**\n * @internal\n */\nexport default async function _getProjectLanguages(\n gt: { baseURL: string, apiKey: string },\n projectID: string\n): Promise<string[]> {\n const response = await fetch(`${gt.baseURL}${defaultAPIRoutes.getProjectLanguages}?projectID=${projectID}`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n 'gtx-api-key': gt.apiKey,\n }\n });\n if (!response.ok) {\n throw new Error(`${response.status}: ${await response.text()}`);\n }\n const result = await response.json();\n return (result as { languages: string[] })?.languages;\n}","import libraryDefaultLanguage from '../settings/libraryDefaultLanguage'\n\n/**\n * Formats a number according to the specified languages and options.\n * \n * @param {Object} params - The parameters for the number formatting.\n * @param {number} params.value - The number to format.\n * @param {string | string[]} [params.languages=['en']] - The languages to use for formatting.\n * @param {Intl.NumberFormatOptions} [params.options={}] - Additional options for number formatting.\n * \n * @returns {string} The formatted number.\n * @internal\n */\nexport function _formatNum({\n value,\n languages = [libraryDefaultLanguage],\n options = {}\n}: {\n value: number, languages?: string | string[]\n options?: Intl.NumberFormatOptions\n}): string {\n return new Intl.NumberFormat(languages, { numberingSystem: 'latn', ...options }).format(value);\n}\n\n/**\n * Formats a date according to the specified languages and options.\n * \n * @param {Object} params - The parameters for the date formatting.\n * @param {Date} params.value - The date to format.\n * @param {string | string[]} [params.languages=['en']] - The languages to use for formatting.\n * @param {Intl.DateTimeFormatOptions} [params.options={}] - Additional options for date formatting.\n * \n * @returns {string} The formatted date.\n * @internal\n */\nexport function _formatDateTime({\n value,\n languages = [libraryDefaultLanguage],\n options = {}\n}: {\n value: Date, languages?: string | string[]\n options?: Intl.DateTimeFormatOptions\n}): string {\n return new Intl.DateTimeFormat(languages, { calendar: \"gregory\", numberingSystem: \"latn\", ...options }).format(value);\n}\n\n/**\n * Formats a currency value according to the specified languages, currency, and options.\n * \n * @param {Object} params - The parameters for the currency formatting.\n * @param {number} params.value - The currency value to format.\n * @param {string} params.currency - The currency code (e.g., 'USD').\n * @param {string | string[]} [params.languages=['en']] - The languages to use for formatting.\n * @param {Intl.NumberFormatOptions} [params.options={}] - Additional options for currency formatting.\n * \n * @returns {string} The formatted currency value.\n * @internal\n */\n\nexport function _formatCurrency({\n value,\n languages = [libraryDefaultLanguage],\n currency = 'USD',\n options = {}\n}: {\n value: number, \n currency?: string,\n languages?: string | string[]\n options?: Intl.NumberFormatOptions\n}): string {\n return new Intl.NumberFormat(languages, { style: 'currency', currency, numberingSystem: 'latn', ...options }).format(value);\n}\n\n/**\n * Formats a list of items according to the specified languages and options.\n * \n * @param {Object} params - The parameters for the list formatting.\n * @param {Array<string | number>} params.value - The list of items to format.\n * @param {string | string[]} [params.languages=['en']] - The languages to use for formatting.\n * @param {Intl.ListFormatOptions} [params.options={}] - Additional options for list formatting.\n * \n * @returns {string} The formatted list.\n * @internal\n */\nexport function _formatList({\n value,\n languages = [libraryDefaultLanguage],\n options = {}\n}: {\n value: Array<any>,\n languages?: string | string[],\n options?: Intl.ListFormatOptions\n}): string {\n return new Intl.ListFormat(languages, { \n type: 'conjunction', // Default type, can be overridden via options\n style: 'long', // Default style, can be overridden via options\n ...options \n }).format(value);\n}\n\n/**\n * Formats a relative time value according to the specified languages and options.\n * \n * @param {Object} params - The parameters for the relative time formatting.\n * @param {number} params.value - The relative time value to format.\n * @param {Intl.RelativeTimeFormatUnit} params.unit - The unit of time (e.g., 'second', 'minute', 'hour', 'day', 'week', 'month', 'year').\n * @param {string | string[]} [params.languages=['en']] - The languages to use for formatting.\n * @param {Intl.RelativeTimeFormatOptions} [params.options={}] - Additional options for relative time formatting.\n * \n * @returns {string} The formatted relative time string.\n * @internal\n */\nexport function _formatRelativeTime({\n value,\n unit,\n languages = [libraryDefaultLanguage],\n options = {}\n}: {\n value: number,\n unit: Intl.RelativeTimeFormatUnit,\n languages?: string | string[],\n options?: Intl.RelativeTimeFormatOptions\n}): string {\n return new Intl.RelativeTimeFormat(languages, { style: \"long\", numeric: 'auto', ...options }).format(value, unit);\n}","import libraryDefaultLanguage from '../settings/libraryDefaultLanguage';\nimport { Content, VariableObject } from '../types/types'\nimport { _formatCurrency, _formatDateTime, _formatNum, _formatList, _formatRelativeTime } from './format'\n\n// Variable types mapping\nconst variableTypeMap: { [key: string]: string } = {\n var: \"variable\",\n num: \"number\",\n datetime: \"datetime\",\n currency: \"currency\"\n};\n\n/** \n* @internal\n*/\n/** \n * @internal\n */\nexport function _splitStringToContent(string: string): Content {\n if (typeof string !== 'string')\n throw new Error(`splitStringToContent: ${string} is not a string!`)\n\n const result: (string | VariableObject)[] = [];\n const regex = /{([^}]+)}/g;\n let lastIndex = 0;\n let match: RegExpExecArray | null;\n\n while ((match = regex.exec(string)) !== null) {\n const [fullMatch, content] = match;\n const startIndex = match.index;\n\n // Check for escaped braces with '^' right before the opening brace\n if (string[startIndex - 1] === \"^\") {\n // Add text before the escape sequence\n if (startIndex - 1 > lastIndex) {\n result.push(string.slice(lastIndex, startIndex - 1));\n }\n // Add the escaped content as literal text\n result.push(fullMatch);\n lastIndex = startIndex + fullMatch.length;\n continue;\n }\n\n // Add text before the match\n if (startIndex > lastIndex) {\n result.push(string.slice(lastIndex, startIndex));\n }\n\n // Handle the variable substitution inside the braces\n const parts = content.split(\",\").map(part => part.trim());\n const key = parts[0];\n const variableType = parts[1] ? variableTypeMap[parts[1]] : undefined;\n\n const variableObject: VariableObject = {\n key,\n ...(variableType && { variable: variableType })\n };\n result.push(variableObject);\n\n lastIndex = startIndex + fullMatch.length;\n }\n\n // Add the remaining part of the string after the last match\n if (lastIndex < string.length) {\n result.push(string.slice(lastIndex));\n }\n\n return result;\n}\n\n\n/** \n* @internal\n*/\nexport function _renderContentToString(content: Content, languages: string | string[] = libraryDefaultLanguage, variables: Record<string, any> = {}, variableOptions: Record<string, any> = {}): string {\n if (typeof content === 'string')\n content = _splitStringToContent(content);\n if (typeof content === 'string')\n return content;\n if (!Array.isArray(content))\n throw new Error(`renderContentToString: content ${content} is invalid`);\n return content.map(item => {\n if (typeof item === 'string') return item;\n if (typeof item === 'object') {\n const value = variables[item.key]\n if (!item.variable) return value;\n else if (item.variable === \"number\") {\n return _formatNum({\n value, languages, \n options: variableOptions[item.key]\n })\n }\n else if (item.variable === \"currency\") {\n return _formatCurrency({\n value, languages, \n ...(variableOptions[item.key] && { options: variableOptions[item.key]}),\n ...(variableOptions[item.key]?.currency && { currency: variableOptions[item.key].currency })\n })\n }\n else if (item.variable === \"datetime\") {\n return _formatDateTime({\n value, languages, \n ...(variableOptions[item.key] && { options: variableOptions[item.key]}),\n })\n }\n else if (item.variable === \"list\") {\n return _formatList({\n value, languages, \n ...(variableOptions[item.key] && { options: variableOptions[item.key]}),\n })\n }\n return value;\n }\n }).join('') \n}","import { _isValidLanguageCode } from \"./codes\";\n\n/**\n* @internal\n*/\nexport default function _getLanguageEmoji(\n code: string, \n custom: Record<string, string> = {}\n): string {\n if (!_isValidLanguageCode(code))\n return defaultLanguageEmoji;\n\n const locale = new Intl.Locale(code);\n code = locale.toString();\n\n if (custom[code]) return custom[code];\n \n // if a region is specified, use it!\n const { region } = locale;\n if (region && emojis[region]) return emojis[region];\n \n // if not, attempt to extrapolate\n const extrapolated = locale.maximize();\n const extrapolatedRegion = extrapolated.region || '';\n\n return (\n exceptions[extrapolated.language] || \n emojis[extrapolatedRegion] || \n defaultLanguageEmoji\n );\n}\n\n// Default language emoji for when none else can be found\nconst europeAfricaGlobe = \"๐\";\nconst asiaAustraliaGlobe = \"๐\";\nexport const defaultLanguageEmoji = europeAfricaGlobe;\n\n// Exceptions to better reflect linguistic and cultural identities\nconst exceptions = {\n \"ca\": europeAfricaGlobe,\n \"eu\": europeAfricaGlobe,\n \"ku\": europeAfricaGlobe,\n \"bo\": asiaAustraliaGlobe,\n \"ug\": asiaAustraliaGlobe,\n \"gd\": \"๐ด๓ ง๓ ข๓ ณ๓ ฃ๓ ด๓ ฟ\",\n \"cy\": \"๐ด๓ ง๓ ข๓ ท๓ ฌ๓ ณ๓ ฟ\",\n \"gv\": \"๐ฎ๐ฒ\",\n \"grc\": \"๐บ\"\n} as Record<string, string>;\n\nconst emojis = {\n AF: '๐ฆ๐ซ', // Afghanistan\n AX: '๐ฆ๐ฝ', // ร
land Islands\n AL: '๐ฆ๐ฑ', // Albania\n DZ: '๐ฉ๐ฟ', // Algeria\n AS: '๐ฆ๐ธ', // American Samoa\n AD: '๐ฆ๐ฉ', // Andorra\n AO: '๐ฆ๐ด', // Angola\n AI: '๐ฆ๐ฎ', // Anguilla\n AQ: '๐ฆ๐ถ', // Antarctica\n AG: '๐ฆ๐ฌ', // Antigua and Barbuda\n AR: '๐ฆ๐ท', // Argentina\n AM: '๐ฆ๐ฒ', // Armenia\n AW: '๐ฆ๐ผ', // Aruba\n AU: '๐ฆ๐บ', // Australia\n AT: '๐ฆ๐น', // Austria\n AZ: '๐ฆ๐ฟ', // Azerbaijan\n BS: '๐ง๐ธ', // Bahamas\n BH: '๐ง๐ญ', // Bahrain\n BD: '๐ง๐ฉ', // Bangladesh\n BB: '๐ง๐ง', // Barbados\n BY: '๐ง๐พ', // Belarus\n BE: '๐ง๐ช', // Belgium\n BZ: '๐ง๐ฟ', // Belize\n BJ: '๐ง๐ฏ', // Benin\n BM: '๐ง๐ฒ', // Bermuda\n BT: '๐ง๐น', // Bhutan\n BO: '๐ง๐ด', // Bolivia\n BQ: '๐ง๐ถ', // Bonaire, Sint Eustatius and Saba\n BA: '๐ง๐ฆ', // Bosnia and Herzegovina\n BW: '๐ง๐ผ', // Botswana\n BV: '๐ง๐ป', // Bouvet Island\n BR: '๐ง๐ท', // Brazil\n IO: '๐ฎ๐ด', // British Indian Ocean Territory\n BN: '๐ง๐ณ', // Brunei Darussalam\n BG: '๐ง๐ฌ', // Bulgaria\n BF: '๐ง๐ซ', // Burkina Faso\n BI: '๐ง๐ฎ', // Burundi\n CV: '๐จ๐ป', // Cabo Verde\n KH: '๐ฐ๐ญ', // Cambodia\n CM: '๐จ๐ฒ', // Cameroon\n CA: '๐จ๐ฆ', // Canada\n KY: '๐ฐ๐พ', // Cayman Islands\n CF: '๐จ๐ซ', // Central African Republic\n TD: '๐น๐ฉ', // Chad\n CL: '๐จ๐ฑ', // Chile\n CN: '๐จ๐ณ', // China\n CX: '๐จ๐ฝ', // Christmas Island\n CC: '๐จ๐จ', // Cocos (Keeling) Islands\n CO: '๐จ๐ด', // Colombia\n KM: '๐ฐ๐ฒ', // Comoros\n CD: '๐จ๐ฉ', // Congo (Democratic Republic)\n CG: '๐จ๐ฌ', // Congo (Republic)\n CK: '๐จ๐ฐ', // Cook Islands\n CR: '๐จ๐ท', // Costa Rica\n CI: '๐จ๐ฎ', // Cรดte d'Ivoire\n HR: '๐ญ๐ท', // Croatia\n CU: '๐จ๐บ', // Cuba\n CW: '๐จ๐ผ', // Curaรงao\n CY: '๐จ๐พ', // Cyprus\n CZ: '๐จ๐ฟ', // Czechia\n DK: '๐ฉ๐ฐ', // Denmark\n DJ: '๐ฉ๐ฏ', // Djibouti\n DM: '๐ฉ๐ฒ', // Dominica\n DO: '๐ฉ๐ด', // Dominican Republic\n EC: '๐ช๐จ', // Ecuador\n EG: '๐ช๐ฌ', // Egypt\n SV: '๐ธ๐ป', // El Salvador\n GQ: '๐ฌ๐ถ', // Equatorial Guinea\n ER: '๐ช๐ท', // Eritrea\n EE: '๐ช๐ช', // Estonia\n SZ: '๐ธ๐ฟ', // Eswatini\n ET: '๐ช๐น', // Ethiopia\n FK: '๐ซ๐ฐ', // Falkland Islands\n FO: '๐ซ๐ด', // Faroe Islands\n FJ: '๐ซ๐ฏ', // Fiji\n FI: '๐ซ๐ฎ', // Finland\n FR: '๐ซ๐ท', // France\n GF: '๐ฌ๐ซ', // French Guiana\n PF: '๐ต๐ซ', // French Polynesia\n TF: '๐น๐ซ', // French Southern Territories\n GA: '๐ฌ๐ฆ', // Gabon\n GM: '๐ฌ๐ฒ', // Gambia\n GE: '๐ฌ๐ช', // Georgia\n DE: '๐ฉ๐ช', // Germany\n GH: '๐ฌ๐ญ', // Ghana\n GI: '๐ฌ๐ฎ', // Gibraltar\n GR: '๐ฌ๐ท', // Greece\n GL: '๐ฌ๐ฑ', // Greenland\n GD: '๐ฌ๐ฉ', // Grenada\n GP: '๐ฌ๐ต', // Guadeloupe\n GU: '๐ฌ๐บ', // Guam\n GT: '๐ฌ๐น', // Guatemala\n GG: '๐ฌ๐ฌ', // Guernsey\n GN: '๐ฌ๐ณ', // Guinea\n GW: '๐ฌ๐ผ', // Guinea-Bissau\n GY: '๐ฌ๐พ', // Guyana\n HT: '๐ญ๐น', // Haiti\n HM: '๐ญ๐ฒ', // Heard Island and McDonald Islands\n VA: '๐ป๐ฆ', // Holy See\n HN: '๐ญ๐ณ', // Honduras\n HK: '๐ญ๐ฐ', // Hong Kong\n HU: '๐ญ๐บ', // Hungary\n IS: '๐ฎ๐ธ', // Iceland\n IN: '๐ฎ๐ณ', // India\n ID: '๐ฎ๐ฉ', // Indonesia\n IR: '๐ฎ๐ท', // Iran\n IQ: '๐ฎ๐ถ', // Iraq\n IE: '๐ฎ๐ช', // Ireland\n IM: '๐ฎ๐ฒ', // Isle of Man\n IL: '๐ฎ๐ฑ', // Israel\n IT: '๐ฎ๐น', // Italy\n JM: '๐ฏ๐ฒ', // Jamaica\n JP: '๐ฏ๐ต', // Japan\n JE: '๐ฏ๐ช', // Jersey\n JO: '๐ฏ๐ด', // Jordan\n KZ: '๐ฐ๐ฟ', // Kazakhstan\n KE: '๐ฐ๐ช', // Kenya\n KI: '๐ฐ๐ฎ', // Kiribati\n KP: '๐ฐ๐ต', // Korea (North)\n KR: '๐ฐ๐ท', // Korea (South)\n KW: '๐ฐ๐ผ', // Kuwait\n KG: '๐ฐ๐ฌ', // Kyrgyzstan\n LA: '๐ฑ๐ฆ', // Laos\n LV: '๐ฑ๐ป', // Latvia\n LB: '๐ฑ๐ง', // Lebanon\n LS: '๐ฑ๐ธ', // Lesotho\n LR: '๐ฑ๐ท', // Liberia\n LY: '๐ฑ๐พ', // Libya\n LI: '๐ฑ๐ฎ', // Liechtenstein\n LT: '๐ฑ๐น', // Lithuania\n LU: '๐ฑ๐บ', // Luxembourg\n MO: '๐ฒ๐ด', // Macao\n MG: '๐ฒ๐ฌ', // Madagascar\n MW: '๐ฒ๐ผ', // Malawi\n MY: '๐ฒ๐พ', // Malaysia\n MV: '๐ฒ๐ป', // Maldives\n ML: '๐ฒ๐ฑ', // Mali\n MT: '๐ฒ๐น', // Malta\n MH: '๐ฒ๐ญ', // Marshall Islands\n MQ: '๐ฒ๐ถ', // Martinique\n MR: '๐ฒ๐ท', // Mauritania\n MU: '๐ฒ๐บ', // Mauritius\n YT: '๐พ๐น', // Mayotte\n MX: '๐ฒ๐ฝ', // Mexico\n FM: '๐ซ๐ฒ', // Micronesia\n MD: '๐ฒ๐ฉ', // Moldova\n MC: '๐ฒ๐จ', // Monaco\n MN: '๐ฒ๐ณ', // Mongolia\n ME: '๐ฒ๐ช', // Montenegro\n MS: '๐ฒ๐ธ', // Montserrat\n MA: '๐ฒ๐ฆ', // Morocco\n MZ: '๐ฒ๐ฟ', // Mozambique\n MM: '๐ฒ๐ฒ', // Myanmar\n NA: '๐ณ๐ฆ', // Namibia\n NR: '๐ณ๐ท', // Nauru\n NP: '๐ณ๐ต', // Nepal\n NL: '๐ณ๐ฑ', // Netherlands\n NC: '๐ณ๐จ', // New Caledonia\n NZ: '๐ณ๐ฟ', // New Zealand\n NI: '๐ณ๐ฎ', // Nicaragua\n NE: '๐ณ๐ช', // Niger\n NG: '๐ณ๐ฌ', // Nigeria\n NU: '๐ณ๐บ', // Niue\n NF: '๐ณ๐ซ', // Norfolk Island\n MK: '๐ฒ๐ฐ', // North Macedonia\n MP: '๐ฒ๐ต', // Northern Mariana Islands\n NO: '๐ณ๐ด', // Norway\n OM: '๐ด๐ฒ', // Oman\n PK: '๐ต๐ฐ', // Pakistan\n PW: '๐ต๐ผ', // Palau\n PS: '๐ต๐ธ', // Palestine, State of\n PA: '๐ต๐ฆ', // Panama\n PG: '๐ต๐ฌ', // Papua New Guinea\n PY: '๐ต๐พ', // Paraguay\n PE: '๐ต๐ช', // Peru\n PH: '๐ต๐ญ', // Philippines\n PN: '๐ต๐ณ', // Pitcairn\n PL: '๐ต๐ฑ', // Poland\n PT: '๐ต๐น', // Portugal\n PR: '๐ต๐ท', // Puerto Rico\n QA: '๐ถ๐ฆ', // Qatar\n RE: '๐ท๐ช', // Rรฉunion\n RO: '๐ท๐ด', // Romania\n RU: '๐ท๐บ', // Russian Federation\n RW: '๐ท๐ผ', // Rwanda\n BL: '๐ง๐ฑ', // Saint Barthรฉlemy\n SH: '๐ธ๐ญ', // Saint Helena, Ascension and Tristan da Cunha\n KN: '๐ฐ๐ณ', // Saint Kitts and Nevis\n LC: '๐ฑ๐จ', // Saint Lucia\n MF: '๐ฒ๐ซ', // Saint Martin (French part)\n PM: '๐ต๐ฒ', // Saint Pierre and Miquelon\n VC: '๐ป๐จ', // Saint Vincent and the Grenadines\n WS: '๐ผ๐ธ', // Samoa\n SM: '๐ธ๐ฒ', // San Marino\n ST: '๐ธ๐น', // Sรฃo Tomรฉ and Prรญncipe\n SA: '๐ธ๐ฆ', // Saudi Arabia\n SN: '๐ธ๐ณ', // Senegal\n RS: '๐ท๐ธ', // Serbia\n SC: '๐ธ๐จ', // Seychelles\n SL: '๐ธ๐ฑ', // Sierra Leone\n SG: '๐ธ๐ฌ', // Singapore\n SX: '๐ธ๐ฝ', // Sint Maarten (Dutch part)\n SK: '๐ธ๐ฐ', // Slovakia\n SI: '๐ธ๐ฎ', // Slovenia\n SB: '๐ธ๐ง', // Solomon Islands\n SO: '๐ธ๐ด', // Somalia\n ZA: '๐ฟ๐ฆ', // South Africa\n GS: '๐ฌ๐ธ', // South Georgia and the South Sandwich Islands\n SS: '๐ธ๐ธ', // South Sudan\n ES: '๐ช๐ธ', // Spain\n LK: '๐ฑ๐ฐ', // Sri Lanka\n SD: '๐ธ๐ฉ', // Sudan\n SR: '๐ธ๐ท', // Suriname\n SJ: '๐ธ๐ฏ', // Svalbard and Jan Mayen\n SE: '๐ธ๐ช', // Sweden\n CH: '๐จ๐ญ', // Switzerland\n SY: '๐ธ๐พ', // Syrian Arab Republic\n TW: '๐น๐ผ', // Taiwan\n TJ: '๐น๐ฏ', // Tajikistan\n TZ: '๐น๐ฟ', // Tanzania\n TH: '๐น๐ญ', // Thailand\n TL: '๐น๐ฑ', // Timor-Leste\n TG: '๐น๐ฌ', // Togo\n TK: '๐น๐ฐ', // Tokelau\n TO: '๐น๐ด', // Tonga\n TT: '๐น๐น', // Trinidad and Tobago\n TN: '๐น๐ณ', // Tunisia\n TR: '๐น๐ท', // Tรผrkiye\n TM: '๐น๐ฒ', // Turkmenistan\n TC: '๐น๐จ', // Turks and Caicos Islands\n TV: '๐น๐ป', // Tuvalu\n UG: '๐บ๐ฌ', // Uganda\n UA: '๐บ๐ฆ', // Ukraine\n AE: '๐ฆ๐ช', // United Arab Emirates\n GB: '๐ฌ๐ง', // United Kingdom\n US: '๐บ๐ธ', // United States of America\n UM: '๐บ๐ฒ', // United States Minor Outlying Islands\n UY: '๐บ๐พ', // Uruguay\n UZ: '๐บ๐ฟ', // Uzbekistan\n VU: '๐ป๐บ', // Vanuatu\n VE: '๐ป๐ช', // Venezuela\n VN: '๐ป๐ณ', // Viet Nam\n VG: '๐ป๐ฌ', // Virgin Islands (British)\n VI: '๐ป๐ฎ', // Virgin Islands (U.S.)\n WF: '๐ผ๐ซ', // Wallis and Futuna\n EH: '๐ช๐ญ', // Western Sahara\n YE: '๐พ๐ช', // Yemen\n ZM: '๐ฟ๐ฒ', // Zambia\n ZW: '๐ฟ๐ผ', // Zimbabwe,\n EU: '๐ช๐บ' // European Union (EU)\n} as Record<string, string>;","// `generaltranslation` language toolkit\n// ยฉ 2024, General Translation, Inc.\n\n// ----- IMPORTS ----- //\n\nimport _translateBatch from './translation/batch/_translateBatch';\nimport _requiresTranslation from './codes/_requiresTranslation';\nimport _translate from './translation/translate/_translate';\nimport _translateReact from './translation/react/_translateReact';\nimport _updateProjectDictionary from './projects/_updateProjectDictionary';\nimport _getProjectLanguages from './projects/_getProjectLanguages';\nimport _determineLanguage from './codes/_determineLanguage';\nimport { _formatNum, _formatCurrency, _formatList, _formatRelativeTime, _formatDateTime } from './formatting/format';\nimport { _splitStringToContent, _renderContentToString } from './formatting/string_content'\nimport { Content, Update, Request, ReactChildrenAsObject, ReactTranslationResult, ContentTranslationResult } from './types/types'\nimport { _getLanguageName, _isValidLanguageCode, _getLanguageDirection, _standardizeLanguageCode } from './codes/codes';\nimport _isSameLanguage from './codes/_isSameLanguage'\nimport _getLanguageNames from './codes/_getLanguageNames';\nimport libraryDefaultLanguage from './settings/libraryDefaultLanguage';\nimport _getLanguageEmoji from './codes/emojis';\n\n// ----- CORE CLASS ----- // \n\nconst getDefaultFromEnv = (VARIABLE: string): string => {\n if (typeof process !== 'undefined' && process.env) {\n return process.env[VARIABLE] || '';\n }\n return '';\n}\n\n/**\n * Type representing the constructor parameters for the GT class.\n */\ntype GTConstructorParams = {\n apiKey?: string;\n defaultLanguage?: string;\n projectID?: string;\n baseURL?: string;\n};\n\n/**\n * GT is the core driver for the General Translation library.\n */\nclass GT {\n apiKey: string;\n defaultLanguage: string;\n projectID: string;\n baseURL: string;\n\n /**\n * Constructs an instance of the GT class.\n * \n * @param {GTConstructorParams} [params] - The parameters for initializing the GT instance.\n * @param {string} [params.apiKey=''] - The API key for accessing the translation service.\n * @param {string} [params.defaultLanguage='en'] - The default language for translations.\n * @param {string} [params.projectID=''] - The project ID for the translation service.\n * @param {string} [params.baseURL='https://prod.gtx.dev'] - The base URL for the translation service.\n */\n constructor({\n apiKey = '',\n defaultLanguage = libraryDefaultLanguage,\n projectID = '',\n baseURL = 'https://prod.gtx.dev'\n }: GTConstructorParams = {}) {\n this.apiKey = apiKey || getDefaultFromEnv('GT_API_KEY');\n this.projectID = projectID || getDefaultFromEnv('GT_PROJECT_ID');\n this.defaultLanguage = defaultLanguage.toLowerCase();\n this.baseURL = baseURL;\n }\n\n /**\n * Translates a string or an array of strings/variables into a target language.\n * If `metadata.save` is provided, the translation is cached for use in a public project.\n * \n * @param {Content} content - The string or array of strings/variables to be translated.\n * @param {string} language - The target language code (e.g., 'en', 'fr') for the translation.\n * @param {{ context?: string, save?: boolean, [key: string]: any }} [metadata] - Additional metadata for the translation request.\n * @param {string} [metadata.context] - Contextual information to assist with the translation.\n * @param {boolean} [metadata.save] - Whether to cache the translation for use in a public project.\n * \n * @returns {Promise<ContentTranslationResult>} A promise that resolves to the translated content, or an error if the translation fails.\n */\n async translate(content: Content, language: string, metadata?: { \n context?: string,\n save?: boolean, \n [key: string]: any \n }): Promise<{ translation: Content, language: string }> {\n return await _translate(this, content, language, { defaultLanguage: this.defaultLanguage, ...metadata })\n }\n\n /**\n * Translates the content of React children elements.\n * \n * @param {Object} params - The parameters for the translation.\n * @param {ReactChildrenAsObject} params.children - The React children content to be translated.\n * @param {string} params.language - The target language for the translation.\n * @param {Object} params.metadata - Additional metadata for the translation process.\n * \n * @returns {Promise<ReactTranslationResult>} - A promise that resolves to the translated content.\n */\n async translateReact(children: ReactChildrenAsObject, language: string, metadata?: { context?: string, save?: boolean, [key: string]: any }): Promise<ReactTranslationResult> {\n return await _translateReact(this, children, language, { defaultLanguage: this.defaultLanguage, ...metadata });\n }\n\n /**\n * Batches multiple translation requests and sends them to the server.\n * @param requests - Array of requests to be processed and sent.\n * @returns A promise that resolves to an array of processed results.\n */\n async translateBatch(requests: Request[]): Promise<Array<ReactTranslationResult | ContentTranslationResult>> {\n return _translateBatch(this, requests);\n }\n\n /**\n * Pushes updates to a remotely cached translation dictionary.\n * @param {Update[]} updates - Array of updates.\n * @param {string[]} [languages] - Array of languages to be updated.\n * @param {string} [projectID=this.projectID] - The ID of the project. Defaults to the instance's projectID.\n * @param {Record<string, any>} [object] - Options, such as whether to replace the existing dictionary. Defaults to false.\n * @returns {Promise<string[]>} A promise that resolves to an array of strings indicating the languages which have been updated.\n */\n async updateProjectDictionary(\n updates: Update[], \n languages: string[] = [], \n options: {\n replace?: boolean,\n retranslate?: boolean,\n projectID?: string;\n [key: string]: any\n } = {}\n ): Promise<string[]> {\n return _updateProjectDictionary(this, updates, languages, options);\n }\n\n /**\n * Retrieves the languages for a GT project as BCP 47 language tags.\n * @param projectID - The project ID to retrieve languages for. If not provided, `this.projectID` should be set.\n * @returns A promise that resolves with an array of languages.\n */\n async getProjectLanguages(\n projectID?: string\n ): Promise<string[]> {\n return _getProjectLanguages(this, projectID || this.projectID);\n }\n\n}\n\n// ----- EXPORTS ----- //\n\n/**\n * Get the text direction for a given language code using the Intl.Locale API.\n * \n * @param {string} code - The language code to check.\n * @returns {string} - 'rtl' if the language is right-to-left, otherwise 'ltr'.\n */\nexport function getLanguageDirection(code: string): string {\n return _getLanguageDirection(code);\n};\n\n/**\n * Retrieves the display name(s) of language code(s) using Intl.DisplayNames.\n *\n * @param {string | string[]} code - A language code or an array of codes.\n * @param {string} [language = 'en'] - The language for display names.\n * @returns {string | string[]} The display name(s) corresponding to the code(s), or empty string(s) if invalid.\n */\nexport function getLanguageName(code: string | string[], language?: string): string | string[] {\n return _getLanguageName(code, language)\n};\n\n/**\n * Generates language details for a given locale code, providing various language-related properties.\n *\n * This function returns information about the language,\n * script, and region of a given language code both in a standard form and in a maximized form (with likely script and region).\n * The function provides these names in both your default language and native forms, and an associated emoji.\n *\n * @param {string} code - The locale code to get language names for (e.g., \"de-AT\").\n * @param {string} [defaultLanguage=libraryDefaultLanguage] - The default language code for display names.\n * @returns {LanguageNames} - An object containing detailed information about the language.\n *\n * @property {string} code - The full locale code, e.g., \"de-AT\".\n * @property {string} name - Language name in the default display language, e.g., \"Austrian German\".\n * @property {string} nativeName - Language name in the locale's native language, e.g., \"รsterreichisches Deutsch\".\n * @property {string} languageCode - The base language code, e.g., \"de\".\n * @property {string} languageName - The language name in the default display language, e.g., \"German\".\n * @property {string} nativeLanguageName - The language name in the native language, e.g., \"Deutsch\".\n * @property {string} nameWithRegionCode - Language name with region in the default language, e.g., \"German (AT)\".\n * @property {string} nativeNameWithRegionCode - Language name with region in the native language, e.g., \"Deutsch (AT)\".\n * @property {string} regionCode - The region code from maximization, e.g., \"AT\".\n * @property {string} regionName - The region name in the default display language, e.g., \"Austria\".\n * @property {string} nativeRegionName - The region name in the native language, e.g., \"รsterreich\".\n * @property {string} scriptCode - The script code from maximization, e.g., \"Latn\".\n * @property {string} scriptName - The script name in the default display language, e.g., \"Latin\".\n * @property {string} nativeScriptName - The script name in the native language, e.g., \"Lateinisch\".\n * @property {string} maximizedCode - The maximized locale code, e.g., \"de-Latn-AT\".\n * @property {string} maximizedName - Maximized language name with likely script in the default language, e.g., \"Austrian German (Latin)\".\n * @property {string} nativeMaximizedName - Maximized language name in the native language, e.g., \"รsterreichisches Deutsch (Lateinisch)\".\n * @property {string} minimizedCode - Minimized locale code, e.g., \"de-AT\" (or \"de\" for \"de-DE\").\n * @property {string} minimizedName - Minimized language name in the default language, e.g., \"Austrian German\".\n * @property {string} nativeMinimizedName - Minimized language name in the native language, e.g., \"รsterreichisches Deutsch\".\n * @property {string} emoji - The emoji associated with the locale's region, if applicable.\n*/\nexport function getLanguageNames(code: string, language?: string): {\n // assume code = \"de-AT\", defaultLanguage = \"en\"\n code: string; // \"de-AT\"\n name: string; // \"Austrian German\"\n nativeName: string; // \"รsterreichisches Deutsch\"\n languageCode: string; // \"de\"\n languageName: string; // \"German\"\n nativeLanguageName: string; // \"Deutsch\"\n // note that maximize() is NOT called here!\n nameWithRegionCode: string // \"German (AT)\"\n nativeNameWithRegionCode: string // \"Deutsch (AT)\"\n // for most likely script and region, maximize() is called\n regionCode: string // \"AT\"\n regionName: string // \"Austria\"\n nativeRegionName: string // รsterreich\n scriptCode: string; // \"Latn\"\n scriptName: string; // \"Latin\"\n nativeScriptName: string; // \"Lateinisch\"\n maximizedCode: string // \"de-Latn-AT\"\n maximizedName: string // \"Austrian German (Latin)\"\n nativeMaximizedName: string; // รsterreichisches Deutsch (Lateinisch)\n minimizedCode: string; // \"de-AT\", but for \"de-DE\" it would just be \"de\"\n minimizedName: string; // \"\"Austrian German\";\n nativeMinimizedName: string; // \"รsterreichisches Deutsch\"\n // Emoji depending on region code\n // In order not to accidentally spark international conflict, some emojis are hard-coded\n emoji: string; \n} {\n return _getLanguageNames(code, language)\n};\n\n/**\n * Retrieves an emoji based on a given language code, taking into account region, language, and specific exceptions.\n * This function uses the language's region (if present) to select an emoji or falls back on default emojis for certain languages.\n * \n * @param code - A string representing the language code (e.g., 'en', 'fr-CA').\n * @param custom - An optional custom mapping of language codes to emojis.\n * @returns The emoji representing the language or its region, or a default emoji if no specific match is found.\n*/\nexport function getLanguageEmoji(code: string, custom?: Record<string, string>) {\n return _getLanguageEmoji(code, custom);\n}\n\n\n/**\n * Checks if a given BCP 47 language code is valid.\n * @param {string} code - The BCP 47 language code to validate.\n * @returns {boolean} True if the BCP 47 code is valid, false otherwise.\n */\nexport function isValidLanguageCode(code: string): boolean {\n return _isValidLanguageCode(code);\n};\n\n/**\n * Standardizes a BCP 47 language code to ensure correct formatting.\n * @param {string} code - The BCP 47 language code to standardize.\n * @returns {string} The standardized BCP 47 language code. \n */\nexport function standardizeLanguageCode(code: string): string {\n return _standardizeLanguageCode(code);\n};\n\n/**\n * Checks if multiple BCP 47 language codes represent the same language.\n * @param {string[]} codes - The BCP 47 language codes to compare.\n * @returns {boolean} True if all BCP 47 codes represent the same language, false otherwise.\n */\nexport function isSameLanguage(...codes: (string | string[])[]): boolean {\n return _isSameLanguage(...codes)\n};\n\n/**\n * Formats a number according to the specified languages and options.\n * @param {Object} params - The parameters for the number formatting.\n * @param {number} params.value - The number to format.\n * @param {string | string[]} [params.languages=['en']] - The languages to use for formatting.\n * @param {Intl.NumberFormatOptions} [params.options={}] - Additional options for number formatting.\n * @returns {string} The formatted number.\n */\nexport function formatNum(params: { value: number; languages?: string | string[]; options?: Intl.NumberFormatOptions }): string {\n return _formatNum(params);\n};\n\n/**\n * Formats a date according to the specified languages and options.\n * @param {Object} params - The parameters for the date formatting.\n * @param {Date} params.value - The date to format.\n * @param {string | string[]} [params.languages=['en']] - The languages to use for formatting.\n * @param {Intl.DateTimeFormatOptions} [params.options={}] - Additional options for date formatting.\n * @returns {string} The formatted date.\n */\nexport function formatDateTime(params: { value: Date; languages?: string | string[]; options?: Intl.DateTimeFormatOptions }): string {\n return _formatDateTime(params);\n};\n\n/**\n * Formats a currency value according to the specified languages, currency, and options.\n * @param {Object} params - The parameters for the currency formatting.\n * @param {number} params.value - The currency value to format.\n * @param {string} params.currency - The currency code (e.g., 'USD').\n * @param {string | string[]} [params.languages=['en']] - The languages to use for formatting.\n * @param {Intl.NumberFormatOptions} [params.options={}] - Additional options for currency formatting.\n * @returns {string} The formatted currency value.\n */\nexport function formatCurrency(params: { value: number; currency: string; languages?: string | string[]; options?: Intl.NumberFormatOptions }): string {\n return _formatCurrency(params);\n};\n\n/**\n * Formats a list of items according to the specified languages and options.\n * @param {Object} params - The parameters for the list formatting.\n * @param {Array<string | number>} params.value - The list of items to format.\n * @param {string | string[]} [params.languages=['en']] - The languages to use for formatting.\n * @param {Intl.ListFormatOptions} [params.options={}] - Additional options for list formatting.\n * @returns {string} The formatted list.\n */\nexport function formatList(params: { value: Array<string | number>; languages?: string | string[]; options?: Intl.ListFormatOptions }) {\n return _formatList(params);\n};\n\n/**\n * Formats a relative time value according to the specified languages and options.\n * @param {Object} params - The parameters for the relative time formatting.\n * @param {number} params.value - The relative time value to format.\n * @param {Intl.RelativeTimeFormatUnit} params.unit - The unit of time (e.g., 'second', 'minute', 'hour', 'day', 'week', 'month', 'year').\n * @param {string | string[]} [params.languages=['en']] - The languages to use for formatting.\n * @param {Intl.RelativeTimeFormatOptions} [params.options={}] - Additional options for relative time formatting.\n * @returns {string} The formatted relative time string.\n */\nexport function formatRelativeTime(params: { value: number; unit: Intl.RelativeTimeFormatUnit; languages?: string | string[]; options?: Intl.RelativeTimeFormatOptions }): string {\n return _formatRelativeTime(params);\n};\n\n/**\n * Splits a string into an array of text and variable objects.\n * @param {string} string - The input string to split.\n * @returns {Content} - An array containing strings and VariableObjects.\n */\nexport function splitStringToContent(string: string): Content {\n return _splitStringToContent(string);\n};\n\n/**\n * Renders content to a string by replacing variables with their formatted values.\n * @param {Content} content - The content to render.\n * @param {string | string[]} [languages='en'] - The language(s) to use for formatting.\n * @param {Record<string, any>} [variables={}] - An object containing variable values.\n * @param {Record<string, any>} [variableOptions={}] - An object containing options for formatting variables.\n * @returns {string} - The rendered string with variables replaced by their formatted values.\n */\nexport function renderContentToString(content: Content, languages?: string | string[], variables?: Record<string, any>, variableOptions?: Record<string, any>): string {\n return _renderContentToString(content, languages, variables, variableOptions)\n};\n\n/**\n * Determines the best matching language from the approved languages list based on a provided list of preferred languages.\n * @param {string | string[]} languages - A single language or an array of languages sorted in preference order.\n * @param {string[]} approvedLanguages - An array of approved languages, also sorted by preference.\n * @returns {string | undefined} - The best matching language from the approvedLanguages list, or undefined if no match is found.\n */\nexport function determineLanguage(languages: string | string[], approvedLanguages: string[]): string | undefined {\n return _determineLanguage(languages, approvedLanguages);\n};\n\n/**\n * Determines whether a translation is required based on the source and target language.\n * \n * - If the target language is not specified, the function returns `false`, as translation is not needed.\n * - If the source and target language are the same, returns `false`, indicating that no translation is necessary.\n * - If the `approvedLanguages` array is provided, and the target language is not within that array, the function also returns `false`.\n * - Otherwise, it returns `true`, meaning that a translation is required.\n * \n * @param {string} sourceLanguage - The language of the original content (BCP 47 language code).\n * @param {string} targetLanguage - The language to translate the content into (BCP 47 language code).\n * @param {string[]} [approvedLanguages] - An optional array of approved target languages.\n * \n * @returns {boolean} - Returns `true` if translation is required, otherwise `false`.\n */\nexport function requiresTranslation(sourceLanguage: string, targetLanguage: string, approvedLanguages?: string[]): boolean {\n return _requiresTranslation(sourceLanguage, targetLanguage, approvedLanguages);\n};\n\n// DEFAULT EXPORT\n\nexport default GT;","import isSameLanguage from './_isSameLanguage'\n\n/**\n * Given a list of language and a list of approved language, sorted in preference order\n * Determines which language of the given languages is the best match in the approvedLanguages, prioritizing exact matches and falling back to dialects of the same language\n* @internal\n*/\nexport default function _determineLanguage(\n languages: string | string[], approvedLanguages: string[]\n): string | undefined {\n if (typeof languages === 'string')\n languages = [languages];\n if (!approvedLanguages) return languages[0];\n for (const language of languages) {\n const exactMatch = approvedLanguages.find(approvedLanguage => approvedLanguage === language)\n if (exactMatch) return exactMatch;\n const sameLanguage = approvedLanguages.find(approvedLanguage => isSameLanguage(approvedLanguage, language));\n if (sameLanguage) return sameLanguage;\n }\n return undefined;\n}","import libraryDefaultLanguage from \"../settings/libraryDefaultLanguage\"\nimport { _isValidLanguageCode, _standardizeLanguageCode } from \"./codes\";\nimport _getLanguageEmoji from \"./emojis\";\n\ntype LanguageNames = {\n \n // assume code = \"de-AT\", defaultLanguage = \"en\"\n\n code: string; // \"de-AT\"\n name: string; // \"Austrian German\"\n nativeName: string; // \"รsterreichisches Deutsch\"\n\n languageCode: string; // \"de\"\n languageName: string; // \"German\"\n nativeLanguageName: string; // \"Deutsch\"\n\n // note that maximize() is NOT called here!\n \n nameWithRegionCode: string // \"German (AT)\"\n nativeNameWithRegionCode: string // \"Deutsch (AT)\"\n\n // for most likely script and region, maximize() is called\n \n regionCode: string // \"AT\"\n regionName: string // \"Austria\"\n nativeRegionName: string // รsterreich\n\n scriptCode: string; // \"Latn\"\n scriptName: string; // \"Latin\"\n nativeScriptName: string; // \"Lateinisch\"\n\n maximizedCode: string // \"de-Latn-AT\"\n maximizedName: string // \"Austrian German (Latin)\"\n nativeMaximizedName: string; // รsterreichisches Deutsch (Lateinisch)\n\n minimizedCode: string; // \"de-AT\", but for \"de-DE\" it would just be \"de\"\n minimizedName: string; // \"\"Austrian German\";\n nativeMinimizedName: string; // \"รsterreichisches Deutsch\"\n\n // Emoji depending on region code\n // In order not to accidentally spark international conflict, some emojis are hard-coded\n emoji: string; \n}\n\n/**\n* @internal\n*/\nexport default function _getLanguageNames(\n code: string, defaultLanguage: string = libraryDefaultLanguage\n): LanguageNames {\n try {\n\n const locale = new Intl.Locale(code); \n code = locale.toString(); // \"de-AT\"\n const languageCode = locale.language; // \"de\"\n const baseRegion = locale.region; // \"AT\"\n \n const maximizedLocale = new Intl.Locale(code).maximize(); \n const maximizedCode = maximizedLocale.toString(); // \"de-Latn-AT\"\n const regionCode = maximizedLocale.region || ''; // \"AT\"\n const scriptCode = maximizedLocale.script || ''; // \"Latn\"\n \n const minimizedLocale = new Intl.Locale(code).minimize();\n const minimizedCode = minimizedLocale.toString(); // \"de-AT\"\n\n // Language names (default and native)\n\n const languageNames = new Intl.DisplayNames([defaultLanguage, code, libraryDefaultLanguage], { type: 'language' });\n const nativeLanguageNames = new Intl.DisplayNames([code, defaultLanguage, libraryDefaultLanguage], { type: 'language' });\n\n const name = languageNames.of(code) || code; // \"Austrian German\"\n const nativeName = nativeLanguageNames.of(code) || code; // \"รsterreichisches Deutsch\"\n \n const maximizedName = languageNames.of(maximizedCode) || code; // \"Austrian German (Latin)\"\n const nativeMaximizedName = nativeLanguageNames.of(maximizedCode) || code; // \"รsterreichisches Deutsch (Lateinisch)\"\n \n const minimizedName = languageNames.of(minimizedCode) || code; // \"Austrian German\", but for \"de-DE\" would just be \"German\"\n const nativeMinimizedName = nativeLanguageNames.of(minimizedCode) || code; // \"รsterreichisches Deutsch\", but for \"de-DE\" would just be \"Deutsch\"\n \n const languageName = languageNames.of(languageCode) || code; // \"German\"\n const nativeLanguageName = nativeLanguageNames.of(languageCode) || code; // \"Deutsch\"\n\n const nameWithRegionCode = baseRegion ? `${languageName} (${baseRegion})`: languageName; // German (AT)\n const nativeNameWithRegionCode = baseRegion ? `${nativeLanguageName} (${baseRegion})`: nativeLanguageName; // \"Deutsch (AT)\"\n\n // Region names (default and native)\n\n const regionNames = new Intl.DisplayNames([defaultLanguage, code, libraryDefaultLanguage], { type: 'region' });\n const nativeRegionNames = new Intl.DisplayNames([code, defaultLanguage, libraryDefaultLanguage], { type: 'region' });\n\n const regionName = regionNames.of(regionCode) || ''; // \"Austria\"\n const nativeRegionName = nativeRegionNames.of(regionCode) || ''; // \"รsterreich\"\n\n // Script names (default and native)\n\n const scriptNames = new Intl.DisplayNames([defaultLanguage, code, libraryDefaultLanguage], { type: 'script' }); \n const nativeScriptNames = new Intl.DisplayNames([code, defaultLanguage, libraryDefaultLanguage], { type: 'script' }); \n\n const scriptName = scriptNames.of(scriptCode) || ''; // \"Latin\"\n const nativeScriptName = nativeScriptNames.of(scriptCode) || ''; // \"Lateinisch\"\n\n // Emoji \n\n const emoji = _getLanguageEmoji(code);\n\n return {\n code, name, nativeName,\n maximizedCode, maximizedName, nativeMaximizedName,\n minimizedCode, minimizedName, nativeMinimizedName,\n languageCode, languageName, nativeLanguageName,\n nameWithRegionCode, nativeNameWithRegionCode,\n regionCode, regionName, nativeRegionName,\n scriptCode, scriptName, nativeScriptName,\n emoji\n }\n } catch (error) {\n \n code ||= '';\n const codeParts = code?.split('-');\n const languageCode = codeParts?.[0] || code || '';\n const regionCode = codeParts.length > 2 ? codeParts?.[2] : codeParts?.[1] || '';\n const scriptCode = codeParts?.[3] || '';\n const nameWithRegionCode = languageCode ? (regionCode ? `${languageCode} (${regionCode})` : languageCode) : '';\n \n return {\n code, name: code, nativeName: code, \n maximizedCode: code, maximizedName: code, nativeMaximizedName: code,\n minimizedCode: code, minimizedName: code, nativeMinimizedName: code,\n languageCode, languageName: languageCode, nativeLanguageName: languageCode,\n regionCode, regionName: regionCode, nativeRegionName: regionCode,\n scriptCode, scriptName: scriptCode, nativeScriptName: scriptCode,\n nameWithRegionCode, nativeNameWithRegionCode: code,\n emoji: _getLanguageEmoji(code)\n }\n }\n\n}","import { _standardizeLanguageCode } from \"./codes\";\nimport _isSameLanguage from \"./_isSameLanguage\";\n\n/**\n * Given a target language and a source language, determines whether a translation is required\n * If the target language and the source language are the same, returns false, otherwise returns true\n * If a translation is not possible due to the target language being outside of the optional approvedLanguages scope, also returns false\n* @internal\n*/\nexport default function _requiresTranslation(\n sourceLanguage: string, targetLanguage: string, approvedLanguages?: string[]\n): boolean {\n\n // if no target\n if (!targetLanguage) return false;\n\n // if the codes are exactly the same\n if (_standardizeLanguageCode(targetLanguage) === _standardizeLanguageCode(sourceLanguage)) return false;\n\n // if the codes are more/less specific versions of each other, e.g. en and en-US\n const { language: sourceLanguageCode, region: sourceRegion } = new Intl.Locale(sourceLanguage);\n const { language: targetLanguageCode, region: targetRegion } = new Intl.Locale(targetLanguage);\n if ((!sourceRegion || !targetRegion) && _isSameLanguage(sourceLanguageCode, targetLanguageCode)) return false;\n\n // if no translation is possible\n if (approvedLanguages && !approvedLanguages.some(approvedLanguage => _isSameLanguage(targetLanguage, approvedLanguage))) return false;\n \n // otherwise, a translation is required!\n return true;\n}"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","__generator","body","f","y","_","label","sent","trys","ops","g","create","Iterator","verb","Symbol","iterator","v","op","TypeError","pop","push","SuppressedError","defaultAPIRoutes","_translateBatch","gt","requests","controller","AbortController","signal","_f","_e","_d","data","metadata","timeout","setTimeout","abort","fetch","concat","baseURL","method","headers","apiKey","JSON","stringify","response","_g","ok","Error","bind","_c","_b","status","text","json","libraryDefaultLanguage","scriptExceptions","_isValidLanguageCode","code","_a","Intl","Locale","language","region","script","DisplayNames","type","of","includes","_standardizeLanguageCode","getCanonicalLocales","_isSameLanguage","codes","_i","languages_1","flat","map","every","error","console","_translate","content","targetLanguage","_translateReact","children","_updateProjectDictionary","updates","languages","options","_getProjectLanguages","projectID","_formatNum","NumberFormat","numberingSystem","format","_formatDateTime","DateTimeFormat","calendar","_formatCurrency","currency","style","_formatList","ListFormat","variableTypeMap","var","num","datetime","_splitStringToContent","string","match","regex","lastIndex","exec","fullMatch","startIndex","index","slice","parts","split","part","trim","key","variableType","undefined","variableObject","variable","_getLanguageEmoji","custom","defaultLanguageEmoji","locale","toString","emojis","extrapolated","maximize","extrapolatedRegion","exceptions","europeAfricaGlobe","ca","eu","ku","bo","ug","gd","cy","gv","grc","AF","AX","AL","DZ","AS","AD","AO","AI","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BQ","BA","BW","BV","BR","IO","BN","BG","BF","BI","CV","KH","CM","CA","KY","CF","TD","CL","CN","CX","CC","CO","KM","CD","CG","CK","CR","CI","HR","CU","CW","CY","CZ","DK","DJ","DM","DO","EC","EG","SV","GQ","ER","EE","SZ","ET","FK","FO","FJ","FI","FR","GF","PF","TF","GA","GM","GE","DE","GH","GI","GR","GL","GD","GP","GU","GT","GG","GN","GW","GY","HT","HM","VA","HN","HK","HU","IS","IN","ID","IR","IQ","IE","IM","IL","IT","JM","JP","JE","JO","KZ","KE","KI","KP","KR","KW","KG","LA","LV","LB","LS","LR","LY","LI","LT","LU","MO","MG","MW","MY","MV","ML","MT","MH","MQ","MR","MU","YT","MX","FM","MD","MC","MN","ME","MS","MA","MZ","MM","NA","NR","NP","NL","NC","NZ","NI","NE","NG","NU","NF","MK","MP","NO","OM","PK","PW","PS","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","RE","RO","RU","RW","BL","SH","KN","LC","MF","PM","VC","WS","SM","ST","SA","SN","RS","SC","SL","SG","SX","SK","SI","SB","SO","ZA","GS","SS","ES","LK","SD","SR","SJ","SE","CH","SY","TW","TJ","TZ","TH","TL","TG","TK","TO","TT","TN","TR","TM","TC","TV","UG","UA","AE","GB","US","UM","UY","UZ","VU","VE","VN","VG","VI","WF","EH","YE","ZM","ZW","EU","getDefaultFromEnv","VARIABLE","process","env","defaultLanguage","toLowerCase","translate","translateReact","translateBatch","updateProjectDictionary","updates_1","getProjectLanguages","approvedLanguages","exactMatch","find","approvedLanguage","sameLanguage","isSameLanguage","_determineLanguage","params","unit","RelativeTimeFormat","numeric","textInfo","direction","_getLanguageDirection","displayNames_1","Array","isArray","c","_getLanguageName","languageCode","baseRegion","maximizedLocale","maximizedCode","regionCode","scriptCode","minimizedCode","minimize","languageNames","nativeLanguageNames","name","nativeName","maximizedName","nativeMaximizedName","minimizedName","nativeMinimizedName","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionNames","nativeRegionNames","regionName","nativeRegionName","scriptNames","nativeScriptNames","scriptName","nativeScriptName","emoji","codeParts","_getLanguageNames","variables","variableOptions","item","join","_renderContentToString","sourceLanguage","sourceLanguageCode","sourceRegion","targetLanguageCode","targetRegion","some","_requiresTranslation"],"mappings":"oEA+BO,IAAIA,EAAW,WAQlB,OAPAA,EAAWC,OAAOC,QAAU,SAAkBC,GAC1C,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAKL,EAAEK,IAE9E,OAAON,CACV,EACMH,EAASa,MAAMC,KAAMP,UAChC,EA0EO,SAASQ,EAAUC,EAASC,EAAYC,EAAGC,GAE9C,OAAO,IAAKD,IAAMA,EAAIE,WAAU,SAAUC,EAASC,GAC/C,SAASC,EAAUC,GAAS,IAAMC,EAAKN,EAAUO,KAAKF,GAAQ,CAAG,MAAOG,GAAKL,EAAOK,GAAO,CAC3F,SAASC,EAASJ,GAAS,IAAMC,EAAKN,EAAiB,MAAEK,GAAU,CAAC,MAAOG,GAAKL,EAAOK,GAAO,CAC9F,SAASF,EAAKI,GAJlB,IAAeL,EAIaK,EAAOC,KAAOT,EAAQQ,EAAOL,QAJ1CA,EAIyDK,EAAOL,MAJhDA,aAAiBN,EAAIM,EAAQ,IAAIN,GAAE,SAAUG,GAAWA,EAAQG,EAAO,KAIhBO,KAAKR,EAAWK,EAAY,CAC9GH,GAAMN,EAAYA,EAAUN,MAAMG,EAASC,GAAc,KAAKS,OACtE,GACA,CAEO,SAASM,EAAYhB,EAASiB,GACjC,IAAsGC,EAAGC,EAAGhC,EAAxGiC,EAAI,CAAEC,MA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ACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,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