@fluid-topics/ft-reader-feedback 1.0.36 → 1.0.37
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.
|
@@ -81,7 +81,9 @@ class FtReaderFeedback extends FtLitElementWithI18n {
|
|
|
81
81
|
return html `
|
|
82
82
|
<div class="ft-reader-feedback--rating" part="rating-container">
|
|
83
83
|
<ft-typography variant="title-dense" part="section-title" class="ft-reader-feedback--section-title">
|
|
84
|
-
${this.i18n(this.ratingSummary.type === "DICHOTOMOUS"
|
|
84
|
+
${this.i18n(this.ratingSummary.type === "DICHOTOMOUS"
|
|
85
|
+
? this.i18nProperties.dichotomousRatingSectionTitle
|
|
86
|
+
: this.i18nProperties.ratingSectionTitle)}
|
|
85
87
|
</ft-typography>
|
|
86
88
|
${this.renderRating()}
|
|
87
89
|
<ft-typography variant="caption" class="ft-reader-feedback--rating-date" part="rating-date">
|
|
@@ -90,7 +92,9 @@ class FtReaderFeedback extends FtLitElementWithI18n {
|
|
|
90
92
|
</div>
|
|
91
93
|
`;
|
|
92
94
|
}
|
|
93
|
-
return this.placeholderInEditor((this.userHasRatingRole
|
|
95
|
+
return this.placeholderInEditor((this.userHasRatingRole
|
|
96
|
+
? designer.messages.ratingNotConfigured()
|
|
97
|
+
: designer.messages.missingRatingRole()));
|
|
94
98
|
}
|
|
95
99
|
renderRatingDate() {
|
|
96
100
|
const ratingDate = this.ratingDate;
|
|
@@ -122,7 +126,9 @@ class FtReaderFeedback extends FtLitElementWithI18n {
|
|
|
122
126
|
.iconVariant=${this.iconVariant}
|
|
123
127
|
icon="${active ? this.filledStarIcon : this.emptyStarIcon}"
|
|
124
128
|
class="ft-reader-feedback--${active ? "active" : "inactive"}"
|
|
125
|
-
@click=${() => this.rate(this.ratingValue === ratingValue
|
|
129
|
+
@click=${() => this.rate(this.ratingValue === ratingValue
|
|
130
|
+
? undefined
|
|
131
|
+
: ratingValue)}
|
|
126
132
|
></ft-button>
|
|
127
133
|
`;
|
|
128
134
|
})}
|
|
@@ -133,7 +139,7 @@ class FtReaderFeedback extends FtLitElementWithI18n {
|
|
|
133
139
|
const liked = this.ratingType === "LIKE" && this.ratingValue === 1;
|
|
134
140
|
return html `
|
|
135
141
|
<ft-switch unselectable
|
|
136
|
-
@change=${(e) => this.rate(e.detail)}
|
|
142
|
+
@change=${(e) => this.rate(e.detail)}
|
|
137
143
|
part="rating rating-like">
|
|
138
144
|
<ft-switch-option .value=${1}
|
|
139
145
|
?selected=${liked}
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
opacity: ${c.opacityContentOnSurfacePressed};
|
|
89
89
|
transform: translate(-50%, -50%) scale(1);
|
|
90
90
|
}
|
|
91
|
-
`,m=e.FtCssVariableFactory.extend("--ft-typography-font-family",e.designSystemVariables.titleFont),$=e.FtCssVariableFactory.extend("--ft-typography-font-family",e.designSystemVariables.contentFont),w={fontFamily:$,fontSize:e.FtCssVariableFactory.create("--ft-typography-font-size","SIZE","16px"),fontWeight:e.FtCssVariableFactory.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:e.FtCssVariableFactory.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:e.FtCssVariableFactory.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:e.FtCssVariableFactory.create("--ft-typography-text-transform","UNKNOWN","inherit")},k={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-title-font-family",m),fontSize:e.FtCssVariableFactory.extend("--ft-typography-title-font-size",w.fontSize,"20px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-title-font-weight",w.fontWeight,"normal"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing",w.letterSpacing,"0.15px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-title-line-height",w.lineHeight,"1.2"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-title-text-transform",w.textTransform,"inherit")},_={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family",m),fontSize:e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size",w.fontSize,"14px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-weight",w.fontWeight,"normal"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-title-dense-letter-spacing",w.letterSpacing,"0.105px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-title-dense-line-height",w.lineHeight,"1.7"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-title-dense-text-transform",w.textTransform,"inherit")},S=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-family",$),I=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-size",w.fontSize,"16px"),C=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-weight",w.fontWeight,"600"),z=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-letter-spacing",w.letterSpacing,"0.144px"),T=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-line-height",w.lineHeight,"1.5"),O=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-text-transform",w.textTransform,"inherit"),R=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-family",$),E=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-size",w.fontSize,"14px"),N=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-weight",w.fontWeight,"normal"),A=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-letter-spacing",w.letterSpacing,"0.098px"),D=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-line-height",w.lineHeight,"1.7"),
|
|
91
|
+
`,m=e.FtCssVariableFactory.extend("--ft-typography-font-family",e.designSystemVariables.titleFont),$=e.FtCssVariableFactory.extend("--ft-typography-font-family",e.designSystemVariables.contentFont),w={fontFamily:$,fontSize:e.FtCssVariableFactory.create("--ft-typography-font-size","SIZE","16px"),fontWeight:e.FtCssVariableFactory.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:e.FtCssVariableFactory.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:e.FtCssVariableFactory.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:e.FtCssVariableFactory.create("--ft-typography-text-transform","UNKNOWN","inherit")},k={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-title-font-family",m),fontSize:e.FtCssVariableFactory.extend("--ft-typography-title-font-size",w.fontSize,"20px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-title-font-weight",w.fontWeight,"normal"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing",w.letterSpacing,"0.15px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-title-line-height",w.lineHeight,"1.2"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-title-text-transform",w.textTransform,"inherit")},_={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family",m),fontSize:e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size",w.fontSize,"14px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-weight",w.fontWeight,"normal"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-title-dense-letter-spacing",w.letterSpacing,"0.105px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-title-dense-line-height",w.lineHeight,"1.7"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-title-dense-text-transform",w.textTransform,"inherit")},S=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-family",$),I=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-size",w.fontSize,"16px"),C=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-weight",w.fontWeight,"600"),z=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-letter-spacing",w.letterSpacing,"0.144px"),T=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-line-height",w.lineHeight,"1.5"),O=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-text-transform",w.textTransform,"inherit"),R=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-family",$),E=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-size",w.fontSize,"14px"),N=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-weight",w.fontWeight,"normal"),A=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-letter-spacing",w.letterSpacing,"0.098px"),D=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-line-height",w.lineHeight,"1.7"),M=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-text-transform",w.textTransform,"inherit"),B={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-body1-font-family",$),fontSize:e.FtCssVariableFactory.extend("--ft-typography-body1-font-size",w.fontSize,"16px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-body1-font-weight",w.fontWeight,"normal"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-body1-letter-spacing",w.letterSpacing,"0.496px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-body1-line-height",w.lineHeight,"1.5"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-body1-text-transform",w.textTransform,"inherit")},U=e.FtCssVariableFactory.extend("--ft-typography-body2-font-family",$),F=e.FtCssVariableFactory.extend("--ft-typography-body2-font-size",w.fontSize,"14px"),j=e.FtCssVariableFactory.extend("--ft-typography-body2-font-weight",w.fontWeight,"normal"),L=e.FtCssVariableFactory.extend("--ft-typography-body2-letter-spacing",w.letterSpacing,"0.252px"),P=e.FtCssVariableFactory.extend("--ft-typography-body2-line-height",w.lineHeight,"1.4"),H=e.FtCssVariableFactory.extend("--ft-typography-body2-text-transform",w.textTransform,"inherit"),Z={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-caption-font-family",$),fontSize:e.FtCssVariableFactory.extend("--ft-typography-caption-font-size",w.fontSize,"12px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-caption-font-weight",w.fontWeight,"normal"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-caption-letter-spacing",w.letterSpacing,"0.396px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-caption-line-height",w.lineHeight,"1.33"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-caption-text-transform",w.textTransform,"inherit")},W=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-family",$),V=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-size",w.fontSize,"10px"),G=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-weight",w.fontWeight,"normal"),K=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-letter-spacing",w.letterSpacing,"0.33px"),Y=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-line-height",w.lineHeight,"1.6"),q=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-text-transform",w.textTransform,"inherit"),X=e.FtCssVariableFactory.extend("--ft-typography-overline-font-family",$),J=e.FtCssVariableFactory.extend("--ft-typography-overline-font-size",w.fontSize,"10px"),Q=e.FtCssVariableFactory.extend("--ft-typography-overline-font-weight",w.fontWeight,"normal"),tt=e.FtCssVariableFactory.extend("--ft-typography-overline-letter-spacing",w.letterSpacing,"1.5px"),et=e.FtCssVariableFactory.extend("--ft-typography-overline-line-height",w.lineHeight,"1.6"),it=e.FtCssVariableFactory.extend("--ft-typography-overline-text-transform",w.textTransform,"uppercase"),ot={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-button-font-family",$),fontSize:e.FtCssVariableFactory.extend("--ft-typography-button-font-size",w.fontSize,"14px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-button-font-weight",w.fontWeight,"600"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-button-letter-spacing",w.letterSpacing,"1.246px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-button-line-height",w.lineHeight,"1.15"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-button-text-transform",w.textTransform,"uppercase")},st=i.css`
|
|
92
92
|
.ft-typography--title {
|
|
93
93
|
font-family: ${k.fontFamily};
|
|
94
94
|
font-size: ${k.fontSize};
|
|
@@ -122,41 +122,41 @@
|
|
|
122
122
|
font-weight: ${N};
|
|
123
123
|
letter-spacing: ${A};
|
|
124
124
|
line-height: ${D};
|
|
125
|
-
text-transform: ${
|
|
125
|
+
text-transform: ${M};
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
`,lt=i.css`
|
|
129
129
|
.ft-typography--body1 {
|
|
130
|
-
font-family: ${
|
|
131
|
-
font-size: ${
|
|
132
|
-
font-weight: ${
|
|
133
|
-
letter-spacing: ${
|
|
134
|
-
line-height: ${
|
|
135
|
-
text-transform: ${
|
|
130
|
+
font-family: ${B.fontFamily};
|
|
131
|
+
font-size: ${B.fontSize};
|
|
132
|
+
font-weight: ${B.fontWeight};
|
|
133
|
+
letter-spacing: ${B.letterSpacing};
|
|
134
|
+
line-height: ${B.lineHeight};
|
|
135
|
+
text-transform: ${B.textTransform};
|
|
136
136
|
}
|
|
137
137
|
`,ht=i.css`
|
|
138
138
|
.ft-typography--body2 {
|
|
139
139
|
font-family: ${U};
|
|
140
|
-
font-size: ${
|
|
141
|
-
font-weight: ${
|
|
140
|
+
font-size: ${F};
|
|
141
|
+
font-weight: ${j};
|
|
142
142
|
letter-spacing: ${L};
|
|
143
143
|
line-height: ${P};
|
|
144
|
-
text-transform: ${
|
|
144
|
+
text-transform: ${H};
|
|
145
145
|
}
|
|
146
146
|
`,dt=i.css`
|
|
147
147
|
.ft-typography--caption {
|
|
148
|
-
font-family: ${
|
|
149
|
-
font-size: ${
|
|
150
|
-
font-weight: ${
|
|
151
|
-
letter-spacing: ${
|
|
152
|
-
line-height: ${
|
|
153
|
-
text-transform: ${
|
|
148
|
+
font-family: ${Z.fontFamily};
|
|
149
|
+
font-size: ${Z.fontSize};
|
|
150
|
+
font-weight: ${Z.fontWeight};
|
|
151
|
+
letter-spacing: ${Z.letterSpacing};
|
|
152
|
+
line-height: ${Z.lineHeight};
|
|
153
|
+
text-transform: ${Z.textTransform};
|
|
154
154
|
}
|
|
155
155
|
`,pt=i.css`
|
|
156
156
|
.ft-typography--breadcrumb {
|
|
157
157
|
font-family: ${W};
|
|
158
|
-
font-size: ${
|
|
159
|
-
font-weight: ${
|
|
158
|
+
font-size: ${V};
|
|
159
|
+
font-weight: ${G};
|
|
160
160
|
letter-spacing: ${K};
|
|
161
161
|
line-height: ${Y};
|
|
162
162
|
text-transform: ${q};
|
|
@@ -284,7 +284,7 @@
|
|
|
284
284
|
|
|
285
285
|
i.ft-icon.ft-icon--fluid-topics {
|
|
286
286
|
font-family: ${gt.fluidTopicsFontFamily}, ft-icons, fticons, sans-serif;
|
|
287
|
-
|
|
287
|
+
|
|
288
288
|
/* Ugly fix because font is broken */
|
|
289
289
|
font-size: calc(0.75 * ${gt.size});
|
|
290
290
|
line-height: ${gt.size};
|
|
@@ -356,7 +356,7 @@
|
|
|
356
356
|
border: 1px solid var(--ft-button-internal-color);
|
|
357
357
|
padding: calc(${mt.verticalPadding} - 1px) calc(${mt.horizontalPadding} - 1px);
|
|
358
358
|
}
|
|
359
|
-
|
|
359
|
+
|
|
360
360
|
.ft-button.ft-button--dense {
|
|
361
361
|
padding: ${_t} ${St};
|
|
362
362
|
border-radius: ${kt};
|
|
@@ -366,7 +366,7 @@
|
|
|
366
366
|
.ft-button.ft-button--dense.ft-button--outlined {
|
|
367
367
|
padding: calc(${_t} - 1px) calc(${St} - 1px);
|
|
368
368
|
}
|
|
369
|
-
|
|
369
|
+
|
|
370
370
|
.ft-button:not([disabled]):hover {
|
|
371
371
|
cursor: pointer;
|
|
372
372
|
}
|
|
@@ -515,7 +515,7 @@
|
|
|
515
515
|
* @license
|
|
516
516
|
* Copyright 2017 Google LLC
|
|
517
517
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
518
|
-
*/;var Rt;const Et=window,Nt=Et.trustedTypes,At=Nt?Nt.createPolicy("lit-html",{createHTML:t=>t}):void 0,Dt="$lit$",
|
|
518
|
+
*/;var Rt;const Et=window,Nt=Et.trustedTypes,At=Nt?Nt.createPolicy("lit-html",{createHTML:t=>t}):void 0,Dt="$lit$",Mt=`lit$${(Math.random()+"").slice(9)}$`,Bt="?"+Mt,Ut=`<${Bt}>`,Ft=document,jt=()=>Ft.createComment(""),Lt=t=>null===t||"object"!=typeof t&&"function"!=typeof t,Pt=Array.isArray,Ht="[ \t\n\f\r]",Zt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Wt=/-->/g,Vt=/>/g,Gt=RegExp(`>|${Ht}(?:([^\\s"'>=/]+)(${Ht}*=${Ht}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),Kt=/'/g,Yt=/"/g,qt=/^(?:script|style|textarea|title)$/i,Xt=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),Jt=Symbol.for("lit-noChange"),Qt=Symbol.for("lit-nothing"),te=new WeakMap,ee=Ft.createTreeWalker(Ft,129,null,!1),ie=(t,e)=>{const i=t.length-1,o=[];let s,n=2===e?"<svg>":"",r=Zt;for(let e=0;e<i;e++){const i=t[e];let a,l,h=-1,d=0;for(;d<i.length&&(r.lastIndex=d,l=r.exec(i),null!==l);)d=r.lastIndex,r===Zt?"!--"===l[1]?r=Wt:void 0!==l[1]?r=Vt:void 0!==l[2]?(qt.test(l[2])&&(s=RegExp("</"+l[2],"g")),r=Gt):void 0!==l[3]&&(r=Gt):r===Gt?">"===l[0]?(r=null!=s?s:Zt,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?Gt:'"'===l[3]?Yt:Kt):r===Yt||r===Kt?r=Gt:r===Wt||r===Vt?r=Zt:(r=Gt,s=void 0);const p=r===Gt&&t[e+1].startsWith("/>")?" ":"";n+=r===Zt?i+Ut:h>=0?(o.push(a),i.slice(0,h)+Dt+i.slice(h)+Mt+p):i+Mt+(-2===h?(o.push(void 0),e):p)}const a=n+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==At?At.createHTML(a):a,o]};class oe{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let s=0,n=0;const r=t.length-1,a=this.parts,[l,h]=ie(t,e);if(this.el=oe.createElement(l,i),ee.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=ee.nextNode())&&a.length<r;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith(Dt)||e.startsWith(Mt)){const i=h[n++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+Dt).split(Mt),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:s,name:e[2],strings:t,ctor:"."===e[1]?le:"?"===e[1]?de:"@"===e[1]?pe:ae})}else a.push({type:6,index:s})}for(const e of t)o.removeAttribute(e)}if(qt.test(o.tagName)){const t=o.textContent.split(Mt),e=t.length-1;if(e>0){o.textContent=Nt?Nt.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],jt()),ee.nextNode(),a.push({type:2,index:++s});o.append(t[e],jt())}}}else if(8===o.nodeType)if(o.data===Bt)a.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(Mt,t+1));)a.push({type:7,index:s}),t+=Mt.length-1}s++}}static createElement(t,e){const i=Ft.createElement("template");return i.innerHTML=t,i}}function se(t,e,i=t,o){var s,n,r,a;if(e===Jt)return e;let l=void 0!==o?null===(s=i._$Co)||void 0===s?void 0:s[o]:i._$Cl;const h=Lt(e)?void 0:e._$litDirective$;return(null==l?void 0:l.constructor)!==h&&(null===(n=null==l?void 0:l._$AO)||void 0===n||n.call(l,!1),void 0===h?l=void 0:(l=new h(t),l._$AT(t,i,o)),void 0!==o?(null!==(r=(a=i)._$Co)&&void 0!==r?r:a._$Co=[])[o]=l:i._$Cl=l),void 0!==l&&(e=se(t,l._$AS(t,e.values),l,o)),e}class ne{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var e;const{el:{content:i},parts:o}=this._$AD,s=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:Ft).importNode(i,!0);ee.currentNode=s;let n=ee.nextNode(),r=0,a=0,l=o[0];for(;void 0!==l;){if(r===l.index){let e;2===l.type?e=new re(n,n.nextSibling,this,t):1===l.type?e=new l.ctor(n,l.name,l.strings,this,t):6===l.type&&(e=new ce(n,this,t)),this._$AV.push(e),l=o[++a]}r!==(null==l?void 0:l.index)&&(n=ee.nextNode(),r++)}return s}v(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class re{constructor(t,e,i,o){var s;this.type=2,this._$AH=Qt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$Cp=null===(s=null==o?void 0:o.isConnected)||void 0===s||s}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===(null==t?void 0:t.nodeType)&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=se(this,t,e),Lt(t)?t===Qt||null==t||""===t?(this._$AH!==Qt&&this._$AR(),this._$AH=Qt):t!==this._$AH&&t!==Jt&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>Pt(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==Qt&&Lt(this._$AH)?this._$AA.nextSibling.data=t:this.$(Ft.createTextNode(t)),this._$AH=t}g(t){var e;const{values:i,_$litType$:o}=t,s="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=oe.createElement(o.h,this.options)),o);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===s)this._$AH.v(i);else{const t=new ne(s,this),e=t.u(this.options);t.v(i),this.$(e),this._$AH=t}}_$AC(t){let e=te.get(t.strings);return void 0===e&&te.set(t.strings,e=new oe(t)),e}T(t){Pt(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,o=0;for(const s of t)o===e.length?e.push(i=new re(this.k(jt()),this.k(jt()),this,this.options)):i=e[o],i._$AI(s),o++;o<e.length&&(this._$AR(i&&i._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cp=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class ae{constructor(t,e,i,o,s){this.type=1,this._$AH=Qt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=s,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Qt}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,o){const s=this.strings;let n=!1;if(void 0===s)t=se(this,t,e,0),n=!Lt(t)||t!==this._$AH&&t!==Jt,n&&(this._$AH=t);else{const o=t;let r,a;for(t=s[0],r=0;r<s.length-1;r++)a=se(this,o[i+r],e,r),a===Jt&&(a=this._$AH[r]),n||(n=!Lt(a)||a!==this._$AH[r]),a===Qt?t=Qt:t!==Qt&&(t+=(null!=a?a:"")+s[r+1]),this._$AH[r]=a}n&&!o&&this.j(t)}j(t){t===Qt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class le extends ae{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===Qt?void 0:t}}const he=Nt?Nt.emptyScript:"";class de extends ae{constructor(){super(...arguments),this.type=4}j(t){t&&t!==Qt?this.element.setAttribute(this.name,he):this.element.removeAttribute(this.name)}}class pe extends ae{constructor(t,e,i,o,s){super(t,e,i,o,s),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=se(this,t,e,0))&&void 0!==i?i:Qt)===Jt)return;const o=this._$AH,s=t===Qt&&o!==Qt||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==Qt&&(o===Qt||s);s&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class ce{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){se(this,t)}}const fe=Et.litHtmlPolyfillSupport;null==fe||fe(oe,re),(null!==(Rt=Et.litHtmlVersions)&&void 0!==Rt?Rt:Et.litHtmlVersions=[]).push("2.7.3");
|
|
519
519
|
/**
|
|
520
520
|
* @license
|
|
521
521
|
* Copyright 2020 Google LLC
|
|
@@ -575,7 +575,7 @@ const ue=Symbol.for(""),be=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
575
575
|
@touchstart=${this.onTouch}>
|
|
576
576
|
<slot></slot>
|
|
577
577
|
<div part="tooltip" role="tooltip" inert
|
|
578
|
-
class="ft-tooltip ft-tooltip--${this.validPosition}"
|
|
578
|
+
class="ft-tooltip ft-tooltip--${this.validPosition}"
|
|
579
579
|
?hidden=${!this.visible}>
|
|
580
580
|
<div part="tooltip-content" class="ft-tooltip--content">
|
|
581
581
|
<slot name="text"></slot>
|
|
@@ -583,7 +583,7 @@ const ue=Symbol.for(""),be=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
583
583
|
</div>
|
|
584
584
|
</div>
|
|
585
585
|
</div>
|
|
586
|
-
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(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(){this.resetTooltipContent();const t=this.slottedElement;if(this.tooltip&&t){const e=t.getBoundingClientRect(),i=(e.height-this.tooltip.clientHeight)/2,o=(e.width-this.tooltip.clientWidth)/2;let s=0,n=0;switch(this.validPosition){case"top":n=-this.tooltip.clientHeight,s=o;break;case"bottom":n=e.height,s=o;break;case"left":n=i,s=-this.tooltip.clientWidth;break;case"right":n=i,s=e.width}e.left+s+this.tooltip.clientWidth>window.innerWidth&&(s=window.innerWidth-this.tooltip.clientWidth-e.left),e.left+s<0&&(s=4-e.left);const r=this.tooltip.style;r.left=s+"px",r.top=n+"px",r.maxWidth=`max(${e.width}px, ${Ee})`}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())}}De.elementDefinitions={"ft-typography":_e},De.styles=Ne,Ae([o.property()],De.prototype,"text",void 0),Ae([o.property({type:Boolean})],De.prototype,"manual",void 0),Ae([o.property({type:Boolean})],De.prototype,"inline",void 0),Ae([o.property({type:Number})],De.prototype,"delay",void 0),Ae([o.property()],De.prototype,"position",void 0),Ae([o.queryAssignedNodes("",!0)],De.prototype,"slotNodes",void 0),Ae([o.query(".ft-tooltip--container")],De.prototype,"container",void 0),Ae([o.query("slot")],De.prototype,"target",void 0),Ae([o.query(".ft-tooltip")],De.prototype,"tooltip",void 0),Ae([o.query(".ft-tooltip--content")],De.prototype,"tooltipContent",void 0),Ae([o.state()],De.prototype,"visible",void 0),e.customElement("ft-tooltip")(De);var
|
|
586
|
+
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(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(){this.resetTooltipContent();const t=this.slottedElement;if(this.tooltip&&t){const e=t.getBoundingClientRect(),i=(e.height-this.tooltip.clientHeight)/2,o=(e.width-this.tooltip.clientWidth)/2;let s=0,n=0;switch(this.validPosition){case"top":n=-this.tooltip.clientHeight,s=o;break;case"bottom":n=e.height,s=o;break;case"left":n=i,s=-this.tooltip.clientWidth;break;case"right":n=i,s=e.width}e.left+s+this.tooltip.clientWidth>window.innerWidth&&(s=window.innerWidth-this.tooltip.clientWidth-e.left),e.left+s<0&&(s=4-e.left);const r=this.tooltip.style;r.left=s+"px",r.top=n+"px",r.maxWidth=`max(${e.width}px, ${Ee})`}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())}}De.elementDefinitions={"ft-typography":_e},De.styles=Ne,Ae([o.property()],De.prototype,"text",void 0),Ae([o.property({type:Boolean})],De.prototype,"manual",void 0),Ae([o.property({type:Boolean})],De.prototype,"inline",void 0),Ae([o.property({type:Number})],De.prototype,"delay",void 0),Ae([o.property()],De.prototype,"position",void 0),Ae([o.queryAssignedNodes("",!0)],De.prototype,"slotNodes",void 0),Ae([o.query(".ft-tooltip--container")],De.prototype,"container",void 0),Ae([o.query("slot")],De.prototype,"target",void 0),Ae([o.query(".ft-tooltip")],De.prototype,"tooltip",void 0),Ae([o.query(".ft-tooltip--content")],De.prototype,"tooltipContent",void 0),Ae([o.state()],De.prototype,"visible",void 0),e.customElement("ft-tooltip")(De);var Me=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Be 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.rippleSize=0,this.originX=0,this.originY=0,this.resizeObserver=new ResizeObserver((()=>this.setRippleSize())),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,i;let{x:o,y:s}=this.getCoordinates(t),n=null!==(i=null===(e=this.ripple)||void 0===e?void 0:e.getBoundingClientRect())&&void 0!==i?i:{x:0,y:0,width:0,height:0};this.originX=Math.round(null!=o?o-n.x:n.width/2),this.originY=Math.round(null!=s?s-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 i.html`
|
|
587
587
|
<style>
|
|
588
588
|
.ft-ripple .ft-ripple--effect,
|
|
589
589
|
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
@@ -600,7 +600,7 @@ const ue=Symbol.for(""),be=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
600
600
|
<div class="ft-ripple--background"></div>
|
|
601
601
|
<div class="ft-ripple--effect"></div>
|
|
602
602
|
</div>
|
|
603
|
-
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){var e,i;super.updated(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(e=this.target)||void 0===e||e.removeAttribute("data-is-ft-ripple-target")):null===(i=this.target)||void 0===i||i.setAttribute("data-is-ft-ripple-target","true")),t.has("unbounded")&&this.setRippleSize()}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}setRippleSize(){if(this.ripple){const t=this.ripple.getBoundingClientRect();this.rippleSize=(this.unbounded?1:1.7)*Math.max(t.width,t.height)}}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run((()=>this.defaultSetup()))}defaultSetup(){var t,e;const i=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;i&&this.setupFor(null!==(e=this.target)&&void 0!==e?e:i),this.setRippleSize()}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)},i=e("mouseup","contextmenu"),o=e("touchend","touchcancel"),s=t=>{["Enter"," "].includes(t.key)&&e("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",i),t.addEventListener("touchstart",o),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",s),t.addEventListener("focus",this.startFocus),t.addEventListener("blur",this.endFocus),t.addEventListener("focusin",this.startFocus),t.addEventListener("focusout",this.endFocus),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover),t.removeEventListener("mousemove",this.moveRipple),t.removeEventListener("mouseleave",this.endHover),t.removeEventListener("mousedown",i),t.removeEventListener("touchstart",o),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",s),t.removeEventListener("focus",this.startFocus),t.removeEventListener("blur",this.endFocus),t.removeEventListener("focusin",this.startFocus),t.removeEventListener("focusout",this.endFocus),this.onDisconnect=void 0,this.target=void 0}}getCoordinates(t){const e=t,i=t;let o,s;return null!=e.x?({x:o,y:s}=e):null!=i.touches&&(o=i.touches[0].clientX,s=i.touches[0].clientY),{x:o,y:s}}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.resizeObserver.disconnect(),this.endRipple()}}
|
|
603
|
+
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){var e,i;super.updated(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(e=this.target)||void 0===e||e.removeAttribute("data-is-ft-ripple-target")):null===(i=this.target)||void 0===i||i.setAttribute("data-is-ft-ripple-target","true")),t.has("unbounded")&&this.setRippleSize()}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}setRippleSize(){if(this.ripple){const t=this.ripple.getBoundingClientRect();this.rippleSize=(this.unbounded?1:1.7)*Math.max(t.width,t.height)}}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run((()=>this.defaultSetup()))}defaultSetup(){var t,e;const i=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;i&&this.setupFor(null!==(e=this.target)&&void 0!==e?e:i),this.setRippleSize()}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)},i=e("mouseup","contextmenu"),o=e("touchend","touchcancel"),s=t=>{["Enter"," "].includes(t.key)&&e("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",i),t.addEventListener("touchstart",o),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",s),t.addEventListener("focus",this.startFocus),t.addEventListener("blur",this.endFocus),t.addEventListener("focusin",this.startFocus),t.addEventListener("focusout",this.endFocus),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover),t.removeEventListener("mousemove",this.moveRipple),t.removeEventListener("mouseleave",this.endHover),t.removeEventListener("mousedown",i),t.removeEventListener("touchstart",o),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",s),t.removeEventListener("focus",this.startFocus),t.removeEventListener("blur",this.endFocus),t.removeEventListener("focusin",this.startFocus),t.removeEventListener("focusout",this.endFocus),this.onDisconnect=void 0,this.target=void 0}}getCoordinates(t){const e=t,i=t;let o,s;return null!=e.x?({x:o,y:s}=e):null!=i.touches&&(o=i.touches[0].clientX,s=i.touches[0].clientY),{x:o,y:s}}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.resizeObserver.disconnect(),this.endRipple()}}Be.elementDefinitions={},Be.styles=y,Me([o.property({type:Boolean})],Be.prototype,"primary",void 0),Me([o.property({type:Boolean})],Be.prototype,"secondary",void 0),Me([o.property({type:Boolean})],Be.prototype,"unbounded",void 0),Me([o.property({type:Boolean})],Be.prototype,"activated",void 0),Me([o.property({type:Boolean})],Be.prototype,"selected",void 0),Me([o.property({type:Boolean})],Be.prototype,"disabled",void 0),Me([o.state()],Be.prototype,"hovered",void 0),Me([o.state()],Be.prototype,"focused",void 0),Me([o.state()],Be.prototype,"pressed",void 0),Me([o.state()],Be.prototype,"rippling",void 0),Me([o.state()],Be.prototype,"rippleSize",void 0),Me([o.state()],Be.prototype,"originX",void 0),Me([o.state()],Be.prototype,"originY",void 0),Me([o.query(".ft-ripple")],Be.prototype,"ripple",void 0),Me([o.query(".ft-ripple--effect")],Be.prototype,"rippleEffect",void 0),e.customElement("ft-ripple")(Be);const Ue={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")},Fe=i.css`
|
|
604
604
|
.ft-switch-option {
|
|
605
605
|
position: relative;
|
|
606
606
|
display: inline-block;
|
|
@@ -684,7 +684,7 @@ const ue=Symbol.for(""),be=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
684
684
|
.ft-switch-option--selected ft-icon {
|
|
685
685
|
color: ${zt.selectedTextColor};
|
|
686
686
|
}
|
|
687
|
-
`;var
|
|
687
|
+
`;var je=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Le extends CustomEvent{constructor(){super("option-change",{bubbles:!0,composed:!0})}}class Pe 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()}updated(t){super.updated(t),t.has("selected")&&this.dispatchEvent(new Le)}render(){const t={"ft-switch-option":!0,"ft-switch-option--trailing-icon":this.trailingIcon,"ft-switch-option--selected":this.selected};return this.addTooltip(i.html`
|
|
688
688
|
<label part="label" for="input" class=${n.classMap(t)}
|
|
689
689
|
@click=${this.onChange}>
|
|
690
690
|
<div class="ft-switch-option--content">
|
|
@@ -708,7 +708,7 @@ const ue=Symbol.for(""),be=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
708
708
|
</ft-tooltip>
|
|
709
709
|
`}onChange(){this.selected=!this.unselectable||!this.selected}getLabel(){return this.label||this.textContent}resolveIcon(){return this.icon?i.html`
|
|
710
710
|
<ft-icon part="icon" .variant=${this.iconVariant} .value=${this.icon}></ft-icon>
|
|
711
|
-
`:i.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()}}Pe.elementDefinitions={"ft-ripple":
|
|
711
|
+
`:i.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()}}Pe.elementDefinitions={"ft-ripple":Be,"ft-typography":_e,"ft-tooltip":De,"ft-icon":Ie},Pe.styles=[e.safariEllipsisFix,Fe],je([o.property()],Pe.prototype,"value",void 0),je([o.property()],Pe.prototype,"icon",void 0),je([o.property()],Pe.prototype,"iconVariant",void 0),je([o.property()],Pe.prototype,"label",void 0),je([o.property()],Pe.prototype,"tooltipPosition",void 0),je([o.property({type:Boolean,reflect:!0})],Pe.prototype,"selected",void 0),je([o.property({type:Boolean})],Pe.prototype,"trailingIcon",void 0),je([o.property({type:Boolean})],Pe.prototype,"unselectable",void 0),je([o.query(".ft-switch-option--content slot")],Pe.prototype,"slottedContent",void 0),je([o.query(".ft-switch-option--input")],Pe.prototype,"input",void 0);var He=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Ze extends CustomEvent{constructor(t){super("change",{detail:t})}}class We 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}updated(t){var e;super.updated(t),t.has("selectedOption")&&(this.updateOptions(),this.dispatchEvent(new Ze(null===(e=this.selectedOption)||void 0===e?void 0:e.value))),t.has("unselectable")&&this.options.forEach((t=>t.unselectable=this.unselectable))}render(){const t={"ft-switch":!0,"ft-switch--dense":this.dense};return i.html`
|
|
712
712
|
<div @keydown=${this.onKeyDown} tabindex="0" class="${n.classMap(t)}">
|
|
713
713
|
<slot @slotchange=${this.onSlotchange}
|
|
714
714
|
@option-change=${this.onOptionChange}></slot>
|
|
@@ -747,7 +747,7 @@ const ue=Symbol.for(""),be=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
747
747
|
--ft-switch-internal-vertical-padding: 2px;
|
|
748
748
|
--ft-switch-internal-horizontal-padding: 4px;
|
|
749
749
|
}
|
|
750
|
-
`,
|
|
750
|
+
`,He([o.property({type:Boolean})],We.prototype,"dense",void 0),He([o.property({type:Boolean})],We.prototype,"unselectable",void 0),He([o.query(".ft-switch slot")],We.prototype,"slottedContent",void 0),He([o.state()],We.prototype,"selectedOption",void 0),He([o.query(".ft-switch")],We.prototype,"ftSwitchDiv",void 0),e.customElement("ft-switch")(We),e.customElement("ft-switch-option")(Pe);const Ve=e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),Ge=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceMedium,"Design system"),Ke=i.css`
|
|
751
751
|
:host {
|
|
752
752
|
display: block;
|
|
753
753
|
}
|
|
@@ -758,12 +758,12 @@ const ue=Symbol.for(""),be=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
758
758
|
|
|
759
759
|
ft-icon {
|
|
760
760
|
transform: rotate(-45deg);
|
|
761
|
-
color: ${
|
|
761
|
+
color: ${Ve};
|
|
762
762
|
}
|
|
763
763
|
|
|
764
764
|
.ft-resizer--dragging ft-icon,
|
|
765
765
|
.ft-resizer:hover ft-icon {
|
|
766
|
-
color: ${
|
|
766
|
+
color: ${Ge};
|
|
767
767
|
}
|
|
768
768
|
`;var Ye=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class qe extends CustomEvent{constructor(t,e){super("resize",{detail:{width:t,height:e}})}}class Xe extends e.FtLitElement{constructor(){super(...arguments),this.initialWidth=0,this.initialHeight=0,this.icon="drag_handle",this.iconVariant=we.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 i.html`
|
|
769
769
|
<style>
|
|
@@ -827,8 +827,8 @@ const ue=Symbol.for(""),be=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
827
827
|
transition: font-size 250ms, line-height 250ms, color 250ms;
|
|
828
828
|
max-width: calc(${Je.labelMaxWidth} - 2 * (${Je.horizontalSpacing} - 4px)); /* -2px on spacing for label padding */
|
|
829
829
|
text-overflow: ellipsis;
|
|
830
|
-
${e.setVariable(
|
|
831
|
-
${e.setVariable(
|
|
830
|
+
${e.setVariable(Z.fontSize,Je.fontSize)};
|
|
831
|
+
${e.setVariable(Z.lineHeight,Je.fontSize)};
|
|
832
832
|
}
|
|
833
833
|
|
|
834
834
|
.ft-input-label--in-error .ft-input-label--text {
|
|
@@ -860,8 +860,8 @@ const ue=Symbol.for(""),be=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
860
860
|
}
|
|
861
861
|
|
|
862
862
|
.ft-input-label--raised .ft-input-label--text {
|
|
863
|
-
${e.setVariable(
|
|
864
|
-
${e.setVariable(
|
|
863
|
+
${e.setVariable(Z.fontSize,Je.raisedFontSize)};
|
|
864
|
+
${e.setVariable(Z.lineHeight,Je.raisedFontSize)};
|
|
865
865
|
}
|
|
866
866
|
|
|
867
867
|
.ft-input-label--raised .ft-input-label--floating-text {
|
|
@@ -953,8 +953,8 @@ const ue=Symbol.for(""),be=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
953
953
|
align-self: stretch;
|
|
954
954
|
resize: none;
|
|
955
955
|
|
|
956
|
-
${e.setVariable(
|
|
957
|
-
${e.setVariable(
|
|
956
|
+
${e.setVariable(B.fontSize,ii.fontSize)};
|
|
957
|
+
${e.setVariable(B.lineHeight,ii.fontSize)};
|
|
958
958
|
color: ${ii.colorOnSurface};
|
|
959
959
|
|
|
960
960
|
padding: 0 ${ii.horizontalSpacing};
|
|
@@ -1005,7 +1005,6 @@ const ue=Symbol.for(""),be=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
1005
1005
|
|
|
1006
1006
|
ft-resizer {
|
|
1007
1007
|
position: absolute;
|
|
1008
|
-
right: 0;
|
|
1009
1008
|
bottom: 0;
|
|
1010
1009
|
}
|
|
1011
1010
|
`;var si=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class ni extends e.FtLitElement{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 i.html`
|
|
@@ -1013,6 +1012,9 @@ const ue=Symbol.for(""),be=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
1013
1012
|
.ft-text-area--main-panel {
|
|
1014
1013
|
height: calc(4 * ${ii.verticalSpacing} + ${ii.labelSize} + ${ii.fontSize} + ${this.height}px);
|
|
1015
1014
|
}
|
|
1015
|
+
ft-resizer {
|
|
1016
|
+
right: ${null!=this.textarea?this.textarea.offsetWidth-this.textarea.clientWidth:0}px;
|
|
1017
|
+
}
|
|
1016
1018
|
</style>
|
|
1017
1019
|
<div class="${n.classMap(t)}">
|
|
1018
1020
|
<div class="ft-text-area--main-panel">
|
|
@@ -1046,7 +1048,7 @@ const ue=Symbol.for(""),be=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
1046
1048
|
${this.helper}
|
|
1047
1049
|
</ft-typography>`:void 0}
|
|
1048
1050
|
</div>
|
|
1049
|
-
`}updated(t){super.updated(t),t.has("value")&&this.dispatchEvent(new CustomEvent("live-change",{detail:this.value}))}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)||""}onResize(t){t.detail.height>=50&&(this.height=t.detail.height)}}ni.elementDefinitions={"ft-input-label":ei,"ft-resizer":Xe,"ft-ripple":
|
|
1051
|
+
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.requestUpdate()}updated(t){super.updated(t),t.has("value")&&this.dispatchEvent(new CustomEvent("live-change",{detail:this.value}))}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)||""}onResize(t){t.detail.height>=50&&(this.height=t.detail.height)}}ni.elementDefinitions={"ft-input-label":ei,"ft-resizer":Xe,"ft-ripple":Be,"ft-typography":_e},ni.styles=[lt,oi],si([o.property({type:String})],ni.prototype,"label",void 0),si([o.property({reflect:!0})],ni.prototype,"value",void 0),si([o.property({type:String})],ni.prototype,"helper",void 0),si([o.property({type:Boolean})],ni.prototype,"outlined",void 0),si([o.property({type:Boolean})],ni.prototype,"disabled",void 0),si([o.property({type:Boolean})],ni.prototype,"error",void 0),si([o.property({type:Number,reflect:!0})],ni.prototype,"height",void 0),si([o.query("textarea")],ni.prototype,"textarea",void 0),si([o.state()],ni.prototype,"focused",void 0),e.customElement("ft-text-area")(ni);class ri extends e.FtLitElement{render(){return i.html`
|
|
1050
1052
|
<div class="ft-loader">
|
|
1051
1053
|
<div></div>
|
|
1052
1054
|
<div></div>
|
|
@@ -1074,15 +1076,17 @@ const ue=Symbol.for(""),be=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
1074
1076
|
position="${this.tooltipPosition}">
|
|
1075
1077
|
${t}
|
|
1076
1078
|
</ft-tooltip>
|
|
1077
|
-
|
|
1079
|
+
`:t}resolveIcon(){return this.loading?i.html`
|
|
1078
1080
|
<ft-loader part="loader icon"></ft-loader> `:this.icon?i.html`
|
|
1079
|
-
<ft-icon part="icon" .variant="${this.iconVariant}" .value="${this.icon}"></ft-icon> `:i.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}}li.elementDefinitions={"ft-ripple":
|
|
1081
|
+
<ft-icon part="icon" .variant="${this.iconVariant}" .value="${this.icon}"></ft-icon> `:i.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}}li.elementDefinitions={"ft-ripple":Be,"ft-tooltip":De,"ft-typography":_e,"ft-icon":Ie,"ft-loader":ri},li.styles=[e.safariEllipsisFix,Ct],ai([o.property({type:String,reflect:!0})],li.prototype,"role",void 0),ai([o.property({type:Boolean})],li.prototype,"primary",void 0),ai([o.property({type:Boolean})],li.prototype,"outlined",void 0),ai([o.property({type:Boolean})],li.prototype,"disabled",void 0),ai([o.property({type:Boolean})],li.prototype,"dense",void 0),ai([o.property({type:Boolean})],li.prototype,"round",void 0),ai([o.property()],li.prototype,"label",void 0),ai([o.property()],li.prototype,"icon",void 0),ai([o.property()],li.prototype,"iconVariant",void 0),ai([o.property({type:Boolean})],li.prototype,"trailingIcon",void 0),ai([o.property({type:Boolean})],li.prototype,"loading",void 0),ai([o.property()],li.prototype,"tooltipPosition",void 0),ai([o.property({type:Boolean})],li.prototype,"hideTooltip",void 0),ai([o.property({type:Boolean})],li.prototype,"forceTooltip",void 0),ai([o.query(".ft-button")],li.prototype,"button",void 0),ai([o.query(".ft-button--label slot")],li.prototype,"slottedContent",void 0),e.customElement("ft-button")(li);const hi=i.css`
|
|
1080
1082
|
`,di=i.css`
|
|
1081
1083
|
`,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 ci{static build(t){const{baseUrl:e,apiIntegrationIdentifier:i}=pi.getState(),o=null!=t?t:i;if(e&&o&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(e,o,!0)}static get(t){var e;return null!=t?ci.build(t):null!==(e=ci.API)&&void 0!==e?e:ci.API=ci.build()}static await(t){return new Promise((e=>{let i=ci.get(t);if(i)e(i);else{const o=pi.subscribe((()=>{i=ci.get(t),i&&(o(),e(i))}))}}))}}var fi;const ui=Symbol("clearAfterUnitTest");class bi{constructor(t){this.messageContextProvider=t,this.defaultMessages={},this.cache=new e.CacheRegistry,this.listeners={},this.currentUiLocale="",this[fi]=()=>{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,i){var o;if(t=t.toLowerCase(),Object.keys(i).length>0){const s={...null!==(o=this.defaultMessages[t])&&void 0!==o?o:{},...i};e.deepEqual(this.defaultMessages[t],s)||(this.defaultMessages[t]=s,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,i,...o){var s,n,r;t=t.toLowerCase(),this.fetchContext(t);const a=null!==(n=null===(s=this.cache.getNow(t))||void 0===s?void 0:s.messages)&&void 0!==n?n:{};return new e.ParametrizedLabelResolver(null!==(r=this.defaultMessages[t])&&void 0!==r?r:{},a).resolve(i,...o)}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 i;return t=t.toLowerCase(),this.listeners[t]=null!==(i=this.listeners[t])&&void 0!==i?i:new Set,this.listeners[t].add(e),()=>{var i;return null===(i=this.listeners[t])||void 0===i?void 0:i.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)))))}}fi=ui,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new bi((async(t,e)=>(await ci.await()).getFluidTopicsMessageContext(t,e)))),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new bi((async(t,e)=>(await ci.await()).getCustomMessageContext(t,e))));const vi=window.FluidTopicsI18nService,gi=window.FluidTopicsCustomI18nService;var xi=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class yi 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=()=>ci.get(),this.cache=new e.CacheRegistry,this.cleanSessionDebouncer=new e.Debouncer}render(){return i.html`
|
|
1082
1084
|
<slot></slot>
|
|
1083
1085
|
`}updated(t){super.updated(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()))))}}yi.elementDefinitions={},yi.styles=di,xi([o.property()],yi.prototype,"baseUrl",void 0),xi([o.property()],yi.prototype,"apiIntegrationIdentifier",void 0),xi([o.property()],yi.prototype,"uiLocale",void 0),xi([e.jsonProperty([])],yi.prototype,"availableUiLocales",void 0),xi([o.property({type:Boolean})],yi.prototype,"editorMode",void 0),xi([o.property({type:Boolean})],yi.prototype,"noCustom",void 0),xi([o.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],yi.prototype,"noCustomComponent",void 0),xi([o.property({type:Boolean})],yi.prototype,"withManualResources",void 0),xi([e.jsonProperty([])],yi.prototype,"messageContexts",void 0),xi([e.jsonProperty(void 0)],yi.prototype,"session",void 0),xi([o.property({type:Object})],yi.prototype,"apiProvider",void 0),e.customElement("ft-app-context")(yi);var mi=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const $i=Symbol("i18nProperties"),wi=Symbol("i18nUnsubs");function ki(t){var e;class i extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map}get i18nService(){return this.useCustomMessageContexts?gi:vi}i18n(t,e,...i){var o;if("string"==typeof t)return this.i18nService.resolveMessage(t,e,...i);const s=null!==(o=t.args)&&void 0!==o?o:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...s)}onI18nUpdate(t){var e;null===(e=this[$i])||void 0===e||e.forEach(((e,i)=>{e.context.toLowerCase()===t.toLowerCase()&&(this[i]=this.i18n(e))})),setTimeout((()=>this.requestUpdate()),0)}updated(t){var e;super.updated(t),null===(e=this[$i])||void 0===e||e.forEach(((t,e)=>{null!=t.argsProvider&&(this[e]=this.i18n(t))}))}connectedCallback(){super.connectedCallback(),null!=this[$i]&&new Set([...this[$i].values()].map((t=>t.context))).forEach((t=>this.addI18nMessages(t)))}addI18nMessages(t,e){t=t.toLowerCase(),this[wi].has(t)||this[wi].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[wi].forEach((t=>t())),this[wi].clear()}}return e=wi,mi([o.property({type:Boolean})],i.prototype,"useCustomMessageContexts",void 0),i}class _i extends(ki(e.FtLitElement)){}class Si extends(ki(e.FtLitElementRedux)){}var Ii=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Ci extends Si{constructor(){super(),this.editorMode=!1,this.addStore(pi)}render(){return this.key&&this.context?i.html`
|
|
1084
|
-
<span class="ft-i18n"
|
|
1085
|
-
|
|
1086
|
+
<span class="ft-i18n">
|
|
1087
|
+
${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}
|
|
1088
|
+
</span>
|
|
1089
|
+
`:this.editorMode?"Select a context and a label key.":i.nothing}update(t){super.update(t),this.context&&this.key&&this.defaultMessage&&this.addI18nMessages(this.context,{[this.key]:this.defaultMessage})}}Ci.elementDefinitions={},Ci.styles=hi,Ii([e.redux()],Ci.prototype,"editorMode",void 0),Ii([o.property()],Ci.prototype,"context",void 0),Ii([o.property()],Ci.prototype,"key",void 0),Ii([e.jsonProperty([])],Ci.prototype,"args",void 0),Ii([o.property()],Ci.prototype,"defaultMessage",void 0);class zi{static build(t){return new zi(t)}static fromGwt(t){return new zi(t)}constructor(t){this.name=t,this.properties=new Proxy({},{get:(t,e)=>{const i=e;return t=>({context:this.name,key:i,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 Ti=(t,e)=>(i,o)=>{var s,n;i.constructor.createProperty(o,null!=e?e:{attribute:!1,type:String});const r={...t,key:null!==(s=t.key)&&void 0!==s?s:o};i[$i]=null!==(n=i[$i])&&void 0!==n?n:new Map,i[$i].set(o,r)};e.customElement("ft-i18n")(Ci);const Oi=zi.build("integratedFeedbackComponent"),Ri={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?",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"},Ei=zi.build("inDesignerFeedbackComponent"),Ni={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."};var Ai=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Di extends _i{constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.ratingAllowed=!1,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(Oi,Ri),this.addI18nContext(Ei,Ni)}get canAccessFeedback(){return this.user&&this.user.roles.includes("FEEDBACK_USER")}get canAccessRating(){return this.userHasRatingRole&&"NO_RATING"!==this.configuredRatingType}get userHasRatingRole(){return this.user&&this.user.roles.includes("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,i;return null!==(i=null===(e=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===e?void 0:e.type)&&void 0!==i?i:"NO_RATING"}get ratingValue(){var t,e,i;return null!==(i=null===(e=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===e?void 0:e.value)&&void 0!==i?i:-1}get ratingDate(){var t,i;const o=null===(i=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===i?void 0:i.date;return"string"==typeof o?e.parseDate(o):o}render(){return this.editorMode||this.canAccessFeedback||this.canAccessRating?i.html`
|
|
1086
1090
|
<div class="ft-reader-feedback">
|
|
1087
1091
|
${this.hideTitle?i.nothing:i.html`
|
|
1088
1092
|
<ft-typography variant="title" part="main-title">
|
|
@@ -1117,7 +1121,7 @@ const ue=Symbol.for(""),be=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
1117
1121
|
</div>
|
|
1118
1122
|
`;case"LIKE":const t="LIKE"===this.ratingType&&0===this.ratingValue,e="LIKE"===this.ratingType&&1===this.ratingValue;return i.html`
|
|
1119
1123
|
<ft-switch unselectable
|
|
1120
|
-
@change=${t=>this.rate(t.detail)}
|
|
1124
|
+
@change=${t=>this.rate(t.detail)}
|
|
1121
1125
|
part="rating rating-like">
|
|
1122
1126
|
<ft-switch-option .value=${1}
|
|
1123
1127
|
?selected=${e}
|
|
@@ -1177,7 +1181,7 @@ const ue=Symbol.for(""),be=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
1177
1181
|
<ft-icon>INFO</ft-icon>
|
|
1178
1182
|
</ft-tooltip>
|
|
1179
1183
|
</div>
|
|
1180
|
-
`:i.nothing}onMailerFeedbackSent(){this.dispatchEvent(new CustomEvent("mailer-feedback"))}clearFeedbackInput(){setTimeout((()=>this.feedbackInput.value=""),0)}}Di.elementDefinitions={"ft-button":li,"ft-typography":_e,"ft-icon":Ie,"ft-tooltip":De,"ft-switch":We,"ft-switch-option":Pe,"ft-text-area":ni},Di.styles=Ot,Ai([o.property({type:Boolean})],Di.prototype,"editorMode",void 0),Ai([o.property({type:Boolean})],Di.prototype,"hideTitle",void 0),Ai([o.property({type:Boolean})],Di.prototype,"ratingAllowed",void 0),Ai([o.property({attribute:!1})],Di.prototype,"i18nProperties",void 0),Ai([o.property({attribute:!1})],Di.prototype,"ratingSummary",void 0),Ai([o.property({attribute:!1})],Di.prototype,"user",void 0),Ai([o.query(".ft-reader-feedback--feedback-input")],Di.prototype,"feedbackInput",void 0),Ai([o.state()],Di.prototype,"feedbackMessage",void 0),Ai([o.property()],Di.prototype,"iconVariant",void 0),Ai([o.property()],Di.prototype,"emptyStarIcon",void 0),Ai([o.property()],Di.prototype,"filledStarIcon",void 0),Ai([o.property()],Di.prototype,"emptyLikeIcon",void 0),Ai([o.property()],Di.prototype,"filledLikeIcon",void 0),Ai([o.property()],Di.prototype,"emptyDislikeIcon",void 0),Ai([o.property()],Di.prototype,"filledDislikeIcon",void 0),Ai([o.property()],Di.prototype,"feedbackMailLinkBuilder",void 0);const
|
|
1184
|
+
`:i.nothing}onMailerFeedbackSent(){this.dispatchEvent(new CustomEvent("mailer-feedback"))}clearFeedbackInput(){setTimeout((()=>this.feedbackInput.value=""),0)}}Di.elementDefinitions={"ft-button":li,"ft-typography":_e,"ft-icon":Ie,"ft-tooltip":De,"ft-switch":We,"ft-switch-option":Pe,"ft-text-area":ni},Di.styles=Ot,Ai([o.property({type:Boolean})],Di.prototype,"editorMode",void 0),Ai([o.property({type:Boolean})],Di.prototype,"hideTitle",void 0),Ai([o.property({type:Boolean})],Di.prototype,"ratingAllowed",void 0),Ai([o.property({attribute:!1})],Di.prototype,"i18nProperties",void 0),Ai([o.property({attribute:!1})],Di.prototype,"ratingSummary",void 0),Ai([o.property({attribute:!1})],Di.prototype,"user",void 0),Ai([o.query(".ft-reader-feedback--feedback-input")],Di.prototype,"feedbackInput",void 0),Ai([o.state()],Di.prototype,"feedbackMessage",void 0),Ai([o.property()],Di.prototype,"iconVariant",void 0),Ai([o.property()],Di.prototype,"emptyStarIcon",void 0),Ai([o.property()],Di.prototype,"filledStarIcon",void 0),Ai([o.property()],Di.prototype,"emptyLikeIcon",void 0),Ai([o.property()],Di.prototype,"filledLikeIcon",void 0),Ai([o.property()],Di.prototype,"emptyDislikeIcon",void 0),Ai([o.property()],Di.prototype,"filledDislikeIcon",void 0),Ai([o.property()],Di.prototype,"feedbackMailLinkBuilder",void 0);const Mi=zi.fromGwt("server");class Bi{constructor(){this.subject="",this.url="",this.subjectMetadata="",this.bodyMetadata="",this.isAuthenticated=!1}update(t,e,i,o,s){var n;this.subject=t,this.url=e,this.configuration=o,this.isAuthenticated=s,this.subjectMetadata=this.filterMetadata(i,o.subjectMetadataIds).map((t=>"["+t.values[t.values.length-1]+"]")).join(""),this.bodyMetadata=this.filterMetadata(i,null!==(n=o.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,i;if(0===t.length||this.isAuthenticated&&(null==this.configuration||(null===(e=this.configuration)||void 0===e?void 0:e.mailsSentByFluidTopics)))return;const o=encodeURIComponent(this.subject+" "+this.subjectMetadata),s=encodeURIComponent(`\n${this.bodyMetadata}\n${this.url}\n_________________________________________________________________\n\n${t}\n\n_________________________________________________________________\n${Mi.messages["mail.feedback.disclaimer"]()}`);return`mailto:${null===(i=this.configuration)||void 0===i?void 0:i.recipients.join(",")}?subject=${o}&body=${s}`}}var Ui=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Fi extends(ki(d)){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.iconVariant=we.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 Bi,this.i18nProperties={feedbackMainTitle:Oi.properties.mapFeedbackMainTitle(),ratingSectionTitle:Oi.properties.mapRatingSectionTitle(),dichotomousRatingSectionTitle:Oi.properties.mapDichotomousRatingSectionTitle(),feedbackSectionTitle:Oi.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)?i.html`
|
|
1181
1185
|
<ft-reader-feedback
|
|
1182
1186
|
ratingAllowed
|
|
1183
1187
|
.i18nProperties=${this.i18nProperties}
|
|
@@ -1203,7 +1207,7 @@ const ue=Symbol.for(""),be=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
1203
1207
|
display: none !important;
|
|
1204
1208
|
}
|
|
1205
1209
|
</style>
|
|
1206
|
-
`}get componentVisible(){var t;return!!this.user&&this.user.roles.includes("FEEDBACK_USER")||!!this.user&&this.user.roles.includes("RATING_USER")&&"NO_RATING"!==(null===(t=this.ratingSummary)||void 0===t?void 0:t.type)}updated(t){var e,i,o;super.updated(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!==(i=null===(e=this.service)||void 0===e?void 0:e.getLink())&&void 0!==i?i:"",this.map.metadata,this.configuration,null!=(null===(o=this.user)||void 0===o?void 0:o.userId))}connectedCallback(){super.connectedCallback(),this.updateData()}onStoreAvailable(t){super.onStoreAvailable(t),this.updateData()}updateData(){this.updateDebouncer.run((async()=>{var t,e;this.map&&((null===(t=this.user)||void 0===t?void 0:t.userId)||null==this.ratingSummary)&&(this.ratingSummary=await(null===(e=this.service)||void 0===e?void 0:e.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 i,o,s;if(!this.editorMode&&this.ratingSummary){try{null==t?await(null===(i=this.service)||void 0===i?void 0:i.unrateMap()):await(null===(o=this.service)||void 0===o?void 0:o.rateMap(null===(s=this.ratingSummary)||void 0===s?void 0:s.type,t))}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:Oi.messages.ratingFailure()}))}this.updateData()}else this.editorMode&&this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:Ei.messages.feedbackAndRatingDisabledInEditor()}))}async sendFeedback(t){var i;try{this.editorMode?this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:Ei.messages.feedbackAndRatingDisabledInEditor()})):(await(null===(i=this.service)||void 0===i?void 0:i.sendMapFeedback(t.detail)),this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:Oi.messages.feedbackSuccess()}))),this.readerFeedback.clearFeedbackInput()}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:Oi.messages.feedbackFailure()}))}}onMailerFeedbackSent(){this.dispatchEvent(new CustomEvent("ft-reader-mailer-map-feedback",{composed:!0,bubbles:!0}))}}
|
|
1210
|
+
`}get componentVisible(){var t;return!!this.user&&this.user.roles.includes("FEEDBACK_USER")||!!this.user&&this.user.roles.includes("RATING_USER")&&"NO_RATING"!==(null===(t=this.ratingSummary)||void 0===t?void 0:t.type)}updated(t){var e,i,o;super.updated(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!==(i=null===(e=this.service)||void 0===e?void 0:e.getLink())&&void 0!==i?i:"",this.map.metadata,this.configuration,null!=(null===(o=this.user)||void 0===o?void 0:o.userId))}connectedCallback(){super.connectedCallback(),this.updateData()}onStoreAvailable(t){super.onStoreAvailable(t),this.updateData()}updateData(){this.updateDebouncer.run((async()=>{var t,e;this.map&&((null===(t=this.user)||void 0===t?void 0:t.userId)||null==this.ratingSummary)&&(this.ratingSummary=await(null===(e=this.service)||void 0===e?void 0:e.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 i,o,s;if(!this.editorMode&&this.ratingSummary){try{null==t?await(null===(i=this.service)||void 0===i?void 0:i.unrateMap()):await(null===(o=this.service)||void 0===o?void 0:o.rateMap(null===(s=this.ratingSummary)||void 0===s?void 0:s.type,t))}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:Oi.messages.ratingFailure()}))}this.updateData()}else this.editorMode&&this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:Ei.messages.feedbackAndRatingDisabledInEditor()}))}async sendFeedback(t){var i;try{this.editorMode?this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:Ei.messages.feedbackAndRatingDisabledInEditor()})):(await(null===(i=this.service)||void 0===i?void 0:i.sendMapFeedback(t.detail)),this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:Oi.messages.feedbackSuccess()}))),this.readerFeedback.clearFeedbackInput()}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:Oi.messages.feedbackFailure()}))}}onMailerFeedbackSent(){this.dispatchEvent(new CustomEvent("ft-reader-mailer-map-feedback",{composed:!0,bubbles:!0}))}}Fi.elementDefinitions={"ft-reader-feedback":Di},Ui([e.redux({store:pi.name,selector:t=>{var e;return null===(e=t.session)||void 0===e?void 0:e.profile}})],Fi.prototype,"user",void 0),Ui([e.redux({store:"reader"})],Fi.prototype,"map",void 0),Ui([e.redux({store:pi.name})],Fi.prototype,"editorMode",void 0),Ui([e.redux({store:"reader",selector:t=>{var e;return null===(e=t.configuration)||void 0===e?void 0:e.feedback}})],Fi.prototype,"configuration",void 0),Ui([o.state()],Fi.prototype,"ratingSummary",void 0),Ui([o.property({type:Boolean})],Fi.prototype,"hideTitle",void 0),Ui([o.property()],Fi.prototype,"iconVariant",void 0),Ui([o.property()],Fi.prototype,"emptyStarIcon",void 0),Ui([o.property()],Fi.prototype,"filledStarIcon",void 0),Ui([o.property()],Fi.prototype,"emptyLikeIcon",void 0),Ui([o.property()],Fi.prototype,"filledLikeIcon",void 0),Ui([o.property()],Fi.prototype,"emptyDislikeIcon",void 0),Ui([o.property()],Fi.prototype,"filledDislikeIcon",void 0),Ui([o.query("ft-reader-feedback")],Fi.prototype,"readerFeedback",void 0),Ui([Ti(Mi.properties["mail.map_feedback.subject"]((t=>{var e;return[null===(e=t.map)||void 0===e?void 0:e.title]})))],Fi.prototype,"mailSubject",void 0);var ji=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Li extends Event{constructor(){super("register-ft-reader-topic-component",{bubbles:!0,composed:!0})}}const Pi=Symbol("registerInterval");class Hi extends(function(t){var e;class i extends t{constructor(){super(...arguments),this.disableContextInteractions=!1,this[e]=0}connectedCallback(){super.connectedCallback(),this[Pi]=window.setInterval((()=>this.tryToRegisterToTopicContext()),50)}tryToRegisterToTopicContext(){null!=this.tocNode?window.clearInterval(this[Pi]):this.dispatchEvent(new Li)}disconnectedCallback(){super.disconnectedCallback(),this.tocNode=void 0}}return e=Pi,ji([o.state()],i.prototype,"tocNode",void 0),ji([o.state()],i.prototype,"disableContextInteractions",void 0),i}(d)){}var Zi=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Wi extends(ki(Hi)){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.iconVariant=we.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 Bi,this.i18nProperties={feedbackMainTitle:Oi.properties.topicFeedbackMainTitle(),ratingSectionTitle:Oi.properties.topicRatingSectionTitle(),dichotomousRatingSectionTitle:Oi.properties.topicDichotomousRatingSectionTitle(),feedbackSectionTitle:Oi.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)?i.html`
|
|
1207
1211
|
<ft-reader-feedback
|
|
1208
1212
|
.i18nProperties=${this.i18nProperties}
|
|
1209
1213
|
?ratingAllowed=${this.tocNode.hasRating}
|
|
@@ -1229,4 +1233,4 @@ const ue=Symbol.for(""),be=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
1229
1233
|
display: none !important;
|
|
1230
1234
|
}
|
|
1231
1235
|
</style>
|
|
1232
|
-
`}get componentVisible(){var t;return!!this.user&&this.user.roles.includes("FEEDBACK_USER")||!!this.user&&this.user.roles.includes("RATING_USER")&&"NO_RATING"!==(null===(t=this.ratingSummary)||void 0===t?void 0:t.type)}updated(t){var e,i,o;super.updated(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!==(i=null===(e=this.service)||void 0===e?void 0:e.getLink(this.tocNode.tocId))&&void 0!==i?i:"",this.map.metadata,this.configuration,null!=(null===(o=this.user)||void 0===o?void 0:o.userId))}connectedCallback(){super.connectedCallback(),this.updateData()}updateData(){this.updateDebouncer.run((async()=>{var t,e;this.tocNode&&((null===(t=this.user)||void 0===t?void 0:t.userId)||null==this.ratingSummary)&&(this.ratingSummary=await(null===(e=this.service)||void 0===e?void 0:e.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 i,o,s;if(!this.editorMode&&this.ratingSummary&&this.tocNode){try{null==t?await(null===(i=this.service)||void 0===i?void 0:i.unrateTopic(this.tocNode.tocId)):await(null===(o=this.service)||void 0===o?void 0:o.rateTopic(this.tocNode.tocId,null===(s=this.ratingSummary)||void 0===s?void 0:s.type,t))}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:Oi.messages.ratingFailure()}))}this.updateData()}else this.editorMode&&this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:Ei.messages.feedbackAndRatingDisabledInEditor()}))}async sendFeedback(t){var i;try{!this.editorMode&&this.tocNode?(await(null===(i=this.service)||void 0===i?void 0:i.sendTopicFeedback(this.tocNode.tocId,t.detail)),this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:Oi.messages.feedbackSuccess()})),this.readerFeedback.clearFeedbackInput()):this.editorMode&&this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:Ei.messages.feedbackAndRatingDisabledInEditor()}))}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:Oi.messages.feedbackFailure()}))}}onMailerFeedbackSent(){const t=this.tocNode;this.dispatchEvent(new CustomEvent("ft-reader-mailer-topic-feedback",{detail:{topic:t},composed:!0,bubbles:!0}))}}Wi.elementDefinitions={"ft-reader-feedback":Di},
|
|
1236
|
+
`}get componentVisible(){var t;return!!this.user&&this.user.roles.includes("FEEDBACK_USER")||!!this.user&&this.user.roles.includes("RATING_USER")&&"NO_RATING"!==(null===(t=this.ratingSummary)||void 0===t?void 0:t.type)}updated(t){var e,i,o;super.updated(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!==(i=null===(e=this.service)||void 0===e?void 0:e.getLink(this.tocNode.tocId))&&void 0!==i?i:"",this.map.metadata,this.configuration,null!=(null===(o=this.user)||void 0===o?void 0:o.userId))}connectedCallback(){super.connectedCallback(),this.updateData()}updateData(){this.updateDebouncer.run((async()=>{var t,e;this.tocNode&&((null===(t=this.user)||void 0===t?void 0:t.userId)||null==this.ratingSummary)&&(this.ratingSummary=await(null===(e=this.service)||void 0===e?void 0:e.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 i,o,s;if(!this.editorMode&&this.ratingSummary&&this.tocNode){try{null==t?await(null===(i=this.service)||void 0===i?void 0:i.unrateTopic(this.tocNode.tocId)):await(null===(o=this.service)||void 0===o?void 0:o.rateTopic(this.tocNode.tocId,null===(s=this.ratingSummary)||void 0===s?void 0:s.type,t))}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:Oi.messages.ratingFailure()}))}this.updateData()}else this.editorMode&&this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:Ei.messages.feedbackAndRatingDisabledInEditor()}))}async sendFeedback(t){var i;try{!this.editorMode&&this.tocNode?(await(null===(i=this.service)||void 0===i?void 0:i.sendTopicFeedback(this.tocNode.tocId,t.detail)),this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:Oi.messages.feedbackSuccess()})),this.readerFeedback.clearFeedbackInput()):this.editorMode&&this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:Ei.messages.feedbackAndRatingDisabledInEditor()}))}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:Oi.messages.feedbackFailure()}))}}onMailerFeedbackSent(){const t=this.tocNode;this.dispatchEvent(new CustomEvent("ft-reader-mailer-topic-feedback",{detail:{topic:t},composed:!0,bubbles:!0}))}}Wi.elementDefinitions={"ft-reader-feedback":Di},Zi([e.redux({store:pi.name,selector:t=>{var e;return null===(e=t.session)||void 0===e?void 0:e.profile}})],Wi.prototype,"user",void 0),Zi([e.redux({store:"reader"})],Wi.prototype,"map",void 0),Zi([e.redux({store:pi.name})],Wi.prototype,"editorMode",void 0),Zi([e.redux({store:"reader",selector:t=>{var e;return null===(e=t.configuration)||void 0===e?void 0:e.feedback}})],Wi.prototype,"configuration",void 0),Zi([o.state()],Wi.prototype,"ratingSummary",void 0),Zi([o.property({type:Boolean})],Wi.prototype,"hideTitle",void 0),Zi([o.property()],Wi.prototype,"iconVariant",void 0),Zi([o.property()],Wi.prototype,"emptyStarIcon",void 0),Zi([o.property()],Wi.prototype,"filledStarIcon",void 0),Zi([o.property()],Wi.prototype,"emptyLikeIcon",void 0),Zi([o.property()],Wi.prototype,"filledLikeIcon",void 0),Zi([o.property()],Wi.prototype,"emptyDislikeIcon",void 0),Zi([o.property()],Wi.prototype,"filledDislikeIcon",void 0),Zi([o.query("ft-reader-feedback")],Wi.prototype,"readerFeedback",void 0),Zi([Ti(Mi.properties["mail.feedback.subject"]((t=>{var e,i;return[null===(e=t.tocNode)||void 0===e?void 0:e.title,null===(i=t.map)||void 0===i?void 0:i.title]})))],Wi.prototype,"mailSubject",void 0),e.customElement("ft-reader-map-feedback")(Fi),e.customElement("ft-reader-topic-feedback")(Wi),t.FtReaderFeedbackCssVariables=Tt,t.FtReaderMapFeedback=Fi,t.FtReaderTopicFeedback=Wi,t.styles=Ot}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litUnsafeHTML,ftGlobals.litClassMap,ftGlobals.litRepeat);
|