locizify 10.0.2 → 10.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 10.0.3
2
+
3
+ - update locize dep
4
+
1
5
  ### 10.0.2
2
6
 
3
7
  - update locize deps
package/locizify.js CHANGED
@@ -9713,7 +9713,7 @@ var locizify = (function() {
9713
9713
  })
9714
9714
  };
9715
9715
  if (!i18n.options.backend && !i18n.options.editor) return opts;
9716
- var pickFrom = i18n.options.editor || i18n.options.backend;
9716
+ var pickFrom = _objectSpread(_objectSpread({}, i18n.options.backend), i18n.options.editor);
9717
9717
  return _objectSpread(_objectSpread({}, opts), {}, {
9718
9718
  projectId: pickFrom.projectId,
9719
9719
  version: pickFrom.version
package/locizify.min.js CHANGED
@@ -221,4 +221,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
221
221
  border-color: transparent ${ki.highlight} transparent
222
222
  transparent;
223
223
  `,t.appendChild(n);var r=document.createElement(`div`);return r.style=`display: flex; flex-direction: column; align-items: flex-start; margin-left: 2px; margin-top: 1px`,Object.keys(e).forEach(function(t){var n=e[t],i=so(t.replace(`attr:`,``),`${n.ns}:${n.key}`,function(e){e&&(e.stopPropagation(),e.preventDefault()),R.selectKey(n)});i.style.marginBottom=`2px`,r.appendChild(i)}),t.appendChild(r),{box:t,arrow:n}}function lo(e,t,n){var r=e.getBoundingClientRect(),i=document.createElement(`div`);return i.classList.add(`i18next-editor-highlight`),i.style=`position: absolute; z-index: 99999; pointer-events: none; top: ${r.top-2+window.scrollY}px; left: ${r.left-2+window.scrollX}px; height: ${r.height+4}px; width: ${r.width+4}px; border: ${t===`none`?`none`:`1px solid ${t}`}; border-radius: 15px; ${n?`box-shadow: inset 1px 1px 5px rgba(255, 255, 255, 0.1), inset -1px -1px 5px rgba(61, 67, 69, 0.3), 0 0 20px 0 ${n};`:``}`,i.setAttribute(`data-i18next-editor-element`,`true`),i}let uo=Math.min,fo=Math.max,po=Math.round,z=e=>({x:e,y:e}),mo={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function ho(e,t,n){return fo(e,uo(t,n))}function go(e,t){return typeof e==`function`?e(t):e}function B(e){return e.split(`-`)[0]}function _o(e){return e.split(`-`)[1]}function vo(e){return e===`x`?`y`:`x`}function yo(e){return e===`y`?`height`:`width`}function V(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function bo(e){return vo(V(e))}function xo(e,t,n){n===void 0&&(n=!1);let r=_o(e),i=bo(e),a=yo(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Ao(o)),[o,Ao(o)]}function So(e){let t=Ao(e);return[Co(e),t,Co(t)]}function Co(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}let wo=[`left`,`right`],To=[`right`,`left`],Eo=[`top`,`bottom`],Do=[`bottom`,`top`];function Oo(e,t,n){switch(e){case`top`:case`bottom`:return n?t?To:wo:t?wo:To;case`left`:case`right`:return t?Eo:Do;default:return[]}}function ko(e,t,n,r){let i=_o(e),a=Oo(B(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Co)))),a}function Ao(e){let t=B(e);return mo[t]+e.slice(t.length)}function jo(e){return{top:0,right:0,bottom:0,left:0,...e}}function Mo(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:jo(e)}function No(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Po(e,t,n){let{reference:r,floating:i}=e,a=V(t),o=bo(t),s=yo(o),c=B(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(_o(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Fo(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=go(t,e),p=Mo(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=No(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=No(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}let Io=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Fo},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Po(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<50&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Po(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Lo=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=go(e,t)||{};if(l==null)return{};let d=Mo(u),f={x:n,y:r},p=bo(i),m=yo(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=uo(d[_],T),D=uo(d[v],T),ee=E,te=C-h[m]-D,O=C/2-h[m]/2+w,ne=ho(ee,O,te),k=!c.arrow&&_o(i)!=null&&O!==ne&&a.reference[m]/2-(O<ee?E:D)-h[m]/2<0,re=k?O<ee?O-ee:O-te:0;return{[p]:f[p]+re,data:{[p]:ne,centerOffset:O-ne-re,...k&&{alignmentOffset:re}},reset:k}}}),Ro=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=go(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=B(r),_=V(o),v=B(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Ao(o)]:So(o)),x=p!==`none`;!d&&x&&b.push(...ko(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=xo(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==V(t))||T.every(e=>V(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=V(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}},zo=new Set([`left`,`top`]);async function Bo(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=B(n),s=_o(n),c=V(n)===`y`,l=zo.has(o)?-1:1,u=a&&c?-1:1,d=go(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}let Vo=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Bo(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Ho=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=go(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=V(B(i)),p=vo(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=ho(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=ho(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}};function Uo(){return typeof window<`u`}function Wo(e){return Go(e)?(e.nodeName||``).toLowerCase():`#document`}function H(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function U(e){return((Go(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Go(e){return Uo()?e instanceof Node||e instanceof H(e).Node:!1}function W(e){return Uo()?e instanceof Element||e instanceof H(e).Element:!1}function G(e){return Uo()?e instanceof HTMLElement||e instanceof H(e).HTMLElement:!1}function Ko(e){return!Uo()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof H(e).ShadowRoot}function qo(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=K(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Jo(e){return/^(table|td|th)$/.test(Wo(e))}function Yo(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}let Xo=/transform|translate|scale|rotate|perspective|filter/,Zo=/paint|layout|strict|content/,Qo=e=>!!e&&e!==`none`,$o;function es(e){let t=W(e)?K(e):e;return Qo(t.transform)||Qo(t.translate)||Qo(t.scale)||Qo(t.rotate)||Qo(t.perspective)||!ns()&&(Qo(t.backdropFilter)||Qo(t.filter))||Xo.test(t.willChange||``)||Zo.test(t.contain||``)}function ts(e){let t=q(e);for(;G(t)&&!rs(t);){if(es(t))return t;if(Yo(t))return null;t=q(t)}return null}function ns(){return $o??($o=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`)),$o}function rs(e){return/^(html|body|#document)$/.test(Wo(e))}function K(e){return H(e).getComputedStyle(e)}function is(e){return W(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function q(e){if(Wo(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ko(e)&&e.host||U(e);return Ko(t)?t.host:t}function as(e){let t=q(e);return rs(t)?e.ownerDocument?e.ownerDocument.body:e.body:G(t)&&qo(t)?t:as(t)}function os(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=as(e),i=r===e.ownerDocument?.body,a=H(r);if(i){let e=ss(a);return t.concat(a,a.visualViewport||[],qo(r)?r:[],e&&n?os(e):[])}else return t.concat(r,os(r,[],n))}function ss(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function cs(e){let t=K(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=G(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=po(n)!==a||po(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ls(e){return W(e)?e:e.contextElement}function us(e){let t=ls(e);if(!G(t))return z(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=cs(t),o=(a?po(n.width):n.width)/r,s=(a?po(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}let ds=z(0);function fs(e){let t=H(e);return!ns()||!t.visualViewport?ds:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ps(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==H(e)?!1:t}function ms(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ls(e),o=z(1);t&&(r?W(r)&&(o=us(r)):o=us(e));let s=ps(a,n,r)?fs(a):z(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=H(a),t=r&&W(r)?H(r):r,n=e,i=ss(n);for(;i&&r&&t!==n;){let e=us(i),t=i.getBoundingClientRect(),r=K(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=H(i),i=ss(n)}}return No({width:u,height:d,x:c,y:l})}function hs(e,t){let n=is(e).scrollLeft;return t?t.left+n:ms(U(e)).left+n}function gs(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-hs(e,n),y:n.top+t.scrollTop}}function _s(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=U(r),s=t?Yo(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=z(1),u=z(0),d=G(r);if((d||!d&&!a)&&((Wo(r)!==`body`||qo(o))&&(c=is(r)),d)){let e=ms(r);l=us(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?gs(o,c):z(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function vs(e){return Array.from(e.getClientRects())}function ys(e){let t=U(e),n=is(e),r=e.ownerDocument.body,i=fo(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=fo(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+hs(e),s=-n.scrollTop;return K(r).direction===`rtl`&&(o+=fo(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function bs(e,t){let n=H(e),r=U(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=ns();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=hs(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=25&&(a-=o)}else l<=25&&(a+=l);return{width:a,height:o,x:s,y:c}}function xs(e,t){let n=ms(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=G(e)?us(e):z(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ss(e,t,n){let r;if(t===`viewport`)r=bs(e,n);else if(t===`document`)r=ys(U(e));else if(W(t))r=xs(t,n);else{let n=fs(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return No(r)}function Cs(e,t){let n=q(e);return n===t||!W(n)||rs(n)?!1:K(n).position===`fixed`||Cs(n,t)}function ws(e,t){let n=t.get(e);if(n)return n;let r=os(e,[],!1).filter(e=>W(e)&&Wo(e)!==`body`),i=null,a=K(e).position===`fixed`,o=a?q(e):e;for(;W(o)&&!rs(o);){let t=K(o),n=es(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||qo(o)&&!n&&Cs(e,o))?r=r.filter(e=>e!==o):i=t,o=q(o)}return t.set(e,r),r}function Ts(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Yo(t)?[]:ws(t,this._c):[].concat(n),r],o=Ss(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Ss(t,a[e],i);s=fo(n.top,s),c=uo(n.right,c),l=uo(n.bottom,l),u=fo(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Es(e){let{width:t,height:n}=cs(e);return{width:t,height:n}}function Ds(e,t,n){let r=G(t),i=U(t),a=n===`fixed`,o=ms(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=z(0);function l(){c.x=hs(i)}if(r||!r&&!a)if((Wo(t)!==`body`||qo(i))&&(s=is(t)),r){let e=ms(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?gs(i,s):z(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Os(e){return K(e).position===`static`}function ks(e,t){if(!G(e)||K(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return U(e)===n&&(n=n.ownerDocument.body),n}function As(e,t){let n=H(e);if(Yo(e))return n;if(!G(e)){let t=q(e);for(;t&&!rs(t);){if(W(t)&&!Os(t))return t;t=q(t)}return n}let r=ks(e,t);for(;r&&Jo(r)&&Os(r);)r=ks(r,t);return r&&rs(r)&&Os(r)&&!es(r)?n:r||ts(e)||n}let js=async function(e){let t=this.getOffsetParent||As,n=this.getDimensions,r=await n(e.floating);return{reference:Ds(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ms(e){return K(e).direction===`rtl`}let Ns={convertOffsetParentRelativeRectToViewportRelativeRect:_s,getDocumentElement:U,getClippingRect:Ts,getOffsetParent:As,getElementRects:js,getClientRects:vs,getDimensions:Es,getScale:us,isElement:W,isRTL:Ms},Ps=Vo,Fs=Ho,Is=Ro,Ls=Lo,Rs=(e,t,n)=>{let r=new Map,i={platform:Ns,...n},a={...i.platform,_c:r};return Io(e,t,{...i,platform:a})};var zs={};function Bs(e,t,n){var r=ka(t);if(!e.highlightBox){var i=lo(r,`none`,`rgba(0,0,0,0.1)`);document.body.appendChild(i),e.highlightBox=i}if(!e.ribbonBox){var a=co(n),o=a.box,s=a.arrow;document.body.appendChild(o),Rs(r,o,{placement:`right`,middleware:[Is({fallbackPlacements:[`left`,`bottom`]}),Fs(),Ps(function(e){var t=e.placement,n=e.rects;return t===`bottom`?-n.reference.height/2-n.floating.height/2:35}),Ls({element:s})]}).then(function(e){var t=e.x,n=e.y,r=e.middlewareData,i=e.placement;Object.assign(o.style,{left:`${t}px`,top:`${n}px`,display:`inline-flex`});var a=i.split(`-`)[0],c={top:`bottom`,right:`left`,bottom:`top`,left:`right`}[a];if(r.arrow){var l=r.arrow,u=l.x,d=l.y;Object.assign(s.style,M(M({left:u==null?``:`${u}px`,top:d==null?``:`${d}px`,right:``,bottom:``},c,`${a===`bottom`?-18:-25}px`),`transform`,a===`bottom`?`rotate(90deg)`:a===`left`?`rotate(180deg)`:``))}}),e.ribbonBox=o}}function Vs(e,t,n){if(!zs[e.id]){var r=ka(t);if(!e.highlightBox){var i=lo(r,ki.warning);document.body.appendChild(i),e.highlightBox=i}}}function Hs(e,t,n){var r=e.id,i=ka(t);if(!e.highlightBox){var a=lo(i,`none`,ki.gray);document.body.appendChild(a),e.highlightBox=a}zs[r]=!0}function Us(e,t,n){zs[e.id]&&(J(e,t,n,!1),Hs(e,t))}function J(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=e.id;r&&zs[i]||(e.highlightBox&&(document.body.removeChild(e.highlightBox),delete e.highlightBox),e.ribbonBox&&(document.body.removeChild(e.ribbonBox),delete e.ribbonBox),delete zs[i])}function Ws(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Gs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ws(Object(n),!0).forEach(function(t){M(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ws(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Y={};function Ks(){Object.values(Y).forEach(function(e){document.body.contains(e.node)||(J(e.id,e.node),delete Y[e.id])})}function qs(e,t,n,r,i,a){!e||!n||!r||!i||(Y[e]||(Y[e]={id:e,node:i,subliminal:t}),t&&(Y[e].subliminal=t),Y[e].keys=Gs(Gs({},Y[e].keys),{},M({},`${n}`,r)),a&&(Y[e].children=Gs(Gs({},Y[e].children),{},M({},`${n}-${a.map(function(e){return e.childIndex}).join(`,`)}`,a))))}function Js(e){return Y[e]}var X={save:qs,clean:Ks,get:Js,data:Y};(function(){if(!(typeof Document>`u`)){var e=1;Document.prototype.hasOwnProperty(`uniqueID`)||(console.info(`"document.uniqueID" not implemented; creating shim`),Object.defineProperty(Document.prototype,`uniqueID`,{get:function(){return e++},enumerable:!1,configurable:!1}),Object.defineProperty(Element.prototype,`uniqueID`,{get:function(){return Object.defineProperty(this,`uniqueID`,{value:document.uniqueID,writable:!1,enumerable:!1,configurable:!1}),this.uniqueID},enumerable:!1,configurable:!0}))}})();function Ys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Xs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ys(Object(n),!0).forEach(function(t){M(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ys(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Z,Q,Zs=[];function Qs(e){Q=e}function $s(e,t){if(!(e.dataset&&e.dataset.i18nextEditorElement===`true`)){t(e);var n=X.get(e.uniqueID),r=F.get(e.uniqueID);if(n||r){var i=e.parentElement?.uniqueID;F.remove(i,e.parentElement)}for(var a=e.childNodes,o=0;o<a.length;o++)$s(a[o],t)}}function ec(e,t,n,r){var i=n.invisibleMeta,a=n.text;if(!(!i||!i.key||!i.ns))return Z||(Z=Q.getSourceLng()),Xs(Xs({eleUniqueID:e,textType:t,children:r&&r.map?r.map(function(e){return e.childIndex}).join(`,`):null,qualifiedKey:`${i.ns}:${i.key}`},i),{},{extractedText:a,i18nTargetLng:Q?.getLng(),i18nSourceLng:Z,i18nRawText:M(M({},`${i.lng}`,i.source===`translation`&&Q?Q?.getResource(i.lng,i.ns,i.key):null),`${Z}`,i.source===`translation`&&Q?Q?.getResource(Z,i.ns,i.key):null)})}function tc(e,t){var n,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,o=r[t];if(o){Z||(Z=Q.getSourceLng());var s=Q.getLng();return{eleUniqueID:e,textType:t,children:a&&a.map?a.map(function(e){return e.childIndex}).join(`,`):null,qualifiedKey:o.key&&(o.ns||(n=Q)!=null&&n.getDefaultNS())?`${o.ns||Q?.getDefaultNS()}:${o.key}`:null,key:o.key,ns:o.ns||Q?.getDefaultNS(),extractedText:i,i18nTargetLng:s,i18nSourceLng:Z,i18nRawText:M(M({},`${s}`,Q&&o.ns&&o.key&&Q?.getResource(s,o.ns,o.key)||i),`${Z}`,Q&&o.ns&&o.key?Q?.getResource(Z,o.ns,o.key):null)}}}function nc(e){return/^\s*$/.test(e)}function rc(e,t,n,r,i,a,o){var s=X.get(e),c=s&&s.keys[`${n}`]||{},l=r[`${n}`]||{};!l.key&&c.key&&(l.key=c.key),!l.ns&&c.ns&&(l.ns=c.ns),r[`${n}`]=l;var u=tc(e,n,r,o,a);u.qualifiedKey?(X.save(e,null,n,u,i,a),F.removeKey(e,n,i)):F.save(e,n,i,o)}function ic(e){if(!(Oi.indexOf(e.nodeName)>-1)){var t=Yi(e),n=!1;if(e.childNodes&&!Zs.includes(e.uniqueID)){var r=[];e.childNodes.forEach(function(t,i){if(r.length&&t.nodeName!==`#text`&&(Zs.push(t.uniqueID),r.push({childIndex:i,child:t})),t.nodeName===`#text`){var a=t.textContent;if(!nc(a)){var o=a.trim(),s=xi(o),c=Si(o);if(s&&(n=!0),c&&s){var l=bi(o);F.remove(e.uniqueID,e),X.save(e.uniqueID,l.invisibleMeta,`text`,ec(e.uniqueID,`text`,l),e)}else if(s&&!r.length){var u=bi(o);F.remove(e.uniqueID,e),X.save(e.uniqueID,u.invisibleMeta,`text`,ec(e.uniqueID,`text`,u),e)}else if(c)r.push({childIndex:i,child:t,text:a});else if(r.length&&!s)r.push({childIndex:i,child:t,text:a});else if(r.length&&s){r.push({childIndex:i,child:t,text:a});var d=bi(r.reduce(function(e,t){return e+t.text},``));F.removeKey(e.uniqueID,`html`,e,a),X.save(e.uniqueID,d.invisibleMeta,`html`,ec(e.uniqueID,`html`,d,r),e,r),r=[]}}}}),n||e.childNodes.forEach(function(n,i){r.length&&n.nodeName!==`#text`&&Zs.push(n.uniqueID);var a=n.textContent;t&&t.html&&i<e.childNodes.length-1?r.push({childIndex:i,child:n,text:a}):t&&t.html&&i===e.childNodes.length-1?(r.push({childIndex:i,child:n,text:a}),rc(e.uniqueID,null,`html`,t,e,r,e.innerHTML),r=[]):a&&(t&&t.text?rc(e.uniqueID,null,`text`,t,e,void 0,a):n.nodeName===`#text`&&!nc(a)&&F.save(e.uniqueID,`text`,e,a))})}e.getAttribute&&Di.forEach(function(n){var r=e.getAttribute(n);if(xi(r)){var i=bi(r);F.removeKey(e.uniqueID,n,e),X.save(e.uniqueID,i.invisibleMeta,n,ec(e.uniqueID,`${n}`,i),e)}else r&&(t&&t[n]?rc(e.uniqueID,null,n,t,e,void 0,r):F.save(e.uniqueID,n,e,r))})}}function ac(e){return Z=void 0,$s(e,ic),X.clean(),Zs=[],X.data}var oc={};function sc(e){if(e.uniqueID){var t=oc[e.uniqueID];if(t&&t.triggered>10&&t.lastTriggerDate+500<Date.now())return!t.warned&&console&&(console.warn(`locize ::: ignoring element change - an element is rerendering too often in short interval`,`
224
- `,`consider adding the "data-locize-editor-ignore:" attribute to the element:`,e),t.warned=!0),!0}var n=e.dataset&&(e.dataset.i18nextEditorElement===`true`||e.dataset.locizeEditorIgnore===`true`);return!n&&e.parentElement?sc(e.parentElement):n}function cc(e,t){var n,r,i=function(){r&&clearTimeout(r),r=setTimeout(function(){n&&(n=!1)},200)},a=[],o=Ki(function(){t(a),a=[]},100),s=new MutationObserver(function(e){if(n){i();return}var t=!1;e.forEach(function(e){if(!(e.type===`attributes`&&!Di.includes(e.attributeName))){var n=e.target.nodeType===3?e.target.parentElement:e.target;if(n){if(Object.keys(oc).forEach(function(e){oc[e].lastTriggerDate+6e4<Date.now()&&delete oc[e]}),e.type===`childList`){var r=0;if(sc(n)||(e.addedNodes.forEach(function(e){sc(e)||(r+=1)},0),e.removedNodes.forEach(function(e){sc(e)||(r+=1)},0)),r===0)return}if(t=!0,n.uniqueID){var i=oc[n.uniqueID]||{triggered:0};i.triggered+=1,i.lastTriggerDate=Date.now(),oc[n.uniqueID]=i}a.reduce(function(e,t){return!!(e||t.contains(n)||!n.parentElement)},!1)||(a=a.filter(function(e){return!n.contains(e)}),a.push(n))}}}),t&&o()});return{start:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{attributes:!0,childList:!0,characterData:!0,subtree:!0};t([e]),s.observe(e,n)},skipNext:function(){n=!0}}}var lc=40;function uc(e){var t=Math.max(0,window.innerHeight-lc);return Math.max(0,Math.min(e,t))}function dc(e,t){var n=t.offsetWidth||0,r=Math.min(0,lc-n),i=Math.max(0,window.innerWidth-lc);return Math.max(r,Math.min(e,i))}function fc(){for(var e=0,t=0,n=0,r=0,i=document.getElementsByClassName(`i18next-editor-popup`),a=null,o=null,s=0;s<i.length;s++){var c=i[s],l=p(c);l&&(l.parentPopup=c,l.onmousedown=u)}function u(e){o||(o=document.getElementById(`i18next-editor-popup-overlay`)),o&&(o.style.display=`block`),Pa(),a=this.parentPopup,e=e||window.event,n=e.clientX,r=e.clientY,document.onmouseup=f,document.onmousemove=d}function d(i){a&&(i=i||window.event,e=n-i.clientX,t=r-i.clientY,n=i.clientX,r=i.clientY,a.style.top=uc(a.offsetTop-t)+`px`,a.style.left=dc(a.offsetLeft-e,a)+`px`)}function f(){Na(),o&&(o.style.display=`none`);var e=document.getElementById(`i18next-editor-popup`);window.localStorage.setItem(`locize_popup_pos`,JSON.stringify({top:parseInt(document.defaultView.getComputedStyle(e).top,10),left:parseInt(document.defaultView.getComputedStyle(e).left,10)})),document.onmouseup=null,document.onmousemove=null}function p(e){var t=e.getElementsByClassName(`i18next-editor-popup-header`);return t.length===1?t[0]:null}}function pc(){for(var e=document.getElementsByClassName(`i18next-editor-popup`),t=null,n=null,r,i,a,o,s=0;s<e.length;s++){var c=e[s],l=document.createElement(`div`);l.className=`resizer-right`,c.appendChild(l),l.addEventListener(`mousedown`,f,!1),l.parentPopup=c;var u=document.createElement(`div`);u.className=`resizer-bottom`,c.appendChild(u),u.addEventListener(`mousedown`,f,!1),u.parentPopup=c;var d=document.createElement(`div`);d.className=`resizer-both`,c.appendChild(d),d.addEventListener(`mousedown`,f,!1),d.parentPopup=c}function f(e){Pa(),n||(n=document.getElementById(`i18next-editor-popup-overlay`)),n&&(n.style.display=`block`),t=this.parentPopup,r=e.clientX,i=e.clientY,a=parseInt(document.defaultView.getComputedStyle(t).width,10),o=parseInt(document.defaultView.getComputedStyle(t).height,10),document.documentElement.addEventListener(`mousemove`,p,!1),document.documentElement.addEventListener(`mouseup`,m,!1)}function p(e){t.style.width=a+e.clientX-r+`px`,t.style.height=o+e.clientY-i+`px`}function m(){Na(),n&&(n.style.display=`none`);var e=document.getElementById(`i18next-editor-popup`);window.localStorage.setItem(`locize_popup_size`,JSON.stringify({width:parseInt(document.defaultView.getComputedStyle(e).width,10),height:parseInt(document.defaultView.getComputedStyle(e).height,10)})),document.documentElement.removeEventListener(`mousemove`,p,!1),document.documentElement.removeEventListener(`mouseup`,m,!1)}}function mc(){return{getResource:function(e,t,n){return{}},setResource:function(e,t,n,r){},getResourceBundle:function(e,t,n){n({})},getDefaultNS:function(){},getLng:function(){},getSourceLng:function(){},getLocizeDetails:function(){return{}},bindLanguageChange:function(e){},bindMissingKeyHandler:function(e){},triggerRerender:function(){}}}function hc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function gc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?hc(Object(n),!0).forEach(function(t){M(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var _c=mc();function vc(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_c,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{show:!1,qsProp:`incontext`};if(typeof document>`u`)return;var n=t.show||Zi(t.qsProp||`incontext`)===`true`,r=document.getElementById(`locize`),i={};[`projectId`,`version`,`ribbonPosition`].forEach(function(e){if(r){var t=r.getAttribute(e.toLowerCase())||r.getAttribute(`data-`+e.toLowerCase());t===`true`&&(t=!0),t===`false`&&(t=!1),t!=null&&(i[e]=t)}}),i=gc(gc(gc({},e.getLocizeDetails()),i),t),R.config=i,R.init(e),Qs(e),e?.bindLanguageChange(function(t){R.sendCurrentTargetLanguage(e.getLng())});function a(){if(!(!ta&&!n)){var e=cc(document.body,function(e){e.forEach(function(e){ac(e)}),R.sendCurrentParsedContent()});if(e.start(),Na(e),!ta&&!document.getElementById(`i18next-editor-popup`)){$i(`starting InContext popup with config`,i,`iframe:`,ji()),i.projectId||console.error(`[locize] InContext editor: no projectId configured (script tag attribute, i18next editor/backend options or startStandalone options) - the editor will not find your project.`),setTimeout(function(){R.initialized||(console.error(`[locize] InContext editor did not connect within 15s. Likely causes: you are not logged in at locize (open https://www.locize.app in another tab and log in), the page CSP blocks frame-src `+ji()+`, or an adblocker blocked the iframe. Enable diagnostics via localStorage.setItem('locize-debug', 'true').`),Ka(`Could not connect to the locize editor. Are you logged in at locize.app? See the browser console for details.`))},15e3);var t=qa(ji(),function(){R.source=document.getElementById(`i18next-editor-iframe`)?.contentWindow,R.initialized=!1,R.initInterval&&(clearInterval(R.initInterval),delete R.initInterval),R.requestInitialize(i)},i);if(document.documentElement.append(t),fc(),pc(),typeof MutationObserver==`function`){var r=5,a=1e4,o=0,s=new MutationObserver(function(){if(!document.getElementById(`i18next-editor-popup`)){if(o>=r){s.disconnect();return}o++,document.documentElement.append(t)}});s.observe(document.documentElement,{childList:!0,subtree:!0}),setTimeout(function(){return s.disconnect()},a)}}if(typeof window<`u`){var c=window.document.location.href;R.sendHrefchanged(c);var l=window.document.querySelector(`body`);new window.MutationObserver(function(e){e.forEach(function(e){c!==window.document.location.href&&(c=window.document.location.href,R.sendHrefchanged(c))})}).observe(l,{childList:!0,subtree:!0})}}}if(document.body)return a();typeof window<`u`&&window.addEventListener(`load`,function(){a()})}function yc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function bc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?yc(Object(n),!0).forEach(function(t){M(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function xc(e){var t={getResource:function(t,n,r){return e.getResource&&e.getResource(t,n,r)},setResource:function(t,n,r,i){return e.addResource(t,n,r,i,{silent:!0})},getResourceBundle:function(t,n,r){e.loadNamespaces(n,function(){r(e.getResourceBundle(t,n))})},getDefaultNS:function(){return e.options.defaultNS},getLng:function(){return e.resolvedLanguage||e.languages&&e.languages[0]||e.options.lng},getSourceLng:function(){var t=e.options.fallbackLng;if(typeof t==`string`)return t;if(Array.isArray(t))return t[t.length-1];if(t&&t.default){if(typeof t.default==`string`)return t;if(Array.isArray(t.default))return t.default[t.default.length-1]}if(typeof t==`function`){var n=t(e.resolvedLanguage);if(typeof n==`string`)return n;if(Array.isArray(n))return n[n.length-1]}return`dev`},getLocizeDetails:function(){var n={backendName:e.services.backendConnector.backend&&e.services.backendConnector.backend.options&&e.services.backendConnector.backend.options.loadPath&&e.services.backendConnector.backend.options.loadPath.indexOf(`.locize.`)>0?`I18NextLocizeBackend`:e.services.backendConnector.backend?e.services.backendConnector.backend.constructor.name:`options.resources`,sourceLng:t.getSourceLng(),i18nFormat:e.options.compatibilityJSON===`v3`?`i18next_v3`:`i18next_v4`,i18nFramework:`i18next`,isLocizify:e.options.isLocizify,defaultNS:e.options.defaultNS,targetLngs:wa(new Set([].concat(e.options.preload,e.options.supportedLngs,[t.getLng()]))).filter(function(e){return e!==`cimode`&&e!==!1&&e!==`false`&&e!==void 0&&e!==t.getSourceLng()}),ns:wa(new Set([].concat(e.options.ns,e.options.fallbackNS,e.options.defaultNS))).filter(function(e){return e!==!1&&e!==`false`})};if(!e.options.backend&&!e.options.editor)return n;var r=e.options.editor||e.options.backend;return bc(bc({},n),{},{projectId:r.projectId,version:r.version})},bindLanguageChange:function(t){e.on(`languageChanged`,t)},bindMissingKeyHandler:function(t){e.options.missingKeyHandler=function(e,n,r,i,a,o){a||t(e,n,r,i)}},triggerRerender:function(){e.emit(`editorSaved`)}};return t}function Sc(e,t){e.use(Ei),typeof t.postProcess==`string`?t.postProcess=[t.postProcess,`subliminal`]:Array.isArray(t.postProcess)?t.postProcess.push(`subliminal`):t.postProcess=`subliminal`,t.postProcessPassResolved=!0}var Cc,wc=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e.qsProp=e.qsProp||`incontext`,{type:`3rdParty`,init:function(t){var n=t.options;Cc=t;var r=xc(t),i=e.show||Zi(e.qsProp)===`true`;(ta||i)&&Sc(Cc,n),vc(r,e)}}}(),Tc=[`implementation`];function Ec(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.implementation,n=Qa(e,Tc);vc(t,Object.keys(n).length>0?n:void 0)}typeof window<`u`&&(window.locizeStartStandalone=Ec);let{i18next:$}=Sr,Dc={saveMissingTo:`all`},Oc={reloadOnSave:!0,bindSavedMissing:!0};$.use(ti).use(wc),$.on(`editorSaved`,()=>{Sr.forceRerender()});function kc(e,t){if(typeof window>`u`)return null;t||(t=window.location.href.toLowerCase()),e=e.replace(/[\[\]]/g,`\\$&`);let n=RegExp(`[?&]`+e+`(=([^&#]*)|&|#|$)`).exec(t);return n?n[2]?decodeURIComponent(n[2].replace(/\+/g,` `)):``:null}function Ac(){if(typeof window>`u`||!window.location)return!1;let e=window.location.hostname;return e?e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`0.0.0.0`||e.endsWith(`.localhost`)||e.endsWith(`.local`):!1}let jc=!1;function Mc(e){Ac()||jc||(jc=!0,typeof console<`u`&&typeof console.warn==`function`&&console.warn(`locizify: reading credential "`+e+`" from URL query string on a non-local host. An attacker-crafted link can replace your locize credentials, redirecting saveMissing writes to an attacker-chosen project. Prefer configuring credentials via the <script id="locizify" apikey="..." projectid="..."> attributes instead.`))}let Nc=$.init;return $.init=(e={},t)=>{e={...Oc,...e,isLocizify:!0};let n=document.getElementById(`locizify`);if(n){let t={},r={};[`fallbackLng`,`saveMissing`,`debug`,`autorun`,`ele`,`cleanIndent`,`cleanWhitespace`,`namespace`,`namespaceFromPath`,`load`].forEach(e=>{let r=n.getAttribute(e.toLowerCase())||n.getAttribute(`data-`+e.toLowerCase());r===`true`&&(r=!0),r===`false`&&(r=!1),r!=null&&(t[e]=r)}),[`ignoreTags`,`ignoreIds`,`ignoreClasses`,`translateAttributes`,`mergeTags`,`inlineTags`,`ignoreInlineOn`,`ignoreCleanIndentFor`,`ns`].forEach(e=>{let r=n.getAttribute(e.toLowerCase())||n.getAttribute(`data-`+e.toLowerCase());r!=null&&(t[e]=r.split(`,`).map(e=>e.trim()))}),[`projectId`,`apiKey`,`referenceLng`,`version`,`allowedAddOrUpdateHost`,`autoPilot`,`cdnType`,`noCache`].forEach(e=>{let t=n.getAttribute(e.toLowerCase())||n.getAttribute(`data-`+e.toLowerCase());if(t===`true`&&(t=!0),t===`false`&&(t=!1),e.toLowerCase()===`autopilot`&&t===``&&(t=!0),t!=null&&(r[e]=t),!t){let n=e.toLowerCase();t=kc(n),t===`true`&&(t=!0),t===`false`&&(t=!1),n===`autopilot`&&t===``&&(t=!0),t!=null&&(r[e]=t,(n===`apikey`||n===`projectid`)&&Mc(n))}}),r.allowedAddOrUpdateHost&&(r.allowedAddOrUpdateHosts=[r.allowedAddOrUpdateHost],delete r.allowedAddOrUpdateHost),e={...Oc,...e,...t},e.backend={...e.backend,...r}}function r(e,n){t(e,n)}if(!e.backend.apiKey&&kc(`apikey`)&&(e.backend.apiKey=kc(`apikey`),Mc(`apikey`)),!e.backend.autoPilot||e.backend.autoPilot===`false`)return Nc.call($,{...e,...Dc},r);new ti(e.backend).getOptions((t,n)=>{t&&typeof console==`object`&&typeof console.error==`function`&&console.error(t),Nc.call($,{...n,...e,...Dc},r)})},Sr.getLanguages=function(e){if($.services.backendConnector)$.services.backendConnector.backend.getLanguages(e);else{function t(){$.off(`initialized`,t),$.services.backendConnector.backend.getLanguages(e)}$.on(`initialized`,t)}},Sr.getOptions=function(e){if($.services.backendConnector)$.services.backendConnector.backend.getOptions(e);else{function t(){$.off(`initialized`,t),$.services.backendConnector.backend.getOptions(e)}$.on(`initialized`,t)}},Sr.editor={setEditorLng:oa},Sr})();
224
+ `,`consider adding the "data-locize-editor-ignore:" attribute to the element:`,e),t.warned=!0),!0}var n=e.dataset&&(e.dataset.i18nextEditorElement===`true`||e.dataset.locizeEditorIgnore===`true`);return!n&&e.parentElement?sc(e.parentElement):n}function cc(e,t){var n,r,i=function(){r&&clearTimeout(r),r=setTimeout(function(){n&&(n=!1)},200)},a=[],o=Ki(function(){t(a),a=[]},100),s=new MutationObserver(function(e){if(n){i();return}var t=!1;e.forEach(function(e){if(!(e.type===`attributes`&&!Di.includes(e.attributeName))){var n=e.target.nodeType===3?e.target.parentElement:e.target;if(n){if(Object.keys(oc).forEach(function(e){oc[e].lastTriggerDate+6e4<Date.now()&&delete oc[e]}),e.type===`childList`){var r=0;if(sc(n)||(e.addedNodes.forEach(function(e){sc(e)||(r+=1)},0),e.removedNodes.forEach(function(e){sc(e)||(r+=1)},0)),r===0)return}if(t=!0,n.uniqueID){var i=oc[n.uniqueID]||{triggered:0};i.triggered+=1,i.lastTriggerDate=Date.now(),oc[n.uniqueID]=i}a.reduce(function(e,t){return!!(e||t.contains(n)||!n.parentElement)},!1)||(a=a.filter(function(e){return!n.contains(e)}),a.push(n))}}}),t&&o()});return{start:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{attributes:!0,childList:!0,characterData:!0,subtree:!0};t([e]),s.observe(e,n)},skipNext:function(){n=!0}}}var lc=40;function uc(e){var t=Math.max(0,window.innerHeight-lc);return Math.max(0,Math.min(e,t))}function dc(e,t){var n=t.offsetWidth||0,r=Math.min(0,lc-n),i=Math.max(0,window.innerWidth-lc);return Math.max(r,Math.min(e,i))}function fc(){for(var e=0,t=0,n=0,r=0,i=document.getElementsByClassName(`i18next-editor-popup`),a=null,o=null,s=0;s<i.length;s++){var c=i[s],l=p(c);l&&(l.parentPopup=c,l.onmousedown=u)}function u(e){o||(o=document.getElementById(`i18next-editor-popup-overlay`)),o&&(o.style.display=`block`),Pa(),a=this.parentPopup,e=e||window.event,n=e.clientX,r=e.clientY,document.onmouseup=f,document.onmousemove=d}function d(i){a&&(i=i||window.event,e=n-i.clientX,t=r-i.clientY,n=i.clientX,r=i.clientY,a.style.top=uc(a.offsetTop-t)+`px`,a.style.left=dc(a.offsetLeft-e,a)+`px`)}function f(){Na(),o&&(o.style.display=`none`);var e=document.getElementById(`i18next-editor-popup`);window.localStorage.setItem(`locize_popup_pos`,JSON.stringify({top:parseInt(document.defaultView.getComputedStyle(e).top,10),left:parseInt(document.defaultView.getComputedStyle(e).left,10)})),document.onmouseup=null,document.onmousemove=null}function p(e){var t=e.getElementsByClassName(`i18next-editor-popup-header`);return t.length===1?t[0]:null}}function pc(){for(var e=document.getElementsByClassName(`i18next-editor-popup`),t=null,n=null,r,i,a,o,s=0;s<e.length;s++){var c=e[s],l=document.createElement(`div`);l.className=`resizer-right`,c.appendChild(l),l.addEventListener(`mousedown`,f,!1),l.parentPopup=c;var u=document.createElement(`div`);u.className=`resizer-bottom`,c.appendChild(u),u.addEventListener(`mousedown`,f,!1),u.parentPopup=c;var d=document.createElement(`div`);d.className=`resizer-both`,c.appendChild(d),d.addEventListener(`mousedown`,f,!1),d.parentPopup=c}function f(e){Pa(),n||(n=document.getElementById(`i18next-editor-popup-overlay`)),n&&(n.style.display=`block`),t=this.parentPopup,r=e.clientX,i=e.clientY,a=parseInt(document.defaultView.getComputedStyle(t).width,10),o=parseInt(document.defaultView.getComputedStyle(t).height,10),document.documentElement.addEventListener(`mousemove`,p,!1),document.documentElement.addEventListener(`mouseup`,m,!1)}function p(e){t.style.width=a+e.clientX-r+`px`,t.style.height=o+e.clientY-i+`px`}function m(){Na(),n&&(n.style.display=`none`);var e=document.getElementById(`i18next-editor-popup`);window.localStorage.setItem(`locize_popup_size`,JSON.stringify({width:parseInt(document.defaultView.getComputedStyle(e).width,10),height:parseInt(document.defaultView.getComputedStyle(e).height,10)})),document.documentElement.removeEventListener(`mousemove`,p,!1),document.documentElement.removeEventListener(`mouseup`,m,!1)}}function mc(){return{getResource:function(e,t,n){return{}},setResource:function(e,t,n,r){},getResourceBundle:function(e,t,n){n({})},getDefaultNS:function(){},getLng:function(){},getSourceLng:function(){},getLocizeDetails:function(){return{}},bindLanguageChange:function(e){},bindMissingKeyHandler:function(e){},triggerRerender:function(){}}}function hc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function gc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?hc(Object(n),!0).forEach(function(t){M(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var _c=mc();function vc(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_c,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{show:!1,qsProp:`incontext`};if(typeof document>`u`)return;var n=t.show||Zi(t.qsProp||`incontext`)===`true`,r=document.getElementById(`locize`),i={};[`projectId`,`version`,`ribbonPosition`].forEach(function(e){if(r){var t=r.getAttribute(e.toLowerCase())||r.getAttribute(`data-`+e.toLowerCase());t===`true`&&(t=!0),t===`false`&&(t=!1),t!=null&&(i[e]=t)}}),i=gc(gc(gc({},e.getLocizeDetails()),i),t),R.config=i,R.init(e),Qs(e),e?.bindLanguageChange(function(t){R.sendCurrentTargetLanguage(e.getLng())});function a(){if(!(!ta&&!n)){var e=cc(document.body,function(e){e.forEach(function(e){ac(e)}),R.sendCurrentParsedContent()});if(e.start(),Na(e),!ta&&!document.getElementById(`i18next-editor-popup`)){$i(`starting InContext popup with config`,i,`iframe:`,ji()),i.projectId||console.error(`[locize] InContext editor: no projectId configured (script tag attribute, i18next editor/backend options or startStandalone options) - the editor will not find your project.`),setTimeout(function(){R.initialized||(console.error(`[locize] InContext editor did not connect within 15s. Likely causes: you are not logged in at locize (open https://www.locize.app in another tab and log in), the page CSP blocks frame-src `+ji()+`, or an adblocker blocked the iframe. Enable diagnostics via localStorage.setItem('locize-debug', 'true').`),Ka(`Could not connect to the locize editor. Are you logged in at locize.app? See the browser console for details.`))},15e3);var t=qa(ji(),function(){R.source=document.getElementById(`i18next-editor-iframe`)?.contentWindow,R.initialized=!1,R.initInterval&&(clearInterval(R.initInterval),delete R.initInterval),R.requestInitialize(i)},i);if(document.documentElement.append(t),fc(),pc(),typeof MutationObserver==`function`){var r=5,a=1e4,o=0,s=new MutationObserver(function(){if(!document.getElementById(`i18next-editor-popup`)){if(o>=r){s.disconnect();return}o++,document.documentElement.append(t)}});s.observe(document.documentElement,{childList:!0,subtree:!0}),setTimeout(function(){return s.disconnect()},a)}}if(typeof window<`u`){var c=window.document.location.href;R.sendHrefchanged(c);var l=window.document.querySelector(`body`);new window.MutationObserver(function(e){e.forEach(function(e){c!==window.document.location.href&&(c=window.document.location.href,R.sendHrefchanged(c))})}).observe(l,{childList:!0,subtree:!0})}}}if(document.body)return a();typeof window<`u`&&window.addEventListener(`load`,function(){a()})}function yc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function bc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?yc(Object(n),!0).forEach(function(t){M(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function xc(e){var t={getResource:function(t,n,r){return e.getResource&&e.getResource(t,n,r)},setResource:function(t,n,r,i){return e.addResource(t,n,r,i,{silent:!0})},getResourceBundle:function(t,n,r){e.loadNamespaces(n,function(){r(e.getResourceBundle(t,n))})},getDefaultNS:function(){return e.options.defaultNS},getLng:function(){return e.resolvedLanguage||e.languages&&e.languages[0]||e.options.lng},getSourceLng:function(){var t=e.options.fallbackLng;if(typeof t==`string`)return t;if(Array.isArray(t))return t[t.length-1];if(t&&t.default){if(typeof t.default==`string`)return t;if(Array.isArray(t.default))return t.default[t.default.length-1]}if(typeof t==`function`){var n=t(e.resolvedLanguage);if(typeof n==`string`)return n;if(Array.isArray(n))return n[n.length-1]}return`dev`},getLocizeDetails:function(){var n={backendName:e.services.backendConnector.backend&&e.services.backendConnector.backend.options&&e.services.backendConnector.backend.options.loadPath&&e.services.backendConnector.backend.options.loadPath.indexOf(`.locize.`)>0?`I18NextLocizeBackend`:e.services.backendConnector.backend?e.services.backendConnector.backend.constructor.name:`options.resources`,sourceLng:t.getSourceLng(),i18nFormat:e.options.compatibilityJSON===`v3`?`i18next_v3`:`i18next_v4`,i18nFramework:`i18next`,isLocizify:e.options.isLocizify,defaultNS:e.options.defaultNS,targetLngs:wa(new Set([].concat(e.options.preload,e.options.supportedLngs,[t.getLng()]))).filter(function(e){return e!==`cimode`&&e!==!1&&e!==`false`&&e!==void 0&&e!==t.getSourceLng()}),ns:wa(new Set([].concat(e.options.ns,e.options.fallbackNS,e.options.defaultNS))).filter(function(e){return e!==!1&&e!==`false`})};if(!e.options.backend&&!e.options.editor)return n;var r=bc(bc({},e.options.backend),e.options.editor);return bc(bc({},n),{},{projectId:r.projectId,version:r.version})},bindLanguageChange:function(t){e.on(`languageChanged`,t)},bindMissingKeyHandler:function(t){e.options.missingKeyHandler=function(e,n,r,i,a,o){a||t(e,n,r,i)}},triggerRerender:function(){e.emit(`editorSaved`)}};return t}function Sc(e,t){e.use(Ei),typeof t.postProcess==`string`?t.postProcess=[t.postProcess,`subliminal`]:Array.isArray(t.postProcess)?t.postProcess.push(`subliminal`):t.postProcess=`subliminal`,t.postProcessPassResolved=!0}var Cc,wc=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e.qsProp=e.qsProp||`incontext`,{type:`3rdParty`,init:function(t){var n=t.options;Cc=t;var r=xc(t),i=e.show||Zi(e.qsProp)===`true`;(ta||i)&&Sc(Cc,n),vc(r,e)}}}(),Tc=[`implementation`];function Ec(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.implementation,n=Qa(e,Tc);vc(t,Object.keys(n).length>0?n:void 0)}typeof window<`u`&&(window.locizeStartStandalone=Ec);let{i18next:$}=Sr,Dc={saveMissingTo:`all`},Oc={reloadOnSave:!0,bindSavedMissing:!0};$.use(ti).use(wc),$.on(`editorSaved`,()=>{Sr.forceRerender()});function kc(e,t){if(typeof window>`u`)return null;t||(t=window.location.href.toLowerCase()),e=e.replace(/[\[\]]/g,`\\$&`);let n=RegExp(`[?&]`+e+`(=([^&#]*)|&|#|$)`).exec(t);return n?n[2]?decodeURIComponent(n[2].replace(/\+/g,` `)):``:null}function Ac(){if(typeof window>`u`||!window.location)return!1;let e=window.location.hostname;return e?e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`0.0.0.0`||e.endsWith(`.localhost`)||e.endsWith(`.local`):!1}let jc=!1;function Mc(e){Ac()||jc||(jc=!0,typeof console<`u`&&typeof console.warn==`function`&&console.warn(`locizify: reading credential "`+e+`" from URL query string on a non-local host. An attacker-crafted link can replace your locize credentials, redirecting saveMissing writes to an attacker-chosen project. Prefer configuring credentials via the <script id="locizify" apikey="..." projectid="..."> attributes instead.`))}let Nc=$.init;return $.init=(e={},t)=>{e={...Oc,...e,isLocizify:!0};let n=document.getElementById(`locizify`);if(n){let t={},r={};[`fallbackLng`,`saveMissing`,`debug`,`autorun`,`ele`,`cleanIndent`,`cleanWhitespace`,`namespace`,`namespaceFromPath`,`load`].forEach(e=>{let r=n.getAttribute(e.toLowerCase())||n.getAttribute(`data-`+e.toLowerCase());r===`true`&&(r=!0),r===`false`&&(r=!1),r!=null&&(t[e]=r)}),[`ignoreTags`,`ignoreIds`,`ignoreClasses`,`translateAttributes`,`mergeTags`,`inlineTags`,`ignoreInlineOn`,`ignoreCleanIndentFor`,`ns`].forEach(e=>{let r=n.getAttribute(e.toLowerCase())||n.getAttribute(`data-`+e.toLowerCase());r!=null&&(t[e]=r.split(`,`).map(e=>e.trim()))}),[`projectId`,`apiKey`,`referenceLng`,`version`,`allowedAddOrUpdateHost`,`autoPilot`,`cdnType`,`noCache`].forEach(e=>{let t=n.getAttribute(e.toLowerCase())||n.getAttribute(`data-`+e.toLowerCase());if(t===`true`&&(t=!0),t===`false`&&(t=!1),e.toLowerCase()===`autopilot`&&t===``&&(t=!0),t!=null&&(r[e]=t),!t){let n=e.toLowerCase();t=kc(n),t===`true`&&(t=!0),t===`false`&&(t=!1),n===`autopilot`&&t===``&&(t=!0),t!=null&&(r[e]=t,(n===`apikey`||n===`projectid`)&&Mc(n))}}),r.allowedAddOrUpdateHost&&(r.allowedAddOrUpdateHosts=[r.allowedAddOrUpdateHost],delete r.allowedAddOrUpdateHost),e={...Oc,...e,...t},e.backend={...e.backend,...r}}function r(e,n){t(e,n)}if(!e.backend.apiKey&&kc(`apikey`)&&(e.backend.apiKey=kc(`apikey`),Mc(`apikey`)),!e.backend.autoPilot||e.backend.autoPilot===`false`)return Nc.call($,{...e,...Dc},r);new ti(e.backend).getOptions((t,n)=>{t&&typeof console==`object`&&typeof console.error==`function`&&console.error(t),Nc.call($,{...n,...e,...Dc},r)})},Sr.getLanguages=function(e){if($.services.backendConnector)$.services.backendConnector.backend.getLanguages(e);else{function t(){$.off(`initialized`,t),$.services.backendConnector.backend.getLanguages(e)}$.on(`initialized`,t)}},Sr.getOptions=function(e){if($.services.backendConnector)$.services.backendConnector.backend.getOptions(e);else{function t(){$.off(`initialized`,t),$.services.backendConnector.backend.getOptions(e)}$.on(`initialized`,t)}},Sr.editor={setEditorLng:oa},Sr})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "locizify",
3
- "version": "10.0.2",
3
+ "version": "10.0.3",
4
4
  "description": "main script for using locize service in frontend",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -37,7 +37,7 @@
37
37
  "dependencies": {
38
38
  "i18next-locize-backend": "10.0.1",
39
39
  "i18nextify": "5.0.0",
40
- "locize": "4.2.1"
40
+ "locize": "4.2.2"
41
41
  },
42
42
  "devDependencies": {
43
43
  "eslint": "9.39.2",