@fluid-topics/ft-reader-feedback 1.1.9 → 1.1.10
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/build/ft-reader-feedback.light.js +126 -126
- package/build/ft-reader-feedback.min.js +138 -138
- package/package.json +5 -5
|
@@ -575,7 +575,7 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
575
575
|
}
|
|
576
576
|
|
|
577
577
|
.ft-tooltip {
|
|
578
|
-
position:
|
|
578
|
+
position: fixed;
|
|
579
579
|
box-sizing: border-box;
|
|
580
580
|
overflow: hidden;
|
|
581
581
|
width: max-content;
|
|
@@ -593,7 +593,7 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
593
593
|
position: relative;
|
|
594
594
|
word-break: break-word;
|
|
595
595
|
}
|
|
596
|
-
`,ro=["start","end"],no=["top","right","bottom","left"].reduce(((t,e)=>t.concat(e,e+"-"+ro[0],e+"-"+ro[1])),[]),ao=Math.min,so=Math.max,lo=Math.round,co=t=>({x:t,y:t}),fo={left:"right",right:"left",bottom:"top",top:"bottom"},ho={start:"end",end:"start"};function po(t,e,o){return so(t,ao(e,o))}function uo(t,e){return"function"==typeof t?t(e):t}function go(t){return t.split("-")[0]}function yo(t){return t.split("-")[1]}function bo(t){return"x"===t?"y":"x"}function mo(t){return"y"===t?"height":"width"}function vo(t){return["top","bottom"].includes(go(t))?"y":"x"}function xo(t){return bo(vo(t))}function wo(t){return t.replace(/left|right|bottom|top/g,(t=>fo[t]))}function Oo(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function $o(t,e,o){let{reference:i,floating:r}=t;const n=vo(e),a=xo(e),s=mo(a),l=go(e),c="y"===n,d=i.x+i.width/2-r.width/2,f=i.y+i.height/2-r.height/2,h=i[s]/2-r[s]/2;let p;switch(l){case"top":p={x:d,y:i.y-r.height};break;case"bottom":p={x:d,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:f};break;case"left":p={x:i.x-r.width,y:f};break;default:p={x:i.x,y:i.y}}switch(yo(e)){case"start":p[a]-=h*(o&&c?-1:1);break;case"end":p[a]+=h*(o&&c?-1:1)}return p}async function So(t,e){var o;void 0===e&&(e={});const{x:i,y:r,platform:n,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=uo(e,t),u=function(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}(p),g=s[h?"floating"===f?"reference":"floating":f],y=Oo(await n.getClippingRect({element:null==(o=await(null==n.isElement?void 0:n.isElement(g)))||o?g:g.contextElement||await(null==n.getDocumentElement?void 0:n.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:l})),b="floating"===f?{...a.floating,x:i,y:r}:a.reference,m=await(null==n.getOffsetParent?void 0:n.getOffsetParent(s.floating)),v=await(null==n.isElement?void 0:n.isElement(m))&&await(null==n.getScale?void 0:n.getScale(m))||{x:1,y:1},x=Oo(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({rect:b,offsetParent:m,strategy:l}):b);return{top:(y.top-x.top+u.top)/v.y,bottom:(x.bottom-y.bottom+u.bottom)/v.y,left:(y.left-x.left+u.left)/v.x,right:(x.right-y.right+u.right)/v.x}}function No(t,e,o){return(t?[...o.filter((e=>yo(e)===t)),...o.filter((e=>yo(e)!==t))]:o.filter((t=>go(t)===t))).filter((o=>!t||(yo(o)===t||!!e&&function(t){return t.replace(/start|end/g,(t=>ho[t]))}(o)!==o)))}const ko=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(e){var o,i,r;const{rects:n,middlewareData:a,placement:s,platform:l,elements:c}=e,{crossAxis:d=!1,alignment:f,allowedPlacements:h=no,autoAlignment:p=!0,...u}=uo(t,e),g=void 0!==f||h===no?No(f||null,p,h):h,y=await So(e,u),b=(null==(o=a.autoPlacement)?void 0:o.index)||0,m=g[b];if(null==m)return{};const v=function(t,e,o){void 0===o&&(o=!1);const i=yo(t),r=xo(t),n=mo(r);let a="x"===r?i===(o?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[n]>e.floating[n]&&(a=wo(a)),[a,wo(a)]}(m,n,await(null==l.isRTL?void 0:l.isRTL(c.floating)));if(s!==m)return{reset:{placement:g[0]}};const x=[y[go(m)],y[v[0]],y[v[1]]],w=[...(null==(i=a.autoPlacement)?void 0:i.overflows)||[],{placement:m,overflows:x}],O=g[b+1];if(O)return{data:{index:b+1,overflows:w},reset:{placement:O}};const $=w.map((t=>{const e=yo(t.placement);return[t.placement,e&&d?t.overflows.slice(0,2).reduce(((t,e)=>t+e),0):t.overflows[0],t.overflows]})).sort(((t,e)=>t[1]-e[1])),S=$.filter((t=>t[2].slice(0,yo(t[0])?2:3).every((t=>t<=0)))),N=(null==(r=S[0])?void 0:r[0])||$[0][0];return N!==s?{data:{index:b+1,overflows:w},reset:{placement:N}}:{}}}};function Co(t){return Eo(t)?(t.nodeName||"").toLowerCase():"#document"}function Io(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function Ro(t){var e;return null==(e=(Eo(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function Eo(t){return t instanceof Node||t instanceof Io(t).Node}function Uo(t){return t instanceof Element||t instanceof Io(t).Element}function Lo(t){return t instanceof HTMLElement||t instanceof Io(t).HTMLElement}function To(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof Io(t).ShadowRoot)}function _o(t){const{overflow:e,overflowX:o,overflowY:i,display:r}=Bo(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+o)&&!["inline","contents"].includes(r)}function Wo(t){return["table","td","th"].includes(Co(t))}function Do(t){const e=Ao(),o=Bo(t);return"none"!==o.transform||"none"!==o.perspective||!!o.containerType&&"normal"!==o.containerType||!e&&!!o.backdropFilter&&"none"!==o.backdropFilter||!e&&!!o.filter&&"none"!==o.filter||["transform","perspective","filter"].some((t=>(o.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(o.contain||"").includes(t)))}function Ao(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function zo(t){return["html","body","#document"].includes(Co(t))}function Bo(t){return Io(t).getComputedStyle(t)}function Fo(t){return Uo(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Ko(t){if("html"===Co(t))return t;const e=t.assignedSlot||t.parentNode||To(t)&&t.host||Ro(t);return To(e)?e.host:e}function Zo(t){const e=Ko(t);return zo(e)?t.ownerDocument?t.ownerDocument.body:t.body:Lo(e)&&_o(e)?e:Zo(e)}function Po(t,e,o){var i;void 0===e&&(e=[]),void 0===o&&(o=!0);const r=Zo(t),n=r===(null==(i=t.ownerDocument)?void 0:i.body),a=Io(r);return n?e.concat(a,a.visualViewport||[],_o(r)?r:[],a.frameElement&&o?Po(a.frameElement):[]):e.concat(r,Po(r,[],o))}function Mo(t){const e=Bo(t);let o=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=Lo(t),n=r?t.offsetWidth:o,a=r?t.offsetHeight:i,s=lo(o)!==n||lo(i)!==a;return s&&(o=n,i=a),{width:o,height:i,$:s}}function Ho(t){return Uo(t)?t:t.contextElement}function jo(t){const e=Ho(t);if(!Lo(e))return co(1);const o=e.getBoundingClientRect(),{width:i,height:r,$:n}=Mo(e);let a=(n?lo(o.width):o.width)/i,s=(n?lo(o.height):o.height)/r;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Go=co(0);function Vo(t){const e=Io(t);return Ao()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Go}function Yo(t,e,o,i){void 0===e&&(e=!1),void 0===o&&(o=!1);const r=t.getBoundingClientRect(),n=Ho(t);let a=co(1);e&&(i?Uo(i)&&(a=jo(i)):a=jo(t));const s=function(t,e,o){return void 0===e&&(e=!1),!(!o||e&&o!==Io(t))&&e}(n,o,i)?Vo(n):co(0);let l=(r.left+s.x)/a.x,c=(r.top+s.y)/a.y,d=r.width/a.x,f=r.height/a.y;if(n){const t=Io(n),e=i&&Uo(i)?Io(i):i;let o=t.frameElement;for(;o&&i&&e!==t;){const t=jo(o),e=o.getBoundingClientRect(),i=Bo(o),r=e.left+(o.clientLeft+parseFloat(i.paddingLeft))*t.x,n=e.top+(o.clientTop+parseFloat(i.paddingTop))*t.y;l*=t.x,c*=t.y,d*=t.x,f*=t.y,l+=r,c+=n,o=Io(o).frameElement}}return Oo({width:d,height:f,x:l,y:c})}function qo(t){return Yo(Ro(t)).left+Fo(t).scrollLeft}function Xo(t,e,o){let i;if("viewport"===e)i=function(t,e){const o=Io(t),i=Ro(t),r=o.visualViewport;let n=i.clientWidth,a=i.clientHeight,s=0,l=0;if(r){n=r.width,a=r.height;const t=Ao();(!t||t&&"fixed"===e)&&(s=r.offsetLeft,l=r.offsetTop)}return{width:n,height:a,x:s,y:l}}(t,o);else if("document"===e)i=function(t){const e=Ro(t),o=Fo(t),i=t.ownerDocument.body,r=so(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),n=so(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let a=-o.scrollLeft+qo(t);const s=-o.scrollTop;return"rtl"===Bo(i).direction&&(a+=so(e.clientWidth,i.clientWidth)-r),{width:r,height:n,x:a,y:s}}(Ro(t));else if(Uo(e))i=function(t,e){const o=Yo(t,!0,"fixed"===e),i=o.top+t.clientTop,r=o.left+t.clientLeft,n=Lo(t)?jo(t):co(1);return{width:t.clientWidth*n.x,height:t.clientHeight*n.y,x:r*n.x,y:i*n.y}}(e,o);else{const o=Vo(t);i={...e,x:e.x-o.x,y:e.y-o.y}}return Oo(i)}function Qo(t,e){const o=Ko(t);return!(o===e||!Uo(o)||zo(o))&&("fixed"===Bo(o).position||Qo(o,e))}function Jo(t,e,o){const i=Lo(e),r=Ro(e),n="fixed"===o,a=Yo(t,!0,n,e);let s={scrollLeft:0,scrollTop:0};const l=co(0);if(i||!i&&!n)if(("body"!==Co(e)||_o(r))&&(s=Fo(e)),i){const t=Yo(e,!0,n,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else r&&(l.x=qo(r));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function ti(t,e){return Lo(t)&&"fixed"!==Bo(t).position?e?e(t):t.offsetParent:null}function ei(t,e){const o=Io(t);if(!Lo(t))return o;let i=ti(t,e);for(;i&&Wo(i)&&"static"===Bo(i).position;)i=ti(i,e);return i&&("html"===Co(i)||"body"===Co(i)&&"static"===Bo(i).position&&!Do(i))?o:i||function(t){let e=Ko(t);for(;Lo(e)&&!zo(e);){if(Do(e))return e;e=Ko(e)}return null}(t)||o}const oi={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:o,strategy:i}=t;const r=Lo(o),n=Ro(o);if(o===n)return e;let a={scrollLeft:0,scrollTop:0},s=co(1);const l=co(0);if((r||!r&&"fixed"!==i)&&(("body"!==Co(o)||_o(n))&&(a=Fo(o)),Lo(o))){const t=Yo(o);s=jo(o),l.x=t.x+o.clientLeft,l.y=t.y+o.clientTop}return{width:e.width*s.x,height:e.height*s.y,x:e.x*s.x-a.scrollLeft*s.x+l.x,y:e.y*s.y-a.scrollTop*s.y+l.y}},getDocumentElement:Ro,getClippingRect:function(t){let{element:e,boundary:o,rootBoundary:i,strategy:r}=t;const n="clippingAncestors"===o?function(t,e){const o=e.get(t);if(o)return o;let i=Po(t,[],!1).filter((t=>Uo(t)&&"body"!==Co(t))),r=null;const n="fixed"===Bo(t).position;let a=n?Ko(t):t;for(;Uo(a)&&!zo(a);){const e=Bo(a),o=Do(a);o||"fixed"!==e.position||(r=null),(n?!o&&!r:!o&&"static"===e.position&&r&&["absolute","fixed"].includes(r.position)||_o(a)&&!o&&Qo(t,a))?i=i.filter((t=>t!==a)):r=e,a=Ko(a)}return e.set(t,i),i}(e,this._c):[].concat(o),a=[...n,i],s=a[0],l=a.reduce(((t,o)=>{const i=Xo(e,o,r);return t.top=so(i.top,t.top),t.right=ao(i.right,t.right),t.bottom=ao(i.bottom,t.bottom),t.left=so(i.left,t.left),t}),Xo(e,s,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:ei,getElementRects:async function(t){let{reference:e,floating:o,strategy:i}=t;const r=this.getOffsetParent||ei,n=this.getDimensions;return{reference:Jo(e,await r(o),i),floating:{x:0,y:0,...await n(o)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){return Mo(t)},getScale:jo,isElement:Uo,isRTL:function(t){return"rtl"===Bo(t).direction}},ii=(t,e,o)=>{const i=new Map,r={platform:oi,...o},n={...r.platform,_c:i};return(async(t,e,o)=>{const{placement:i="bottom",strategy:r="absolute",middleware:n=[],platform:a}=o,s=n.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:r}),{x:d,y:f}=$o(c,i,l),h=i,p={},u=0;for(let o=0;o<s.length;o++){const{name:n,fn:g}=s[o],{x:y,y:b,data:m,reset:v}=await g({x:d,y:f,initialPlacement:i,placement:h,strategy:r,middlewareData:p,rects:c,platform:a,elements:{reference:t,floating:e}});d=null!=y?y:d,f=null!=b?b:f,p={...p,[n]:{...p[n],...m}},v&&u<=50&&(u++,"object"==typeof v&&(v.placement&&(h=v.placement),v.rects&&(c=!0===v.rects?await a.getElementRects({reference:t,floating:e,strategy:r}):v.rects),({x:d,y:f}=$o(c,h,l))),o=-1)}return{x:d,y:f,placement:h,strategy:r,middlewareData:p}})(t,e,{...r,platform:n})};var ri=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class ni extends e.FtLitElement{constructor(){super(...arguments),this.text="",this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.visible=!1,this.validPositions=new Set(["top","bottom","left","right"]),this.hideDebounce=new e.Debouncer,this.revealDebouncer=new e.Debouncer}get validPosition(){return this.validPositions.has(this.position)?this.position:"bottom"}render(){return o.html`
|
|
596
|
+
`,ro=["start","end"],no=["top","right","bottom","left"].reduce(((t,e)=>t.concat(e,e+"-"+ro[0],e+"-"+ro[1])),[]),ao=Math.min,so=Math.max,lo=Math.round,co=t=>({x:t,y:t}),fo={left:"right",right:"left",bottom:"top",top:"bottom"},ho={start:"end",end:"start"};function po(t,e,o){return so(t,ao(e,o))}function uo(t,e){return"function"==typeof t?t(e):t}function go(t){return t.split("-")[0]}function yo(t){return t.split("-")[1]}function bo(t){return"x"===t?"y":"x"}function mo(t){return"y"===t?"height":"width"}function vo(t){return["top","bottom"].includes(go(t))?"y":"x"}function xo(t){return bo(vo(t))}function wo(t){return t.replace(/left|right|bottom|top/g,(t=>fo[t]))}function Oo(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function $o(t,e,o){let{reference:i,floating:r}=t;const n=vo(e),a=xo(e),s=mo(a),l=go(e),c="y"===n,d=i.x+i.width/2-r.width/2,f=i.y+i.height/2-r.height/2,h=i[s]/2-r[s]/2;let p;switch(l){case"top":p={x:d,y:i.y-r.height};break;case"bottom":p={x:d,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:f};break;case"left":p={x:i.x-r.width,y:f};break;default:p={x:i.x,y:i.y}}switch(yo(e)){case"start":p[a]-=h*(o&&c?-1:1);break;case"end":p[a]+=h*(o&&c?-1:1)}return p}async function So(t,e){var o;void 0===e&&(e={});const{x:i,y:r,platform:n,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=uo(e,t),u=function(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}(p),g=s[h?"floating"===f?"reference":"floating":f],y=Oo(await n.getClippingRect({element:null==(o=await(null==n.isElement?void 0:n.isElement(g)))||o?g:g.contextElement||await(null==n.getDocumentElement?void 0:n.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:l})),b="floating"===f?{...a.floating,x:i,y:r}:a.reference,m=await(null==n.getOffsetParent?void 0:n.getOffsetParent(s.floating)),v=await(null==n.isElement?void 0:n.isElement(m))&&await(null==n.getScale?void 0:n.getScale(m))||{x:1,y:1},x=Oo(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({rect:b,offsetParent:m,strategy:l}):b);return{top:(y.top-x.top+u.top)/v.y,bottom:(x.bottom-y.bottom+u.bottom)/v.y,left:(y.left-x.left+u.left)/v.x,right:(x.right-y.right+u.right)/v.x}}function No(t,e,o){return(t?[...o.filter((e=>yo(e)===t)),...o.filter((e=>yo(e)!==t))]:o.filter((t=>go(t)===t))).filter((o=>!t||(yo(o)===t||!!e&&function(t){return t.replace(/start|end/g,(t=>ho[t]))}(o)!==o)))}const ko=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(e){var o,i,r;const{rects:n,middlewareData:a,placement:s,platform:l,elements:c}=e,{crossAxis:d=!1,alignment:f,allowedPlacements:h=no,autoAlignment:p=!0,...u}=uo(t,e),g=void 0!==f||h===no?No(f||null,p,h):h,y=await So(e,u),b=(null==(o=a.autoPlacement)?void 0:o.index)||0,m=g[b];if(null==m)return{};const v=function(t,e,o){void 0===o&&(o=!1);const i=yo(t),r=xo(t),n=mo(r);let a="x"===r?i===(o?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[n]>e.floating[n]&&(a=wo(a)),[a,wo(a)]}(m,n,await(null==l.isRTL?void 0:l.isRTL(c.floating)));if(s!==m)return{reset:{placement:g[0]}};const x=[y[go(m)],y[v[0]],y[v[1]]],w=[...(null==(i=a.autoPlacement)?void 0:i.overflows)||[],{placement:m,overflows:x}],O=g[b+1];if(O)return{data:{index:b+1,overflows:w},reset:{placement:O}};const $=w.map((t=>{const e=yo(t.placement);return[t.placement,e&&d?t.overflows.slice(0,2).reduce(((t,e)=>t+e),0):t.overflows[0],t.overflows]})).sort(((t,e)=>t[1]-e[1])),S=$.filter((t=>t[2].slice(0,yo(t[0])?2:3).every((t=>t<=0)))),N=(null==(r=S[0])?void 0:r[0])||$[0][0];return N!==s?{data:{index:b+1,overflows:w},reset:{placement:N}}:{}}}};function Co(t){return Eo(t)?(t.nodeName||"").toLowerCase():"#document"}function Io(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function Ro(t){var e;return null==(e=(Eo(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function Eo(t){return t instanceof Node||t instanceof Io(t).Node}function Uo(t){return t instanceof Element||t instanceof Io(t).Element}function Lo(t){return t instanceof HTMLElement||t instanceof Io(t).HTMLElement}function To(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof Io(t).ShadowRoot)}function _o(t){const{overflow:e,overflowX:o,overflowY:i,display:r}=Bo(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+o)&&!["inline","contents"].includes(r)}function Wo(t){return["table","td","th"].includes(Co(t))}function Do(t){const e=Ao(),o=Bo(t);return"none"!==o.transform||"none"!==o.perspective||!!o.containerType&&"normal"!==o.containerType||!e&&!!o.backdropFilter&&"none"!==o.backdropFilter||!e&&!!o.filter&&"none"!==o.filter||["transform","perspective","filter"].some((t=>(o.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(o.contain||"").includes(t)))}function Ao(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function zo(t){return["html","body","#document"].includes(Co(t))}function Bo(t){return Io(t).getComputedStyle(t)}function Fo(t){return Uo(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Ko(t){if("html"===Co(t))return t;const e=t.assignedSlot||t.parentNode||To(t)&&t.host||Ro(t);return To(e)?e.host:e}function Zo(t){const e=Ko(t);return zo(e)?t.ownerDocument?t.ownerDocument.body:t.body:Lo(e)&&_o(e)?e:Zo(e)}function Po(t,e,o){var i;void 0===e&&(e=[]),void 0===o&&(o=!0);const r=Zo(t),n=r===(null==(i=t.ownerDocument)?void 0:i.body),a=Io(r);return n?e.concat(a,a.visualViewport||[],_o(r)?r:[],a.frameElement&&o?Po(a.frameElement):[]):e.concat(r,Po(r,[],o))}function Mo(t){const e=Bo(t);let o=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=Lo(t),n=r?t.offsetWidth:o,a=r?t.offsetHeight:i,s=lo(o)!==n||lo(i)!==a;return s&&(o=n,i=a),{width:o,height:i,$:s}}function Ho(t){return Uo(t)?t:t.contextElement}function jo(t){const e=Ho(t);if(!Lo(e))return co(1);const o=e.getBoundingClientRect(),{width:i,height:r,$:n}=Mo(e);let a=(n?lo(o.width):o.width)/i,s=(n?lo(o.height):o.height)/r;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Go=co(0);function Vo(t){const e=Io(t);return Ao()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Go}function Yo(t,e,o,i){void 0===e&&(e=!1),void 0===o&&(o=!1);const r=t.getBoundingClientRect(),n=Ho(t);let a=co(1);e&&(i?Uo(i)&&(a=jo(i)):a=jo(t));const s=function(t,e,o){return void 0===e&&(e=!1),!(!o||e&&o!==Io(t))&&e}(n,o,i)?Vo(n):co(0);let l=(r.left+s.x)/a.x,c=(r.top+s.y)/a.y,d=r.width/a.x,f=r.height/a.y;if(n){const t=Io(n),e=i&&Uo(i)?Io(i):i;let o=t.frameElement;for(;o&&i&&e!==t;){const t=jo(o),e=o.getBoundingClientRect(),i=Bo(o),r=e.left+(o.clientLeft+parseFloat(i.paddingLeft))*t.x,n=e.top+(o.clientTop+parseFloat(i.paddingTop))*t.y;l*=t.x,c*=t.y,d*=t.x,f*=t.y,l+=r,c+=n,o=Io(o).frameElement}}return Oo({width:d,height:f,x:l,y:c})}function qo(t){return Yo(Ro(t)).left+Fo(t).scrollLeft}function Xo(t,e,o){let i;if("viewport"===e)i=function(t,e){const o=Io(t),i=Ro(t),r=o.visualViewport;let n=i.clientWidth,a=i.clientHeight,s=0,l=0;if(r){n=r.width,a=r.height;const t=Ao();(!t||t&&"fixed"===e)&&(s=r.offsetLeft,l=r.offsetTop)}return{width:n,height:a,x:s,y:l}}(t,o);else if("document"===e)i=function(t){const e=Ro(t),o=Fo(t),i=t.ownerDocument.body,r=so(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),n=so(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let a=-o.scrollLeft+qo(t);const s=-o.scrollTop;return"rtl"===Bo(i).direction&&(a+=so(e.clientWidth,i.clientWidth)-r),{width:r,height:n,x:a,y:s}}(Ro(t));else if(Uo(e))i=function(t,e){const o=Yo(t,!0,"fixed"===e),i=o.top+t.clientTop,r=o.left+t.clientLeft,n=Lo(t)?jo(t):co(1);return{width:t.clientWidth*n.x,height:t.clientHeight*n.y,x:r*n.x,y:i*n.y}}(e,o);else{const o=Vo(t);i={...e,x:e.x-o.x,y:e.y-o.y}}return Oo(i)}function Qo(t,e){const o=Ko(t);return!(o===e||!Uo(o)||zo(o))&&("fixed"===Bo(o).position||Qo(o,e))}function Jo(t,e,o){const i=Lo(e),r=Ro(e),n="fixed"===o,a=Yo(t,!0,n,e);let s={scrollLeft:0,scrollTop:0};const l=co(0);if(i||!i&&!n)if(("body"!==Co(e)||_o(r))&&(s=Fo(e)),i){const t=Yo(e,!0,n,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else r&&(l.x=qo(r));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function ti(t,e){return Lo(t)&&"fixed"!==Bo(t).position?e?e(t):t.offsetParent:null}function ei(t,e){const o=Io(t);if(!Lo(t))return o;let i=ti(t,e);for(;i&&Wo(i)&&"static"===Bo(i).position;)i=ti(i,e);return i&&("html"===Co(i)||"body"===Co(i)&&"static"===Bo(i).position&&!Do(i))?o:i||function(t){let e=Ko(t);for(;Lo(e)&&!zo(e);){if(Do(e))return e;e=Ko(e)}return null}(t)||o}const oi={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:o,strategy:i}=t;const r=Lo(o),n=Ro(o);if(o===n)return e;let a={scrollLeft:0,scrollTop:0},s=co(1);const l=co(0);if((r||!r&&"fixed"!==i)&&(("body"!==Co(o)||_o(n))&&(a=Fo(o)),Lo(o))){const t=Yo(o);s=jo(o),l.x=t.x+o.clientLeft,l.y=t.y+o.clientTop}return{width:e.width*s.x,height:e.height*s.y,x:e.x*s.x-a.scrollLeft*s.x+l.x,y:e.y*s.y-a.scrollTop*s.y+l.y}},getDocumentElement:Ro,getClippingRect:function(t){let{element:e,boundary:o,rootBoundary:i,strategy:r}=t;const n="clippingAncestors"===o?function(t,e){const o=e.get(t);if(o)return o;let i=Po(t,[],!1).filter((t=>Uo(t)&&"body"!==Co(t))),r=null;const n="fixed"===Bo(t).position;let a=n?Ko(t):t;for(;Uo(a)&&!zo(a);){const e=Bo(a),o=Do(a);o||"fixed"!==e.position||(r=null),(n?!o&&!r:!o&&"static"===e.position&&r&&["absolute","fixed"].includes(r.position)||_o(a)&&!o&&Qo(t,a))?i=i.filter((t=>t!==a)):r=e,a=Ko(a)}return e.set(t,i),i}(e,this._c):[].concat(o),a=[...n,i],s=a[0],l=a.reduce(((t,o)=>{const i=Xo(e,o,r);return t.top=so(i.top,t.top),t.right=ao(i.right,t.right),t.bottom=ao(i.bottom,t.bottom),t.left=so(i.left,t.left),t}),Xo(e,s,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:ei,getElementRects:async function(t){let{reference:e,floating:o,strategy:i}=t;const r=this.getOffsetParent||ei,n=this.getDimensions;return{reference:Jo(e,await r(o),i),floating:{x:0,y:0,...await n(o)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){return Mo(t)},getScale:jo,isElement:Uo,isRTL:function(t){return"rtl"===Bo(t).direction}},ii=(t,e,o)=>{const i=new Map,r={platform:oi,...o},n={...r.platform,_c:i};return(async(t,e,o)=>{const{placement:i="bottom",strategy:r="absolute",middleware:n=[],platform:a}=o,s=n.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:r}),{x:d,y:f}=$o(c,i,l),h=i,p={},u=0;for(let o=0;o<s.length;o++){const{name:n,fn:g}=s[o],{x:y,y:b,data:m,reset:v}=await g({x:d,y:f,initialPlacement:i,placement:h,strategy:r,middlewareData:p,rects:c,platform:a,elements:{reference:t,floating:e}});d=null!=y?y:d,f=null!=b?b:f,p={...p,[n]:{...p[n],...m}},v&&u<=50&&(u++,"object"==typeof v&&(v.placement&&(h=v.placement),v.rects&&(c=!0===v.rects?await a.getElementRects({reference:t,floating:e,strategy:r}):v.rects),({x:d,y:f}=$o(c,h,l))),o=-1)}return{x:d,y:f,placement:h,strategy:r,middlewareData:p}})(t,e,{...r,platform:n})};function ri(t){return function(t){for(let e=t;e;e=ni(e))if(e instanceof Element&&"none"===getComputedStyle(e).display)return null;for(let e=ni(t);e;e=ni(e)){if(!(e instanceof Element))continue;const t=getComputedStyle(e);if("contents"!==t.display){if("static"!==t.position||"none"!==t.filter)return e;if("BODY"===e.tagName)return e}}return null}(t)}function ni(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}var ai=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class si extends e.FtLitElement{constructor(){super(...arguments),this.text="",this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.visible=!1,this.validPositions=new Set(["top","bottom","left","right"]),this.hideDebounce=new e.Debouncer,this.revealDebouncer=new e.Debouncer}get validPosition(){return this.validPositions.has(this.position)?this.position:"bottom"}render(){return o.html`
|
|
597
597
|
<div part="container"
|
|
598
598
|
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
599
599
|
@mouseenter=${this.onHover}
|
|
@@ -601,7 +601,7 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
601
601
|
@focusin=${this.onHover}
|
|
602
602
|
@focusout=${this.onOut}
|
|
603
603
|
@touchstart=${this.onTouch}>
|
|
604
|
-
<slot></slot>
|
|
604
|
+
<slot part="slot"></slot>
|
|
605
605
|
<div part="tooltip" role="tooltip" inert
|
|
606
606
|
class="ft-tooltip ft-tooltip--${this.validPosition}"
|
|
607
607
|
?hidden=${!this.visible}>
|
|
@@ -611,7 +611,7 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
611
611
|
</div>
|
|
612
612
|
</div>
|
|
613
613
|
</div>
|
|
614
|
-
`}updated(t){t.has("visible")&&this.visible&&this.resetTooltipContent(),super.updated(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((e=>t.has(e)))&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){var t;this.resetTooltipContent(),this.tooltip&&this.slottedElement&&(this.tooltip.style.left="",this.tooltip.style.top="",ii(this.slottedElement,this.tooltip,{middleware:[(t={crossAxis:!0},void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:o,y:i,placement:r}=e,{mainAxis:n=!0,crossAxis:a=!1,limiter:s={fn:t=>{let{x:e,y:o}=t;return{x:e,y:o}}},...l}=uo(t,e),c={x:o,y:i},d=await So(e,l),f=vo(go(r)),h=bo(f);let p=c[h],u=c[f];if(n){const t="y"===h?"bottom":"right";p=po(p+d["y"===h?"top":"left"],p,p-d[t])}if(a){const t="y"===f?"bottom":"right";u=po(u+d["y"===f?"top":"left"],u,u-d[t])}const g=s.fn({...e,[h]:p,[f]:u});return{...g,data:{x:g.x-o,y:g.y-i}}}}),ko({allowedPlacements:[this.position]})]}).then((({x:t,y:e})=>{this.tooltip&&(this.tooltip.style.left=`${t}px`,this.tooltip.style.top=`${e}px`)}))),this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}correctOutOfWindowPixels(t,e){return Math.max(t,Math.min(0,-e))}}
|
|
614
|
+
`}updated(t){t.has("visible")&&this.visible&&this.resetTooltipContent(),super.updated(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((e=>t.has(e)))&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){var t;this.resetTooltipContent(),this.tooltip&&this.slottedElement&&(this.tooltip.style.left="",this.tooltip.style.top="",ii(this.slottedElement,this.tooltip,{platform:{...oi,getOffsetParent:t=>oi.getOffsetParent(t,ri)},middleware:[(t={crossAxis:!0},void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:o,y:i,placement:r}=e,{mainAxis:n=!0,crossAxis:a=!1,limiter:s={fn:t=>{let{x:e,y:o}=t;return{x:e,y:o}}},...l}=uo(t,e),c={x:o,y:i},d=await So(e,l),f=vo(go(r)),h=bo(f);let p=c[h],u=c[f];if(n){const t="y"===h?"bottom":"right";p=po(p+d["y"===h?"top":"left"],p,p-d[t])}if(a){const t="y"===f?"bottom":"right";u=po(u+d["y"===f?"top":"left"],u,u-d[t])}const g=s.fn({...e,[h]:p,[f]:u});return{...g,data:{x:g.x-o,y:g.y-i}}}}),ko({allowedPlacements:[this.position]})]}).then((({x:t,y:e})=>{this.tooltip&&(this.tooltip.style.left=`${t}px`,this.tooltip.style.top=`${e}px`)}))),this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}correctOutOfWindowPixels(t,e){return Math.max(t,Math.min(0,-e))}}si.elementDefinitions={"ft-typography":Ve},si.styles=io,ai([i.property()],si.prototype,"text",void 0),ai([i.property({type:Boolean})],si.prototype,"manual",void 0),ai([i.property({type:Boolean})],si.prototype,"inline",void 0),ai([i.property({type:Number})],si.prototype,"delay",void 0),ai([i.property()],si.prototype,"position",void 0),ai([i.queryAssignedNodes()],si.prototype,"slotNodes",void 0),ai([i.query(".ft-tooltip--container")],si.prototype,"container",void 0),ai([i.query(".ft-tooltip")],si.prototype,"tooltip",void 0),ai([i.query(".ft-tooltip--content")],si.prototype,"tooltipContent",void 0),ai([i.state()],si.prototype,"visible",void 0),ai([i.eventOptions({passive:!0})],si.prototype,"onTouch",null),ai([i.eventOptions({passive:!0})],si.prototype,"onHover",null),ai([i.eventOptions({passive:!0})],si.prototype,"onOut",null),e.customElement("ft-tooltip")(si);var li=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class ci extends e.FtLitElement{constructor(){super(...arguments),this.primary=!1,this.secondary=!1,this.unbounded=!1,this.activated=!1,this.selected=!1,this.disabled=!1,this.hovered=!1,this.focused=!1,this.pressed=!1,this.rippling=!1,this.originX=0,this.originY=0,this.debouncer=new e.Debouncer(1e3),this.onTransitionStart=t=>{"transform"===t.propertyName&&(this.rippling=this.pressed,this.debouncer.run((()=>this.rippling=!1)))},this.onTransitionEnd=t=>{"transform"===t.propertyName&&(this.rippling=!1)},this.setupDebouncer=new e.Debouncer(10),this.moveRipple=t=>{var e,o;let{x:i,y:r}=this.getCoordinates(t),n=null!==(o=null===(e=this.ripple)||void 0===e?void 0:e.getBoundingClientRect())&&void 0!==o?o:{x:0,y:0,width:0,height:0};this.originX=Math.round(null!=i?i-n.x:n.width/2),this.originY=Math.round(null!=r?r-n.y:n.height/2)},this.startPress=t=>{this.moveRipple(t),this.pressed=!this.isIgnored(t)},this.endPress=()=>{this.pressed=!1},this.startHover=t=>{this.hovered=!this.isIgnored(t)},this.endHover=()=>{this.hovered=!1},this.startFocus=t=>{this.focused=this.isFocusVisible(null==t?void 0:t.target)&&!this.isIgnored(t)},this.endFocus=()=>{this.focused=!1}}render(){let t={"ft-ripple":!0,"ft-ripple--primary":this.primary,"ft-ripple--secondary":this.secondary,"ft-ripple--unbounded":this.unbounded,"ft-ripple--selected":(this.selected||this.activated)&&!this.disabled,"ft-ripple--pressed":(this.pressed||this.rippling)&&!this.disabled,"ft-ripple--hovered":this.hovered&&!this.disabled,"ft-ripple--focused":this.focused&&!this.disabled};return o.html`
|
|
615
615
|
<style>
|
|
616
616
|
.ft-ripple .ft-ripple--effect {
|
|
617
617
|
left: ${this.originX}px;
|
|
@@ -622,7 +622,7 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
622
622
|
<div class="ft-ripple--background"></div>
|
|
623
623
|
<div class="ft-ripple--effect"></div>
|
|
624
624
|
</div>
|
|
625
|
-
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}update(t){var e,o;super.update(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(e=this.target)||void 0===e||e.removeAttribute("data-is-ft-ripple-target")):null===(o=this.target)||void 0===o||o.setAttribute("data-is-ft-ripple-target","true"))}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run((()=>this.defaultSetup()))}defaultSetup(){var t,e;const o=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;o&&this.setupFor(null!==(e=this.target)&&void 0!==e?e:o)}setupFor(t){if(this.setupDebouncer.cancel(),this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const e=(...t)=>e=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(e)},o=e("mouseup","contextmenu"),i=e("touchend","touchcancel"),r=t=>{["Enter"," "].includes(t.key)&&e("keyup")(t)},n={passive:!0};t.addEventListener("mouseover",this.startHover,n),t.addEventListener("mousemove",this.moveRipple,n),t.addEventListener("mouseleave",this.endHover,n),t.addEventListener("mousedown",o,n),t.addEventListener("touchstart",i,n),t.addEventListener("touchmove",this.moveRipple,n),t.addEventListener("keydown",r,n),t.addEventListener("focus",this.startFocus,n),t.addEventListener("blur",this.endFocus,n),t.addEventListener("focusin",this.startFocus,n),t.addEventListener("focusout",this.endFocus,n),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover,n),t.removeEventListener("mousemove",this.moveRipple,n),t.removeEventListener("mouseleave",this.endHover,n),t.removeEventListener("mousedown",o,n),t.removeEventListener("touchstart",i,n),t.removeEventListener("touchmove",this.moveRipple,n),t.removeEventListener("keydown",r,n),t.removeEventListener("focus",this.startFocus,n),t.removeEventListener("blur",this.endFocus,n),t.removeEventListener("focusin",this.startFocus,n),t.removeEventListener("focusout",this.endFocus,n),this.onDisconnect=void 0,this.target=void 0}}getCoordinates(t){const e=t,o=t;let i,r;return null!=e.x?({x:i,y:r}=e):null!=o.touches&&(i=o.touches[0].clientX,r=o.touches[0].clientY),{x:i,y:r}}isFocusVisible(t){return!(t instanceof HTMLElement)||t.matches(":focus-visible")}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let e of t.composedPath()){if(e===this.target)break;if("hasAttribute"in e&&e.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.endRipple()}}
|
|
625
|
+
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}update(t){var e,o;super.update(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(e=this.target)||void 0===e||e.removeAttribute("data-is-ft-ripple-target")):null===(o=this.target)||void 0===o||o.setAttribute("data-is-ft-ripple-target","true"))}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run((()=>this.defaultSetup()))}defaultSetup(){var t,e;const o=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;o&&this.setupFor(null!==(e=this.target)&&void 0!==e?e:o)}setupFor(t){if(this.setupDebouncer.cancel(),this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const e=(...t)=>e=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(e)},o=e("mouseup","contextmenu"),i=e("touchend","touchcancel"),r=t=>{["Enter"," "].includes(t.key)&&e("keyup")(t)},n={passive:!0};t.addEventListener("mouseover",this.startHover,n),t.addEventListener("mousemove",this.moveRipple,n),t.addEventListener("mouseleave",this.endHover,n),t.addEventListener("mousedown",o,n),t.addEventListener("touchstart",i,n),t.addEventListener("touchmove",this.moveRipple,n),t.addEventListener("keydown",r,n),t.addEventListener("focus",this.startFocus,n),t.addEventListener("blur",this.endFocus,n),t.addEventListener("focusin",this.startFocus,n),t.addEventListener("focusout",this.endFocus,n),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover,n),t.removeEventListener("mousemove",this.moveRipple,n),t.removeEventListener("mouseleave",this.endHover,n),t.removeEventListener("mousedown",o,n),t.removeEventListener("touchstart",i,n),t.removeEventListener("touchmove",this.moveRipple,n),t.removeEventListener("keydown",r,n),t.removeEventListener("focus",this.startFocus,n),t.removeEventListener("blur",this.endFocus,n),t.removeEventListener("focusin",this.startFocus,n),t.removeEventListener("focusout",this.endFocus,n),this.onDisconnect=void 0,this.target=void 0}}getCoordinates(t){const e=t,o=t;let i,r;return null!=e.x?({x:i,y:r}=e):null!=o.touches&&(i=o.touches[0].clientX,r=o.touches[0].clientY),{x:i,y:r}}isFocusVisible(t){return!(t instanceof HTMLElement)||t.matches(":focus-visible")}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let e of t.composedPath()){if(e===this.target)break;if("hasAttribute"in e&&e.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.endRipple()}}ci.elementDefinitions={},ci.styles=x,li([i.property({type:Boolean})],ci.prototype,"primary",void 0),li([i.property({type:Boolean})],ci.prototype,"secondary",void 0),li([i.property({type:Boolean})],ci.prototype,"unbounded",void 0),li([i.property({type:Boolean})],ci.prototype,"activated",void 0),li([i.property({type:Boolean})],ci.prototype,"selected",void 0),li([i.property({type:Boolean})],ci.prototype,"disabled",void 0),li([i.state()],ci.prototype,"hovered",void 0),li([i.state()],ci.prototype,"focused",void 0),li([i.state()],ci.prototype,"pressed",void 0),li([i.state()],ci.prototype,"rippling",void 0),li([i.state()],ci.prototype,"originX",void 0),li([i.state()],ci.prototype,"originY",void 0),li([i.query(".ft-ripple")],ci.prototype,"ripple",void 0),li([i.query(".ft-ripple--effect")],ci.prototype,"rippleEffect",void 0),e.customElement("ft-ripple")(ci);const di={borderRadiusLeft:e.FtCssVariableFactory.extend("--ft-switch-option-border-radius-left","",e.designSystemVariables.borderRadiusL),borderRadiusRight:e.FtCssVariableFactory.extend("--ft-switch-option-border-radius-right","",e.designSystemVariables.borderRadiusL),borderWidthLeft:e.FtCssVariableFactory.create("--ft-switch-option-border-width-left","","SIZE","1px"),borderWidthRight:e.FtCssVariableFactory.create("--ft-switch-option-border-width-right","","SIZE","1px"),borderWidthVertical:e.FtCssVariableFactory.create("--ft-switch-option-border-width-vertical","","SIZE","1px")},fi=o.css`
|
|
626
626
|
.ft-switch-option {
|
|
627
627
|
position: relative;
|
|
628
628
|
display: inline-block;
|
|
@@ -641,8 +641,8 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
641
641
|
|
|
642
642
|
border-style: solid;
|
|
643
643
|
border-color: ${Dt.borderColor};
|
|
644
|
-
border-width: ${
|
|
645
|
-
border-radius: ${
|
|
644
|
+
border-width: ${di.borderWidthVertical} ${di.borderWidthRight} ${di.borderWidthVertical} ${di.borderWidthLeft};
|
|
645
|
+
border-radius: ${di.borderRadiusLeft} ${di.borderRadiusRight} ${di.borderRadiusRight} ${di.borderRadiusLeft};
|
|
646
646
|
display: flex;
|
|
647
647
|
align-items: center;
|
|
648
648
|
justify-content: center;
|
|
@@ -659,7 +659,7 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
659
659
|
|
|
660
660
|
.ft-switch-option--selected .ft-switch-option--content:before {
|
|
661
661
|
background-color: ${Dt.selectedBackgroundColor};
|
|
662
|
-
border-radius: ${
|
|
662
|
+
border-radius: ${di.borderRadiusLeft} ${di.borderRadiusRight} ${di.borderRadiusRight} ${di.borderRadiusLeft};
|
|
663
663
|
position: absolute;
|
|
664
664
|
inset: 0;
|
|
665
665
|
content: "";
|
|
@@ -706,7 +706,7 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
706
706
|
.ft-switch-option--selected ft-icon {
|
|
707
707
|
color: ${Dt.selectedTextColor};
|
|
708
708
|
}
|
|
709
|
-
`;var
|
|
709
|
+
`;var hi=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class pi extends CustomEvent{constructor(t){super("option-change-by-user",{detail:t,bubbles:!0,composed:!0})}}class ui extends CustomEvent{constructor(t){super("option-change",{detail:t,bubbles:!0,composed:!0})}}class gi extends e.FtLitElement{constructor(){super(...arguments),this.value="",this.label="",this.tooltipPosition="bottom",this.selected=!1,this.trailingIcon=!1,this.unselectable=!1}focus(){this.input.focus()}update(t){super.update(t),t.has("selected")&&this.dispatchEvent(new ui(this.selected))}render(){const t={"ft-switch-option":!0,"ft-switch-option--trailing-icon":this.trailingIcon,"ft-switch-option--selected":this.selected};return this.addTooltip(o.html`
|
|
710
710
|
<label part="label" for="input" class=${n.classMap(t)}
|
|
711
711
|
@click=${this.onChange}>
|
|
712
712
|
<div class="ft-switch-option--content">
|
|
@@ -728,16 +728,16 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
728
728
|
position="${this.tooltipPosition}">
|
|
729
729
|
${t}
|
|
730
730
|
</ft-tooltip>
|
|
731
|
-
`}onChange(){this.selected=!this.unselectable||!this.selected,this.dispatchEvent(new
|
|
731
|
+
`}onChange(){this.selected=!this.unselectable||!this.selected,this.dispatchEvent(new pi(this.selected))}getLabel(){return this.label||this.textContent}resolveIcon(){return this.icon?o.html`
|
|
732
732
|
<ft-icon part="icon" .variant=${this.iconVariant} .value=${this.icon}></ft-icon>
|
|
733
|
-
`:o.nothing}get textContent(){var t,e;return null!==(e=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==e?e:""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}}
|
|
733
|
+
`:o.nothing}get textContent(){var t,e;return null!==(e=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==e?e:""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}}gi.elementDefinitions={"ft-ripple":ci,"ft-typography":Ve,"ft-tooltip":si,"ft-icon":qe},gi.styles=[e.safariEllipsisFix,fi],hi([i.property()],gi.prototype,"value",void 0),hi([i.property()],gi.prototype,"icon",void 0),hi([i.property()],gi.prototype,"iconVariant",void 0),hi([i.property()],gi.prototype,"label",void 0),hi([i.property()],gi.prototype,"tooltipPosition",void 0),hi([i.property({type:Boolean,reflect:!0})],gi.prototype,"selected",void 0),hi([i.property({type:Boolean})],gi.prototype,"trailingIcon",void 0),hi([i.property({type:Boolean})],gi.prototype,"unselectable",void 0),hi([i.query(".ft-switch-option--content slot")],gi.prototype,"slottedContent",void 0),hi([i.query(".ft-switch-option--input")],gi.prototype,"input",void 0);var yi=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class bi extends CustomEvent{constructor(t){super("change",{detail:t})}}class mi extends e.FtLitElement{constructor(){super(...arguments),this.dense=!1,this.unselectable=!1,this.options=[]}get value(){var t;return null===(t=this.selectedOption)||void 0===t?void 0:t.value}update(t){super.update(t),t.has("selectedOption")&&this.updateOptions(),t.has("unselectable")&&this.options.forEach((t=>t.unselectable=this.unselectable))}render(){const t={"ft-switch":!0,"ft-switch--dense":this.dense};return o.html`
|
|
734
734
|
<div @keydown=${this.onKeyDown} tabindex="0" class="${n.classMap(t)}">
|
|
735
735
|
<slot @slotchange=${this.onSlotchange}
|
|
736
736
|
@option-change=${this.onOptionChangeByScript}
|
|
737
737
|
@option-change-by-user=${this.onOptionChangeByUser}
|
|
738
738
|
></slot>
|
|
739
739
|
</div>
|
|
740
|
-
`}onKeyDown(t){let e;"ArrowDown"!=t.key&&"ArrowRight"!=t.key||(e=this.selectedOption?this.options.indexOf(this.selectedOption)+1:0),"ArrowUp"!=t.key&&"ArrowLeft"!=t.key||(e=this.selectedOption?this.options.indexOf(this.selectedOption)-1:this.options.length-1),null!=e&&(t.preventDefault(),this.options[this.fixIndex(e)].selected=!0)}fixIndex(t){return t<0?this.options.length-1:t>this.options.length-1?0:t}onSlotchange(){var t;this.options=[],null===(t=this.slottedContent)||void 0===t||t.assignedElements().forEach((t=>{t instanceof
|
|
740
|
+
`}onKeyDown(t){let e;"ArrowDown"!=t.key&&"ArrowRight"!=t.key||(e=this.selectedOption?this.options.indexOf(this.selectedOption)+1:0),"ArrowUp"!=t.key&&"ArrowLeft"!=t.key||(e=this.selectedOption?this.options.indexOf(this.selectedOption)-1:this.options.length-1),null!=e&&(t.preventDefault(),this.options[this.fixIndex(e)].selected=!0)}fixIndex(t){return t<0?this.options.length-1:t>this.options.length-1?0:t}onSlotchange(){var t;this.options=[],null===(t=this.slottedContent)||void 0===t||t.assignedElements().forEach((t=>{t instanceof gi&&this.registerOption(t)})),this.selectedOption=this.options.find((t=>t.selected))}registerOption(t){t.setAttribute("tabindex","-1"),t.unselectable=this.unselectable,this.options.push(t)}onOptionChangeByScript(t){t.stopPropagation();let e=t.target;this.onOptionChange(e)}onOptionChangeByUser(t){var e;t.stopPropagation(),this.onOptionChange(t.target),this.dispatchEvent(new bi(null===(e=this.selectedOption)||void 0===e?void 0:e.value))}onOptionChange(t){t.selected?this.selectedOption=t:this.selectedOption=this.options.find((t=>t.selected))}private(t){t.selected?this.selectedOption=t:this.selectedOption=this.options.find((t=>t.selected))}focus(){this.ftSwitchDiv.focus()}updateOptions(){this.options.forEach((t=>{t.selected=t===this.selectedOption}))}}mi.elementDefinitions={},mi.styles=o.css`
|
|
741
741
|
:host {
|
|
742
742
|
display: inline-block;
|
|
743
743
|
}
|
|
@@ -753,25 +753,25 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
753
753
|
}
|
|
754
754
|
|
|
755
755
|
.ft-switch slot::slotted(ft-switch-option) {
|
|
756
|
-
${e.setVariable(
|
|
757
|
-
${e.setVariable(
|
|
758
|
-
${e.setVariable(
|
|
756
|
+
${e.setVariable(di.borderRadiusLeft,"0")};
|
|
757
|
+
${e.setVariable(di.borderRadiusRight,"0")};
|
|
758
|
+
${e.setVariable(di.borderWidthLeft,"0")};
|
|
759
759
|
}
|
|
760
760
|
|
|
761
761
|
.ft-switch slot::slotted(ft-switch-option:first-child) {
|
|
762
|
-
${e.setVariable(
|
|
763
|
-
${e.setVariable(
|
|
762
|
+
${e.setVariable(di.borderRadiusLeft,Dt.borderRadius)};
|
|
763
|
+
${e.setVariable(di.borderWidthLeft,"1px")};
|
|
764
764
|
}
|
|
765
765
|
|
|
766
766
|
.ft-switch slot::slotted(ft-switch-option:last-child) {
|
|
767
|
-
${e.setVariable(
|
|
767
|
+
${e.setVariable(di.borderRadiusRight,Dt.borderRadius)};
|
|
768
768
|
}
|
|
769
769
|
|
|
770
770
|
.ft-switch--dense slot::slotted(ft-switch-option) {
|
|
771
771
|
--ft-switch-internal-vertical-padding: 2px;
|
|
772
772
|
--ft-switch-internal-horizontal-padding: 4px;
|
|
773
773
|
}
|
|
774
|
-
`,
|
|
774
|
+
`,yi([i.property({type:Boolean})],mi.prototype,"dense",void 0),yi([i.property({type:Boolean})],mi.prototype,"unselectable",void 0),yi([i.query(".ft-switch slot")],mi.prototype,"slottedContent",void 0),yi([i.state()],mi.prototype,"selectedOption",void 0),yi([i.query(".ft-switch")],mi.prototype,"ftSwitchDiv",void 0),e.customElement("ft-switch")(mi),e.customElement("ft-switch-option")(gi);const vi=e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),xi=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceMedium,"Design system"),wi=o.css`
|
|
775
775
|
:host {
|
|
776
776
|
display: block;
|
|
777
777
|
}
|
|
@@ -782,14 +782,14 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
782
782
|
|
|
783
783
|
ft-icon {
|
|
784
784
|
transform: rotate(-45deg);
|
|
785
|
-
color: ${
|
|
785
|
+
color: ${vi};
|
|
786
786
|
}
|
|
787
787
|
|
|
788
788
|
.ft-resizer--dragging ft-icon,
|
|
789
789
|
.ft-resizer:hover ft-icon {
|
|
790
|
-
color: ${
|
|
790
|
+
color: ${xi};
|
|
791
791
|
}
|
|
792
|
-
`;var
|
|
792
|
+
`;var Oi=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class $i extends CustomEvent{constructor(t,e){super("resize",{detail:{width:t,height:e}})}}class Si extends e.FtLitElement{constructor(){super(...arguments),this.initialWidth=0,this.initialHeight=0,this.icon="drag_handle",this.iconVariant=je.material,this.cursor="nwse-resize",this.dragging=!1,this.fixedWidth=0,this.fixedHeight=0,this.startX=0,this.startY=0,this.doDragFromMouse=t=>this.doDrag(t.clientX,t.clientY),this.doDragFromTouch=t=>this.doDrag(t.touches[0].clientX,t.touches[0].clientY),this.stopDrag=()=>{this.dragging=!1,document.removeEventListener("mousemove",this.doDragFromMouse,!1),document.removeEventListener("mouseup",this.stopDrag,!1),document.removeEventListener("touchmove",this.doDragFromTouch,!1),document.removeEventListener("touchend",this.stopDrag,!1),document.removeEventListener("touchcancel",this.stopDrag,!1)}}render(){return o.html`
|
|
793
793
|
<style>
|
|
794
794
|
.ft-resizer {
|
|
795
795
|
cursor: ${o.unsafeCSS(this.cursor)}
|
|
@@ -800,25 +800,25 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
800
800
|
@touchstart=${this.initDragFromTouch}>
|
|
801
801
|
<ft-icon .variant="${this.iconVariant}" .value="${this.icon}"></ft-icon>
|
|
802
802
|
</div>
|
|
803
|
-
`}initDragFromMouse(t){this.initDrag(t.clientX,t.clientY)}initDragFromTouch(t){t.preventDefault(),t.stopPropagation(),this.initDrag(t.touches[0].clientX,t.touches[0].clientY)}initDrag(t,e){this.dragging=!0,this.startX=t,this.startY=e,this.fixedWidth=this.initialWidth,this.fixedHeight=this.initialHeight,this.installDocumentEventListeners()}installDocumentEventListeners(){document.addEventListener("mousemove",this.doDragFromMouse,!1),document.addEventListener("mouseup",this.stopDrag,!1),document.addEventListener("touchmove",this.doDragFromTouch,!1),document.addEventListener("touchend",this.stopDrag,!1),document.addEventListener("touchcancel",this.stopDrag,!1)}doDrag(t,e){let o=this.fixedWidth+t-this.startX,i=this.fixedHeight+e-this.startY;this.dispatchEvent(new
|
|
803
|
+
`}initDragFromMouse(t){this.initDrag(t.clientX,t.clientY)}initDragFromTouch(t){t.preventDefault(),t.stopPropagation(),this.initDrag(t.touches[0].clientX,t.touches[0].clientY)}initDrag(t,e){this.dragging=!0,this.startX=t,this.startY=e,this.fixedWidth=this.initialWidth,this.fixedHeight=this.initialHeight,this.installDocumentEventListeners()}installDocumentEventListeners(){document.addEventListener("mousemove",this.doDragFromMouse,!1),document.addEventListener("mouseup",this.stopDrag,!1),document.addEventListener("touchmove",this.doDragFromTouch,!1),document.addEventListener("touchend",this.stopDrag,!1),document.addEventListener("touchcancel",this.stopDrag,!1)}doDrag(t,e){let o=this.fixedWidth+t-this.startX,i=this.fixedHeight+e-this.startY;this.dispatchEvent(new $i(o,i))}}Si.elementDefinitions={"ft-icon":qe},Si.styles=[e.noTextSelect,wi],Oi([i.property({type:Number})],Si.prototype,"initialWidth",void 0),Oi([i.property({type:Number})],Si.prototype,"initialHeight",void 0),Oi([i.property()],Si.prototype,"icon",void 0),Oi([i.property()],Si.prototype,"iconVariant",void 0),Oi([i.property()],Si.prototype,"cursor",void 0),Oi([i.state()],Si.prototype,"dragging",void 0),Oi([i.eventOptions({passive:!0})],Si.prototype,"initDragFromMouse",null),Oi([i.eventOptions({passive:!0})],Si.prototype,"initDragFromTouch",null),e.customElement("ft-resizer")(Si);const Ni={fontSize:e.FtCssVariableFactory.create("--ft-input-label-font-size","","SIZE","14px"),raisedFontSize:e.FtCssVariableFactory.create("--ft-input-label-raised-font-size","","SIZE","11px"),raisedZIndex:e.FtCssVariableFactory.create("--ft-input-label-outlined-raised-z-index","","NUMBER","2"),verticalSpacing:e.FtCssVariableFactory.create("--ft-input-label-vertical-spacing","","SIZE","4px"),horizontalSpacing:e.FtCssVariableFactory.create("--ft-input-label-horizontal-spacing","","SIZE","12px"),labelMaxWidth:e.FtCssVariableFactory.create("--ft-input-label-max-width","","SIZE","100%"),borderColor:e.FtCssVariableFactory.extend("--ft-input-label-border-color","",e.designSystemVariables.colorOutline),textColor:e.FtCssVariableFactory.extend("--ft-input-label-text-color","",e.designSystemVariables.colorOnSurfaceMedium),disabledTextColor:e.FtCssVariableFactory.extend("--ft-input-label-disabled-text-color","",e.designSystemVariables.colorOnSurfaceDisabled),colorSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system"),borderRadiusS:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design system"),colorError:e.FtCssVariableFactory.external(e.designSystemVariables.colorError,"Design system")},ki=o.css`
|
|
804
804
|
.ft-input-label {
|
|
805
805
|
position: absolute;
|
|
806
806
|
inset: 0;
|
|
807
807
|
display: flex;
|
|
808
|
-
background-color: ${
|
|
809
|
-
border-radius: ${
|
|
808
|
+
background-color: ${Ni.colorSurface};
|
|
809
|
+
border-radius: ${Ni.borderRadiusS} ${Ni.borderRadiusS} 0 0;
|
|
810
810
|
}
|
|
811
811
|
|
|
812
812
|
.ft-input-label--outlined {
|
|
813
|
-
border-radius: ${
|
|
813
|
+
border-radius: ${Ni.borderRadiusS};
|
|
814
814
|
}
|
|
815
815
|
|
|
816
816
|
.ft-input-label {
|
|
817
|
-
border-color: ${
|
|
817
|
+
border-color: ${Ni.borderColor};
|
|
818
818
|
}
|
|
819
819
|
|
|
820
820
|
.ft-input-label.ft-input-label--in-error {
|
|
821
|
-
border-color: ${
|
|
821
|
+
border-color: ${Ni.colorError}
|
|
822
822
|
}
|
|
823
823
|
|
|
824
824
|
.ft-input-label:before,
|
|
@@ -831,7 +831,7 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
831
831
|
}
|
|
832
832
|
|
|
833
833
|
.ft-input-label:before {
|
|
834
|
-
width: calc(${
|
|
834
|
+
width: calc(${Ni.horizontalSpacing} - 4px);
|
|
835
835
|
flex-shrink: 0;
|
|
836
836
|
}
|
|
837
837
|
|
|
@@ -847,20 +847,20 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
847
847
|
border-bottom-width: 1px;
|
|
848
848
|
border-bottom-style: solid;
|
|
849
849
|
border-color: inherit;
|
|
850
|
-
color: ${
|
|
850
|
+
color: ${Ni.textColor};
|
|
851
851
|
transition: font-size 250ms, line-height 250ms, color 250ms;
|
|
852
|
-
max-width: calc(${
|
|
852
|
+
max-width: calc(${Ni.labelMaxWidth} - 2 * (${Ni.horizontalSpacing} - 4px)); /* -2px on spacing for label padding */
|
|
853
853
|
text-overflow: ellipsis;
|
|
854
|
-
${e.setVariable(X.fontSize
|
|
855
|
-
${e.setVariable(X.lineHeight
|
|
854
|
+
${e.setVariable(X.fontSize,Ni.fontSize)};
|
|
855
|
+
${e.setVariable(X.lineHeight,Ni.fontSize)};
|
|
856
856
|
}
|
|
857
857
|
|
|
858
858
|
.ft-input-label--in-error .ft-input-label--text {
|
|
859
|
-
color: ${
|
|
859
|
+
color: ${Ni.colorError}
|
|
860
860
|
}
|
|
861
861
|
|
|
862
862
|
.ft-input-label--disabled .ft-input-label--text {
|
|
863
|
-
color: ${
|
|
863
|
+
color: ${Ni.disabledTextColor};
|
|
864
864
|
}
|
|
865
865
|
|
|
866
866
|
.ft-input-label--hidden-text {
|
|
@@ -877,19 +877,19 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
877
877
|
overflow: hidden;
|
|
878
878
|
white-space: nowrap;
|
|
879
879
|
text-overflow: ellipsis;
|
|
880
|
-
padding: ${
|
|
881
|
-
margin: calc(${
|
|
880
|
+
padding: ${Ni.verticalSpacing} 4px;
|
|
881
|
+
margin: calc(${Ni.verticalSpacing} * -1) 0;
|
|
882
882
|
max-width: 100%;
|
|
883
883
|
box-sizing: border-box;
|
|
884
884
|
}
|
|
885
885
|
|
|
886
886
|
.ft-input-label--raised .ft-input-label--text {
|
|
887
|
-
${e.setVariable(X.fontSize
|
|
888
|
-
${e.setVariable(X.lineHeight
|
|
887
|
+
${e.setVariable(X.fontSize,Ni.raisedFontSize)};
|
|
888
|
+
${e.setVariable(X.lineHeight,Ni.raisedFontSize)};
|
|
889
889
|
}
|
|
890
890
|
|
|
891
891
|
.ft-input-label--raised .ft-input-label--floating-text {
|
|
892
|
-
top: ${
|
|
892
|
+
top: ${Ni.verticalSpacing};
|
|
893
893
|
}
|
|
894
894
|
|
|
895
895
|
.ft-input-label--outlined .ft-input-label--text,
|
|
@@ -902,27 +902,27 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
902
902
|
.ft-input-label--outlined:before {
|
|
903
903
|
border-left-width: 1px;
|
|
904
904
|
border-left-style: solid;
|
|
905
|
-
border-radius: ${
|
|
905
|
+
border-radius: ${Ni.borderRadiusS} 0 0 ${Ni.borderRadiusS};
|
|
906
906
|
}
|
|
907
907
|
|
|
908
908
|
.ft-input-label--outlined:after {
|
|
909
909
|
border-right-width: 1px;
|
|
910
910
|
border-right-style: solid;
|
|
911
|
-
border-radius: 0 ${
|
|
911
|
+
border-radius: 0 ${Ni.borderRadiusS} ${Ni.borderRadiusS} 0;
|
|
912
912
|
}
|
|
913
913
|
|
|
914
914
|
.ft-input-label--outlined.ft-input-label--raised .ft-input-label--floating-text {
|
|
915
915
|
padding: 2px 4px;
|
|
916
|
-
z-index: ${
|
|
917
|
-
background-color: ${
|
|
918
|
-
border-radius: ${
|
|
916
|
+
z-index: ${Ni.raisedZIndex};
|
|
917
|
+
background-color: ${Ni.colorSurface};
|
|
918
|
+
border-radius: ${Ni.borderRadiusS};
|
|
919
919
|
top: calc((var(--ft-typography-caption-line-height) / -2) + 2px);
|
|
920
920
|
}
|
|
921
921
|
|
|
922
922
|
.ft-input-label--outlined.ft-input-label--raised .ft-input-label--text {
|
|
923
923
|
border-top: none;
|
|
924
924
|
}
|
|
925
|
-
`;var
|
|
925
|
+
`;var Ci=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Ii extends e.FtLitElement{constructor(){super(...arguments),this.text="",this.raised=!1,this.outlined=!1,this.disabled=!1,this.error=!1}render(){const t={"ft-input-label":!0,"ft-input-label--raised":this.raised,"ft-input-label--outlined":this.outlined,"ft-input-label--disabled":this.disabled,"ft-input-label--in-error":this.error};return o.html`
|
|
926
926
|
<div class="${n.classMap(t)}">
|
|
927
927
|
${this.text?o.html`
|
|
928
928
|
<div class="ft-input-label--text ft-typography--caption">
|
|
@@ -931,7 +931,7 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
931
931
|
</div>
|
|
932
932
|
`:null}
|
|
933
933
|
</div>
|
|
934
|
-
`}}
|
|
934
|
+
`}}Ii.elementDefinitions={},Ii.styles=[bt,ki],Ci([i.property({type:String})],Ii.prototype,"text",void 0),Ci([i.property({type:Boolean})],Ii.prototype,"raised",void 0),Ci([i.property({type:Boolean})],Ii.prototype,"outlined",void 0),Ci([i.property({type:Boolean})],Ii.prototype,"disabled",void 0),Ci([i.property({type:Boolean})],Ii.prototype,"error",void 0),e.customElement("ft-input-label")(Ii);const Ri={fontSize:e.FtCssVariableFactory.create("--ft-text-area-font-size","","SIZE","14px"),labelSize:e.FtCssVariableFactory.create("--ft-text-area-label-size","","SIZE","11px"),verticalSpacing:e.FtCssVariableFactory.create("--ft-text-area-vertical-spacing","","SIZE","4px"),horizontalSpacing:e.FtCssVariableFactory.create("--ft-text-area-horizontal-spacing","","SIZE","16px"),helperColor:e.FtCssVariableFactory.extend("--ft-text-area-helper-color","",e.designSystemVariables.colorOnSurfaceMedium),colorPrimary:e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),colorOnSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system"),borderRadiusS:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design system"),colorError:e.FtCssVariableFactory.external(e.designSystemVariables.colorError,"Design system")},Ei=o.css`
|
|
935
935
|
*:focus {
|
|
936
936
|
outline: none;
|
|
937
937
|
}
|
|
@@ -943,10 +943,10 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
943
943
|
}
|
|
944
944
|
|
|
945
945
|
ft-input-label {
|
|
946
|
-
${e.setVariable(
|
|
947
|
-
${e.setVariable(
|
|
948
|
-
${e.setVariable(
|
|
949
|
-
${e.setVariable(
|
|
946
|
+
${e.setVariable(Ni.fontSize,Ri.fontSize)};
|
|
947
|
+
${e.setVariable(Ni.raisedFontSize,Ri.labelSize)};
|
|
948
|
+
${e.setVariable(Ni.verticalSpacing,Ri.verticalSpacing)};
|
|
949
|
+
${e.setVariable(Ni.horizontalSpacing,Ri.horizontalSpacing)};
|
|
950
950
|
}
|
|
951
951
|
|
|
952
952
|
.ft-text-area--main-panel {
|
|
@@ -977,12 +977,12 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
977
977
|
align-self: stretch;
|
|
978
978
|
resize: none;
|
|
979
979
|
|
|
980
|
-
${e.setVariable(M.fontSize,
|
|
981
|
-
${e.setVariable(M.lineHeight,
|
|
982
|
-
color: ${
|
|
980
|
+
${e.setVariable(M.fontSize,Ri.fontSize)};
|
|
981
|
+
${e.setVariable(M.lineHeight,Ri.fontSize)};
|
|
982
|
+
color: ${Ri.colorOnSurface};
|
|
983
983
|
|
|
984
|
-
padding: 0 ${
|
|
985
|
-
margin: calc(${
|
|
984
|
+
padding: 0 ${Ri.horizontalSpacing};
|
|
985
|
+
margin: calc(${Ri.verticalSpacing} + ${Ri.labelSize} / 2) 0 ${Ri.verticalSpacing} 0;
|
|
986
986
|
|
|
987
987
|
border: none;
|
|
988
988
|
background: none;
|
|
@@ -991,7 +991,7 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
991
991
|
}
|
|
992
992
|
|
|
993
993
|
.ft-text-area--disabled .ft-text-area--input {
|
|
994
|
-
color: ${
|
|
994
|
+
color: ${Ri.colorOnSurfaceDisabled};
|
|
995
995
|
}
|
|
996
996
|
|
|
997
997
|
.ft-text-area:not(.ft-text-area--disabled) .ft-text-area--input-panel {
|
|
@@ -999,42 +999,42 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
999
999
|
}
|
|
1000
1000
|
|
|
1001
1001
|
.ft-text-area:not(.ft-text-area--disabled):focus-within ft-input-label {
|
|
1002
|
-
${e.setVariable(
|
|
1003
|
-
${e.setVariable(
|
|
1002
|
+
${e.setVariable(Ni.borderColor,Ri.colorPrimary)};
|
|
1003
|
+
${e.setVariable(Ni.textColor,Ri.colorPrimary)};
|
|
1004
1004
|
}
|
|
1005
1005
|
|
|
1006
1006
|
.ft-text-area--filled .ft-text-area--input-panel {
|
|
1007
|
-
border-radius: ${
|
|
1007
|
+
border-radius: ${Ri.borderRadiusS} ${Ri.borderRadiusS} 0 0;
|
|
1008
1008
|
}
|
|
1009
1009
|
|
|
1010
1010
|
.ft-text-area--filled:not(.ft-text-area--no-label) .ft-text-area--input {
|
|
1011
1011
|
align-self: stretch;
|
|
1012
|
-
margin-bottom: ${
|
|
1013
|
-
margin-top: calc(${
|
|
1012
|
+
margin-bottom: ${Ri.verticalSpacing};
|
|
1013
|
+
margin-top: calc(${Ri.labelSize} + 2 * ${Ri.verticalSpacing});
|
|
1014
1014
|
}
|
|
1015
1015
|
|
|
1016
1016
|
.ft-text-area--outlined .ft-text-area--input-panel {
|
|
1017
|
-
border-radius: ${
|
|
1017
|
+
border-radius: ${Ri.borderRadiusS};
|
|
1018
1018
|
}
|
|
1019
1019
|
|
|
1020
1020
|
.ft-text-area--helper-text {
|
|
1021
|
-
padding: 0 12px 0 ${
|
|
1022
|
-
color: ${
|
|
1021
|
+
padding: 0 12px 0 ${Ri.horizontalSpacing};
|
|
1022
|
+
color: ${Ri.helperColor};
|
|
1023
1023
|
}
|
|
1024
1024
|
|
|
1025
1025
|
.ft-text-area--in-error .ft-text-area--input,
|
|
1026
1026
|
.ft-text-area--in-error .ft-text-area--helper-text {
|
|
1027
|
-
color: ${
|
|
1027
|
+
color: ${Ri.colorError};
|
|
1028
1028
|
}
|
|
1029
1029
|
|
|
1030
1030
|
ft-resizer {
|
|
1031
1031
|
position: absolute;
|
|
1032
1032
|
bottom: 0;
|
|
1033
1033
|
}
|
|
1034
|
-
`;var
|
|
1034
|
+
`;var Ui=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Li extends(e.toFtFormComponent(e.FtLitElement,"textbox")){constructor(){super(...arguments),this.label="",this.value="",this.helper="",this.outlined=!1,this.disabled=!1,this.error=!1,this.height=50,this.focused=!1}render(){const t={"ft-text-area":!0,"ft-text-area--filled":!this.outlined,"ft-text-area--outlined":this.outlined,"ft-text-area--disabled":this.disabled,"ft-text-area--has-value":!!this.value,"ft-text-area--no-label":!this.label,"ft-text-area--in-error":this.error};return o.html`
|
|
1035
1035
|
<style>
|
|
1036
1036
|
.ft-text-area--main-panel {
|
|
1037
|
-
height: calc(4 * ${
|
|
1037
|
+
height: calc(4 * ${Ri.verticalSpacing} + ${Ri.labelSize} + ${Ri.fontSize} + ${this.height}px);
|
|
1038
1038
|
}
|
|
1039
1039
|
|
|
1040
1040
|
ft-resizer {
|
|
@@ -1073,14 +1073,14 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
1073
1073
|
${this.helper}
|
|
1074
1074
|
</ft-typography>`:void 0}
|
|
1075
1075
|
</div>
|
|
1076
|
-
`}setValue(t,e=!1){this.value=t,this.setFormValue(t),e&&(this.dispatchEvent(new CustomEvent("live-change",{detail:this.value})),this.dispatchEvent(new CustomEvent("change",{detail:this.value})))}contentAvailableCallback(t){super.contentAvailableCallback(t),this.requestUpdate()}onKeyDown(t){"Enter"!==t.key&&" "!==t.key||t.stopPropagation()}updateValueFromInputField(){this.dispatchEvent(new CustomEvent("change",{detail:this.value}))}liveUpdateValueFromInputField(){var t;this.value=(null===(t=this.textarea)||void 0===t?void 0:t.value)||"",this.setFormValue(this.value),this.dispatchEvent(new CustomEvent("live-change",{detail:this.value}))}onResize(t){t.detail.height>=50&&(this.height=t.detail.height)}}
|
|
1076
|
+
`}setValue(t,e=!1){this.value=t,this.setFormValue(t),e&&(this.dispatchEvent(new CustomEvent("live-change",{detail:this.value})),this.dispatchEvent(new CustomEvent("change",{detail:this.value})))}contentAvailableCallback(t){super.contentAvailableCallback(t),this.requestUpdate()}onKeyDown(t){"Enter"!==t.key&&" "!==t.key||t.stopPropagation()}updateValueFromInputField(){this.dispatchEvent(new CustomEvent("change",{detail:this.value}))}liveUpdateValueFromInputField(){var t;this.value=(null===(t=this.textarea)||void 0===t?void 0:t.value)||"",this.setFormValue(this.value),this.dispatchEvent(new CustomEvent("live-change",{detail:this.value}))}onResize(t){t.detail.height>=50&&(this.height=t.detail.height)}}Li.elementDefinitions={"ft-input-label":Ii,"ft-resizer":Si,"ft-ripple":ci,"ft-typography":Ve},Li.styles=[gt,Ei],Ui([i.property({type:String})],Li.prototype,"label",void 0),Ui([i.property({reflect:!0})],Li.prototype,"value",void 0),Ui([i.property({type:String})],Li.prototype,"helper",void 0),Ui([i.property({type:Boolean})],Li.prototype,"outlined",void 0),Ui([i.property({type:Boolean})],Li.prototype,"disabled",void 0),Ui([i.property({type:Boolean})],Li.prototype,"error",void 0),Ui([i.property({type:Number,reflect:!0})],Li.prototype,"height",void 0),Ui([i.query("textarea")],Li.prototype,"textarea",void 0),Ui([i.state()],Li.prototype,"focused",void 0),e.customElement("ft-text-area")(Li);class Ti extends e.FtLitElement{render(){return o.html`
|
|
1077
1077
|
<div class="ft-loader">
|
|
1078
1078
|
<div></div>
|
|
1079
1079
|
<div></div>
|
|
1080
1080
|
<div></div>
|
|
1081
1081
|
<div></div>
|
|
1082
1082
|
</div>
|
|
1083
|
-
`}}
|
|
1083
|
+
`}}Ti.styles=St,e.customElement("ft-loader")(Ti);var _i=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Wi extends(e.toFtFormComponent(e.FtLitElement,"button")){constructor(){super(...arguments),this.role="button",this.type="button",this.disabled=!1,this.label="",this.icon=void 0,this.trailingIcon=!1,this.loading=!1,this.tooltipPosition="bottom",this.hideTooltip=!1,this.forceTooltip=!1,this.onclick=t=>{var e;this.isDisabled()?(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()):"submit"==this.type&&(null===(e=this.form)||void 0===e||e.requestSubmit())}}render(){return this.addTooltipIfNeeded(o.html`
|
|
1084
1084
|
<button part="button"
|
|
1085
1085
|
class="${n.classMap(this.buttonClasses)}"
|
|
1086
1086
|
aria-label="${this.getLabel()}"
|
|
@@ -1103,7 +1103,7 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
1103
1103
|
</ft-tooltip>
|
|
1104
1104
|
`:t}resolveIcon(){return this.loading?o.html`
|
|
1105
1105
|
<ft-loader part="loader icon"></ft-loader> `:this.icon?o.html`
|
|
1106
|
-
<ft-icon part="icon" .variant="${this.iconVariant}" .value="${this.icon}"></ft-icon> `:o.nothing}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}
|
|
1106
|
+
<ft-icon part="icon" .variant="${this.iconVariant}" .value="${this.icon}"></ft-icon> `:o.nothing}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}Wi.elementDefinitions={"ft-ripple":ci,"ft-tooltip":si,"ft-typography":Ve,"ft-icon":qe,"ft-loader":Ti},_i([i.property({type:String,reflect:!0})],Wi.prototype,"role",void 0),_i([i.property()],Wi.prototype,"type",void 0),_i([i.property({type:Boolean})],Wi.prototype,"disabled",void 0),_i([i.property()],Wi.prototype,"label",void 0),_i([i.property()],Wi.prototype,"icon",void 0),_i([i.property()],Wi.prototype,"iconVariant",void 0),_i([i.property({type:Boolean})],Wi.prototype,"trailingIcon",void 0),_i([i.property({type:Boolean})],Wi.prototype,"loading",void 0),_i([i.property()],Wi.prototype,"tooltipPosition",void 0),_i([i.property({type:Boolean})],Wi.prototype,"hideTooltip",void 0),_i([i.property({type:Boolean})],Wi.prototype,"forceTooltip",void 0),_i([i.query(".ft-button")],Wi.prototype,"button",void 0),_i([i.query(".ft-button--label slot")],Wi.prototype,"slottedContent",void 0);var Di=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Ai extends Wi{constructor(){super(...arguments),this.primary=!1,this.outlined=!1,this.dense=!1,this.round=!1}get buttonClasses(){return{"ft-button":!0,"ft-button--primary":this.primary,"ft-button--outlined":this.outlined,"ft-button--dense":this.dense,"ft-button--round":this.round,"ft-button--trailing-icon":this.trailingIcon,"ft-button--loading":this.trailingIcon,"ft-no-text-select":!0}}get typographyVariant(){return"button"}}Ai.styles=[e.safariEllipsisFix,Wt],Di([i.property({type:Boolean})],Ai.prototype,"primary",void 0),Di([i.property({type:Boolean})],Ai.prototype,"outlined",void 0),Di([i.property({type:Boolean})],Ai.prototype,"dense",void 0),Di([i.property({type:Boolean})],Ai.prototype,"round",void 0);const zi=[o.css`
|
|
1107
1107
|
:host {
|
|
1108
1108
|
display: inline-block;
|
|
1109
1109
|
max-width: 100%;
|
|
@@ -1321,15 +1321,15 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
1321
1321
|
width: ${k.smallIconOnlyWidth};
|
|
1322
1322
|
padding: unset;
|
|
1323
1323
|
}
|
|
1324
|
-
`,e.noTextSelect];var
|
|
1325
|
-
`,
|
|
1326
|
-
`,
|
|
1324
|
+
`,e.noTextSelect];var Bi=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Fi extends Wi{constructor(){super(...arguments),this.primary=!1,this.secondary=!1,this.tertiary=!1,this.neutral=!1,this.small=!1}get buttonClasses(){return{"ft-button":!0,"ft-button--primary":this.primary,"ft-button--secondary":this.secondary,"ft-button--tertiary":this.tertiary||!this.primary&&!this.secondary&&!this.neutral,"ft-button--neutral":this.neutral,"ft-button--large":!this.small,"ft-button--small":this.small,"ft-button--icon-only":!this.hasTextContent(),"ft-button--trailing-icon":this.trailingIcon,"ft-button--loading":this.trailingIcon,"ft-no-text-select":!0,"ft-button--no-icon":!this.icon}}get typographyVariant(){return this.small?Pe.caption1medium:Pe.body2medium}}Fi.styles=[e.safariEllipsisFix,zi],Bi([i.property({type:Boolean})],Fi.prototype,"primary",void 0),Bi([i.property({type:Boolean})],Fi.prototype,"secondary",void 0),Bi([i.property({type:Boolean})],Fi.prototype,"tertiary",void 0),Bi([i.property({type:Boolean})],Fi.prototype,"neutral",void 0),Bi([i.property({type:Boolean})],Fi.prototype,"small",void 0),e.customElement("ft-button")(Ai),e.customElement("ftds-button")(Fi);const Ki=o.css`
|
|
1325
|
+
`,Zi=o.css`
|
|
1326
|
+
`,Pi=e.FtReduxStore.get({name:"ft-app-info",reducers:{setBaseUrl:(t,e)=>{t.baseUrl=e.payload},setApiIntegrationIdentifier:(t,e)=>{t.apiIntegrationIdentifier=e.payload},setUiLocale:(t,e)=>{t.uiLocale=e.payload},setAvailableUiLocales:(t,e)=>{t.availableUiLocales=e.payload},setEditorMode:(t,e)=>{t.editorMode=e.payload},setNoCustom:(t,e)=>{t.noCustom=e.payload},setNoCustomComponent:(t,e)=>{t.noCustomComponent=e.payload},setSession:(t,e)=>{t.session=e.payload}},initialState:{uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],editorMode:!1,noCustom:!1,noCustomComponent:!1}});class Mi{static build(t){const{baseUrl:e,apiIntegrationIdentifier:o}=Pi.getState(),i=null!=t?t:o;if(e&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(e,i,!0)}static get(t){var e;return null!=t?Mi.build(t):null!==(e=Mi.API)&&void 0!==e?e:Mi.API=Mi.build()}static await(t){return new Promise((e=>{let o=Mi.get(t);if(o)e(o);else{const i=Pi.subscribe((()=>{o=Mi.get(t),o&&(i(),e(o))}))}}))}}var Hi;const ji=Symbol("clearAfterUnitTest");class Gi{constructor(t){this.messageContextProvider=t,this.defaultMessages={},this.cache=new e.CacheRegistry,this.listeners={},this.currentUiLocale="",this[Hi]=()=>{this.defaultMessages={},this.cache=new e.CacheRegistry,this.listeners={}},this.currentUiLocale=Pi.getState().uiLocale,Pi.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=Pi.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const e=t.name.toLowerCase();this.cache.setFinal(e,t),this.notify(e)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,o){var i;if(t=t.toLowerCase(),Object.keys(o).length>0){const r={...null!==(i=this.defaultMessages[t])&&void 0!==i?i:{},...o};e.deepEqual(this.defaultMessages[t],r)||(this.defaultMessages[t]=r,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,o,...i){var r,n,a;t=t.toLowerCase(),this.fetchContext(t);const s=null!==(n=null===(r=this.cache.getNow(t))||void 0===r?void 0:r.messages)&&void 0!==n?n:{};return new e.ParametrizedLabelResolver(null!==(a=this.defaultMessages[t])&&void 0!==a?a:{},s).resolve(o,...i)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(()=>this.messageContextProvider(this.currentUiLocale,t))),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,e){var o;return t=t.toLowerCase(),this.listeners[t]=null!==(o=this.listeners[t])&&void 0!==o?o:new Set,this.listeners[t].add(e),()=>{var o;return null===(o=this.listeners[t])||void 0===o?void 0:o.delete(e)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map((t=>this.notify(t))))}async notify(t){null!=this.listeners[t]&&await Promise.all([...this.listeners[t].values()].map((t=>e.delay(0).then((()=>t())).catch((()=>null)))))}}Hi=ji,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new Gi((async(t,e)=>(await Mi.await()).getFluidTopicsMessageContext(t,e)))),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new Gi((async(t,e)=>(await Mi.await()).getCustomMessageContext(t,e))));const Vi=window.FluidTopicsI18nService,Yi=window.FluidTopicsCustomI18nService;var qi=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Xi extends e.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.availableUiLocales=[],this.editorMode=!1,this.noCustom=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>Mi.get(),this.cache=new e.CacheRegistry,this.cleanSessionDebouncer=new e.Debouncer}render(){return o.html`
|
|
1327
1327
|
<slot></slot>
|
|
1328
|
-
`}update(t){super.update(t),t.has("baseUrl")&&
|
|
1328
|
+
`}update(t){super.update(t),t.has("baseUrl")&&Pi.actions.setBaseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&Pi.actions.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&Pi.actions.setUiLocale(this.uiLocale),t.has("noCustom")&&Pi.actions.setNoCustom(this.noCustom),t.has("editorMode")&&Pi.actions.setEditorMode(this.editorMode),t.has("noCustomComponent")&&Pi.actions.setNoCustomComponent(this.noCustomComponent),t.has("session")&&Pi.actions.setSession(this.session),t.has("availableUiLocales")&&Pi.actions.setAvailableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>Vi.addContext(t))),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){const t=this.apiProvider();!this.withManualResources&&t&&(null==this.session&&(this.session=await this.cache.get("session",(async()=>{const e=await t.getCurrentSession();return e.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),e.idleTimeoutInMillis),e}))),null==this.availableUiLocales&&(this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>t.getAvailableUiLocales()))))}}Xi.elementDefinitions={},Xi.styles=Zi,qi([i.property()],Xi.prototype,"baseUrl",void 0),qi([i.property()],Xi.prototype,"apiIntegrationIdentifier",void 0),qi([i.property()],Xi.prototype,"uiLocale",void 0),qi([e.jsonProperty([])],Xi.prototype,"availableUiLocales",void 0),qi([i.property({type:Boolean})],Xi.prototype,"editorMode",void 0),qi([i.property({type:Boolean})],Xi.prototype,"noCustom",void 0),qi([i.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],Xi.prototype,"noCustomComponent",void 0),qi([i.property({type:Boolean})],Xi.prototype,"withManualResources",void 0),qi([e.jsonProperty([])],Xi.prototype,"messageContexts",void 0),qi([e.jsonProperty(void 0)],Xi.prototype,"session",void 0),qi([i.property({type:Object})],Xi.prototype,"apiProvider",void 0);class Qi{async listMySearches(){var t;return(null===(t=Pi.getState().session)||void 0===t?void 0:t.sessionAuthenticated)?(await Mi.await()).listMySearches(Pi.getState().session.profile.userId):[]}}const Ji=new e.CacheRegistry;class tr{async listMyBookmarks(){return Ji.get("bookmarks",(async()=>(await Mi.await()).listMyBookmarks(Pi.getState().session.profile.userId)))}clearCache(){Ji.clear("bookmarks")}}const er=e.FtReduxStore.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});const or=new class{constructor(){this.currentSession=Pi.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new tr,Pi.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:o}=Pi.getState();e.deepEqual(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==o?void 0:o.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){er.actions.savedSearches(void 0)}clearMyBookmarks(){er.actions.bookmarks(void 0)}async reloadMySearches(){const t=new Qi,e=await t.listMySearches();er.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const e=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;er.actions.bookmarks(e)}}};e.customElement("ft-app-context")(Xi);var ir=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};const rr=Symbol("i18nProperties"),nr=Symbol("i18nUnsubs");function ar(t){var e;class o extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map}get i18nService(){return this.useCustomMessageContexts?Yi:Vi}i18n(t,e,...o){var i;if("string"==typeof t)return this.i18nService.resolveMessage(t,e,...o);const r=null!==(i=t.args)&&void 0!==i?i:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...r)}onI18nUpdate(t){var e;null===(e=this[rr])||void 0===e||e.forEach(((e,o)=>{e.context.toLowerCase()===t.toLowerCase()&&(this[o]=this.i18n(e))})),setTimeout((()=>this.requestUpdate()),0)}update(t){var e;super.update(t),null===(e=this[rr])||void 0===e||e.forEach(((t,e)=>{null!=t.argsProvider&&(this[e]=this.i18n(t))}))}connectedCallback(){super.connectedCallback(),null!=this[rr]&&new Set([...this[rr].values()].map((t=>t.context))).forEach((t=>this.addI18nMessages(t)))}addI18nMessages(t,e){t=t.toLowerCase(),this[nr].has(t)||this[nr].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=e?e:{})}addI18nContext(t,e){this.addI18nMessages(t.name,e)}disconnectedCallback(){super.disconnectedCallback(),this[nr].forEach((t=>t())),this[nr].clear()}}return e=nr,ir([i.property({type:Boolean})],o.prototype,"useCustomMessageContexts",void 0),o}class sr extends(ar(e.FtLitElement)){}class lr extends(ar(e.FtLitElementRedux)){}var cr=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class dr extends lr{constructor(){super(),this.editorMode=!1,this.addStore(Pi)}render(){return this.key&&this.context?o.html`
|
|
1329
1329
|
<span class="ft-i18n">
|
|
1330
1330
|
${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}
|
|
1331
1331
|
</span>
|
|
1332
|
-
`:this.editorMode?"Select a context and a label key.":o.nothing}update(t){var e;super.update(t),this.context&&this.key&&this.addI18nMessages(this.context,{[this.key]:null!==(e=this.defaultMessage)&&void 0!==e?e:""})}}
|
|
1332
|
+
`:this.editorMode?"Select a context and a label key.":o.nothing}update(t){var e;super.update(t),this.context&&this.key&&this.addI18nMessages(this.context,{[this.key]:null!==(e=this.defaultMessage)&&void 0!==e?e:""})}}dr.elementDefinitions={},dr.styles=Ki,cr([e.redux()],dr.prototype,"editorMode",void 0),cr([i.property()],dr.prototype,"context",void 0),cr([i.property()],dr.prototype,"key",void 0),cr([e.jsonProperty([])],dr.prototype,"args",void 0),cr([i.property()],dr.prototype,"defaultMessage",void 0);class fr{static build(t){return new fr(t)}static fromGwt(t){return new fr(t)}constructor(t){this.name=t,this.properties=new Proxy({},{get:(t,e)=>{const o=e;return t=>({context:this.name,key:o,args:"function"==typeof t?void 0:t,argsProvider:"function"==typeof t?t:void 0})}}),this.messages=new Proxy({},{get:(t,e)=>(...t)=>Vi.resolveMessage(this.name,e,...t)})}}const hr=(t,e)=>(o,i)=>{var r,n;o.constructor.createProperty(i,null!=e?e:{attribute:!1,type:String});const a={...t,key:null!==(r=t.key)&&void 0!==r?r:i};o[rr]=null!==(n=o[rr])&&void 0!==n?n:new Map,o[rr].set(i,a)};e.customElement("ft-i18n")(dr);const pr=fr.build("integratedFeedbackComponent"),ur={starsRating:"{0} stars","starsRating[\\=1]":"1 star",like:"Like",dislike:"Dislike",dichotomousYes:"Yes",dichotomousNo:"No",notRated:"Not rated",ratedNow:"Rated now",ratedToday:"Rated today",ratedOn:"Rated on {0, date}",feedbackInputLabel:"How can we improve it?",feedbackfromEmail:"Your email",feedbackfromEmailInvalid:"Please enter a valid email address",okButton:"Send feedback",cancelButton:"Cancel",feedbackSuccess:"Feedback successfully sent. Thank you!",feedbackFailure:"Failed to send feedback. Please try again later.",ratingSuccess:"Rating successfully sent. Thank you!",ratingFailure:"Failed to send rating. Please try again later.",mapFeedbackMainTitle:"Send feedback",mapRatingSectionTitle:"Rate this document",mapDichotomousRatingSectionTitle:"Did it solve your problem?",mapFeedbackSectionTitle:"Write your review",topicFeedbackMainTitle:"Send feedback",topicRatingSectionTitle:"Rate this content",topicDichotomousRatingSectionTitle:"Did this content solve your problem?",topicFeedbackSectionTitle:"Write your review"},gr=fr.build("inDesignerFeedbackComponent"),yr={ratingNotConfigured:"Rating unavailable: no rating configured for this content.",missingRatingRole:"Rating unavailable: missing role RATING_USER.",missingFeedbackRole:"Feedback unavailable: missing role FEEDBACK_USER.",inDesignerOnlyNotice:"This notice will not appear outside this designer.",feedbackAndRatingDisabledInEditor:"Feedback and ratings performed here are not taken into account."},br={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","","SIZE","14px"),labelSize:e.FtCssVariableFactory.create("--ft-text-field-label-size","","SIZE","11px"),verticalSpacing:e.FtCssVariableFactory.create("--ft-text-field-vertical-spacing","","SIZE","4px"),horizontalSpacing:e.FtCssVariableFactory.create("--ft-text-field-horizontal-spacing","","SIZE","16px"),helperColor:e.FtCssVariableFactory.extend("--ft-text-field-helper-color","",e.designSystemVariables.colorOnSurfaceMedium),colorPrimary:e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),colorOnSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system"),borderRadiusS:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design system"),colorError:e.FtCssVariableFactory.external(e.designSystemVariables.colorError,"Design system"),prefixColor:e.FtCssVariableFactory.extend("--ft-text-field-prefix-color","",e.designSystemVariables.colorOnSurfaceMedium),iconColor:e.FtCssVariableFactory.extend("--ft-text-field-icon-color","",e.designSystemVariables.colorOnSurfaceMedium),floatingZIndex:e.FtCssVariableFactory.create("--ft-text-field-floating-components-z-index","","NUMBER","3"),colorSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system"),colorOutline:e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),elevation02:e.FtCssVariableFactory.external(e.designSystemVariables.elevation02,"Design system"),suggestSize:e.FtCssVariableFactory.create("--ft-text-field-suggest-size","","SIZE","300px")},mr=o.css`
|
|
1333
1333
|
*:focus {
|
|
1334
1334
|
outline: none;
|
|
1335
1335
|
}
|
|
@@ -1342,16 +1342,16 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
1342
1342
|
}
|
|
1343
1343
|
|
|
1344
1344
|
ft-input-label {
|
|
1345
|
-
${e.setVariable(
|
|
1346
|
-
${e.setVariable(
|
|
1347
|
-
${e.setVariable(
|
|
1348
|
-
${e.setVariable(
|
|
1345
|
+
${e.setVariable(Ni.fontSize,br.fontSize)};
|
|
1346
|
+
${e.setVariable(Ni.raisedFontSize,br.labelSize)};
|
|
1347
|
+
${e.setVariable(Ni.verticalSpacing,br.verticalSpacing)};
|
|
1348
|
+
${e.setVariable(Ni.horizontalSpacing,br.horizontalSpacing)};
|
|
1349
1349
|
}
|
|
1350
1350
|
|
|
1351
1351
|
.ft-text-field--main-panel {
|
|
1352
1352
|
position: relative;
|
|
1353
1353
|
display: flex;
|
|
1354
|
-
height: calc(4 * ${
|
|
1354
|
+
height: calc(4 * ${br.verticalSpacing} + ${br.labelSize} + ${br.fontSize});
|
|
1355
1355
|
}
|
|
1356
1356
|
|
|
1357
1357
|
.ft-text-field--input-panel {
|
|
@@ -1360,10 +1360,10 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
1360
1360
|
display: flex;
|
|
1361
1361
|
align-items: center;
|
|
1362
1362
|
overflow: hidden;
|
|
1363
|
-
padding: 0 ${
|
|
1363
|
+
padding: 0 ${br.horizontalSpacing};
|
|
1364
1364
|
|
|
1365
|
-
${e.setVariable(M.fontSize,
|
|
1366
|
-
${e.setVariable(M.lineHeight,
|
|
1365
|
+
${e.setVariable(M.fontSize,br.fontSize)};
|
|
1366
|
+
${e.setVariable(M.lineHeight,br.fontSize)};
|
|
1367
1367
|
}
|
|
1368
1368
|
|
|
1369
1369
|
.ft-text-field--input-panel ft-ripple {
|
|
@@ -1373,11 +1373,11 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
1373
1373
|
|
|
1374
1374
|
.ft-text-field--filled.ft-text-field--with-label .ft-text-field--input-panel {
|
|
1375
1375
|
align-items: flex-end;
|
|
1376
|
-
padding: 0 ${
|
|
1376
|
+
padding: 0 ${br.horizontalSpacing} ${br.verticalSpacing} ${br.horizontalSpacing};
|
|
1377
1377
|
}
|
|
1378
1378
|
|
|
1379
1379
|
.ft-text-field--prefix {
|
|
1380
|
-
color: ${
|
|
1380
|
+
color: ${br.prefixColor};
|
|
1381
1381
|
margin-right: 2px;
|
|
1382
1382
|
flex-shrink: 1;
|
|
1383
1383
|
overflow: hidden;
|
|
@@ -1396,15 +1396,15 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
1396
1396
|
flex-shrink: 1;
|
|
1397
1397
|
min-width: 0; /* flex sets this to auto an prevents input from shrinking properly */
|
|
1398
1398
|
|
|
1399
|
-
color: ${
|
|
1400
|
-
padding: calc(2 * ${
|
|
1399
|
+
color: ${br.colorOnSurface};
|
|
1400
|
+
padding: calc(2 * ${br.verticalSpacing}) 0;
|
|
1401
1401
|
border: none;
|
|
1402
1402
|
background: none;
|
|
1403
1403
|
}
|
|
1404
1404
|
|
|
1405
1405
|
.ft-text-field--filled.ft-text-field--with-label .ft-text-field--input {
|
|
1406
1406
|
padding-bottom: 0;
|
|
1407
|
-
padding-top: calc(${
|
|
1407
|
+
padding-top: calc(${br.labelSize} + 2 * ${br.verticalSpacing});
|
|
1408
1408
|
}
|
|
1409
1409
|
|
|
1410
1410
|
.ft-text-field--input::-webkit-calendar-picker-indicator,
|
|
@@ -1413,37 +1413,37 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
1413
1413
|
}
|
|
1414
1414
|
|
|
1415
1415
|
.ft-text-field--disabled .ft-text-field--input {
|
|
1416
|
-
color: ${
|
|
1416
|
+
color: ${br.colorOnSurfaceDisabled};
|
|
1417
1417
|
}
|
|
1418
1418
|
|
|
1419
1419
|
.ft-text-field:not(.ft-text-field--disabled):focus-within ft-input-label {
|
|
1420
|
-
${e.setVariable(
|
|
1421
|
-
${e.setVariable(
|
|
1420
|
+
${e.setVariable(Ni.borderColor,br.colorPrimary)};
|
|
1421
|
+
${e.setVariable(Ni.textColor,br.colorPrimary)};
|
|
1422
1422
|
}
|
|
1423
1423
|
|
|
1424
1424
|
.ft-text-field--filled .ft-text-field--input-panel {
|
|
1425
|
-
border-radius: ${
|
|
1425
|
+
border-radius: ${br.borderRadiusS} ${br.borderRadiusS} 0 0;
|
|
1426
1426
|
}
|
|
1427
1427
|
|
|
1428
1428
|
.ft-text-field--outlined .ft-text-field--input-panel {
|
|
1429
|
-
border-radius: ${
|
|
1429
|
+
border-radius: ${br.borderRadiusS};
|
|
1430
1430
|
}
|
|
1431
1431
|
|
|
1432
1432
|
.ft-text-field--helper-text {
|
|
1433
|
-
padding: 0 12px 0 ${
|
|
1434
|
-
color: ${
|
|
1433
|
+
padding: 0 12px 0 ${br.horizontalSpacing};
|
|
1434
|
+
color: ${br.helperColor};
|
|
1435
1435
|
}
|
|
1436
1436
|
|
|
1437
1437
|
.ft-text-field--in-error .ft-text-field--input,
|
|
1438
1438
|
.ft-text-field--in-error .ft-text-field--helper-text,
|
|
1439
1439
|
.ft-text-field--in-error .ft-text-field--prefix {
|
|
1440
|
-
color: ${
|
|
1440
|
+
color: ${br.colorError};
|
|
1441
1441
|
}
|
|
1442
1442
|
|
|
1443
1443
|
.ft-text-field--icon {
|
|
1444
1444
|
align-self: center;
|
|
1445
1445
|
margin-left: 8px;
|
|
1446
|
-
color: ${
|
|
1446
|
+
color: ${br.iconColor};
|
|
1447
1447
|
}
|
|
1448
1448
|
|
|
1449
1449
|
.ft-text-field--container {
|
|
@@ -1456,13 +1456,13 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
1456
1456
|
position: absolute;
|
|
1457
1457
|
left: 0;
|
|
1458
1458
|
right: 0;
|
|
1459
|
-
z-index: ${
|
|
1460
|
-
background: ${
|
|
1461
|
-
border: 1px solid ${
|
|
1462
|
-
border-radius: 0 0 ${
|
|
1463
|
-
box-shadow: ${
|
|
1459
|
+
z-index: ${br.floatingZIndex};
|
|
1460
|
+
background: ${br.colorSurface};
|
|
1461
|
+
border: 1px solid ${br.colorOutline};
|
|
1462
|
+
border-radius: 0 0 ${br.borderRadiusS} ${br.borderRadiusS};
|
|
1463
|
+
box-shadow: ${br.elevation02};
|
|
1464
1464
|
outline: none;
|
|
1465
|
-
max-height: ${
|
|
1465
|
+
max-height: ${br.suggestSize};
|
|
1466
1466
|
overflow-y: auto;
|
|
1467
1467
|
}
|
|
1468
1468
|
|
|
@@ -1479,13 +1479,13 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
1479
1479
|
}
|
|
1480
1480
|
|
|
1481
1481
|
.ft-text-field--with-icon {
|
|
1482
|
-
${e.setVariable(
|
|
1482
|
+
${e.setVariable(Ni.labelMaxWidth,`calc(100% - ${Nt.size} - ${Ni.horizontalSpacing})`)};
|
|
1483
1483
|
}
|
|
1484
1484
|
|
|
1485
1485
|
.ft-text-field--with-password ft-icon:hover {
|
|
1486
1486
|
cursor: pointer;
|
|
1487
1487
|
}
|
|
1488
|
-
`;var
|
|
1488
|
+
`;var vr=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class xr extends(e.toFtFormComponent(e.FtLitElement,"textbox")){constructor(){super(...arguments),this._value="",this.dispatchedValue="",this.outlined=!1,this.disabled=!1,this.error=!1,this.prefix=null,this.passwordHiddenIcon=Me.EYE_SLASH,this.passwordRevealedIcon=Me.EYE,this.filterSuggestions=!1,this.password=!1,this.focused=!1,this.hidePassword=!0,this.suggestionsOnTop=!1,this.hideSuggestions=!1,this.visibleSuggestions=[]}get value(){return this._value||""}set value(t){this.setInternalValue(t||""),this.dispatchedValue=t||""}setInternalValue(t){const e=this._value;this._value=t||"",this.setFormValue(this._value),this.requestUpdate("value",e)}focus(){var t;null===(t=this.input)||void 0===t||t.focus()}render(){const t={"ft-text-field":!0,"ft-text-field--filled":!this.outlined,"ft-text-field--outlined":this.outlined,"ft-text-field--disabled":this.disabled,"ft-text-field--has-value":!!this.value,"ft-text-field--with-label":!!this.label,"ft-text-field--in-error":this.error,"ft-text-field--with-prefix":!!this.prefix,"ft-text-field--hide-suggestions":0===this.visibleSuggestions.length||this.hideSuggestions,"ft-text-field--raised-label":this.focused||""!=this.value,"ft-text-field--with-icon":!!this.icon,"ft-text-field--with-password":this.password};return o.html`
|
|
1489
1489
|
<div class="${n.classMap(t)}">
|
|
1490
1490
|
<div class="ft-text-field--main-panel"
|
|
1491
1491
|
@keydown=${this.handleKeyboardNavigation}
|
|
@@ -1536,7 +1536,7 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
1536
1536
|
.variant=${this.iconVariant}
|
|
1537
1537
|
.value=${this.icon}
|
|
1538
1538
|
@click=${()=>{var t;return null===(t=this.input)||void 0===t?void 0:t.focus()}}></ft-icon>
|
|
1539
|
-
`:o.nothing}update(t){super.update(t),(t.has("value")||t.has("filterSuggestions"))&&this.filterSuggestionsIfNeeded(),t.has("value")&&null!=t.get("value")&&(this.hideSuggestions=!1),t.has("dispatchedValue")&&null!=t.get("dispatchedValue")&&(this.hideSuggestions=!0)}filterSuggestionsIfNeeded(){this.filterSuggestions?(this.suggestions.forEach((t=>t.hidden=!t.getValue().toLowerCase().includes(this.value.toLowerCase()))),this.visibleSuggestions=this.suggestions.filter((t=>!t.hidden))):this.visibleSuggestions=this.suggestions}contentAvailableCallback(t){var e,o;if(super.contentAvailableCallback(t),t.has("focused")&&!this.hideSuggestions&&this.visibleSuggestions.length>0){const t=null===(e=this.input)||void 0===e?void 0:e.getBoundingClientRect(),i=null===(o=this.suggestionsContainer)||void 0===o?void 0:o.getBoundingClientRect();t&&i&&(this.suggestionsOnTop=t.bottom+i.height>window.innerHeight&&t.top-i.height>0)}}setValue(t,e=!1){this.value!==t&&(this.setInternalValue(t),this.dispatchEvent(new CustomEvent("live-change",{detail:t}))),e&&this.dispatchedValue!==t&&(this.dispatchedValue=t,this.dispatchEvent(new CustomEvent("change",{detail:t})))}handleInput(t){var e;const o=(null===(e=this.input)||void 0===e?void 0:e.value)||"";this.setValue(o,"Escape"==t.key||"Enter"==t.key)}handleClick(){this.hideSuggestions=!1}handleKeyboardNavigation(t){var e;if("ArrowDown"===t.key||"ArrowUp"===t.key){t.preventDefault(),t.stopPropagation(),this.hideSuggestions=!1;const o=this.visibleSuggestions.findIndex((t=>t.matches(":focus-within")));let i;i="ArrowDown"===t.key?o<this.visibleSuggestions.length-1?o+1:0:o>0?o-1:this.visibleSuggestions.length-1,null===(e=this.visibleSuggestions[i])||void 0===e||e.focus()}"Escape"!=t.key&&"Enter"!=t.key||(this.hideSuggestions=!0)}onSuggestionSelected(t){var e;this.setValue(t.detail,!0),null===(e=this.input)||void 0===e||e.focus(),setTimeout((()=>this.hideSuggestions=!0),0)}onFocus(){this.focused=!0,this.hideSuggestions=!1}onMainPanelBlur(){var t,e;(null===(t=this.mainPanel)||void 0===t?void 0:t.matches(":focus-within"))||(this.focused=!1,this.setValue((null===(e=this.input)||void 0===e?void 0:e.value)||"",!0))}togglePasswordVisibility(){this.hidePassword=!this.hidePassword}}
|
|
1539
|
+
`:o.nothing}update(t){super.update(t),(t.has("value")||t.has("filterSuggestions"))&&this.filterSuggestionsIfNeeded(),t.has("value")&&null!=t.get("value")&&(this.hideSuggestions=!1),t.has("dispatchedValue")&&null!=t.get("dispatchedValue")&&(this.hideSuggestions=!0)}filterSuggestionsIfNeeded(){this.filterSuggestions?(this.suggestions.forEach((t=>t.hidden=!t.getValue().toLowerCase().includes(this.value.toLowerCase()))),this.visibleSuggestions=this.suggestions.filter((t=>!t.hidden))):this.visibleSuggestions=this.suggestions}contentAvailableCallback(t){var e,o;if(super.contentAvailableCallback(t),t.has("focused")&&!this.hideSuggestions&&this.visibleSuggestions.length>0){const t=null===(e=this.input)||void 0===e?void 0:e.getBoundingClientRect(),i=null===(o=this.suggestionsContainer)||void 0===o?void 0:o.getBoundingClientRect();t&&i&&(this.suggestionsOnTop=t.bottom+i.height>window.innerHeight&&t.top-i.height>0)}}setValue(t,e=!1){this.value!==t&&(this.setInternalValue(t),this.dispatchEvent(new CustomEvent("live-change",{detail:t}))),e&&this.dispatchedValue!==t&&(this.dispatchedValue=t,this.dispatchEvent(new CustomEvent("change",{detail:t})))}handleInput(t){var e;const o=(null===(e=this.input)||void 0===e?void 0:e.value)||"";this.setValue(o,"Escape"==t.key||"Enter"==t.key)}handleClick(){this.hideSuggestions=!1}handleKeyboardNavigation(t){var e;if("ArrowDown"===t.key||"ArrowUp"===t.key){t.preventDefault(),t.stopPropagation(),this.hideSuggestions=!1;const o=this.visibleSuggestions.findIndex((t=>t.matches(":focus-within")));let i;i="ArrowDown"===t.key?o<this.visibleSuggestions.length-1?o+1:0:o>0?o-1:this.visibleSuggestions.length-1,null===(e=this.visibleSuggestions[i])||void 0===e||e.focus()}"Escape"!=t.key&&"Enter"!=t.key||(this.hideSuggestions=!0)}onSuggestionSelected(t){var e;this.setValue(t.detail,!0),null===(e=this.input)||void 0===e||e.focus(),setTimeout((()=>this.hideSuggestions=!0),0)}onFocus(){this.focused=!0,this.hideSuggestions=!1}onMainPanelBlur(){var t,e;(null===(t=this.mainPanel)||void 0===t?void 0:t.matches(":focus-within"))||(this.focused=!1,this.setValue((null===(e=this.input)||void 0===e?void 0:e.value)||"",!0))}togglePasswordVisibility(){this.hidePassword=!this.hidePassword}}xr.elementDefinitions={"ft-input-label":Ii,"ft-ripple":ci,"ft-typography":Ve,"ft-icon":qe},xr.styles=[gt,mr],vr([i.property()],xr.prototype,"label",void 0),vr([i.property({noAccessor:!0})],xr.prototype,"value",null),vr([i.state()],xr.prototype,"dispatchedValue",void 0),vr([i.property()],xr.prototype,"helper",void 0),vr([i.property({type:Boolean})],xr.prototype,"outlined",void 0),vr([i.property({type:Boolean})],xr.prototype,"disabled",void 0),vr([i.property({type:Boolean})],xr.prototype,"error",void 0),vr([i.property()],xr.prototype,"prefix",void 0),vr([i.property()],xr.prototype,"icon",void 0),vr([i.property()],xr.prototype,"passwordHiddenIcon",void 0),vr([i.property()],xr.prototype,"passwordRevealedIcon",void 0),vr([i.property()],xr.prototype,"iconVariant",void 0),vr([i.property({type:Boolean})],xr.prototype,"filterSuggestions",void 0),vr([i.property({type:Number})],xr.prototype,"maxLength",void 0),vr([i.property({type:Boolean})],xr.prototype,"password",void 0),vr([i.state()],xr.prototype,"focused",void 0),vr([i.state()],xr.prototype,"hidePassword",void 0),vr([i.state()],xr.prototype,"suggestionsOnTop",void 0),vr([i.state()],xr.prototype,"hideSuggestions",void 0),vr([i.state()],xr.prototype,"visibleSuggestions",void 0),vr([i.query(".ft-text-field--main-panel")],xr.prototype,"mainPanel",void 0),vr([i.query(".ft-text-field--input")],xr.prototype,"input",void 0),vr([i.query(".ft-text-field--suggestions")],xr.prototype,"suggestionsContainer",void 0),vr([i.queryAssignedElements({selector:"ft-text-field-suggestion"})],xr.prototype,"suggestions",void 0);const wr=o.css`
|
|
1540
1540
|
.ft-text-field-suggestion {
|
|
1541
1541
|
position: relative;
|
|
1542
1542
|
padding: 8px 16px;
|
|
@@ -1561,7 +1561,7 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
1561
1561
|
slot {
|
|
1562
1562
|
pointer-events: none;
|
|
1563
1563
|
}
|
|
1564
|
-
`;var
|
|
1564
|
+
`;var Or=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class $r extends CustomEvent{constructor(t){super("suggestion-selected",{detail:t,bubbles:!0,composed:!0})}}class Sr extends e.FtLitElement{render(){return o.html`
|
|
1565
1565
|
<div class="ft-text-field-suggestion"
|
|
1566
1566
|
tabindex="-1"
|
|
1567
1567
|
@keydown=${this.onKeyDown}
|
|
@@ -1573,15 +1573,15 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
1573
1573
|
<slot></slot>
|
|
1574
1574
|
</ft-typography>
|
|
1575
1575
|
</div>
|
|
1576
|
-
`}focus(t){var e;null===(e=this.container)||void 0===e||e.focus(t)}click(){var t;null===(t=this.container)||void 0===t||t.click()}confirmSuggestion(){this.dispatchEvent(new wr(this.getValue()))}getValue(){return this.value||this.textContent}get textContent(){return this.assignedNodes.map((t=>t.textContent)).join("").trim()}onKeyDown(t){["Enter"," "].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),this.confirmSuggestion())}}Or.elementDefinitions={"ft-ripple":si,"ft-typography":Ve,"ft-icon":qe},Or.styles=vr,xr([i.property()],Or.prototype,"value",void 0),xr([i.query(".ft-text-field-suggestion")],Or.prototype,"container",void 0),xr([i.queryAssignedNodes()],Or.prototype,"assignedNodes",void 0),e.customElement("ft-text-field")(mr),e.customElement("ft-text-field-suggestion")(Or);class $r{constructor(t){this.paginatedToc=t,this.nodeByTocId={},this.knownPrettyUrls=new Set,this.duplicatedPrettyUrls=new Set,this.pages=[],this.pageByTocId={}}build(){return{paginationConfiguration:this.paginatedToc.configuration,toc:this.convertNodes(this.paginatedToc.paginatedToc,1),pagesToc:this.extractPagesToc(this.paginatedToc.paginatedToc,1),nodeByTocId:this.nodeByTocId,duplicatedPrettyUrls:this.duplicatedPrettyUrls,pages:this.pages,pageByTocId:this.pageByTocId}}extractPagesToc(t,e,o){return t.flatMap((t=>(t.pageConfiguration&&this.registerPage(this.buildPage(t,o)),null==t.tocId?this.extractPagesToc(t.children,e,o):[{tocId:t.tocId,title:t.title,depth:e,children:this.extractPagesToc(t.children,e+1,t.tocId)}])))}convertNodes(t,e,o){return t.flatMap((t=>{var i,r,n;if(null==t.tocId)return[...this.convertSectionNodes(null!==(i=t.pageToc)&&void 0!==i?i:[],e,t.tocId),...this.convertNodes(t.children,e,t.tocId)];let a=null===(r=t.prettyUrl)||void 0===r?void 0:r.replace(/^\//,"");const s={tocId:t.tocId,contentId:t.contentId,title:t.title,hasRating:t.hasRating,origin:t.origin,prettyUrl:a,depth:e,parentTocId:o,children:[]};this.register(s);const l=this.convertSectionNodes(null!==(n=t.pageToc)&&void 0!==n?n:[],e+1,t.tocId),c=this.convertNodes(t.children,e+1,s.tocId);return s.children=[...l,...c],[s]}))}convertSectionNodes(t,e,o){return t.flatMap((t=>{var i;let r=null===(i=t.prettyUrl)||void 0===i?void 0:i.replace(/^\//,"");const n={...t,prettyUrl:r,depth:e,parentTocId:o,children:[]};return this.register(n),n.children=this.convertSectionNodes(t.children,e+1,t.tocId),[n]}))}buildPage(t,e){var o,i,r,n,a,s;const l={number:this.pages.length+1,title:null!==(o=t.title)&&void 0!==o?o:"",rootTocId:null!==(i=t.tocId)&&void 0!==i?i:"root",toc:(null!==(r=t.pageToc)&&void 0!==r?r:[]).map((t=>this.nodeByTocId[t.tocId])),topics:[],hiddenTopics:[],breadcrumb:e?this.buildBreadcrumb(this.nodeByTocId[e]):[]},c=(t,e)=>(e?l.topics:l.hiddenTopics).push(t),d=null!==(a=null===(n=t.pageConfiguration)||void 0===n?void 0:n.parentsVisibility)&&void 0!==a?a:[];return l.breadcrumb.forEach(((t,e)=>{c(t,d[e])})),t.tocId&&c(t.tocId,t.pageConfiguration.isVisible),l.topics.push(...this.tocIds(null!==(s=t.pageToc)&&void 0!==s?s:[])),l}registerPage(t){for(let e of[...t.topics,...t.hiddenTopics])this.pageByTocId[e]||(this.pageByTocId[e]=t);this.pages.push(t)}tocIds(t){return t.flatMap((t=>[t.tocId,...this.tocIds(t.children)]))}buildBreadcrumb(t){const e=[t.tocId];for(;null==t?void 0:t.parentTocId;)e.unshift(t.parentTocId),t=this.nodeByTocId[t.parentTocId];return e}register(t){t.prettyUrl&&(this.knownPrettyUrls.has(t.prettyUrl)&&this.duplicatedPrettyUrls.add(t.prettyUrl),this.knownPrettyUrls.add(t.prettyUrl)),this.nodeByTocId[t.tocId]=t}}class Sr{convertPaginatedToc(t){return new $r(t).build()}}class Nr{get mapId(){return this._mapId}set mapId(t){t!==this._mapId&&this.clear(),this._mapId=t}constructor(t,e,o,i){this.converter=t,this.api=e,this.cache=o,this._mapId=i,this.initCache()}async withMapId(t){return this._mapId?t(this._mapId):void 0}initCache(){this.cache.registerFinal("configuration",(()=>this.api.getReaderConfiguration())),this.cache.register("map",(()=>this.withMapId((t=>this.fetchMap(t))))),this.cache.register("enrichedToc",(()=>this.withMapId((t=>this.fetchPages(t).then((t=>this.converter.convertPaginatedToc(t))))))),this.cache.register("ratingSummary",(()=>{var t,e;return ee(null!==(e=null===(t=Ki.getState().session)||void 0===t?void 0:t.profile.roles)&&void 0!==e?e:[],"RATING_USER")?this.withMapId((t=>this.fetchMapRating(t))):Promise.resolve()}))}clear(){this.cache.clearAll()}getMap(){return this.cache.get("map")}getConfiguration(){return this.cache.get("configuration")}getEnrichedToc(){return this.cache.get("enrichedToc")}get enrichedToc(){return this.cache.getNow("enrichedToc")}async getPaginationConfiguration(){return(await this.getEnrichedToc()).paginationConfiguration}async getToc(){return(await this.getEnrichedToc()).toc}async getPagesToc(){return(await this.getEnrichedToc()).pagesToc}async getTocNode(t){return(await this.getEnrichedToc()).nodeByTocId[t]}getTocNodeNow(t){var e;return null===(e=this.enrichedToc)||void 0===e?void 0:e.nodeByTocId[t]}async getPage(t){const e=await this.getEnrichedToc();return e.pages[t-1]||e.pages[0]}async getPageByTocId(t){const e=await this.getEnrichedToc();return e.pageByTocId[t]||e.pages[0]}getTopicInfo(t){return this.cache.get("topic-"+t.tocId,(()=>this.fetchTopicMetadata(t)))}getTopicContent(t){return this.cache.get("topic-content-"+t.tocId,(()=>this.fetchTopicHTMLContent(t)))}getLink(t,e,o){const i=this.getNavigationData(t,e,o),r=this.getReaderLinkPrefix()+(i.prettyUrl?i.prettyUrl:`${i.mapId}/${i.tocId}`),n=new URL(r,this.api.tenantBaseUrl);return null!=i.page&&n.searchParams.set("page",`${i.page}`),i.prettyUrlDuplicated&&n.searchParams.set("tocId",i.tocId),null!=i.section&&n.searchParams.set("section",i.section),n.href}getNavigationData(t,e,o){var i,r;t=t||"root";const n=this.enrichedToc,a=null==n?void 0:n.pageByTocId[t],s=null==n?void 0:n.nodeByTocId[t],l=null==s?void 0:s.prettyUrl;return{mapId:this.mapId,tocId:t,topicTitle:null!==(i=null==s?void 0:s.title)&&void 0!==i?i:"",page:e&&a&&a.number!==e?e:void 0,prettyUrl:null!=l?l.replace(/^r\//,""):void 0,prettyUrlDuplicated:null!==(r=null==n?void 0:n.duplicatedPrettyUrls.has(null!=l?l:""))&&void 0!==r&&r,section:o}}async getAccurateNavigationData(t,e,o){return await this.getEnrichedToc(),this.getNavigationData(t,e,o)}getRatingSummary(){return this.cache.get("ratingSummary")}getMapRating(){return this.getRatingSummary().then((t=>null==t?void 0:t.publication))}getTopicRating(t){return this.getRatingSummary().then((e=>{var o;return e?{type:e.topics.type,rating:null===(o=e.topics)||void 0===o?void 0:o.ratings.find((e=>e.tocId===t))}:void 0}))}rateMap(t,e){return this.makeRateMapRequest(t,e).then((()=>this.clearRatingIfNecessary()))}unrateMap(){return this.makeUnrateMapRequest().then((()=>this.clearRatingIfNecessary()))}sendMapFeedback(t,e){return this.makeMapFeedbackRequest(t,e)}rateTopic(t,e,o){return this.makeRateTopicRequest(t,e,o).then((()=>this.clearRatingIfNecessary()))}unrateTopic(t){return this.makeUnrateTopicRequest(t).then((()=>this.clearRatingIfNecessary()))}async clearRatingIfNecessary(){const t=Ki.getState().session;(null==t?void 0:t.sessionAuthenticated)&&this.cache.clear("ratingSummary")}sendTopicFeedback(t,e,o){return this.makeTopicFeedbackRequest(t,e,o)}fontsStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.fonts)}themeStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.theme)}buildBreadcrumb(t){let e=this.getTocNodeNow(t),o=[{tocId:e.tocId,title:e.title}],i=this.getTocNodeNow(e.parentTocId);for(;i;)o.unshift({tocId:i.tocId,title:i.title}),i=this.getTocNodeNow(i.parentTocId);return o}isFeatureAccessible(t,{session:e,ratingType:o}){if(!this.isFeatureAvailable(t))return!1;switch(t){case s.FEEDBACK:return ee(null!=e?e:[],Qt.FEEDBACK_USER);case s.RATING:return ee(null!=e?e:[],Qt.RATING_USER)&&null!=o&&o!==Zt.NO_RATING;case s.PRINT:return ee(null!=e?e:[],Qt.PRINT_USER);case s.BOOKMARK:return!!(null==e?void 0:e.sessionAuthenticated);case s.COLLECTIONS:return ee(null!=e?e:[],Qt.COLLECTION_USER);case s.PERSONAL_BOOKS:return ee(null!=e?e:[],Qt.PERSONAL_BOOK_USER);default:return!1}}}class kr extends Nr{static async build(t){return new kr(new Sr,await Zi.await(),new e.CacheRegistry,t)}clear(){super.clear(),this.fingerprint=void 0}async fetchMap(t){const e=await this.api.getMap(t);return this.fingerprint=e.fingerprint,e}fetchMapRating(t){return this.api.getMapRating(t)}async fetchPages(t){return await this.getMap(),this.api.getPages(t,this.fingerprint)}fetchTopicHTMLContent(t){return this.api.getTopicHTMLContent(this.mapId,t.contentId,"DESIGNED_READER",this.fingerprint)}fetchTopicMetadata(t){return this.api.getTopic(this.mapId,t.contentId,this.fingerprint)}makeMapFeedbackRequest(t,e){return this.api.sendMapFeedback(this.mapId,t,e)}makeRateMapRequest(t,e){return this.api.rateMap(this.mapId,t,e)}makeRateTopicRequest(t,e,o){return this.api.rateTopic(this.mapId,t,e,o)}makeTopicFeedbackRequest(t,e,o){return this.api.sendTopicFeedback(this.mapId,t,e,o)}makeUnrateMapRequest(){return this.api.unrateMap(this.mapId)}makeUnrateTopicRequest(t){return this.api.unrateTopic(this.mapId,t)}getReaderLinkPrefix(){return"r/"}isFeatureAvailable(t){return!0}}class Cr{static build(t,o){return new Cr((t=>e.FtReduxStore.get({name:"ft-reader-"+t,initialState:{mapId:void 0,visibleTopics:[],map:void 0,toc:void 0,pagesToc:void 0,paginationConfiguration:void 0,currentPage:void 0,scrollTarget:void 0,configuration:void 0,searchInDocumentQuery:void 0}}))(t.trim()||"context"),null!=o?o:kr.build)}constructor(t,o){this.store=t,this.reloadDebouncer=new e.Debouncer(10),this.initService(o)}async initService(t){return this.service=await t(),this.service.mapId=this.store.getState().mapId,this.reload()}async setMapId(t){t!==this.store.getState().mapId&&(this.store.actions.mapId(t),this.service&&(this.service.mapId=t),await this.reload())}setVisibleTopics(t){this.store.actions.visibleTopics(t)}async awaitService(){for(;null==this.service;)await e.delay(5);return this.service}async navigateToTopic(t,e,o){const i=await this.awaitService(),r=await(null!=o?i.getPage(o):i.getPageByTocId(null!=t?t:"root"));this.store.actions.currentPage(r),this.store.actions.scrollTarget({tocId:this.resolveValidNonRootTocId(t,r),section:e})}resolveValidNonRootTocId(t,e){var o,i,r;let n=null!==(o="root"===t?void 0:t)&&void 0!==o?o:e.rootTocId;return e.topics.includes(n)?n:null!==(r=null!==(i=e.topics[0])&&void 0!==i?i:e.hiddenTopics[0])&&void 0!==r?r:"root"}async navigateToPage(t){const e=await this.awaitService();let o=await e.getPage(t);this.store.actions.currentPage(o)}scrollDone(){this.store.actions.scrollTarget({})}async reload(){var t,e;this.store.actions.configuration(void 0),this.store.actions.map(void 0),this.store.actions.toc(void 0),this.store.actions.pagesToc(void 0),this.store.actions.currentPage(void 0),this.store.actions.searchInDocumentQuery(""),null===(t=this.service)||void 0===t||t.clear(),(null===(e=this.service)||void 0===e?void 0:e.mapId)&&await this.reloadDebouncer.run((()=>this.fetchData()))}async fetchData(){var t,o,i,r,n;try{await Promise.all([null===(t=this.service)||void 0===t?void 0:t.getConfiguration().then((t=>this.store.actions.configuration(t))),null===(o=this.service)||void 0===o?void 0:o.getMap().then((t=>this.store.actions.map(t))),null===(i=this.service)||void 0===i?void 0:i.getToc().then((t=>this.store.actions.toc(t))),null===(r=this.service)||void 0===r?void 0:r.getPagesToc().then((t=>this.store.actions.pagesToc(t))),null===(n=this.service)||void 0===n?void 0:n.getPaginationConfiguration().then((t=>this.store.actions.paginationConfiguration(t)))])}catch(t){!this.errorHandler||t instanceof e.CanceledPromiseError||this.errorHandler(t)}}setSearchInDocumentQuery(t){this.store.actions.searchInDocumentQuery(t)}}const Ir=o.css`
|
|
1577
|
-
`;class
|
|
1576
|
+
`}focus(t){var e;null===(e=this.container)||void 0===e||e.focus(t)}click(){var t;null===(t=this.container)||void 0===t||t.click()}confirmSuggestion(){this.dispatchEvent(new $r(this.getValue()))}getValue(){return this.value||this.textContent}get textContent(){return this.assignedNodes.map((t=>t.textContent)).join("").trim()}onKeyDown(t){["Enter"," "].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),this.confirmSuggestion())}}Sr.elementDefinitions={"ft-ripple":ci,"ft-typography":Ve,"ft-icon":qe},Sr.styles=wr,Or([i.property()],Sr.prototype,"value",void 0),Or([i.query(".ft-text-field-suggestion")],Sr.prototype,"container",void 0),Or([i.queryAssignedNodes()],Sr.prototype,"assignedNodes",void 0),e.customElement("ft-text-field")(xr),e.customElement("ft-text-field-suggestion")(Sr);class Nr{constructor(t){this.paginatedToc=t,this.nodeByTocId={},this.knownPrettyUrls=new Set,this.duplicatedPrettyUrls=new Set,this.pages=[],this.pageByTocId={}}build(){return{paginationConfiguration:this.paginatedToc.configuration,toc:this.convertNodes(this.paginatedToc.paginatedToc,1),pagesToc:this.extractPagesToc(this.paginatedToc.paginatedToc,1),nodeByTocId:this.nodeByTocId,duplicatedPrettyUrls:this.duplicatedPrettyUrls,pages:this.pages,pageByTocId:this.pageByTocId}}extractPagesToc(t,e,o){return t.flatMap((t=>(t.pageConfiguration&&this.registerPage(this.buildPage(t,o)),null==t.tocId?this.extractPagesToc(t.children,e,o):[{tocId:t.tocId,title:t.title,depth:e,children:this.extractPagesToc(t.children,e+1,t.tocId)}])))}convertNodes(t,e,o){return t.flatMap((t=>{var i,r,n;if(null==t.tocId)return[...this.convertSectionNodes(null!==(i=t.pageToc)&&void 0!==i?i:[],e,t.tocId),...this.convertNodes(t.children,e,t.tocId)];let a=null===(r=t.prettyUrl)||void 0===r?void 0:r.replace(/^\//,"");const s={tocId:t.tocId,contentId:t.contentId,title:t.title,hasRating:t.hasRating,origin:t.origin,prettyUrl:a,depth:e,parentTocId:o,children:[]};this.register(s);const l=this.convertSectionNodes(null!==(n=t.pageToc)&&void 0!==n?n:[],e+1,t.tocId),c=this.convertNodes(t.children,e+1,s.tocId);return s.children=[...l,...c],[s]}))}convertSectionNodes(t,e,o){return t.flatMap((t=>{var i;let r=null===(i=t.prettyUrl)||void 0===i?void 0:i.replace(/^\//,"");const n={...t,prettyUrl:r,depth:e,parentTocId:o,children:[]};return this.register(n),n.children=this.convertSectionNodes(t.children,e+1,t.tocId),[n]}))}buildPage(t,e){var o,i,r,n,a,s;const l={number:this.pages.length+1,title:null!==(o=t.title)&&void 0!==o?o:"",rootTocId:null!==(i=t.tocId)&&void 0!==i?i:"root",toc:(null!==(r=t.pageToc)&&void 0!==r?r:[]).map((t=>this.nodeByTocId[t.tocId])),topics:[],hiddenTopics:[],breadcrumb:e?this.buildBreadcrumb(this.nodeByTocId[e]):[]},c=(t,e)=>(e?l.topics:l.hiddenTopics).push(t),d=null!==(a=null===(n=t.pageConfiguration)||void 0===n?void 0:n.parentsVisibility)&&void 0!==a?a:[];return l.breadcrumb.forEach(((t,e)=>{c(t,d[e])})),t.tocId&&c(t.tocId,t.pageConfiguration.isVisible),l.topics.push(...this.tocIds(null!==(s=t.pageToc)&&void 0!==s?s:[])),l}registerPage(t){for(let e of[...t.topics,...t.hiddenTopics])this.pageByTocId[e]||(this.pageByTocId[e]=t);this.pages.push(t)}tocIds(t){return t.flatMap((t=>[t.tocId,...this.tocIds(t.children)]))}buildBreadcrumb(t){const e=[t.tocId];for(;null==t?void 0:t.parentTocId;)e.unshift(t.parentTocId),t=this.nodeByTocId[t.parentTocId];return e}register(t){t.prettyUrl&&(this.knownPrettyUrls.has(t.prettyUrl)&&this.duplicatedPrettyUrls.add(t.prettyUrl),this.knownPrettyUrls.add(t.prettyUrl)),this.nodeByTocId[t.tocId]=t}}class kr{convertPaginatedToc(t){return new Nr(t).build()}}class Cr{get mapId(){return this._mapId}set mapId(t){t!==this._mapId&&this.clear(),this._mapId=t}constructor(t,e,o,i){this.converter=t,this.api=e,this.cache=o,this._mapId=i,this.initCache()}async withMapId(t){return this._mapId?t(this._mapId):void 0}initCache(){this.cache.registerFinal("configuration",(()=>this.api.getReaderConfiguration())),this.cache.register("map",(()=>this.withMapId((t=>this.fetchMap(t))))),this.cache.register("enrichedToc",(()=>this.withMapId((t=>this.fetchPages(t).then((t=>this.converter.convertPaginatedToc(t))))))),this.cache.register("ratingSummary",(()=>{var t,e;return ee(null!==(e=null===(t=Pi.getState().session)||void 0===t?void 0:t.profile.roles)&&void 0!==e?e:[],"RATING_USER")?this.withMapId((t=>this.fetchMapRating(t))):Promise.resolve()}))}clear(){this.cache.clearAll()}getMap(){return this.cache.get("map")}getConfiguration(){return this.cache.get("configuration")}getEnrichedToc(){return this.cache.get("enrichedToc")}get enrichedToc(){return this.cache.getNow("enrichedToc")}async getPaginationConfiguration(){return(await this.getEnrichedToc()).paginationConfiguration}async getToc(){return(await this.getEnrichedToc()).toc}async getPagesToc(){return(await this.getEnrichedToc()).pagesToc}async getTocNode(t){return(await this.getEnrichedToc()).nodeByTocId[t]}getTocNodeNow(t){var e;return null===(e=this.enrichedToc)||void 0===e?void 0:e.nodeByTocId[t]}async getPage(t){const e=await this.getEnrichedToc();return e.pages[t-1]||e.pages[0]}async getPageByTocId(t){const e=await this.getEnrichedToc();return e.pageByTocId[t]||e.pages[0]}getTopicInfo(t){return this.cache.get("topic-"+t.tocId,(()=>this.fetchTopicMetadata(t)))}getTopicContent(t){return this.cache.get("topic-content-"+t.tocId,(()=>this.fetchTopicHTMLContent(t)))}getLink(t,e,o){const i=this.getNavigationData(t,e,o),r=this.getReaderLinkPrefix()+(i.prettyUrl?i.prettyUrl:`${i.mapId}/${i.tocId}`),n=new URL(r,this.api.tenantBaseUrl);return null!=i.page&&n.searchParams.set("page",`${i.page}`),i.prettyUrlDuplicated&&n.searchParams.set("tocId",i.tocId),null!=i.section&&n.searchParams.set("section",i.section),n.href}getNavigationData(t,e,o){var i,r;t=t||"root";const n=this.enrichedToc,a=null==n?void 0:n.pageByTocId[t],s=null==n?void 0:n.nodeByTocId[t],l=null==s?void 0:s.prettyUrl;return{mapId:this.mapId,tocId:t,topicTitle:null!==(i=null==s?void 0:s.title)&&void 0!==i?i:"",page:e&&a&&a.number!==e?e:void 0,prettyUrl:null!=l?l.replace(/^r\//,""):void 0,prettyUrlDuplicated:null!==(r=null==n?void 0:n.duplicatedPrettyUrls.has(null!=l?l:""))&&void 0!==r&&r,section:o}}async getAccurateNavigationData(t,e,o){return await this.getEnrichedToc(),this.getNavigationData(t,e,o)}getRatingSummary(){return this.cache.get("ratingSummary")}getMapRating(){return this.getRatingSummary().then((t=>null==t?void 0:t.publication))}getTopicRating(t){return this.getRatingSummary().then((e=>{var o;return e?{type:e.topics.type,rating:null===(o=e.topics)||void 0===o?void 0:o.ratings.find((e=>e.tocId===t))}:void 0}))}rateMap(t,e){return this.makeRateMapRequest(t,e).then((()=>this.clearRatingIfNecessary()))}unrateMap(){return this.makeUnrateMapRequest().then((()=>this.clearRatingIfNecessary()))}sendMapFeedback(t,e){return this.makeMapFeedbackRequest(t,e)}rateTopic(t,e,o){return this.makeRateTopicRequest(t,e,o).then((()=>this.clearRatingIfNecessary()))}unrateTopic(t){return this.makeUnrateTopicRequest(t).then((()=>this.clearRatingIfNecessary()))}async clearRatingIfNecessary(){const t=Pi.getState().session;(null==t?void 0:t.sessionAuthenticated)&&this.cache.clear("ratingSummary")}sendTopicFeedback(t,e,o){return this.makeTopicFeedbackRequest(t,e,o)}fontsStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.fonts)}themeStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.theme)}buildBreadcrumb(t){let e=this.getTocNodeNow(t),o=[{tocId:e.tocId,title:e.title}],i=this.getTocNodeNow(e.parentTocId);for(;i;)o.unshift({tocId:i.tocId,title:i.title}),i=this.getTocNodeNow(i.parentTocId);return o}isFeatureAccessible(t,{session:e,ratingType:o}){if(!this.isFeatureAvailable(t))return!1;switch(t){case s.FEEDBACK:return ee(null!=e?e:[],Qt.FEEDBACK_USER);case s.RATING:return ee(null!=e?e:[],Qt.RATING_USER)&&null!=o&&o!==Zt.NO_RATING;case s.PRINT:return ee(null!=e?e:[],Qt.PRINT_USER);case s.BOOKMARK:return!!(null==e?void 0:e.sessionAuthenticated);case s.COLLECTIONS:return ee(null!=e?e:[],Qt.COLLECTION_USER);case s.PERSONAL_BOOKS:return ee(null!=e?e:[],Qt.PERSONAL_BOOK_USER);default:return!1}}}class Ir extends Cr{static async build(t){return new Ir(new kr,await Mi.await(),new e.CacheRegistry,t)}clear(){super.clear(),this.fingerprint=void 0}async fetchMap(t){const e=await this.api.getMap(t);return this.fingerprint=e.fingerprint,e}fetchMapRating(t){return this.api.getMapRating(t)}async fetchPages(t){return await this.getMap(),this.api.getPages(t,this.fingerprint)}fetchTopicHTMLContent(t){return this.api.getTopicHTMLContent(this.mapId,t.contentId,"DESIGNED_READER",this.fingerprint)}fetchTopicMetadata(t){return this.api.getTopic(this.mapId,t.contentId,this.fingerprint)}makeMapFeedbackRequest(t,e){return this.api.sendMapFeedback(this.mapId,t,e)}makeRateMapRequest(t,e){return this.api.rateMap(this.mapId,t,e)}makeRateTopicRequest(t,e,o){return this.api.rateTopic(this.mapId,t,e,o)}makeTopicFeedbackRequest(t,e,o){return this.api.sendTopicFeedback(this.mapId,t,e,o)}makeUnrateMapRequest(){return this.api.unrateMap(this.mapId)}makeUnrateTopicRequest(t){return this.api.unrateTopic(this.mapId,t)}getReaderLinkPrefix(){return"r/"}isFeatureAvailable(t){return!0}}class Rr{static build(t,o){return new Rr((t=>e.FtReduxStore.get({name:"ft-reader-"+t,initialState:{mapId:void 0,visibleTopics:[],map:void 0,toc:void 0,pagesToc:void 0,paginationConfiguration:void 0,currentPage:void 0,scrollTarget:void 0,configuration:void 0,searchInDocumentQuery:void 0}}))(t.trim()||"context"),null!=o?o:Ir.build)}constructor(t,o){this.store=t,this.reloadDebouncer=new e.Debouncer(10),this.initService(o)}async initService(t){return this.service=await t(),this.service.mapId=this.store.getState().mapId,this.reload()}async setMapId(t){t!==this.store.getState().mapId&&(this.store.actions.mapId(t),this.service&&(this.service.mapId=t),await this.reload())}setVisibleTopics(t){this.store.actions.visibleTopics(t)}async awaitService(){for(;null==this.service;)await e.delay(5);return this.service}async navigateToTopic(t,e,o){const i=await this.awaitService(),r=await(null!=o?i.getPage(o):i.getPageByTocId(null!=t?t:"root"));this.store.actions.currentPage(r),this.store.actions.scrollTarget({tocId:this.resolveValidNonRootTocId(t,r),section:e})}resolveValidNonRootTocId(t,e){var o,i,r;let n=null!==(o="root"===t?void 0:t)&&void 0!==o?o:e.rootTocId;return e.topics.includes(n)?n:null!==(r=null!==(i=e.topics[0])&&void 0!==i?i:e.hiddenTopics[0])&&void 0!==r?r:"root"}async navigateToPage(t){const e=await this.awaitService();let o=await e.getPage(t);this.store.actions.currentPage(o)}scrollDone(){this.store.actions.scrollTarget({})}async reload(){var t,e;this.store.actions.configuration(void 0),this.store.actions.map(void 0),this.store.actions.toc(void 0),this.store.actions.pagesToc(void 0),this.store.actions.currentPage(void 0),this.store.actions.searchInDocumentQuery(""),null===(t=this.service)||void 0===t||t.clear(),(null===(e=this.service)||void 0===e?void 0:e.mapId)&&await this.reloadDebouncer.run((()=>this.fetchData()))}async fetchData(){var t,o,i,r,n;try{await Promise.all([null===(t=this.service)||void 0===t?void 0:t.getConfiguration().then((t=>this.store.actions.configuration(t))),null===(o=this.service)||void 0===o?void 0:o.getMap().then((t=>this.store.actions.map(t))),null===(i=this.service)||void 0===i?void 0:i.getToc().then((t=>this.store.actions.toc(t))),null===(r=this.service)||void 0===r?void 0:r.getPagesToc().then((t=>this.store.actions.pagesToc(t))),null===(n=this.service)||void 0===n?void 0:n.getPaginationConfiguration().then((t=>this.store.actions.paginationConfiguration(t)))])}catch(t){!this.errorHandler||t instanceof e.CanceledPromiseError||this.errorHandler(t)}}setSearchInDocumentQuery(t){this.store.actions.searchInDocumentQuery(t)}}const Er=o.css`
|
|
1577
|
+
`;class Ur extends CustomEvent{constructor(t,e){super("ft-reader-map-loaded",{detail:{map:t,toc:e}})}}class Lr extends CustomEvent{constructor(t,e){super("ft-reader-visible-topics-change",{detail:{visibleTopics:e}})}}class Tr extends CustomEvent{constructor(t){super("ft-reader-navigation-done",{detail:t})}}class _r extends CustomEvent{constructor(t){super("ft-reader-load-error",{detail:t})}}class Wr extends Event{constructor(){super("ft-reader-map-not-found")}}class Dr extends Event{constructor(){super("ft-reader-map-unauthorized")}}var Ar=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class zr extends e.FtLitElementRedux{constructor(){super(),this.visibleTopics=[],this.scrollToTargetDebouncer=new e.Debouncer(5),this.navigationDebouncer=new e.Debouncer(10),this.addStore(Pi)}render(){return o.html`
|
|
1578
1578
|
${this.importStyleIfNeeded()}
|
|
1579
1579
|
<slot @register-ft-reader-component=${this.registerComponent}></slot>
|
|
1580
1580
|
`}importStyleIfNeeded(){var t,e;const i=null===(t=this.stateManager.service)||void 0===t?void 0:t.themeStylesheet();return!i||window.location.href.startsWith(null!==(e=this.baseUrl)&&void 0!==e?e:"")?o.nothing:o.html`
|
|
1581
1581
|
<style>
|
|
1582
1582
|
@import "${i}"
|
|
1583
1583
|
</style>
|
|
1584
|
-
`}get stateManager(){return null==this._stateManager&&(this._stateManager=
|
|
1584
|
+
`}get stateManager(){return null==this._stateManager&&(this._stateManager=Rr.build(this.id||(""+Math.round(999e3*Math.random())).padStart(6,"0"),this.readerServiceProvider),this._stateManager.errorHandler=t=>this.handleLoadError(t),this.addStore(this.stateManager.store,"reader")),this._stateManager}connectedCallback(){super.connectedCallback(),this.stateManager.setMapId(this.mapId),this.stateManager.awaitService().then((t=>{const e=t.fontsStylesheet();if(e&&!window.location.href.startsWith(this.baseUrl)&&!document.querySelector(`head link[href="${e}"]`)){const t=document.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href",e),document.head.append(t)}}))}update(t){super.update(t),t.has("readerServiceProvider")&&this.readerServiceProvider&&this.stateManager.initService(this.readerServiceProvider),t.has("mapId")&&this.mapId&&this.stateManager.setMapId(this.mapId),t.has("searchInDocumentQuery")&&null!=this.searchInDocumentQuery&&this.stateManager.setSearchInDocumentQuery(this.searchInDocumentQuery),["tocId","section","page","mapId"].some((e=>t.has(e)))&&this.mapId&&this.navigateToTarget()}contentAvailableCallback(t){var e;if(super.contentAvailableCallback(t),(t.has("map")||t.has("toc"))&&this.map&&this.toc&&this.dispatchEvent(new Ur(this.map,this.toc)),t.has("scrollTarget")&&null==(null===(e=this.scrollTarget)||void 0===e?void 0:e.tocId)){const e=t.get("scrollTarget");null!=(null==e?void 0:e.tocId)&&this.scrollToTargetDebouncer.run((()=>{var t;return this.stateManager.service.getAccurateNavigationData(e.tocId,null===(t=this.currentPage)||void 0===t?void 0:t.number,e.section).then((t=>this.dispatchEvent(new Tr(t))))}))}t.has("visibleTopics")&&Promise.all(this.visibleTopics.map((t=>{var e;return this.stateManager.service.getAccurateNavigationData(t,null===(e=this.currentPage)||void 0===e?void 0:e.number)}))).then((t=>{let e=t.filter((t=>null!=t&&""!==t.topicTitle)).map((t=>{var e;return{tocId:t.tocId,title:t.topicTitle,page:t.page,prettyUrl:t.prettyUrl,prettyUrlDuplicated:t.prettyUrlDuplicated,breadcrumb:null===(e=this.stateManager.service)||void 0===e?void 0:e.buildBreadcrumb(t.tocId)}}));this.dispatchEvent(new Lr(this.map,e))}))}async reload(){await this.stateManager.reload(),this.navigateToTarget()}navigateToTarget(){this.navigationDebouncer.run((()=>{null!=this.tocId?this.stateManager.navigateToTopic(this.tocId,this.section,this.page):null!=this.page&&this.stateManager.navigateToPage(this.page)}))}registerComponent(t){t.stopPropagation();const e=t.composedPath()[0];this.register(e)}register(t){t.setReaderStateManager(this.stateManager)}handleLoadError(t){const e=t;404===e.status?this.dispatchEvent(new Wr):401===e.status?this.dispatchEvent(new Dr):this.dispatchEvent(new _r(t))}reloadBookmarks(){or.reloadBookmarks()}}var Br;zr.styles=Er,Ar([e.redux({store:Pi.name})],zr.prototype,"baseUrl",void 0),Ar([i.property()],zr.prototype,"mapId",void 0),Ar([i.property()],zr.prototype,"tocId",void 0),Ar([i.property()],zr.prototype,"section",void 0),Ar([i.property()],zr.prototype,"searchInDocumentQuery",void 0),Ar([i.property({type:Number,converter:{fromAttribute:t=>+(null!=t?t:"NaN")>0?+t:Br}})],zr.prototype,"page",void 0),Ar([e.redux({store:"reader"})],zr.prototype,"map",void 0),Ar([e.redux({store:"reader"})],zr.prototype,"toc",void 0),Ar([e.redux({store:"reader"})],zr.prototype,"visibleTopics",void 0),Ar([e.redux({store:"reader"})],zr.prototype,"currentPage",void 0),Ar([e.redux({store:"reader"})],zr.prototype,"scrollTarget",void 0),Ar([i.property({attribute:!1})],zr.prototype,"readerServiceProvider",void 0),e.customElement("ft-reader-context")(zr);var Fr=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Kr extends(ar(f)){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.ratingAllowed=!1,this.from="",this.feedbackMessage="",this.emptyStarIcon="STAR",this.filledStarIcon="STAR_PLAIN",this.emptyLikeIcon="THUMBS_UP",this.filledLikeIcon="THUMBS_UP_PLAIN",this.emptyDislikeIcon="THUMBS_DOWN",this.filledDislikeIcon="THUMBS_DOWN_PLAIN",this.addI18nContext(pr,ur),this.addI18nContext(gr,yr)}get canAccessFeedback(){var t;return null===(t=this.service)||void 0===t?void 0:t.isFeatureAccessible(s.FEEDBACK,{session:this.session})}get canAccessRating(){var t,e;return null===(t=this.service)||void 0===t?void 0:t.isFeatureAccessible(s.RATING,{session:this.session,ratingType:null===(e=this.ratingSummary)||void 0===e?void 0:e.type})}get userHasRatingRole(){return this.session&&ee(this.session,"RATING_USER")}get configuredRatingType(){var t,e;return null!==(e=this.ratingAllowed?null===(t=this.ratingSummary)||void 0===t?void 0:t.type:"NO_RATING")&&void 0!==e?e:"NO_RATING"}get ratingType(){var t,e,o;return null!==(o=null===(e=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===e?void 0:e.type)&&void 0!==o?o:"NO_RATING"}get ratingValue(){var t,e,o;return null!==(o=null===(e=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===e?void 0:e.value)&&void 0!==o?o:-1}get ratingDate(){var t,o;const i=null===(o=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===o?void 0:o.date;return"string"==typeof i?e.parseDate(i):i}render(){return this.editorMode||this.canAccessFeedback||this.canAccessRating?o.html`
|
|
1585
1585
|
<div class="ft-reader-feedback">
|
|
1586
1586
|
${this.hideTitle?o.nothing:o.html`
|
|
1587
1587
|
<ft-typography variant="title" part="main-title">
|
|
@@ -1601,11 +1601,11 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
1601
1601
|
${this.renderRatingDate()}
|
|
1602
1602
|
</ft-typography>
|
|
1603
1603
|
</div>
|
|
1604
|
-
`:this.placeholderInEditor(this.userHasRatingRole?
|
|
1604
|
+
`:this.placeholderInEditor(this.userHasRatingRole?gr.messages.ratingNotConfigured():gr.messages.missingRatingRole())}renderRatingDate(){const t=this.ratingDate;if(null==t)return pr.messages.notRated();if(t.getTime()>(new Date).getTime()-6e4)return pr.messages.ratedNow();return(new Date).toLocaleDateString()===t.toLocaleDateString()?pr.messages.ratedToday():pr.messages.ratedOn(t)}renderRating(){switch(this.configuredRatingType){case"STARS":return o.html`
|
|
1605
1605
|
<div class="ft-reader-feedback--stars" part="rating rating-stars">
|
|
1606
1606
|
${a.repeat(new Array(5),((t,e)=>e),((t,e)=>{let i="STARS"===this.ratingType&&this.ratingValue>e;const r=e+1;return o.html`
|
|
1607
1607
|
<ft-button round part="rating-stars-${r}"
|
|
1608
|
-
label="${
|
|
1608
|
+
label="${pr.messages.starsRating(r)}"
|
|
1609
1609
|
tooltipPosition="top"
|
|
1610
1610
|
.iconVariant=${this.iconVariant}
|
|
1611
1611
|
icon="${i?this.filledStarIcon:this.emptyStarIcon}"
|
|
@@ -1622,13 +1622,13 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
1622
1622
|
?selected=${e}
|
|
1623
1623
|
.iconVariant=${this.iconVariant}
|
|
1624
1624
|
icon="${e?this.filledLikeIcon:this.emptyLikeIcon}">
|
|
1625
|
-
${
|
|
1625
|
+
${pr.messages.like()}
|
|
1626
1626
|
</ft-switch-option>
|
|
1627
1627
|
<ft-switch-option .value=${0}
|
|
1628
1628
|
?selected=${t}
|
|
1629
1629
|
.iconVariant=${this.iconVariant}
|
|
1630
1630
|
icon="${t?this.filledDislikeIcon:this.emptyDislikeIcon}">
|
|
1631
|
-
${
|
|
1631
|
+
${pr.messages.dislike()}
|
|
1632
1632
|
</ft-switch-option>
|
|
1633
1633
|
</ft-switch>
|
|
1634
1634
|
`;case"DICHOTOMOUS":const i="DICHOTOMOUS"===this.ratingType&&0===this.ratingValue,r="DICHOTOMOUS"===this.ratingType&&1===this.ratingValue;return o.html`
|
|
@@ -1637,11 +1637,11 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
1637
1637
|
part="rating rating-dichotomous">
|
|
1638
1638
|
<ft-switch-option .value=${1}
|
|
1639
1639
|
?selected=${r}>
|
|
1640
|
-
${
|
|
1640
|
+
${pr.messages.dichotomousYes()}
|
|
1641
1641
|
</ft-switch-option>
|
|
1642
1642
|
<ft-switch-option .value=${0}
|
|
1643
1643
|
?selected=${i}>
|
|
1644
|
-
${
|
|
1644
|
+
${pr.messages.dichotomousNo()}
|
|
1645
1645
|
</ft-switch-option>
|
|
1646
1646
|
</ft-switch>
|
|
1647
1647
|
`}return o.nothing}rate(t){(null!=t?t:-1)!==this.ratingValue&&this.dispatchEvent(new CustomEvent("rate",{detail:t}))}renderFeedbackSection(){var t,e,i;if(this.canAccessFeedback){const r=this.feedbackMailLinkBuilder(this.feedbackMessage);let n=o.html`
|
|
@@ -1650,7 +1650,7 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
1650
1650
|
class="ft-reader-feedback--send-feedback"
|
|
1651
1651
|
?disabled=${!this.feedbackMessage||!this.validFromEmail()}
|
|
1652
1652
|
part="send-feedback">
|
|
1653
|
-
${
|
|
1653
|
+
${pr.messages.okButton()}
|
|
1654
1654
|
</ft-button>
|
|
1655
1655
|
`;return r&&(n=o.html`
|
|
1656
1656
|
<a class="ft-reader-feedback--feedback-link" href="${r}">
|
|
@@ -1665,28 +1665,28 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
1665
1665
|
${null==(null===(e=null===(t=this.session)||void 0===t?void 0:t.profile)||void 0===e?void 0:e.userId)&&(null===(i=this.configuration)||void 0===i?void 0:i.mailsSentByFluidTopicsForUnauthenticatedUsers)?o.html`
|
|
1666
1666
|
<ft-text-field outlined name="email" type="email" autocomplete="email"
|
|
1667
1667
|
class="ft-reader-feedback--from-input"
|
|
1668
|
-
label=${
|
|
1668
|
+
label=${pr.messages.feedbackfromEmail()}
|
|
1669
1669
|
@change=${t=>this.from=t.detail.trim()}
|
|
1670
1670
|
?error=${this.from&&!this.validFromEmail()}
|
|
1671
|
-
helper=${this.from&&!this.validFromEmail()?
|
|
1671
|
+
helper=${this.from&&!this.validFromEmail()?pr.messages.feedbackfromEmailInvalid():""}
|
|
1672
1672
|
/>
|
|
1673
1673
|
`:o.nothing}
|
|
1674
1674
|
<ft-text-area outlined
|
|
1675
1675
|
class="ft-reader-feedback--feedback-input" part="feedback-input"
|
|
1676
|
-
label="${
|
|
1676
|
+
label="${pr.messages.feedbackInputLabel()}"
|
|
1677
1677
|
@live-change=${t=>this.feedbackMessage=t.detail.trim()}
|
|
1678
1678
|
></ft-text-area>
|
|
1679
1679
|
${n}
|
|
1680
1680
|
</form>
|
|
1681
|
-
`}return this.placeholderInEditor(
|
|
1681
|
+
`}return this.placeholderInEditor(gr.messages.missingFeedbackRole())}onFormSubmitEvent(t,e){t.preventDefault(),e?this.onMailerFeedbackSent():this.sendFeedback()}validFromEmail(){var t,e,o;return!(null==(null===(e=null===(t=this.session)||void 0===t?void 0:t.profile)||void 0===e?void 0:e.userId)&&(null===(o=this.configuration)||void 0===o?void 0:o.mailsSentByFluidTopicsForUnauthenticatedUsers))||/^[a-zA-Z0-9_+&*-]+(?:\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/.test(this.from)}sendFeedback(){var t;this.dispatchEvent(new CustomEvent("send-feedback",{detail:{message:this.feedbackInput.value,...(null===(t=this.configuration)||void 0===t?void 0:t.mailsSentByFluidTopicsForUnauthenticatedUsers)&&{from:this.from}}}))}placeholderInEditor(t){return this.editorMode?o.html`
|
|
1682
1682
|
<div class="ft-reader-feedback--placeholder">
|
|
1683
1683
|
<ft-typography variant="caption">${t}</ft-typography>
|
|
1684
1684
|
<ft-tooltip position="left"
|
|
1685
|
-
text="${
|
|
1685
|
+
text="${gr.messages.inDesignerOnlyNotice()}">
|
|
1686
1686
|
<ft-icon>INFO</ft-icon>
|
|
1687
1687
|
</ft-tooltip>
|
|
1688
1688
|
</div>
|
|
1689
|
-
`:o.nothing}onMailerFeedbackSent(){this.dispatchEvent(new CustomEvent("mailer-feedback"))}clearFeedbackInput(){setTimeout((()=>this.feedbackInput.value=""),0)}}
|
|
1689
|
+
`:o.nothing}onMailerFeedbackSent(){this.dispatchEvent(new CustomEvent("mailer-feedback"))}clearFeedbackInput(){setTimeout((()=>this.feedbackInput.value=""),0)}}Kr.elementDefinitions={"ft-button":Ai,"ft-typography":Ve,"ft-icon":qe,"ft-tooltip":si,"ft-switch":mi,"ft-switch-option":gi,"ft-text-area":Li,"ft-text-field":xr},Kr.styles=zt,Fr([i.property({type:Boolean})],Kr.prototype,"editorMode",void 0),Fr([i.property({type:Boolean})],Kr.prototype,"hideTitle",void 0),Fr([i.property({type:Boolean})],Kr.prototype,"ratingAllowed",void 0),Fr([i.property({attribute:!1})],Kr.prototype,"i18nProperties",void 0),Fr([i.property({attribute:!1})],Kr.prototype,"ratingSummary",void 0),Fr([i.property({attribute:!1})],Kr.prototype,"session",void 0),Fr([i.query(".ft-reader-feedback--feedback-input")],Kr.prototype,"feedbackInput",void 0),Fr([i.state()],Kr.prototype,"from",void 0),Fr([i.state()],Kr.prototype,"feedbackMessage",void 0),Fr([i.property()],Kr.prototype,"iconVariant",void 0),Fr([i.property()],Kr.prototype,"emptyStarIcon",void 0),Fr([i.property()],Kr.prototype,"filledStarIcon",void 0),Fr([i.property()],Kr.prototype,"emptyLikeIcon",void 0),Fr([i.property()],Kr.prototype,"filledLikeIcon",void 0),Fr([i.property()],Kr.prototype,"emptyDislikeIcon",void 0),Fr([i.property()],Kr.prototype,"filledDislikeIcon",void 0),Fr([e.redux({store:"reader",selector:t=>{var e;return null===(e=t.configuration)||void 0===e?void 0:e.feedback}})],Kr.prototype,"configuration",void 0),Fr([i.property()],Kr.prototype,"feedbackMailLinkBuilder",void 0);const Zr=fr.fromGwt("server");class Pr{constructor(){this.subject="",this.url="",this.subjectMetadata="",this.bodyMetadata="",this.isAuthenticated=!1}update(t,e,o,i,r){var n;this.subject=t,this.url=e,this.configuration=i,this.isAuthenticated=r,this.subjectMetadata=this.filterMetadata(o,i.subjectMetadataIds).map((t=>"["+t.values[t.values.length-1]+"]")).join(""),this.bodyMetadata=this.filterMetadata(o,null!==(n=i.bodyMetadataIds)&&void 0!==n?n:[]).map((t=>"["+t.values.join(", ")+"]")).join(" ")}filterMetadata(t,e){return e.map((e=>t.find((t=>t.key===e)))).filter((t=>null!=t&&t.values.length>0))}build(t){var e,o,i;if(0===t.length||this.isAuthenticated&&(null==this.configuration||(null===(e=this.configuration)||void 0===e?void 0:e.mailsSentByFluidTopics))||(null===(o=this.configuration)||void 0===o?void 0:o.mailsSentByFluidTopicsForUnauthenticatedUsers))return;const r=encodeURIComponent(this.subject+" "+this.subjectMetadata),n=encodeURIComponent(`\n${this.bodyMetadata}\n${this.url}\n_________________________________________________________________\n\n${t}\n\n_________________________________________________________________\n${Zr.messages["mail.feedback.disclaimer"]()}`);return`mailto:${null===(i=this.configuration)||void 0===i?void 0:i.recipients.join(",")}?subject=${r}&body=${n}`}}var Mr=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Hr extends(ar(f)){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.iconVariant=je.fluid_topics,this.emptyStarIcon="STAR",this.filledStarIcon="STAR_PLAIN",this.emptyLikeIcon="THUMBS_UP",this.filledLikeIcon="THUMBS_UP_PLAIN",this.emptyDislikeIcon="THUMBS_DOWN",this.filledDislikeIcon="THUMBS_DOWN_PLAIN",this.feedbackLinkBuilder=new Pr,this.i18nProperties={feedbackMainTitle:pr.properties.mapFeedbackMainTitle(),ratingSectionTitle:pr.properties.mapRatingSectionTitle(),dichotomousRatingSectionTitle:pr.properties.mapDichotomousRatingSectionTitle(),feedbackSectionTitle:pr.properties.mapFeedbackSectionTitle()},this.updateDebouncer=new e.Debouncer(100),this.sendRatingDebouncer=new e.Debouncer(500),this.addStore(Pi)}render(){return this.map&&(this.editorMode||this.componentVisible)?o.html`
|
|
1690
1690
|
<ft-reader-feedback
|
|
1691
1691
|
ratingAllowed
|
|
1692
1692
|
.i18nProperties=${this.i18nProperties}
|
|
@@ -1712,7 +1712,7 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
1712
1712
|
display: none !important;
|
|
1713
1713
|
}
|
|
1714
1714
|
</style>
|
|
1715
|
-
`}get componentVisible(){var t,e,o;return(null===(t=this.service)||void 0===t?void 0:t.isFeatureAccessible(s.FEEDBACK,{session:this.session}))||(null===(e=this.service)||void 0===e?void 0:e.isFeatureAccessible(s.RATING,{session:this.session,ratingType:null===(o=this.ratingSummary)||void 0===o?void 0:o.type}))}update(t){var e,o,i,r;super.update(t),t.has("map")&&this.map&&this.updateData(),["map","configuration","user","mailSubject"].some((e=>t.has(e)))&&this.map&&this.configuration&&this.feedbackLinkBuilder.update(this.mailSubject,null!==(o=null===(e=this.service)||void 0===e?void 0:e.getLink())&&void 0!==o?o:"",this.map.metadata,this.configuration,null!=(null===(r=null===(i=this.session)||void 0===i?void 0:i.profile)||void 0===r?void 0:r.userId))}connectedCallback(){super.connectedCallback(),this.updateData()}onStoreAvailable(t){super.onStoreAvailable(t),this.updateData()}updateData(){this.updateDebouncer.run((async()=>{var t,e,o;this.map&&((null===(e=null===(t=this.session)||void 0===t?void 0:t.profile)||void 0===e?void 0:e.userId)||null==this.ratingSummary)&&(this.ratingSummary=await(null===(o=this.service)||void 0===o?void 0:o.getMapRating()))}))}rate(t){this.ratingSummary&&(this.ratingSummary={...this.ratingSummary,rating:null==t.detail?void 0:{type:this.ratingSummary.type,value:t.detail,date:new Date}},this.sendRatingDebouncer.run((()=>this.sendRating(t.detail))))}async sendRating(t){var o,i,r;if(!this.editorMode&&this.ratingSummary){try{null==t?await(null===(o=this.service)||void 0===o?void 0:o.unrateMap()):await(null===(i=this.service)||void 0===i?void 0:i.rateMap(null===(r=this.ratingSummary)||void 0===r?void 0:r.type,t))}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:
|
|
1715
|
+
`}get componentVisible(){var t,e,o;return(null===(t=this.service)||void 0===t?void 0:t.isFeatureAccessible(s.FEEDBACK,{session:this.session}))||(null===(e=this.service)||void 0===e?void 0:e.isFeatureAccessible(s.RATING,{session:this.session,ratingType:null===(o=this.ratingSummary)||void 0===o?void 0:o.type}))}update(t){var e,o,i,r;super.update(t),t.has("map")&&this.map&&this.updateData(),["map","configuration","user","mailSubject"].some((e=>t.has(e)))&&this.map&&this.configuration&&this.feedbackLinkBuilder.update(this.mailSubject,null!==(o=null===(e=this.service)||void 0===e?void 0:e.getLink())&&void 0!==o?o:"",this.map.metadata,this.configuration,null!=(null===(r=null===(i=this.session)||void 0===i?void 0:i.profile)||void 0===r?void 0:r.userId))}connectedCallback(){super.connectedCallback(),this.updateData()}onStoreAvailable(t){super.onStoreAvailable(t),this.updateData()}updateData(){this.updateDebouncer.run((async()=>{var t,e,o;this.map&&((null===(e=null===(t=this.session)||void 0===t?void 0:t.profile)||void 0===e?void 0:e.userId)||null==this.ratingSummary)&&(this.ratingSummary=await(null===(o=this.service)||void 0===o?void 0:o.getMapRating()))}))}rate(t){this.ratingSummary&&(this.ratingSummary={...this.ratingSummary,rating:null==t.detail?void 0:{type:this.ratingSummary.type,value:t.detail,date:new Date}},this.sendRatingDebouncer.run((()=>this.sendRating(t.detail))))}async sendRating(t){var o,i,r;if(!this.editorMode&&this.ratingSummary){try{null==t?await(null===(o=this.service)||void 0===o?void 0:o.unrateMap()):await(null===(i=this.service)||void 0===i?void 0:i.rateMap(null===(r=this.ratingSummary)||void 0===r?void 0:r.type,t))}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:pr.messages.ratingFailure()}))}this.updateData()}else this.editorMode&&this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:gr.messages.feedbackAndRatingDisabledInEditor()}))}async sendFeedback(t){var o;try{this.editorMode?this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:gr.messages.feedbackAndRatingDisabledInEditor()})):(await(null===(o=this.service)||void 0===o?void 0:o.sendMapFeedback(t.detail.message,t.detail.from)),this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:pr.messages.feedbackSuccess()}))),this.readerFeedback.clearFeedbackInput()}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:pr.messages.feedbackFailure()}))}}onMailerFeedbackSent(){this.dispatchEvent(new CustomEvent("ft-reader-mailer-map-feedback",{composed:!0,bubbles:!0}))}}Hr.elementDefinitions={"ft-reader-feedback":Kr},Mr([e.redux({store:Pi.name})],Hr.prototype,"session",void 0),Mr([e.redux({store:"reader"})],Hr.prototype,"map",void 0),Mr([e.redux({store:Pi.name})],Hr.prototype,"editorMode",void 0),Mr([e.redux({store:"reader",selector:t=>{var e;return null===(e=t.configuration)||void 0===e?void 0:e.feedback}})],Hr.prototype,"configuration",void 0),Mr([i.state()],Hr.prototype,"ratingSummary",void 0),Mr([i.property({type:Boolean})],Hr.prototype,"hideTitle",void 0),Mr([i.property()],Hr.prototype,"iconVariant",void 0),Mr([i.property()],Hr.prototype,"emptyStarIcon",void 0),Mr([i.property()],Hr.prototype,"filledStarIcon",void 0),Mr([i.property()],Hr.prototype,"emptyLikeIcon",void 0),Mr([i.property()],Hr.prototype,"filledLikeIcon",void 0),Mr([i.property()],Hr.prototype,"emptyDislikeIcon",void 0),Mr([i.property()],Hr.prototype,"filledDislikeIcon",void 0),Mr([i.query("ft-reader-feedback")],Hr.prototype,"readerFeedback",void 0),Mr([hr(Zr.properties["mail.map_feedback.subject"]((t=>{var e;return[null===(e=t.map)||void 0===e?void 0:e.title]})))],Hr.prototype,"mailSubject",void 0);var jr=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Gr extends Event{constructor(){super("register-ft-reader-topic-component",{bubbles:!0,composed:!0})}}const Vr=Symbol("registerInterval");class Yr extends(function(t){var e;class o extends t{constructor(){super(...arguments),this.disableContextInteractions=!1,this[e]=0}connectedCallback(){super.connectedCallback(),this[Vr]=window.setInterval((()=>this.tryToRegisterToTopicContext()),50)}tryToRegisterToTopicContext(){null!=this.tocNode?window.clearInterval(this[Vr]):this.dispatchEvent(new Gr)}disconnectedCallback(){super.disconnectedCallback(),this.tocNode=void 0}}return e=Vr,jr([i.state()],o.prototype,"tocNode",void 0),jr([i.state()],o.prototype,"disableContextInteractions",void 0),o}(f)){}var qr=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Xr extends(ar(Yr)){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.iconVariant=je.fluid_topics,this.emptyStarIcon="STAR",this.filledStarIcon="STAR_PLAIN",this.emptyLikeIcon="THUMBS_UP",this.filledLikeIcon="THUMBS_UP_PLAIN",this.emptyDislikeIcon="THUMBS_DOWN",this.filledDislikeIcon="THUMBS_DOWN_PLAIN",this.feedbackLinkBuilder=new Pr,this.i18nProperties={feedbackMainTitle:pr.properties.topicFeedbackMainTitle(),ratingSectionTitle:pr.properties.topicRatingSectionTitle(),dichotomousRatingSectionTitle:pr.properties.topicDichotomousRatingSectionTitle(),feedbackSectionTitle:pr.properties.topicFeedbackSectionTitle()},this.updateDebouncer=new e.Debouncer(100),this.sendRatingDebouncer=new e.Debouncer(500),this.addStore(Pi)}render(){return this.map&&this.tocNode&&(this.editorMode||this.componentVisible)?o.html`
|
|
1716
1716
|
<ft-reader-feedback
|
|
1717
1717
|
.i18nProperties=${this.i18nProperties}
|
|
1718
1718
|
?ratingAllowed=${this.tocNode.hasRating}
|
|
@@ -1738,4 +1738,4 @@ const ze=Symbol.for(""),Be=t=>{if(t?.r===ze)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
1738
1738
|
display: none !important;
|
|
1739
1739
|
}
|
|
1740
1740
|
</style>
|
|
1741
|
-
`}get componentVisible(){var t,e,o;return(null===(t=this.service)||void 0===t?void 0:t.isFeatureAccessible(s.FEEDBACK,{session:this.session}))||(null===(e=this.service)||void 0===e?void 0:e.isFeatureAccessible(s.RATING,{session:this.session,ratingType:null===(o=this.ratingSummary)||void 0===o?void 0:o.type}))}update(t){var e,o,i,r;super.update(t),["tocNode","user"].some((e=>t.has(e)))&&this.tocNode&&this.updateData(),["map","tocNode","configuration","user","mailSubject"].some((e=>t.has(e)))&&this.map&&this.tocNode&&this.configuration&&this.feedbackLinkBuilder.update(this.mailSubject,null!==(o=null===(e=this.service)||void 0===e?void 0:e.getLink(this.tocNode.tocId))&&void 0!==o?o:"",this.map.metadata,this.configuration,null!=(null===(r=null===(i=this.session)||void 0===i?void 0:i.profile)||void 0===r?void 0:r.userId))}connectedCallback(){super.connectedCallback(),this.updateData()}updateData(){this.updateDebouncer.run((async()=>{var t,e,o;this.tocNode&&((null===(e=null===(t=this.session)||void 0===t?void 0:t.profile)||void 0===e?void 0:e.userId)||null==this.ratingSummary)&&(this.ratingSummary=await(null===(o=this.service)||void 0===o?void 0:o.getTopicRating(this.tocNode.tocId)))}))}rate(t){this.ratingSummary&&this.tocNode&&(this.ratingSummary={...this.ratingSummary,rating:null==t.detail?void 0:{tocId:this.tocNode.tocId,type:this.ratingSummary.type,value:t.detail,date:new Date}},this.sendRatingDebouncer.run((()=>this.sendRating(t.detail))))}async sendRating(t){var o,i,r;if(!this.editorMode&&this.ratingSummary&&this.tocNode){try{null==t?await(null===(o=this.service)||void 0===o?void 0:o.unrateTopic(this.tocNode.tocId)):await(null===(i=this.service)||void 0===i?void 0:i.rateTopic(this.tocNode.tocId,null===(r=this.ratingSummary)||void 0===r?void 0:r.type,t))}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:
|
|
1741
|
+
`}get componentVisible(){var t,e,o;return(null===(t=this.service)||void 0===t?void 0:t.isFeatureAccessible(s.FEEDBACK,{session:this.session}))||(null===(e=this.service)||void 0===e?void 0:e.isFeatureAccessible(s.RATING,{session:this.session,ratingType:null===(o=this.ratingSummary)||void 0===o?void 0:o.type}))}update(t){var e,o,i,r;super.update(t),["tocNode","user"].some((e=>t.has(e)))&&this.tocNode&&this.updateData(),["map","tocNode","configuration","user","mailSubject"].some((e=>t.has(e)))&&this.map&&this.tocNode&&this.configuration&&this.feedbackLinkBuilder.update(this.mailSubject,null!==(o=null===(e=this.service)||void 0===e?void 0:e.getLink(this.tocNode.tocId))&&void 0!==o?o:"",this.map.metadata,this.configuration,null!=(null===(r=null===(i=this.session)||void 0===i?void 0:i.profile)||void 0===r?void 0:r.userId))}connectedCallback(){super.connectedCallback(),this.updateData()}updateData(){this.updateDebouncer.run((async()=>{var t,e,o;this.tocNode&&((null===(e=null===(t=this.session)||void 0===t?void 0:t.profile)||void 0===e?void 0:e.userId)||null==this.ratingSummary)&&(this.ratingSummary=await(null===(o=this.service)||void 0===o?void 0:o.getTopicRating(this.tocNode.tocId)))}))}rate(t){this.ratingSummary&&this.tocNode&&(this.ratingSummary={...this.ratingSummary,rating:null==t.detail?void 0:{tocId:this.tocNode.tocId,type:this.ratingSummary.type,value:t.detail,date:new Date}},this.sendRatingDebouncer.run((()=>this.sendRating(t.detail))))}async sendRating(t){var o,i,r;if(!this.editorMode&&this.ratingSummary&&this.tocNode){try{null==t?await(null===(o=this.service)||void 0===o?void 0:o.unrateTopic(this.tocNode.tocId)):await(null===(i=this.service)||void 0===i?void 0:i.rateTopic(this.tocNode.tocId,null===(r=this.ratingSummary)||void 0===r?void 0:r.type,t))}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:pr.messages.ratingFailure()}))}this.updateData()}else this.editorMode&&this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:gr.messages.feedbackAndRatingDisabledInEditor()}))}async sendFeedback(t){var o;try{!this.editorMode&&this.tocNode?(await(null===(o=this.service)||void 0===o?void 0:o.sendTopicFeedback(this.tocNode.tocId,t.detail.message,t.detail.from)),this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:pr.messages.feedbackSuccess()})),this.readerFeedback.clearFeedbackInput()):this.editorMode&&this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:gr.messages.feedbackAndRatingDisabledInEditor()}))}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:pr.messages.feedbackFailure()}))}}onMailerFeedbackSent(){const t=this.tocNode;this.dispatchEvent(new CustomEvent("ft-reader-mailer-topic-feedback",{detail:{topic:t},composed:!0,bubbles:!0}))}}Xr.elementDefinitions={"ft-reader-feedback":Kr},qr([e.redux({store:Pi.name})],Xr.prototype,"session",void 0),qr([e.redux({store:"reader"})],Xr.prototype,"map",void 0),qr([e.redux({store:Pi.name})],Xr.prototype,"editorMode",void 0),qr([e.redux({store:"reader",selector:t=>{var e;return null===(e=t.configuration)||void 0===e?void 0:e.feedback}})],Xr.prototype,"configuration",void 0),qr([i.state()],Xr.prototype,"ratingSummary",void 0),qr([i.property({type:Boolean})],Xr.prototype,"hideTitle",void 0),qr([i.property()],Xr.prototype,"iconVariant",void 0),qr([i.property()],Xr.prototype,"emptyStarIcon",void 0),qr([i.property()],Xr.prototype,"filledStarIcon",void 0),qr([i.property()],Xr.prototype,"emptyLikeIcon",void 0),qr([i.property()],Xr.prototype,"filledLikeIcon",void 0),qr([i.property()],Xr.prototype,"emptyDislikeIcon",void 0),qr([i.property()],Xr.prototype,"filledDislikeIcon",void 0),qr([i.query("ft-reader-feedback")],Xr.prototype,"readerFeedback",void 0),qr([hr(Zr.properties["mail.feedback.subject"]((t=>{var e,o;return[null===(e=t.tocNode)||void 0===e?void 0:e.title,null===(o=t.map)||void 0===o?void 0:o.title]})))],Xr.prototype,"mailSubject",void 0),e.customElement("ft-reader-map-feedback")(Hr),e.customElement("ft-reader-topic-feedback")(Xr),t.FtReaderFeedbackCssVariables=At,t.FtReaderMapFeedback=Hr,t.FtReaderTopicFeedback=Xr,t.styles=zt}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litUnsafeHTML,ftGlobals.litClassMap,ftGlobals.litRepeat);
|