@fluid-topics/ft-reader-feedback 1.0.55 → 1.0.56
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.js +1 -1
- package/build/ft-reader-feedback.light.js +207 -191
- package/build/ft-reader-feedback.min.js +34 -18
- package/build/ft-reader-map-feedback.d.ts +1 -1
- package/build/ft-reader-map-feedback.js +2 -2
- package/build/ft-reader-topic-feedback.d.ts +1 -1
- package/build/ft-reader-topic-feedback.js +2 -2
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t,i,
|
|
1
|
+
!function(t,e,i,o,s,n,r){var a=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 l extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}const h=Symbol("registerInterval");class d extends(function(t){var e;class i extends t{constructor(){super(...arguments),this[e]=0}setReaderStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"reader")}clearStateManager(){this.stateManager&&(this.removeStore("reader"),this.stateManager=void 0)}get service(){var t;return null===(t=this.stateManager)||void 0===t?void 0:t.service}connectedCallback(){super.connectedCallback(),this[h]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[h]):this.dispatchEvent(new l)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=h,a([o.state()],i.prototype,"stateManager",void 0),i}(e.FtLitElementRedux)){}const f=e.FtCssVariableFactory.extend("--ft-ripple-color",e.designSystemVariables.colorContent),c={color:f,backgroundColor:e.FtCssVariableFactory.extend("--ft-ripple-background-color",f),opacityContentOnSurfacePressed:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceSelected,"Design system"),borderRadius:e.FtCssVariableFactory.create("--ft-ripple-border-radius","SIZE","0px")},p=e.FtCssVariableFactory.extend("--ft-ripple-color",e.designSystemVariables.colorPrimary),u=p,v=e.FtCssVariableFactory.extend("--ft-ripple-background-color",p),b=e.FtCssVariableFactory.extend("--ft-ripple-color",e.designSystemVariables.colorSecondary),g=b,x=e.FtCssVariableFactory.extend("--ft-ripple-background-color",b),y=i.css`
|
|
2
2
|
:host {
|
|
3
3
|
display: contents;
|
|
4
4
|
}
|
|
@@ -20,6 +20,30 @@
|
|
|
20
20
|
opacity: 0;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
.ft-ripple .ft-ripple--effect {
|
|
24
|
+
aspect-ratio: 1;
|
|
25
|
+
width: auto;
|
|
26
|
+
height: auto;
|
|
27
|
+
min-width: 170%;
|
|
28
|
+
min-height: 170%;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.ft-ripple .ft-ripple--background{
|
|
32
|
+
width: 100%;
|
|
33
|
+
height: 100%;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--effect,
|
|
37
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
38
|
+
aspect-ratio: 1;
|
|
39
|
+
width: auto;
|
|
40
|
+
height: auto;
|
|
41
|
+
max-width: unset;
|
|
42
|
+
max-height: unset;
|
|
43
|
+
min-width: 100%;
|
|
44
|
+
min-height: 100%;
|
|
45
|
+
}
|
|
46
|
+
|
|
23
47
|
.ft-ripple .ft-ripple--background {
|
|
24
48
|
background-color: ${c.backgroundColor};
|
|
25
49
|
}
|
|
@@ -47,8 +71,6 @@
|
|
|
47
71
|
.ft-ripple .ft-ripple--background {
|
|
48
72
|
top: 0;
|
|
49
73
|
left: 0;
|
|
50
|
-
height: 100%;
|
|
51
|
-
width: 100%;
|
|
52
74
|
transition: opacity 75ms linear;
|
|
53
75
|
}
|
|
54
76
|
|
|
@@ -88,7 +110,7 @@
|
|
|
88
110
|
opacity: ${c.opacityContentOnSurfacePressed};
|
|
89
111
|
transform: translate(-50%, -50%) scale(1);
|
|
90
112
|
}
|
|
91
|
-
`,m=
|
|
113
|
+
`,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")},S={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")},_=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-family",$),E=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-size",w.fontSize,"16px"),I=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-weight",w.fontWeight,"600"),T=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-letter-spacing",w.letterSpacing,"0.144px"),R=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-line-height",w.lineHeight,"1.5"),A=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-text-transform",w.textTransform,"inherit"),O=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-family",$),C=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-size",w.fontSize,"14px"),N=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-weight",w.fontWeight,"normal"),U=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"),z=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")},M=e.FtCssVariableFactory.extend("--ft-typography-body2-font-family",$),F=e.FtCssVariableFactory.extend("--ft-typography-body2-font-size",w.fontSize,"14px"),L=e.FtCssVariableFactory.extend("--ft-typography-body2-font-weight",w.fontWeight,"normal"),P=e.FtCssVariableFactory.extend("--ft-typography-body2-letter-spacing",w.letterSpacing,"0.252px"),j=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")},K=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"),W=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-letter-spacing",w.letterSpacing,"0.33px"),X=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-line-height",w.lineHeight,"1.6"),Y=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-text-transform",w.textTransform,"inherit"),q=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
114
|
.ft-typography--title {
|
|
93
115
|
font-family: ${k.fontFamily};
|
|
94
116
|
font-size: ${k.fontSize};
|
|
@@ -97,7 +119,7 @@
|
|
|
97
119
|
line-height: ${k.lineHeight};
|
|
98
120
|
text-transform: ${k.textTransform};
|
|
99
121
|
}
|
|
100
|
-
`,nt=
|
|
122
|
+
`,nt=i.css`
|
|
101
123
|
.ft-typography--title-dense {
|
|
102
124
|
font-family: ${S.fontFamily};
|
|
103
125
|
font-size: ${S.fontSize};
|
|
@@ -106,18 +128,18 @@
|
|
|
106
128
|
line-height: ${S.lineHeight};
|
|
107
129
|
text-transform: ${S.textTransform};
|
|
108
130
|
}
|
|
109
|
-
`,rt=
|
|
131
|
+
`,rt=i.css`
|
|
110
132
|
.ft-typography--subtitle1 {
|
|
111
133
|
font-family: ${_};
|
|
112
134
|
font-size: ${E};
|
|
113
135
|
font-weight: ${I};
|
|
114
136
|
letter-spacing: ${T};
|
|
115
137
|
line-height: ${R};
|
|
116
|
-
text-transform: ${
|
|
138
|
+
text-transform: ${A};
|
|
117
139
|
}
|
|
118
|
-
`,at=
|
|
140
|
+
`,at=i.css`
|
|
119
141
|
.ft-typography--subtitle2 {
|
|
120
|
-
font-family: ${
|
|
142
|
+
font-family: ${O};
|
|
121
143
|
font-size: ${C};
|
|
122
144
|
font-weight: ${N};
|
|
123
145
|
letter-spacing: ${U};
|
|
@@ -125,7 +147,7 @@
|
|
|
125
147
|
text-transform: ${z};
|
|
126
148
|
}
|
|
127
149
|
|
|
128
|
-
`,lt=
|
|
150
|
+
`,lt=i.css`
|
|
129
151
|
.ft-typography--body1 {
|
|
130
152
|
font-family: ${B.fontFamily};
|
|
131
153
|
font-size: ${B.fontSize};
|
|
@@ -134,7 +156,7 @@
|
|
|
134
156
|
line-height: ${B.lineHeight};
|
|
135
157
|
text-transform: ${B.textTransform};
|
|
136
158
|
}
|
|
137
|
-
`,ht=
|
|
159
|
+
`,ht=i.css`
|
|
138
160
|
.ft-typography--body2 {
|
|
139
161
|
font-family: ${M};
|
|
140
162
|
font-size: ${F};
|
|
@@ -143,7 +165,7 @@
|
|
|
143
165
|
line-height: ${j};
|
|
144
166
|
text-transform: ${H};
|
|
145
167
|
}
|
|
146
|
-
`,dt=
|
|
168
|
+
`,dt=i.css`
|
|
147
169
|
.ft-typography--caption {
|
|
148
170
|
font-family: ${Z.fontFamily};
|
|
149
171
|
font-size: ${Z.fontSize};
|
|
@@ -152,7 +174,7 @@
|
|
|
152
174
|
line-height: ${Z.lineHeight};
|
|
153
175
|
text-transform: ${Z.textTransform};
|
|
154
176
|
}
|
|
155
|
-
`,ft=
|
|
177
|
+
`,ft=i.css`
|
|
156
178
|
.ft-typography--breadcrumb {
|
|
157
179
|
font-family: ${K};
|
|
158
180
|
font-size: ${V};
|
|
@@ -161,16 +183,16 @@
|
|
|
161
183
|
line-height: ${X};
|
|
162
184
|
text-transform: ${Y};
|
|
163
185
|
}
|
|
164
|
-
`,ct=
|
|
186
|
+
`,ct=i.css`
|
|
165
187
|
.ft-typography--overline {
|
|
166
188
|
font-family: ${q};
|
|
167
189
|
font-size: ${J};
|
|
168
190
|
font-weight: ${Q};
|
|
169
191
|
letter-spacing: ${tt};
|
|
170
|
-
line-height: ${
|
|
171
|
-
text-transform: ${
|
|
192
|
+
line-height: ${et};
|
|
193
|
+
text-transform: ${it};
|
|
172
194
|
}
|
|
173
|
-
`,pt=
|
|
195
|
+
`,pt=i.css`
|
|
174
196
|
.ft-typography--button {
|
|
175
197
|
font-family: ${ot.fontFamily};
|
|
176
198
|
font-size: ${ot.fontSize};
|
|
@@ -179,11 +201,11 @@
|
|
|
179
201
|
line-height: ${ot.lineHeight};
|
|
180
202
|
text-transform: ${ot.textTransform};
|
|
181
203
|
}
|
|
182
|
-
`,ut=
|
|
204
|
+
`,ut=i.css`
|
|
183
205
|
.ft-typography {
|
|
184
206
|
vertical-align: inherit;
|
|
185
207
|
}
|
|
186
|
-
`,vt={color:
|
|
208
|
+
`,vt={color:e.FtCssVariableFactory.extend("--ft-loader-color",e.designSystemVariables.colorPrimary),size:e.FtCssVariableFactory.create("--ft-loader-size","SIZE","80px")},bt=i.css`
|
|
187
209
|
:host {
|
|
188
210
|
line-height: 0;
|
|
189
211
|
}
|
|
@@ -252,7 +274,7 @@
|
|
|
252
274
|
transform: translate(calc(0.35 * ${vt.size}), 0);
|
|
253
275
|
}
|
|
254
276
|
}
|
|
255
|
-
`,gt={size:
|
|
277
|
+
`,gt={size:e.FtCssVariableFactory.create("--ft-icon-font-size","SIZE","24px"),fluidTopicsFontFamily:e.FtCssVariableFactory.extend("--ft-icon-fluid-topics-font-family",e.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-icons")),fileFormatFontFamily:e.FtCssVariableFactory.extend("--ft-icon-file-format-font-family",e.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-mime")),materialFontFamily:e.FtCssVariableFactory.extend("--ft-icon-material-font-family",e.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","Material Icons")),verticalAlign:e.FtCssVariableFactory.create("--ft-icon-vertical-align","UNKNOWN","unset")},xt=i.css`
|
|
256
278
|
:host, i.ft-icon {
|
|
257
279
|
display: inline-flex;
|
|
258
280
|
align-items: center;
|
|
@@ -300,7 +322,7 @@
|
|
|
300
322
|
.ft-icon--material {
|
|
301
323
|
font-family: ${gt.materialFontFamily}, "Material Icons", sans-serif;
|
|
302
324
|
}
|
|
303
|
-
`,yt=
|
|
325
|
+
`,yt=e.FtCssVariableFactory.extend("--ft-button-color",e.designSystemVariables.colorPrimary),mt={backgroundColor:e.FtCssVariableFactory.extend("--ft-button-background-color",e.designSystemVariables.colorSurface),borderRadius:e.FtCssVariableFactory.extend("--ft-button-border-radius",e.designSystemVariables.borderRadiusL),color:yt,fontSize:e.FtCssVariableFactory.extend("--ft-button-font-size",ot.fontSize),iconSize:e.FtCssVariableFactory.create("--ft-button-icon-size","SIZE","24px"),rippleColor:e.FtCssVariableFactory.extend("--ft-button-ripple-color",yt),verticalPadding:e.FtCssVariableFactory.create("--ft-button-vertical-padding","SIZE","6px"),horizontalPadding:e.FtCssVariableFactory.create("--ft-button-horizontal-padding","SIZE","8px"),iconPadding:e.FtCssVariableFactory.create("--ft-button-icon-padding","SIZE","8px"),opacityDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOpacityDisabled,"Design system")},$t=e.FtCssVariableFactory.extend("--ft-button-primary-color",e.FtCssVariableFactory.extend("--ft-button-color",e.designSystemVariables.colorOnPrimary)),wt={backgroundColor:e.FtCssVariableFactory.extend("--ft-button-primary-background-color",e.FtCssVariableFactory.extend("--ft-button-background-color",e.designSystemVariables.colorPrimary)),color:$t,rippleColor:e.FtCssVariableFactory.extend("--ft-button-primary-ripple-color",$t)},kt=e.FtCssVariableFactory.extend("--ft-button-dense-border-radius",e.FtCssVariableFactory.extend("--ft-button-border-radius",e.designSystemVariables.borderRadiusM)),St=e.FtCssVariableFactory.create("--ft-button-dense-vertical-padding","SIZE","2px"),_t=e.FtCssVariableFactory.create("--ft-button-dense-horizontal-padding","SIZE","4px"),Et=e.FtCssVariableFactory.create("--ft-button-dense-icon-padding","SIZE","4px"),It=[i.css`
|
|
304
326
|
:host {
|
|
305
327
|
display: inline-block;
|
|
306
328
|
max-width: 100%;
|
|
@@ -342,8 +364,8 @@
|
|
|
342
364
|
|
|
343
365
|
--ft-button-internal-line-height: max(calc(${mt.fontSize} + 2px), ${mt.iconSize});
|
|
344
366
|
--ft-button-internal-color: ${mt.color};
|
|
345
|
-
${
|
|
346
|
-
${
|
|
367
|
+
${e.setVariable(gt.size,mt.iconSize)};
|
|
368
|
+
${e.setVariable(c.color,mt.rippleColor)};
|
|
347
369
|
|
|
348
370
|
border-radius: ${mt.borderRadius};
|
|
349
371
|
padding: ${mt.verticalPadding} ${mt.horizontalPadding};
|
|
@@ -387,7 +409,7 @@
|
|
|
387
409
|
.ft-button.ft-button--primary {
|
|
388
410
|
background-color: ${wt.backgroundColor};
|
|
389
411
|
--ft-button-internal-color: ${wt.color};
|
|
390
|
-
${
|
|
412
|
+
${e.setVariable(c.color,wt.rippleColor)};
|
|
391
413
|
}
|
|
392
414
|
|
|
393
415
|
.ft-button:focus {
|
|
@@ -401,8 +423,8 @@
|
|
|
401
423
|
text-overflow: ellipsis;
|
|
402
424
|
display: block;
|
|
403
425
|
margin: 0 ${mt.iconPadding};
|
|
404
|
-
${
|
|
405
|
-
${
|
|
426
|
+
${e.setVariable(ot.fontSize,"1em")};
|
|
427
|
+
${e.setVariable(ot.lineHeight,"var(--ft-button-internal-line-height)")};
|
|
406
428
|
}
|
|
407
429
|
|
|
408
430
|
.ft-button--dense .ft-button--label {
|
|
@@ -434,10 +456,10 @@
|
|
|
434
456
|
}
|
|
435
457
|
|
|
436
458
|
ft-loader {
|
|
437
|
-
${
|
|
438
|
-
${
|
|
459
|
+
${e.setVariable(vt.size,mt.iconSize)};
|
|
460
|
+
${e.setVariable(vt.color,"var(--ft-button-internal-color)")};
|
|
439
461
|
}
|
|
440
|
-
`,
|
|
462
|
+
`,e.noTextSelect],Tt={textColor:e.FtCssVariableFactory.extend("--ft-switch-text-color",e.designSystemVariables.colorOnSurfaceHigh),backgroundColor:e.FtCssVariableFactory.extend("--ft-switch-background-color",e.designSystemVariables.colorSurface),selectedTextColor:e.FtCssVariableFactory.extend("--ft-switch-selected-text-color",e.designSystemVariables.colorPrimary),selectedBackgroundColor:e.FtCssVariableFactory.extend("--ft-switch-selected-background-color",e.designSystemVariables.colorPrimary),borderColor:e.FtCssVariableFactory.extend("--ft-switch-border-color",e.designSystemVariables.colorOutline),borderRadius:e.FtCssVariableFactory.extend("--ft-switch-border-radius",e.designSystemVariables.borderRadiusL),fontSize:e.FtCssVariableFactory.extend("--ft-switch-font-size",ot.fontSize),iconSize:e.FtCssVariableFactory.create("--ft-switch-icon-size","SIZE","24px"),iconColor:e.FtCssVariableFactory.extend("--ft-switch-text-color",e.designSystemVariables.colorOnSurfaceMedium),rippleColor:e.FtCssVariableFactory.extend("--ft-switch-ripple-color",e.designSystemVariables.colorPrimary),outlineColor:e.FtCssVariableFactory.extend("--ft-switch-outline-color",e.designSystemVariables.colorPrimary)},Rt={feedbackInputMinWidth:e.FtCssVariableFactory.create("--ft-reader-feedback-input-min-width","SIZE","300px"),ratedDateColor:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceMedium,"Design system"),sendFeedbackColor:e.FtCssVariableFactory.extend("--ft-reader-feedback-send-feedback-color",e.designSystemVariables.colorOnPrimary),sendFeedbackBackgroundColor:e.FtCssVariableFactory.extend("--ft-reader-feedback-send-feedback-background-color",e.designSystemVariables.colorPrimary),filledRatingColor:e.FtCssVariableFactory.extend("--ft-reader-feedback-filled-rating-color",e.designSystemVariables.colorPrimary),emptyRatingColor:e.FtCssVariableFactory.extend("--ft-reader-feedback-empty-rating-color",e.designSystemVariables.colorOnSurfaceMedium),mainTitleFontSize:e.FtCssVariableFactory.external(k.fontSize,"Typography"),sectionTitleFontSize:e.FtCssVariableFactory.external(S.fontSize,"Typography")},At=i.css`
|
|
441
463
|
.ft-reader-feedback {
|
|
442
464
|
box-sizing: border-box;
|
|
443
465
|
display: flex;
|
|
@@ -483,14 +505,14 @@
|
|
|
483
505
|
}
|
|
484
506
|
|
|
485
507
|
.ft-reader-feedback--rating {
|
|
486
|
-
${
|
|
487
|
-
${
|
|
488
|
-
${
|
|
489
|
-
${
|
|
508
|
+
${e.setVariable(mt.color,Rt.emptyRatingColor)};
|
|
509
|
+
${e.setVariable(mt.rippleColor,Rt.filledRatingColor)};
|
|
510
|
+
${e.setVariable(Tt.textColor,Rt.emptyRatingColor)};
|
|
511
|
+
${e.setVariable(Tt.selectedTextColor,Rt.filledRatingColor)};
|
|
490
512
|
}
|
|
491
513
|
|
|
492
514
|
.ft-reader-feedback--rating .ft-reader-feedback--active {
|
|
493
|
-
${
|
|
515
|
+
${e.setVariable(mt.color,Rt.filledRatingColor)};
|
|
494
516
|
}
|
|
495
517
|
|
|
496
518
|
.ft-reader-feedback--feedback {
|
|
@@ -507,33 +529,33 @@
|
|
|
507
529
|
|
|
508
530
|
.ft-reader-feedback--send-feedback, .ft-reader-feedback--feedback-link {
|
|
509
531
|
align-self: flex-end;
|
|
510
|
-
${
|
|
511
|
-
${
|
|
532
|
+
${e.setVariable(mt.color,Rt.sendFeedbackColor)};
|
|
533
|
+
${e.setVariable(mt.backgroundColor,Rt.sendFeedbackBackgroundColor)};
|
|
512
534
|
}
|
|
513
|
-
`;!function(t){!function(i){var e={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(e.arrayBuffer)var o=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(t){return t&&o.indexOf(Object.prototype.toString.call(t))>-1};function n(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function r(t){return"string"!=typeof t&&(t=String(t)),t}function a(t){var i={next:function(){var i=t.shift();return{done:void 0===i,value:i}}};return e.iterable&&(i[Symbol.iterator]=function(){return i}),i}function l(t){this.map={},t instanceof l?t.forEach((function(t,i){this.append(i,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(i){this.append(i,t[i])}),this)}function h(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function d(t){return new Promise((function(i,e){t.onload=function(){i(t.result)},t.onerror=function(){e(t.error)}}))}function f(t){var i=new FileReader,e=d(i);return i.readAsArrayBuffer(t),e}function c(t){if(t.slice)return t.slice(0);var i=new Uint8Array(t.byteLength);return i.set(new Uint8Array(t)),i.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(t){var i;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:e.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:e.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:e.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():e.arrayBuffer&&e.blob&&((i=t)&&DataView.prototype.isPrototypeOf(i))?(this._bodyArrayBuffer=c(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):e.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||s(t))?this._bodyArrayBuffer=c(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):e.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},e.blob&&(this.blob=function(){var t=h(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(f)}),this.text=function(){var t,i,e,o=h(this);if(o)return o;if(this._bodyBlob)return t=this._bodyBlob,i=new FileReader,e=d(i),i.readAsText(t),e;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var i=new Uint8Array(t),e=new Array(i.length),o=0;o<i.length;o++)e[o]=String.fromCharCode(i[o]);return e.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},e.formData&&(this.formData=function(){return this.text().then(b)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(t,i){t=n(t),i=r(i);var e=this.map[t];this.map[t]=e?e+", "+i:i},l.prototype.delete=function(t){delete this.map[n(t)]},l.prototype.get=function(t){return t=n(t),this.has(t)?this.map[t]:null},l.prototype.has=function(t){return this.map.hasOwnProperty(n(t))},l.prototype.set=function(t,i){this.map[n(t)]=r(i)},l.prototype.forEach=function(t,i){for(var e in this.map)this.map.hasOwnProperty(e)&&t.call(i,this.map[e],e,this)},l.prototype.keys=function(){var t=[];return this.forEach((function(i,e){t.push(e)})),a(t)},l.prototype.values=function(){var t=[];return this.forEach((function(i){t.push(i)})),a(t)},l.prototype.entries=function(){var t=[];return this.forEach((function(i,e){t.push([e,i])})),a(t)},e.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var u=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function v(t,i){var e,o,s=(i=i||{}).body;if(t instanceof v){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,i.headers||(this.headers=new l(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,s||null==t._bodyInit||(s=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=i.credentials||this.credentials||"same-origin",!i.headers&&this.headers||(this.headers=new l(i.headers)),this.method=(e=i.method||this.method||"GET",o=e.toUpperCase(),u.indexOf(o)>-1?o:e),this.mode=i.mode||this.mode||null,this.signal=i.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&s)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(s)}function b(t){var i=new FormData;return t.trim().split("&").forEach((function(t){if(t){var e=t.split("="),o=e.shift().replace(/\+/g," "),s=e.join("=").replace(/\+/g," ");i.append(decodeURIComponent(o),decodeURIComponent(s))}})),i}function g(t,i){i||(i={}),this.type="default",this.status=void 0===i.status?200:i.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in i?i.statusText:"OK",this.headers=new l(i.headers),this.url=i.url||"",this._initBody(t)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},p.call(v.prototype),p.call(g.prototype),g.prototype.clone=function(){return new g(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},g.error=function(){var t=new g(null,{status:0,statusText:""});return t.type="error",t};var x=[301,302,303,307,308];g.redirect=function(t,i){if(-1===x.indexOf(i))throw new RangeError("Invalid status code");return new g(null,{status:i,headers:{location:t}})},i.DOMException=t.DOMException;try{new i.DOMException}catch(t){i.DOMException=function(t,i){this.message=t,this.name=i;var e=Error(t);this.stack=e.stack},i.DOMException.prototype=Object.create(Error.prototype),i.DOMException.prototype.constructor=i.DOMException}function y(t,o){return new Promise((function(s,n){var r=new v(t,o);if(r.signal&&r.signal.aborted)return n(new i.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function h(){a.abort()}a.onload=function(){var t,i,e={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",i=new l,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var e=t.split(":"),o=e.shift().trim();if(o){var s=e.join(":").trim();i.append(o,s)}})),i)};e.url="responseURL"in a?a.responseURL:e.headers.get("X-Request-URL");var o="response"in a?a.response:a.responseText;s(new g(o,e))},a.onerror=function(){n(new TypeError("Network request failed"))},a.ontimeout=function(){n(new TypeError("Network request failed"))},a.onabort=function(){n(new i.DOMException("Aborted","AbortError"))},a.open(r.method,r.url,!0),"include"===r.credentials?a.withCredentials=!0:"omit"===r.credentials&&(a.withCredentials=!1),"responseType"in a&&e.blob&&(a.responseType="blob"),r.headers.forEach((function(t,i){a.setRequestHeader(i,t)})),r.signal&&(r.signal.addEventListener("abort",h),a.onreadystatechange=function(){4===a.readyState&&r.signal.removeEventListener("abort",h)}),a.send(void 0===r._bodyInit?null:r._bodyInit)}))}y.polyfill=!0,t.fetch||(t.fetch=y,t.Headers=l,t.Request=v,t.Response=g),i.Headers=l,i.Request=v,i.Response=g,i.fetch=y,Object.defineProperty(i,"t",{value:!0})}({})}("undefined"!=typeof self?self:void 0);const At=t=>"object"==typeof t&&null!=t,Ct=t=>"string"==typeof t;var Nt,Ut,Dt,zt,Bt,Mt,Ft,Lt,Pt,jt,Ht,Zt;!function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"}(Nt||(Nt={})),function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"}(Ut||(Ut={})),function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER"}(Dt||(Dt={})),function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"}(zt||(zt={})),function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"}(Bt||(Bt={})),function(t){t.ASC="ASC",t.DESC="DESC"}(Mt||(Mt={})),function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"}(Ft||(Ft={})),function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK"}(Lt||(Lt={})),function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"}(Pt||(Pt={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"}(jt||(jt={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"}(Ht||(Ht={})),function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN",t.DEVELOPER="DEVELOPER"}(Zt||(Zt={}));const Kt=t=>At(t)&&(null==t.authenticationIdentifier||(t=>At(t)&&Ct(t.identifier)&&Ct(t.realm))(t.authenticationIdentifier))&&(t=>"number"==typeof t)(t.idleTimeoutInMillis)&&Vt(t.profile)&&(t=>"boolean"==typeof t)(t.sessionAuthenticated),Vt=t=>At(t)&&(null==t.emailAddress||Ct(t.emailAddress))&&(null==t.displayName||Ct(t.displayName))&&Array.isArray(t.roles)&&t.roles.every((t=>(t=>["PERSONAL_BOOK_USER","PERSONAL_BOOK_SHARE_USER","HTML_EXPORT_USER","PDF_EXPORT_USER","SAVED_SEARCH_USER","COLLECTION_USER","OFFLINE_USER","ANALYTICS_USER","BETA_USER","DEBUG_USER","PRINT_USER","RATING_USER","FEEDBACK_USER","CONTENT_PUBLISHER","KHUB_ADMIN","USERS_ADMIN","PORTAL_ADMIN","ADMIN","DEVELOPER"].includes(t))(t)))&&(null==t.userId||Ct(t.userId)),Gt={[Zt.PERSONAL_BOOK_SHARE_USER]:[Zt.PERSONAL_BOOK_USER],[Zt.HTML_EXPORT_USER]:[Zt.PERSONAL_BOOK_USER],[Zt.PDF_EXPORT_USER]:[Zt.PERSONAL_BOOK_USER],[Zt.KHUB_ADMIN]:[Zt.CONTENT_PUBLISHER],[Zt.ADMIN]:[Zt.KHUB_ADMIN,Zt.USERS_ADMIN,Zt.PORTAL_ADMIN],[Zt.DEVELOPER]:[Zt.BETA_USER,Zt.DEBUG_USER]};function Wt(t,i){return t===i||(Gt[t]??[]).some((t=>Wt(t,i)))}function Xt(t,i){return(Kt(t)?t.profile.roles:Vt(t)?t.roles:t).some((t=>Wt(t,i)))}
|
|
535
|
+
`;!function(t){!function(e){var i={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(i.arrayBuffer)var o=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(t){return t&&o.indexOf(Object.prototype.toString.call(t))>-1};function n(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function r(t){return"string"!=typeof t&&(t=String(t)),t}function a(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return i.iterable&&(e[Symbol.iterator]=function(){return e}),e}function l(t){this.map={},t instanceof l?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function h(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function d(t){return new Promise((function(e,i){t.onload=function(){e(t.result)},t.onerror=function(){i(t.error)}}))}function f(t){var e=new FileReader,i=d(e);return e.readAsArrayBuffer(t),i}function c(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:i.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:i.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:i.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():i.arrayBuffer&&i.blob&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=c(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||s(t))?this._bodyArrayBuffer=c(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i.blob&&(this.blob=function(){var t=h(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(f)}),this.text=function(){var t,e,i,o=h(this);if(o)return o;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,i=d(e),e.readAsText(t),i;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),i=new Array(e.length),o=0;o<e.length;o++)i[o]=String.fromCharCode(e[o]);return i.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i.formData&&(this.formData=function(){return this.text().then(b)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(t,e){t=n(t),e=r(e);var i=this.map[t];this.map[t]=i?i+", "+e:e},l.prototype.delete=function(t){delete this.map[n(t)]},l.prototype.get=function(t){return t=n(t),this.has(t)?this.map[t]:null},l.prototype.has=function(t){return this.map.hasOwnProperty(n(t))},l.prototype.set=function(t,e){this.map[n(t)]=r(e)},l.prototype.forEach=function(t,e){for(var i in this.map)this.map.hasOwnProperty(i)&&t.call(e,this.map[i],i,this)},l.prototype.keys=function(){var t=[];return this.forEach((function(e,i){t.push(i)})),a(t)},l.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),a(t)},l.prototype.entries=function(){var t=[];return this.forEach((function(e,i){t.push([i,e])})),a(t)},i.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var u=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function v(t,e){var i,o,s=(e=e||{}).body;if(t instanceof v){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new l(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,s||null==t._bodyInit||(s=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new l(e.headers)),this.method=(i=e.method||this.method||"GET",o=i.toUpperCase(),u.indexOf(o)>-1?o:i),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&s)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(s)}function b(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var i=t.split("="),o=i.shift().replace(/\+/g," "),s=i.join("=").replace(/\+/g," ");e.append(decodeURIComponent(o),decodeURIComponent(s))}})),e}function g(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new l(e.headers),this.url=e.url||"",this._initBody(t)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},p.call(v.prototype),p.call(g.prototype),g.prototype.clone=function(){return new g(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},g.error=function(){var t=new g(null,{status:0,statusText:""});return t.type="error",t};var x=[301,302,303,307,308];g.redirect=function(t,e){if(-1===x.indexOf(e))throw new RangeError("Invalid status code");return new g(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var i=Error(t);this.stack=i.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function y(t,o){return new Promise((function(s,n){var r=new v(t,o);if(r.signal&&r.signal.aborted)return n(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function h(){a.abort()}a.onload=function(){var t,e,i={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",e=new l,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var i=t.split(":"),o=i.shift().trim();if(o){var s=i.join(":").trim();e.append(o,s)}})),e)};i.url="responseURL"in a?a.responseURL:i.headers.get("X-Request-URL");var o="response"in a?a.response:a.responseText;s(new g(o,i))},a.onerror=function(){n(new TypeError("Network request failed"))},a.ontimeout=function(){n(new TypeError("Network request failed"))},a.onabort=function(){n(new e.DOMException("Aborted","AbortError"))},a.open(r.method,r.url,!0),"include"===r.credentials?a.withCredentials=!0:"omit"===r.credentials&&(a.withCredentials=!1),"responseType"in a&&i.blob&&(a.responseType="blob"),r.headers.forEach((function(t,e){a.setRequestHeader(e,t)})),r.signal&&(r.signal.addEventListener("abort",h),a.onreadystatechange=function(){4===a.readyState&&r.signal.removeEventListener("abort",h)}),a.send(void 0===r._bodyInit?null:r._bodyInit)}))}y.polyfill=!0,t.fetch||(t.fetch=y,t.Headers=l,t.Request=v,t.Response=g),e.Headers=l,e.Request=v,e.Response=g,e.fetch=y,Object.defineProperty(e,"t",{value:!0})}({})}("undefined"!=typeof self?self:void 0);const Ot=t=>"object"==typeof t&&null!=t,Ct=t=>"string"==typeof t;var Nt,Ut,Dt,zt,Bt,Mt,Ft,Lt,Pt,jt,Ht,Zt;!function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"}(Nt||(Nt={})),function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"}(Ut||(Ut={})),function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER"}(Dt||(Dt={})),function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"}(zt||(zt={})),function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"}(Bt||(Bt={})),function(t){t.ASC="ASC",t.DESC="DESC"}(Mt||(Mt={})),function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"}(Ft||(Ft={})),function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK"}(Lt||(Lt={})),function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"}(Pt||(Pt={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"}(jt||(jt={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"}(Ht||(Ht={})),function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN",t.DEVELOPER="DEVELOPER"}(Zt||(Zt={}));const Kt=t=>Ot(t)&&(null==t.authenticationIdentifier||(t=>Ot(t)&&Ct(t.identifier)&&Ct(t.realm))(t.authenticationIdentifier))&&(t=>"number"==typeof t)(t.idleTimeoutInMillis)&&Vt(t.profile)&&(t=>"boolean"==typeof t)(t.sessionAuthenticated),Vt=t=>Ot(t)&&(null==t.emailAddress||Ct(t.emailAddress))&&(null==t.displayName||Ct(t.displayName))&&Array.isArray(t.roles)&&t.roles.every((t=>(t=>["PERSONAL_BOOK_USER","PERSONAL_BOOK_SHARE_USER","HTML_EXPORT_USER","PDF_EXPORT_USER","SAVED_SEARCH_USER","COLLECTION_USER","OFFLINE_USER","ANALYTICS_USER","BETA_USER","DEBUG_USER","PRINT_USER","RATING_USER","FEEDBACK_USER","CONTENT_PUBLISHER","KHUB_ADMIN","USERS_ADMIN","PORTAL_ADMIN","ADMIN","DEVELOPER"].includes(t))(t)))&&(null==t.userId||Ct(t.userId)),Gt={[Zt.PERSONAL_BOOK_SHARE_USER]:[Zt.PERSONAL_BOOK_USER],[Zt.HTML_EXPORT_USER]:[Zt.PERSONAL_BOOK_USER],[Zt.PDF_EXPORT_USER]:[Zt.PERSONAL_BOOK_USER],[Zt.KHUB_ADMIN]:[Zt.CONTENT_PUBLISHER],[Zt.ADMIN]:[Zt.KHUB_ADMIN,Zt.USERS_ADMIN,Zt.PORTAL_ADMIN],[Zt.DEVELOPER]:[Zt.BETA_USER,Zt.DEBUG_USER]};function Wt(t,e){return t===e||(Gt[t]??[]).some((t=>Wt(t,e)))}function Xt(t,e){return(Kt(t)?t.profile.roles:Vt(t)?t.roles:t).some((t=>Wt(t,e)))}
|
|
514
536
|
/**
|
|
515
537
|
* @license
|
|
516
538
|
* Copyright 2017 Google LLC
|
|
517
539
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
518
|
-
*/var Yt;const qt=window,Jt=qt.trustedTypes,Qt=Jt?Jt.createPolicy("lit-html",{createHTML:t=>t}):void 0,
|
|
540
|
+
*/var Yt;const qt=window,Jt=qt.trustedTypes,Qt=Jt?Jt.createPolicy("lit-html",{createHTML:t=>t}):void 0,te="$lit$",ee=`lit$${(Math.random()+"").slice(9)}$`,ie="?"+ee,oe=`<${ie}>`,se=document,ne=()=>se.createComment(""),re=t=>null===t||"object"!=typeof t&&"function"!=typeof t,ae=Array.isArray,le="[ \t\n\f\r]",he=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,de=/-->/g,fe=/>/g,ce=RegExp(`>|${le}(?:([^\\s"'>=/]+)(${le}*=${le}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),pe=/'/g,ue=/"/g,ve=/^(?:script|style|textarea|title)$/i,be=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),ge=Symbol.for("lit-noChange"),xe=Symbol.for("lit-nothing"),ye=new WeakMap,me=se.createTreeWalker(se,129,null,!1),$e=(t,e)=>{const i=t.length-1,o=[];let s,n=2===e?"<svg>":"",r=he;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===he?"!--"===l[1]?r=de:void 0!==l[1]?r=fe:void 0!==l[2]?(ve.test(l[2])&&(s=RegExp("</"+l[2],"g")),r=ce):void 0!==l[3]&&(r=ce):r===ce?">"===l[0]?(r=null!=s?s:he,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?ce:'"'===l[3]?ue:pe):r===ue||r===pe?r=ce:r===de||r===fe?r=he:(r=ce,s=void 0);const f=r===ce&&t[e+1].startsWith("/>")?" ":"";n+=r===he?i+oe:h>=0?(o.push(a),i.slice(0,h)+te+i.slice(h)+ee+f):i+ee+(-2===h?(o.push(void 0),e):f)}const a=n+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==Qt?Qt.createHTML(a):a,o]};class we{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]=$e(t,e);if(this.el=we.createElement(l,i),me.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=me.nextNode())&&a.length<r;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith(te)||e.startsWith(ee)){const i=h[n++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+te).split(ee),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:s,name:e[2],strings:t,ctor:"."===e[1]?Ie:"?"===e[1]?Re:"@"===e[1]?Ae:Ee})}else a.push({type:6,index:s})}for(const e of t)o.removeAttribute(e)}if(ve.test(o.tagName)){const t=o.textContent.split(ee),e=t.length-1;if(e>0){o.textContent=Jt?Jt.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],ne()),me.nextNode(),a.push({type:2,index:++s});o.append(t[e],ne())}}}else if(8===o.nodeType)if(o.data===ie)a.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(ee,t+1));)a.push({type:7,index:s}),t+=ee.length-1}s++}}static createElement(t,e){const i=se.createElement("template");return i.innerHTML=t,i}}function ke(t,e,i=t,o){var s,n,r,a;if(e===ge)return e;let l=void 0!==o?null===(s=i._$Co)||void 0===s?void 0:s[o]:i._$Cl;const h=re(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=ke(t,l._$AS(t,e.values),l,o)),e}class Se{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:se).importNode(i,!0);me.currentNode=s;let n=me.nextNode(),r=0,a=0,l=o[0];for(;void 0!==l;){if(r===l.index){let e;2===l.type?e=new _e(n,n.nextSibling,this,t):1===l.type?e=new l.ctor(n,l.name,l.strings,this,t):6===l.type&&(e=new Oe(n,this,t)),this._$AV.push(e),l=o[++a]}r!==(null==l?void 0:l.index)&&(n=me.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 _e{constructor(t,e,i,o){var s;this.type=2,this._$AH=xe,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=ke(this,t,e),re(t)?t===xe||null==t||""===t?(this._$AH!==xe&&this._$AR(),this._$AH=xe):t!==this._$AH&&t!==ge&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>ae(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!==xe&&re(this._$AH)?this._$AA.nextSibling.data=t:this.$(se.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=we.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 Se(s,this),e=t.u(this.options);t.v(i),this.$(e),this._$AH=t}}_$AC(t){let e=ye.get(t.strings);return void 0===e&&ye.set(t.strings,e=new we(t)),e}T(t){ae(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 _e(this.k(ne()),this.k(ne()),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 Ee{constructor(t,e,i,o,s){this.type=1,this._$AH=xe,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=xe}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=ke(this,t,e,0),n=!re(t)||t!==this._$AH&&t!==ge,n&&(this._$AH=t);else{const o=t;let r,a;for(t=s[0],r=0;r<s.length-1;r++)a=ke(this,o[i+r],e,r),a===ge&&(a=this._$AH[r]),n||(n=!re(a)||a!==this._$AH[r]),a===xe?t=xe:t!==xe&&(t+=(null!=a?a:"")+s[r+1]),this._$AH[r]=a}n&&!o&&this.j(t)}j(t){t===xe?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class Ie extends Ee{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===xe?void 0:t}}const Te=Jt?Jt.emptyScript:"";class Re extends Ee{constructor(){super(...arguments),this.type=4}j(t){t&&t!==xe?this.element.setAttribute(this.name,Te):this.element.removeAttribute(this.name)}}class Ae extends Ee{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=ke(this,t,e,0))&&void 0!==i?i:xe)===ge)return;const o=this._$AH,s=t===xe&&o!==xe||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==xe&&(o===xe||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 Oe{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){ke(this,t)}}const Ce=qt.litHtmlPolyfillSupport;null==Ce||Ce(we,_e),(null!==(Yt=qt.litHtmlVersions)&&void 0!==Yt?Yt:qt.litHtmlVersions=[]).push("2.7.3");
|
|
519
541
|
/**
|
|
520
542
|
* @license
|
|
521
543
|
* Copyright 2020 Google LLC
|
|
522
544
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
523
545
|
*/
|
|
524
|
-
const
|
|
525
|
-
<${
|
|
546
|
+
const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void 0:t._$litStatic$},De=t=>({_$litStatic$:t,r:Ne}),ze=new Map,Be=(t=>(e,...i)=>{const o=i.length;let s,n;const r=[],a=[];let l,h=0,d=!1;for(;h<o;){for(l=e[h];h<o&&void 0!==(n=i[h],s=Ue(n));)l+=s+e[++h],d=!0;h!==o&&a.push(n),r.push(l),h++}if(h===o&&r.push(e[o]),d){const t=r.join("$$lit$$");void 0===(e=ze.get(t))&&(r.raw=r,ze.set(t,e=r)),i=a}return t(e,...i)})(be);var Me;!function(t){t.title="title",t.title_dense="title-dense",t.subtitle1="subtitle1",t.subtitle2="subtitle2",t.body1="body1",t.body2="body2",t.caption="caption",t.breadcrumb="breadcrumb",t.overline="overline",t.button="button"}(Me||(Me={}));var Fe,Le,Pe,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 He extends e.FtLitElement{constructor(){super(...arguments),this.variant=Me.body1}render(){return this.element?Be`
|
|
547
|
+
<${De(this.element)}
|
|
526
548
|
class="ft-typography ft-typography--${this.variant}">
|
|
527
549
|
<slot></slot>
|
|
528
|
-
</${
|
|
529
|
-
`:
|
|
550
|
+
</${De(this.element)}>
|
|
551
|
+
`:Be`
|
|
530
552
|
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
531
|
-
`}}
|
|
553
|
+
`}}He.styles=[st,nt,rt,at,lt,ht,dt,ft,ct,pt,ut],je([o.property()],He.prototype,"element",void 0),je([o.property()],He.prototype,"variant",void 0),e.customElement("ft-typography")(He),function(t){t.THUMBS_DOWN="",t.THUMBS_DOWN_PLAIN="",t.THUMBS_UP="",t.THUMBS_UP_PLAIN="",t.STAR="",t.STAR_PLAIN="",t.DESKTOP="",t.LIFE_RING="",t.GLOBE="",t.PIGGY_BANK="",t.TABLET_LANDSCAPE="",t.TABLET_PORTRAIT="",t.MOBILE_LANDSCAPE="",t.MOBILE_PORTRAIT="",t.ARROW_RIGHT_TO_LINE="",t.THIN_ARROW_UP="",t.CONTEXTUAL="",t.CHART_SIMPLE="",t.BARS_PROGRESS="",t.LINE_CHART="",t.STACKED_CHART="",t.BOOK_OPEN_GEAR="",t.BOOK_OPEN_GEAR_SLASH="",t.DIAGRAM_SUNBURST="",t.DIAGRAM_SANKEY="",t.UNSTRUCTURED_DOC="",t.RESET="",t.THIN_ARROW_LEFT="",t.THIN_ARROW_RIGHT="",t.MY_COLLECTIONS="",t.OFFLINE_SETTINGS="",t.MY_LIBRARY="",t.RATE_PLAIN="",t.RATE="",t.FEEDBACK_PLAIN="",t.PAUSE="",t.PLAY="",t.RELATIVES_PLAIN="",t.RELATIVES="",t.SHORTCUT_MENU="",t.PRINT="",t.DEFAULT_ROLES="",t.ACCOUNT_SETTINGS="",t.ONLINE="",t.OFFLINE="",t.UPLOAD="",t.BOOK_PLAIN="",t.SYNC="",t.SHARED_PBK="",t.COLLECTIONS="",t.SEARCH_IN_PUBLICATION="",t.BOOKS="",t.LOCKER="",t.ARROW_DOWN="",t.ARROW_LEFT="",t.ARROW_RIGHT="",t.ARROW_UP="",t.SAVE="",t.MAILS_AND_NOTIFICATIONS="",t.DOT="",t.MINUS="",t.PLUS="",t.FILTERS="",t.STRIPE_ARROW_RIGHT="",t.STRIPE_ARROW_LEFT="",t.ATTACHMENTS="",t.ADD_BOOKMARK="",t.BOOKMARK="",t.EXPORT="",t.MENU="",t.TAG="",t.TAG_PLAIN="",t.COPY_TO_CLIPBOARD="",t.COLUMNS="",t.ARTICLE="",t.CLOSE_PLAIN="",t.CHECK_PLAIN="",t.LOGOUT="",t.SIGN_IN="",t.THIN_ARROW="",t.TRIANGLE_BOTTOM="",t.TRIANGLE_LEFT="",t.TRIANGLE_RIGHT="",t.TRIANGLE_TOP="",t.FACET_HAS_DESCENDANT="",t.MINUS_PLAIN="",t.PLUS_PLAIN="",t.INFO="",t.ICON_EXPAND="",t.ICON_COLLAPSE="",t.ADD_TO_PBK="",t.ALERT="",t.ADD_ALERT="",t.BACK_TO_SEARCH="",t.DOWNLOAD="",t.EDIT="",t.FEEDBACK="",t.MODIFY_PBK="",t.SCHEDULED="",t.SEARCH="",t.SHARE="󨃱",t.TOC="",t.WRITE_UGC="",t.TRASH="",t.EXTLINK="",t.CALENDAR="",t.BOOK="",t.DOWNLOAD_PLAIN="",t.CHECK="",t.TOPICS="",t.EYE="",t.EYE_SLASH="",t.DISC="",t.CIRCLE="",t.SHARED="",t.SORT_UNSORTED="",t.SORT_UP="",t.SORT_DOWN="",t.WORKING="",t.CLOSE="",t.ZOOM_OUT="",t.ZOOM_IN="",t.ZOOM_REALSIZE="",t.ZOOM_FULLSCREEN="",t.ADMIN_RESTRICTED="",t.ADMIN_THEME="",t.WARNING="",t.CONTEXT="",t.SEARCH_HOME="",t.STEPS="",t.HOME="",t.TRANSLATE="",t.USER="",t.ADMIN="",t.ANALYTICS="",t.ADMIN_KHUB="",t.ADMIN_USERS="",t.ADMIN_INTEGRATION="",t.ADMIN_PORTAL="",t.COMMENT_QUESTION="",t.COMMENT_QUESTION_PLAIN="",t.MESSAGE_BOT="",t.PIP="",t.PIP_WIDE="",t.EXPAND_WIDE="",t.X_MARK=""}(Fe||(Fe={})),function(t){t.UNKNOWN="",t.ABW="",t.AUDIO="",t.AVI="",t.CHM="",t.CODE="",t.CSV="",t.DITA="",t.EPUB="",t.EXCEL="",t.FLAC="",t.GIF="",t.GZIP="",t.HTML="",t.IMAGE="",t.JPEG="",t.JSON="",t.M4A="",t.MOV="",t.MP3="",t.MP4="",t.OGG="",t.PDF="",t.PNG="",t.POWERPOINT="",t.RAR="",t.STP="",t.TEXT="",t.VIDEO="",t.WAV="",t.WMA="",t.WORD="",t.XML="",t.YAML="",t.ZIP=""}(Le||(Le={})),new Map([...["abw"].map((t=>[t,Le.ABW])),...["3gp","act","aiff","aac","amr","au","awb","dct","dss","dvf","gsm","iklax","ivs","mmf","mpc","msv","opus","ra","rm","raw","sln","tta","vox","wv"].map((t=>[t,Le.AUDIO])),...["avi"].map((t=>[t,Le.AVI])),...["chm","xhs"].map((t=>[t,Le.CHM])),...["java","py","php","php3","php4","php5","js","javascript","rb","rbw","c","cpp","cxx","h","hh","hpp","hxx","sh","bash","zsh","tcsh","ksh","csh","vb","scala","pl","prl","perl","groovy","ceylon","aspx","jsp","scpt","applescript","bas","bat","lua","jsp","mk","cmake","css","sass","less","m","mm","xcodeproj"].map((t=>[t,Le.CODE])),...["csv"].map((t=>[t,Le.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,Le.DITA])),...["epub"].map((t=>[t,Le.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,Le.EXCEL])),...["flac"].map((t=>[t,Le.FLAC])),...["gif"].map((t=>[t,Le.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,Le.GZIP])),...["html","htm","xhtml"].map((t=>[t,Le.HTML])),...["ai","vml","xps","img","cpt","psd","psp","xcf","svg","svg+xml","bmp","bpg","ppm","pgm","pbm","pnm","rif","tif","tiff","webp","wmf"].map((t=>[t,Le.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,Le.JPEG])),...["json"].map((t=>[t,Le.JSON])),...["m4a","m4p"].map((t=>[t,Le.M4A])),...["mov","qt"].map((t=>[t,Le.MOV])),...["mp3"].map((t=>[t,Le.MP3])),...["mp4","m4v"].map((t=>[t,Le.MP4])),...["ogg","oga"].map((t=>[t,Le.OGG])),...["pdf","ps"].map((t=>[t,Le.PDF])),...["png"].map((t=>[t,Le.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,Le.POWERPOINT])),...["rar"].map((t=>[t,Le.RAR])),...["stp"].map((t=>[t,Le.STP])),...["txt","rtf","md","mdown"].map((t=>[t,Le.TEXT])),...["webm","mkv","flv","vob","ogv","ogg","drc","mng","wmv","yuv","rm","rmvb","asf","mpg","mp2","mpeg","mpe","mpv","m2v","svi","3gp","3g2","mxf","roq","nsv"].map((t=>[t,Le.VIDEO])),...["wav"].map((t=>[t,Le.WAV])),...["wma"].map((t=>[t,Le.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,Le.WORD])),...["xml","xsl","rdf"].map((t=>[t,Le.XML])),...["yaml","yml","x-yaml"].map((t=>[t,Le.YAML])),...["zip"].map((t=>[t,Le.ZIP]))]),function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(Pe||(Pe={}));var Ze=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 Ke extends e.FtLitElement{constructor(){super(...arguments),this.resolvedIcon=i.nothing}render(){const t=this.variant&&Object.values(Pe).includes(this.variant)?this.variant:Pe.fluid_topics,e=t!==Pe.material||!!this.value;return i.html`
|
|
532
554
|
<i class="ft-icon ft-icon--${t}" part="icon icon-${t}">
|
|
533
555
|
${s.unsafeHTML(this.resolvedIcon)}
|
|
534
|
-
<slot ?hidden=${
|
|
556
|
+
<slot ?hidden=${e}></slot>
|
|
535
557
|
</i>
|
|
536
|
-
`}get textContent(){var t,
|
|
558
|
+
`}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:""}update(t){super.update(t),["value","variant"].some((e=>t.has(e)))&&this.resolveIcon()}resolveIcon(){var t,e;let o=this.value||this.textContent;switch(this.variant){case Pe.file_format:this.resolvedIcon=null!==(t=Le[o.replace("-","_").toUpperCase()])&&void 0!==t?t:o;break;case Pe.material:this.resolvedIcon=this.value||i.nothing;break;default:this.resolvedIcon=null!==(e=Fe[o.replace("-","_").toUpperCase()])&&void 0!==e?e:o}}firstUpdated(t){super.firstUpdated(t),setTimeout((()=>this.resolveIcon()))}}Ke.elementDefinitions={},Ke.styles=xt,Ze([o.property()],Ke.prototype,"variant",void 0),Ze([o.property()],Ke.prototype,"value",void 0),Ze([o.state()],Ke.prototype,"resolvedIcon",void 0),Ze([o.query("slot")],Ke.prototype,"slottedContent",void 0),e.customElement("ft-icon")(Ke);const Ve=e.FtCssVariableFactory.create("--ft-tooltip-distance","SIZE","4px"),Ge=e.FtCssVariableFactory.create("--ft-tooltip-color","COLOR","#FFFFFF"),We=e.FtCssVariableFactory.create("--ft-tooltip-background-color","COLOR","#666666"),Xe=e.FtCssVariableFactory.create("--ft-tooltip-z-index","NUMBER","100"),Ye=e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design system"),qe=e.FtCssVariableFactory.create("--ft-tooltip-max-width","SIZE","150px"),Je=i.css`
|
|
537
559
|
.ft-tooltip--container {
|
|
538
560
|
display: block;
|
|
539
561
|
}
|
|
@@ -548,21 +570,21 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
548
570
|
box-sizing: border-box;
|
|
549
571
|
overflow: hidden;
|
|
550
572
|
width: max-content;
|
|
551
|
-
max-width: ${
|
|
573
|
+
max-width: ${qe};
|
|
552
574
|
text-align: center;
|
|
553
|
-
padding: ${
|
|
554
|
-
z-index: ${
|
|
575
|
+
padding: ${Ve};
|
|
576
|
+
z-index: ${Xe};
|
|
555
577
|
}
|
|
556
578
|
|
|
557
579
|
.ft-tooltip--content {
|
|
558
580
|
padding: 4px 8px;
|
|
559
|
-
border-radius: ${
|
|
560
|
-
background-color: ${
|
|
561
|
-
color: ${
|
|
581
|
+
border-radius: ${Ye};
|
|
582
|
+
background-color: ${We};
|
|
583
|
+
color: ${Ge};
|
|
562
584
|
position: relative;
|
|
563
585
|
word-break: break-word;
|
|
564
586
|
}
|
|
565
|
-
`;var
|
|
587
|
+
`;var Qe=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 ti 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 i.html`
|
|
566
588
|
<div part="container"
|
|
567
589
|
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
568
590
|
@mouseenter=${this.onHover}
|
|
@@ -580,14 +602,8 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
580
602
|
</div>
|
|
581
603
|
</div>
|
|
582
604
|
</div>
|
|
583
|
-
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((
|
|
605
|
+
`}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=this.tooltip.offsetWidth,i=this.tooltip.offsetHeight,o=(t.offsetHeight-i)/2,s=(t.offsetWidth-e)/2;let n=0,r=0;switch(this.tooltip.style.top="0",this.tooltip.style.left="0",this.validPosition){case"top":r=t.offsetTop-i-this.tooltip.offsetTop,n=t.offsetLeft+s-this.tooltip.offsetLeft;break;case"bottom":r=t.offsetTop+t.offsetHeight-this.tooltip.offsetTop,n=t.offsetLeft+s-this.tooltip.offsetLeft;break;case"left":r=t.offsetTop+o-this.tooltip.offsetTop,n=t.offsetLeft-e-this.tooltip.offsetLeft;break;case"right":r=t.offsetTop+o-this.tooltip.offsetTop,n=t.offsetLeft+t.offsetWidth-this.tooltip.offsetLeft}const a=this.tooltip.style;a.left=n+"px",a.top=r+"px";const l=this.tooltip.getBoundingClientRect();let h=-l.x,d=l.x+l.width-window.innerWidth;a.left=n+Math.round(this.correctOutOfWindowPixels(h,d))+"px";let f=-l.y,c=l.y+l.height-window.innerHeight;a.top=r+Math.round(this.correctOutOfWindowPixels(f,c))+"px",a.maxWidth=`max(${t.offsetWidth}px, ${qe})`}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))}}ti.elementDefinitions={"ft-typography":He},ti.styles=Je,Qe([o.property()],ti.prototype,"text",void 0),Qe([o.property({type:Boolean})],ti.prototype,"manual",void 0),Qe([o.property({type:Boolean})],ti.prototype,"inline",void 0),Qe([o.property({type:Number})],ti.prototype,"delay",void 0),Qe([o.property()],ti.prototype,"position",void 0),Qe([o.queryAssignedNodes("",!0)],ti.prototype,"slotNodes",void 0),Qe([o.query(".ft-tooltip--container")],ti.prototype,"container",void 0),Qe([o.query(".ft-tooltip")],ti.prototype,"tooltip",void 0),Qe([o.query(".ft-tooltip--content")],ti.prototype,"tooltipContent",void 0),Qe([o.state()],ti.prototype,"visible",void 0),e.customElement("ft-tooltip")(ti);var ei=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 ii 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,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`
|
|
584
606
|
<style>
|
|
585
|
-
.ft-ripple .ft-ripple--effect,
|
|
586
|
-
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
587
|
-
width: ${this.rippleSize}px;
|
|
588
|
-
height: ${this.rippleSize}px;
|
|
589
|
-
}
|
|
590
|
-
|
|
591
607
|
.ft-ripple .ft-ripple--effect {
|
|
592
608
|
left: ${this.originX}px;
|
|
593
609
|
top: ${this.originY}px;
|
|
@@ -597,7 +613,7 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
597
613
|
<div class="ft-ripple--background"></div>
|
|
598
614
|
<div class="ft-ripple--effect"></div>
|
|
599
615
|
</div>
|
|
600
|
-
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.
|
|
616
|
+
`}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,i;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===(i=this.target)||void 0===i||i.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 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)}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.endRipple()}}ii.elementDefinitions={},ii.styles=y,ei([o.property({type:Boolean})],ii.prototype,"primary",void 0),ei([o.property({type:Boolean})],ii.prototype,"secondary",void 0),ei([o.property({type:Boolean})],ii.prototype,"unbounded",void 0),ei([o.property({type:Boolean})],ii.prototype,"activated",void 0),ei([o.property({type:Boolean})],ii.prototype,"selected",void 0),ei([o.property({type:Boolean})],ii.prototype,"disabled",void 0),ei([o.state()],ii.prototype,"hovered",void 0),ei([o.state()],ii.prototype,"focused",void 0),ei([o.state()],ii.prototype,"pressed",void 0),ei([o.state()],ii.prototype,"rippling",void 0),ei([o.state()],ii.prototype,"originX",void 0),ei([o.state()],ii.prototype,"originY",void 0),ei([o.query(".ft-ripple")],ii.prototype,"ripple",void 0),ei([o.query(".ft-ripple--effect")],ii.prototype,"rippleEffect",void 0),e.customElement("ft-ripple")(ii);const oi={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")},si=i.css`
|
|
601
617
|
.ft-switch-option {
|
|
602
618
|
position: relative;
|
|
603
619
|
display: inline-block;
|
|
@@ -616,13 +632,13 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
616
632
|
|
|
617
633
|
border-style: solid;
|
|
618
634
|
border-color: ${Tt.borderColor};
|
|
619
|
-
border-width: ${
|
|
620
|
-
border-radius: ${
|
|
635
|
+
border-width: ${oi.borderWidthVertical} ${oi.borderWidthRight} ${oi.borderWidthVertical} ${oi.borderWidthLeft};
|
|
636
|
+
border-radius: ${oi.borderRadiusLeft} ${oi.borderRadiusRight} ${oi.borderRadiusRight} ${oi.borderRadiusLeft};
|
|
621
637
|
display: flex;
|
|
622
638
|
align-items: center;
|
|
623
639
|
justify-content: center;
|
|
624
640
|
overflow: hidden;
|
|
625
|
-
${
|
|
641
|
+
${e.setVariable(gt.size,Tt.iconSize)};
|
|
626
642
|
padding: var(--ft-switch-internal-vertical-padding, 6px) var(--ft-switch-internal-horizontal-padding, 8px);
|
|
627
643
|
background-color: ${Tt.backgroundColor};
|
|
628
644
|
-webkit-mask-image: radial-gradient(white, black);
|
|
@@ -634,12 +650,12 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
634
650
|
|
|
635
651
|
.ft-switch-option--selected .ft-switch-option--content:before {
|
|
636
652
|
background-color: ${Tt.selectedBackgroundColor};
|
|
637
|
-
border-radius: ${
|
|
653
|
+
border-radius: ${oi.borderRadiusLeft} ${oi.borderRadiusRight} ${oi.borderRadiusRight} ${oi.borderRadiusLeft};
|
|
638
654
|
position: absolute;
|
|
639
655
|
inset: 0;
|
|
640
656
|
content: "";
|
|
641
657
|
z-index: 1;
|
|
642
|
-
opacity: ${
|
|
658
|
+
opacity: ${e.designSystemVariables.opacityPrimaryOnSurfaceSelected};
|
|
643
659
|
}
|
|
644
660
|
|
|
645
661
|
.ft-switch-option--label {
|
|
@@ -649,8 +665,8 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
649
665
|
text-overflow: ellipsis;
|
|
650
666
|
display: block;
|
|
651
667
|
margin: 0 8px;
|
|
652
|
-
${
|
|
653
|
-
${
|
|
668
|
+
${e.setVariable(ot.fontSize,Tt.fontSize)};
|
|
669
|
+
${e.setVariable(ot.lineHeight,"var(--ft-switch-option-internal-content-height)")}
|
|
654
670
|
}
|
|
655
671
|
|
|
656
672
|
.ft-switch-option--selected .ft-switch-option--label {
|
|
@@ -662,7 +678,7 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
662
678
|
}
|
|
663
679
|
|
|
664
680
|
.ft-switch-option--ripple {
|
|
665
|
-
${
|
|
681
|
+
${e.setVariable(c.color,Tt.rippleColor)};
|
|
666
682
|
}
|
|
667
683
|
|
|
668
684
|
ft-icon, ft-ripple, ft-typography {
|
|
@@ -681,14 +697,14 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
681
697
|
.ft-switch-option--selected ft-icon {
|
|
682
698
|
color: ${Tt.selectedTextColor};
|
|
683
699
|
}
|
|
684
|
-
`;var
|
|
700
|
+
`;var ni=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 ri extends CustomEvent{constructor(t){super("option-change-by-user",{detail:t,bubbles:!0,composed:!0})}}class ai extends CustomEvent{constructor(t){super("option-change",{detail:t,bubbles:!0,composed:!0})}}class li 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 ai(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(i.html`
|
|
685
701
|
<label part="label" for="input" class=${n.classMap(t)}
|
|
686
702
|
@click=${this.onChange}>
|
|
687
703
|
<div class="ft-switch-option--content">
|
|
688
704
|
<ft-ripple part="ripple" class="ft-switch-option--ripple"></ft-ripple>
|
|
689
705
|
<ft-typography part="text"
|
|
690
706
|
variant="button"
|
|
691
|
-
class="ft-switch-option--label ${
|
|
707
|
+
class="ft-switch-option--label ${e.isSafari?"ft-safari-ellipsis-fix":""}"
|
|
692
708
|
?hidden=${!this.hasTextContent()}>
|
|
693
709
|
<slot @slotchange=${this.onSlotchange}></slot>
|
|
694
710
|
</ft-typography>
|
|
@@ -697,22 +713,22 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
697
713
|
</label>
|
|
698
714
|
<input id="input" type="radio" class="ft-switch-option--input"
|
|
699
715
|
.checked=${this.selected}>
|
|
700
|
-
`)}addTooltip(t){return this.hasTextContent()||0===this.getLabel().trim().length?t:
|
|
716
|
+
`)}addTooltip(t){return this.hasTextContent()||0===this.getLabel().trim().length?t:i.html`
|
|
701
717
|
<ft-tooltip part="tooltip"
|
|
702
718
|
text="${this.getLabel()}"
|
|
703
719
|
position="${this.tooltipPosition}">
|
|
704
720
|
${t}
|
|
705
721
|
</ft-tooltip>
|
|
706
|
-
`}onChange(){this.selected=!this.unselectable||!this.selected,this.dispatchEvent(new
|
|
722
|
+
`}onChange(){this.selected=!this.unselectable||!this.selected,this.dispatchEvent(new ri(this.selected))}getLabel(){return this.label||this.textContent}resolveIcon(){return this.icon?i.html`
|
|
707
723
|
<ft-icon part="icon" .variant=${this.iconVariant} .value=${this.icon}></ft-icon>
|
|
708
|
-
`:
|
|
724
|
+
`: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()}}li.elementDefinitions={"ft-ripple":ii,"ft-typography":He,"ft-tooltip":ti,"ft-icon":Ke},li.styles=[e.safariEllipsisFix,si],ni([o.property()],li.prototype,"value",void 0),ni([o.property()],li.prototype,"icon",void 0),ni([o.property()],li.prototype,"iconVariant",void 0),ni([o.property()],li.prototype,"label",void 0),ni([o.property()],li.prototype,"tooltipPosition",void 0),ni([o.property({type:Boolean,reflect:!0})],li.prototype,"selected",void 0),ni([o.property({type:Boolean})],li.prototype,"trailingIcon",void 0),ni([o.property({type:Boolean})],li.prototype,"unselectable",void 0),ni([o.query(".ft-switch-option--content slot")],li.prototype,"slottedContent",void 0),ni([o.query(".ft-switch-option--input")],li.prototype,"input",void 0);var hi=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 CustomEvent{constructor(t){super("change",{detail:t})}}class fi 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 i.html`
|
|
709
725
|
<div @keydown=${this.onKeyDown} tabindex="0" class="${n.classMap(t)}">
|
|
710
726
|
<slot @slotchange=${this.onSlotchange}
|
|
711
727
|
@option-change=${this.onOptionChangeByScript}
|
|
712
728
|
@option-change-by-user=${this.onOptionChangeByUser}
|
|
713
729
|
></slot>
|
|
714
730
|
</div>
|
|
715
|
-
`}onKeyDown(t){let
|
|
731
|
+
`}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 li&&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 di(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}))}}fi.elementDefinitions={},fi.styles=i.css`
|
|
716
732
|
:host {
|
|
717
733
|
display: inline-block;
|
|
718
734
|
}
|
|
@@ -728,25 +744,25 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
728
744
|
}
|
|
729
745
|
|
|
730
746
|
.ft-switch slot::slotted(ft-switch-option) {
|
|
731
|
-
${
|
|
732
|
-
${
|
|
733
|
-
${
|
|
747
|
+
${e.setVariable(oi.borderRadiusLeft,"0")};
|
|
748
|
+
${e.setVariable(oi.borderRadiusRight,"0")};
|
|
749
|
+
${e.setVariable(oi.borderWidthLeft,"0")};
|
|
734
750
|
}
|
|
735
751
|
|
|
736
752
|
.ft-switch slot::slotted(ft-switch-option:first-child) {
|
|
737
|
-
${
|
|
738
|
-
${
|
|
753
|
+
${e.setVariable(oi.borderRadiusLeft,Tt.borderRadius)};
|
|
754
|
+
${e.setVariable(oi.borderWidthLeft,"1px")};
|
|
739
755
|
}
|
|
740
756
|
|
|
741
757
|
.ft-switch slot::slotted(ft-switch-option:last-child) {
|
|
742
|
-
${
|
|
758
|
+
${e.setVariable(oi.borderRadiusRight,Tt.borderRadius)};
|
|
743
759
|
}
|
|
744
760
|
|
|
745
761
|
.ft-switch--dense slot::slotted(ft-switch-option) {
|
|
746
762
|
--ft-switch-internal-vertical-padding: 2px;
|
|
747
763
|
--ft-switch-internal-horizontal-padding: 4px;
|
|
748
764
|
}
|
|
749
|
-
`,
|
|
765
|
+
`,hi([o.property({type:Boolean})],fi.prototype,"dense",void 0),hi([o.property({type:Boolean})],fi.prototype,"unselectable",void 0),hi([o.query(".ft-switch slot")],fi.prototype,"slottedContent",void 0),hi([o.state()],fi.prototype,"selectedOption",void 0),hi([o.query(".ft-switch")],fi.prototype,"ftSwitchDiv",void 0),e.customElement("ft-switch")(fi),e.customElement("ft-switch-option")(li);const ci=e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),pi=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceMedium,"Design system"),ui=i.css`
|
|
750
766
|
:host {
|
|
751
767
|
display: block;
|
|
752
768
|
}
|
|
@@ -757,17 +773,17 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
757
773
|
|
|
758
774
|
ft-icon {
|
|
759
775
|
transform: rotate(-45deg);
|
|
760
|
-
color: ${
|
|
776
|
+
color: ${ci};
|
|
761
777
|
}
|
|
762
778
|
|
|
763
779
|
.ft-resizer--dragging ft-icon,
|
|
764
780
|
.ft-resizer:hover ft-icon {
|
|
765
|
-
color: ${
|
|
781
|
+
color: ${pi};
|
|
766
782
|
}
|
|
767
|
-
`;var
|
|
783
|
+
`;var vi=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 bi extends CustomEvent{constructor(t,e){super("resize",{detail:{width:t,height:e}})}}class gi extends e.FtLitElement{constructor(){super(...arguments),this.initialWidth=0,this.initialHeight=0,this.icon="drag_handle",this.iconVariant=Pe.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`
|
|
768
784
|
<style>
|
|
769
785
|
.ft-resizer {
|
|
770
|
-
cursor: ${
|
|
786
|
+
cursor: ${i.unsafeCSS(this.cursor)}
|
|
771
787
|
}
|
|
772
788
|
</style>
|
|
773
789
|
<div class="ft-resizer ft-no-text-select ${this.dragging?"ft-resizer--dragging":""}"
|
|
@@ -775,25 +791,25 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
775
791
|
@touchstart=${this.initDragFromTouch}>
|
|
776
792
|
<ft-icon .variant="${this.iconVariant}" .value="${this.icon}"></ft-icon>
|
|
777
793
|
</div>
|
|
778
|
-
`}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,
|
|
794
|
+
`}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 i=this.fixedWidth+t-this.startX,o=this.fixedHeight+e-this.startY;this.dispatchEvent(new bi(i,o))}}gi.elementDefinitions={"ft-icon":Ke},gi.styles=[e.noTextSelect,ui],vi([o.property({type:Number})],gi.prototype,"initialWidth",void 0),vi([o.property({type:Number})],gi.prototype,"initialHeight",void 0),vi([o.property()],gi.prototype,"icon",void 0),vi([o.property()],gi.prototype,"iconVariant",void 0),vi([o.property()],gi.prototype,"cursor",void 0),vi([o.state()],gi.prototype,"dragging",void 0),e.customElement("ft-resizer")(gi);const xi={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")},yi=i.css`
|
|
779
795
|
.ft-input-label {
|
|
780
796
|
position: absolute;
|
|
781
797
|
inset: 0;
|
|
782
798
|
display: flex;
|
|
783
|
-
background-color: ${
|
|
784
|
-
border-radius: ${
|
|
799
|
+
background-color: ${xi.colorSurface};
|
|
800
|
+
border-radius: ${xi.borderRadiusS} ${xi.borderRadiusS} 0 0;
|
|
785
801
|
}
|
|
786
802
|
|
|
787
803
|
.ft-input-label--outlined {
|
|
788
|
-
border-radius: ${
|
|
804
|
+
border-radius: ${xi.borderRadiusS};
|
|
789
805
|
}
|
|
790
806
|
|
|
791
807
|
.ft-input-label {
|
|
792
|
-
border-color: ${
|
|
808
|
+
border-color: ${xi.borderColor};
|
|
793
809
|
}
|
|
794
810
|
|
|
795
811
|
.ft-input-label.ft-input-label--in-error {
|
|
796
|
-
border-color: ${
|
|
812
|
+
border-color: ${xi.colorError}
|
|
797
813
|
}
|
|
798
814
|
|
|
799
815
|
.ft-input-label:before,
|
|
@@ -806,7 +822,7 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
806
822
|
}
|
|
807
823
|
|
|
808
824
|
.ft-input-label:before {
|
|
809
|
-
width: calc(${
|
|
825
|
+
width: calc(${xi.horizontalSpacing} - 4px);
|
|
810
826
|
flex-shrink: 0;
|
|
811
827
|
}
|
|
812
828
|
|
|
@@ -822,20 +838,20 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
822
838
|
border-bottom-width: 1px;
|
|
823
839
|
border-bottom-style: solid;
|
|
824
840
|
border-color: inherit;
|
|
825
|
-
color: ${
|
|
841
|
+
color: ${xi.textColor};
|
|
826
842
|
transition: font-size 250ms, line-height 250ms, color 250ms;
|
|
827
|
-
max-width: calc(${
|
|
843
|
+
max-width: calc(${xi.labelMaxWidth} - 2 * (${xi.horizontalSpacing} - 4px)); /* -2px on spacing for label padding */
|
|
828
844
|
text-overflow: ellipsis;
|
|
829
|
-
${
|
|
830
|
-
${
|
|
845
|
+
${e.setVariable(Z.fontSize,xi.fontSize)};
|
|
846
|
+
${e.setVariable(Z.lineHeight,xi.fontSize)};
|
|
831
847
|
}
|
|
832
848
|
|
|
833
849
|
.ft-input-label--in-error .ft-input-label--text {
|
|
834
|
-
color: ${
|
|
850
|
+
color: ${xi.colorError}
|
|
835
851
|
}
|
|
836
852
|
|
|
837
853
|
.ft-input-label--disabled .ft-input-label--text {
|
|
838
|
-
color: ${
|
|
854
|
+
color: ${xi.disabledTextColor};
|
|
839
855
|
}
|
|
840
856
|
|
|
841
857
|
.ft-input-label--hidden-text {
|
|
@@ -852,19 +868,19 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
852
868
|
overflow: hidden;
|
|
853
869
|
white-space: nowrap;
|
|
854
870
|
text-overflow: ellipsis;
|
|
855
|
-
padding: ${
|
|
856
|
-
margin: calc(${
|
|
871
|
+
padding: ${xi.verticalSpacing} 4px;
|
|
872
|
+
margin: calc(${xi.verticalSpacing} * -1) 0;
|
|
857
873
|
max-width: 100%;
|
|
858
874
|
box-sizing: border-box;
|
|
859
875
|
}
|
|
860
876
|
|
|
861
877
|
.ft-input-label--raised .ft-input-label--text {
|
|
862
|
-
${
|
|
863
|
-
${
|
|
878
|
+
${e.setVariable(Z.fontSize,xi.raisedFontSize)};
|
|
879
|
+
${e.setVariable(Z.lineHeight,xi.raisedFontSize)};
|
|
864
880
|
}
|
|
865
881
|
|
|
866
882
|
.ft-input-label--raised .ft-input-label--floating-text {
|
|
867
|
-
top: ${
|
|
883
|
+
top: ${xi.verticalSpacing};
|
|
868
884
|
}
|
|
869
885
|
|
|
870
886
|
.ft-input-label--outlined .ft-input-label--text,
|
|
@@ -877,36 +893,36 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
877
893
|
.ft-input-label--outlined:before {
|
|
878
894
|
border-left-width: 1px;
|
|
879
895
|
border-left-style: solid;
|
|
880
|
-
border-radius: ${
|
|
896
|
+
border-radius: ${xi.borderRadiusS} 0 0 ${xi.borderRadiusS};
|
|
881
897
|
}
|
|
882
898
|
|
|
883
899
|
.ft-input-label--outlined:after {
|
|
884
900
|
border-right-width: 1px;
|
|
885
901
|
border-right-style: solid;
|
|
886
|
-
border-radius: 0 ${
|
|
902
|
+
border-radius: 0 ${xi.borderRadiusS} ${xi.borderRadiusS} 0;
|
|
887
903
|
}
|
|
888
904
|
|
|
889
905
|
.ft-input-label--outlined.ft-input-label--raised .ft-input-label--floating-text {
|
|
890
906
|
padding: 2px 4px;
|
|
891
|
-
z-index: ${
|
|
892
|
-
background-color: ${
|
|
893
|
-
border-radius: ${
|
|
907
|
+
z-index: ${xi.raisedZIndex};
|
|
908
|
+
background-color: ${xi.colorSurface};
|
|
909
|
+
border-radius: ${xi.borderRadiusS};
|
|
894
910
|
top: calc((var(--ft-typography-caption-line-height) / -2) + 2px);
|
|
895
911
|
}
|
|
896
912
|
|
|
897
913
|
.ft-input-label--outlined.ft-input-label--raised .ft-input-label--text {
|
|
898
914
|
border-top: none;
|
|
899
915
|
}
|
|
900
|
-
`;var
|
|
916
|
+
`;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};class $i 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 i.html`
|
|
901
917
|
<div class="${n.classMap(t)}">
|
|
902
|
-
${this.text?
|
|
918
|
+
${this.text?i.html`
|
|
903
919
|
<div class="ft-input-label--text ft-typography--caption">
|
|
904
920
|
<span class="ft-input-label--floating-text">${this.text}</span>
|
|
905
921
|
<span class="ft-input-label--hidden-text" aria-hidden="true">${this.text}</span>
|
|
906
922
|
</div>
|
|
907
923
|
`:null}
|
|
908
924
|
</div>
|
|
909
|
-
`}}$
|
|
925
|
+
`}}$i.elementDefinitions={},$i.styles=[dt,yi],mi([o.property({type:String})],$i.prototype,"text",void 0),mi([o.property({type:Boolean})],$i.prototype,"raised",void 0),mi([o.property({type:Boolean})],$i.prototype,"outlined",void 0),mi([o.property({type:Boolean})],$i.prototype,"disabled",void 0),mi([o.property({type:Boolean})],$i.prototype,"error",void 0),e.customElement("ft-input-label")($i);const wi={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")},ki=i.css`
|
|
910
926
|
*:focus {
|
|
911
927
|
outline: none;
|
|
912
928
|
}
|
|
@@ -918,10 +934,10 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
918
934
|
}
|
|
919
935
|
|
|
920
936
|
ft-input-label {
|
|
921
|
-
${
|
|
922
|
-
${
|
|
923
|
-
${
|
|
924
|
-
${
|
|
937
|
+
${e.setVariable(xi.fontSize,wi.fontSize)};
|
|
938
|
+
${e.setVariable(xi.raisedFontSize,wi.labelSize)};
|
|
939
|
+
${e.setVariable(xi.verticalSpacing,wi.verticalSpacing)};
|
|
940
|
+
${e.setVariable(xi.horizontalSpacing,wi.horizontalSpacing)};
|
|
925
941
|
}
|
|
926
942
|
|
|
927
943
|
.ft-text-area--main-panel {
|
|
@@ -939,8 +955,8 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
939
955
|
}
|
|
940
956
|
|
|
941
957
|
.ft-text-area--input-panel ft-ripple {
|
|
942
|
-
${
|
|
943
|
-
${
|
|
958
|
+
${e.setVariable(c.opacityContentOnSurfaceHover,"0.08")};
|
|
959
|
+
${e.setVariable(c.opacityContentOnSurfacePressed,"0.04")};
|
|
944
960
|
}
|
|
945
961
|
|
|
946
962
|
.ft-text-area--input {
|
|
@@ -952,12 +968,12 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
952
968
|
align-self: stretch;
|
|
953
969
|
resize: none;
|
|
954
970
|
|
|
955
|
-
${
|
|
956
|
-
${
|
|
957
|
-
color: ${
|
|
971
|
+
${e.setVariable(B.fontSize,wi.fontSize)};
|
|
972
|
+
${e.setVariable(B.lineHeight,wi.fontSize)};
|
|
973
|
+
color: ${wi.colorOnSurface};
|
|
958
974
|
|
|
959
|
-
padding: 0 ${
|
|
960
|
-
margin: calc(${
|
|
975
|
+
padding: 0 ${wi.horizontalSpacing};
|
|
976
|
+
margin: calc(${wi.verticalSpacing} + ${wi.labelSize} / 2) 0 ${wi.verticalSpacing} 0;
|
|
961
977
|
|
|
962
978
|
border: none;
|
|
963
979
|
background: none;
|
|
@@ -966,7 +982,7 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
966
982
|
}
|
|
967
983
|
|
|
968
984
|
.ft-text-area--disabled .ft-text-area--input {
|
|
969
|
-
color: ${
|
|
985
|
+
color: ${wi.colorOnSurfaceDisabled};
|
|
970
986
|
}
|
|
971
987
|
|
|
972
988
|
.ft-text-area:not(.ft-text-area--disabled) .ft-text-area--input-panel {
|
|
@@ -974,42 +990,42 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
974
990
|
}
|
|
975
991
|
|
|
976
992
|
.ft-text-area:not(.ft-text-area--disabled):focus-within ft-input-label {
|
|
977
|
-
${
|
|
978
|
-
${
|
|
993
|
+
${e.setVariable(xi.borderColor,wi.colorPrimary)};
|
|
994
|
+
${e.setVariable(xi.textColor,wi.colorPrimary)};
|
|
979
995
|
}
|
|
980
996
|
|
|
981
997
|
.ft-text-area--filled .ft-text-area--input-panel {
|
|
982
|
-
border-radius: ${
|
|
998
|
+
border-radius: ${wi.borderRadiusS} ${wi.borderRadiusS} 0 0;
|
|
983
999
|
}
|
|
984
1000
|
|
|
985
1001
|
.ft-text-area--filled:not(.ft-text-area--no-label) .ft-text-area--input {
|
|
986
1002
|
align-self: stretch;
|
|
987
|
-
margin-bottom: ${
|
|
988
|
-
margin-top: calc(${
|
|
1003
|
+
margin-bottom: ${wi.verticalSpacing};
|
|
1004
|
+
margin-top: calc(${wi.labelSize} + 2 * ${wi.verticalSpacing});
|
|
989
1005
|
}
|
|
990
1006
|
|
|
991
1007
|
.ft-text-area--outlined .ft-text-area--input-panel {
|
|
992
|
-
border-radius: ${
|
|
1008
|
+
border-radius: ${wi.borderRadiusS};
|
|
993
1009
|
}
|
|
994
1010
|
|
|
995
1011
|
.ft-text-area--helper-text {
|
|
996
|
-
padding: 0 12px 0 ${
|
|
997
|
-
color: ${
|
|
1012
|
+
padding: 0 12px 0 ${wi.horizontalSpacing};
|
|
1013
|
+
color: ${wi.helperColor};
|
|
998
1014
|
}
|
|
999
1015
|
|
|
1000
1016
|
.ft-text-area--in-error .ft-text-area--input,
|
|
1001
1017
|
.ft-text-area--in-error .ft-text-area--helper-text {
|
|
1002
|
-
color: ${
|
|
1018
|
+
color: ${wi.colorError};
|
|
1003
1019
|
}
|
|
1004
1020
|
|
|
1005
1021
|
ft-resizer {
|
|
1006
1022
|
position: absolute;
|
|
1007
1023
|
bottom: 0;
|
|
1008
1024
|
}
|
|
1009
|
-
`;var
|
|
1025
|
+
`;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 _i 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`
|
|
1010
1026
|
<style>
|
|
1011
1027
|
.ft-text-area--main-panel {
|
|
1012
|
-
height: calc(4 * ${
|
|
1028
|
+
height: calc(4 * ${wi.verticalSpacing} + ${wi.labelSize} + ${wi.fontSize} + ${this.height}px);
|
|
1013
1029
|
}
|
|
1014
1030
|
|
|
1015
1031
|
ft-resizer {
|
|
@@ -1026,7 +1042,7 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
1026
1042
|
></ft-input-label>
|
|
1027
1043
|
<div class="ft-text-area--input-panel"
|
|
1028
1044
|
aria-label="${this.label}">
|
|
1029
|
-
${this.outlined?null:
|
|
1045
|
+
${this.outlined?null:i.html`
|
|
1030
1046
|
<ft-ripple ?disabled=${this.disabled} activated></ft-ripple>
|
|
1031
1047
|
`}
|
|
1032
1048
|
<textarea class="ft-typography--body1 ft-text-area--input"
|
|
@@ -1043,19 +1059,19 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
1043
1059
|
initialHeight="${this.height}"
|
|
1044
1060
|
cursor="ns-resize"></ft-resizer>
|
|
1045
1061
|
</div>
|
|
1046
|
-
${this.helper?
|
|
1062
|
+
${this.helper?i.html`
|
|
1047
1063
|
<ft-typography class="ft-text-area--helper-text" variant="caption">
|
|
1048
1064
|
${this.helper}
|
|
1049
1065
|
</ft-typography>`:void 0}
|
|
1050
1066
|
</div>
|
|
1051
|
-
`}setValue(t,
|
|
1067
|
+
`}setValue(t,e=!1){this.value=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.dispatchEvent(new CustomEvent("live-change",{detail:this.value}))}onResize(t){t.detail.height>=50&&(this.height=t.detail.height)}}_i.elementDefinitions={"ft-input-label":$i,"ft-resizer":gi,"ft-ripple":ii,"ft-typography":He},_i.styles=[lt,ki],Si([o.property({type:String})],_i.prototype,"label",void 0),Si([o.property({reflect:!0})],_i.prototype,"value",void 0),Si([o.property({type:String})],_i.prototype,"helper",void 0),Si([o.property({type:Boolean})],_i.prototype,"outlined",void 0),Si([o.property({type:Boolean})],_i.prototype,"disabled",void 0),Si([o.property({type:Boolean})],_i.prototype,"error",void 0),Si([o.property({type:Number,reflect:!0})],_i.prototype,"height",void 0),Si([o.query("textarea")],_i.prototype,"textarea",void 0),Si([o.state()],_i.prototype,"focused",void 0),e.customElement("ft-text-area")(_i);class Ei extends e.FtLitElement{render(){return i.html`
|
|
1052
1068
|
<div class="ft-loader">
|
|
1053
1069
|
<div></div>
|
|
1054
1070
|
<div></div>
|
|
1055
1071
|
<div></div>
|
|
1056
1072
|
<div></div>
|
|
1057
1073
|
</div>
|
|
1058
|
-
`}}
|
|
1074
|
+
`}}Ei.styles=bt,e.customElement("ft-loader")(Ei);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 Ti extends e.FtLitElement{constructor(){super(...arguments),this.role="button",this.primary=!1,this.outlined=!1,this.disabled=!1,this.dense=!1,this.round=!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=>{this.isDisabled()&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation())}}render(){const t={"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};return this.addTooltipIfNeeded(i.html`
|
|
1059
1075
|
<button part="button"
|
|
1060
1076
|
class="${n.classMap(t)}"
|
|
1061
1077
|
aria-label="${this.getLabel()}"
|
|
@@ -1064,29 +1080,29 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
1064
1080
|
<ft-typography part="label"
|
|
1065
1081
|
variant="button"
|
|
1066
1082
|
element="span"
|
|
1067
|
-
class="ft-button--label ${
|
|
1083
|
+
class="ft-button--label ${e.isSafari?"ft-safari-ellipsis-fix":""}"
|
|
1068
1084
|
?hidden=${!this.hasTextContent()}>
|
|
1069
1085
|
<slot @slotchange=${this.onSlotchange}></slot>
|
|
1070
1086
|
</ft-typography>
|
|
1071
1087
|
${this.resolveIcon()}
|
|
1072
1088
|
</button>
|
|
1073
|
-
`)}addTooltipIfNeeded(t){return this.getLabel().trim().length>0&&(this.forceTooltip||!this.hasTextContent()&&!this.hideTooltip)?
|
|
1089
|
+
`)}addTooltipIfNeeded(t){return this.getLabel().trim().length>0&&(this.forceTooltip||!this.hasTextContent()&&!this.hideTooltip)?i.html`
|
|
1074
1090
|
<ft-tooltip part="tooltip"
|
|
1075
1091
|
text="${this.getLabel()}"
|
|
1076
1092
|
position="${this.tooltipPosition}">
|
|
1077
1093
|
${t}
|
|
1078
1094
|
</ft-tooltip>
|
|
1079
|
-
`:t}resolveIcon(){return this.loading?
|
|
1080
|
-
<ft-loader part="loader icon"></ft-loader> `:this.icon?
|
|
1081
|
-
<ft-icon part="icon" .variant="${this.iconVariant}" .value="${this.icon}"></ft-icon> `:
|
|
1082
|
-
`,
|
|
1083
|
-
`,
|
|
1095
|
+
`:t}resolveIcon(){return this.loading?i.html`
|
|
1096
|
+
<ft-loader part="loader icon"></ft-loader> `:this.icon?i.html`
|
|
1097
|
+
<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}}Ti.elementDefinitions={"ft-ripple":ii,"ft-tooltip":ti,"ft-typography":He,"ft-icon":Ke,"ft-loader":Ei},Ti.styles=[e.safariEllipsisFix,It],Ii([o.property({type:String,reflect:!0})],Ti.prototype,"role",void 0),Ii([o.property({type:Boolean})],Ti.prototype,"primary",void 0),Ii([o.property({type:Boolean})],Ti.prototype,"outlined",void 0),Ii([o.property({type:Boolean})],Ti.prototype,"disabled",void 0),Ii([o.property({type:Boolean})],Ti.prototype,"dense",void 0),Ii([o.property({type:Boolean})],Ti.prototype,"round",void 0),Ii([o.property()],Ti.prototype,"label",void 0),Ii([o.property()],Ti.prototype,"icon",void 0),Ii([o.property()],Ti.prototype,"iconVariant",void 0),Ii([o.property({type:Boolean})],Ti.prototype,"trailingIcon",void 0),Ii([o.property({type:Boolean})],Ti.prototype,"loading",void 0),Ii([o.property()],Ti.prototype,"tooltipPosition",void 0),Ii([o.property({type:Boolean})],Ti.prototype,"hideTooltip",void 0),Ii([o.property({type:Boolean})],Ti.prototype,"forceTooltip",void 0),Ii([o.query(".ft-button")],Ti.prototype,"button",void 0),Ii([o.query(".ft-button--label slot")],Ti.prototype,"slottedContent",void 0),e.customElement("ft-button")(Ti);const Ri=i.css`
|
|
1098
|
+
`,Ai=i.css`
|
|
1099
|
+
`,Oi=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}=Oi.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=Oi.subscribe((()=>{i=Ci.get(t),i&&(o(),e(i))}))}}))}}var Ni;const Ui=Symbol("clearAfterUnitTest");class Di{constructor(t){this.messageContextProvider=t,this.defaultMessages={},this.cache=new e.CacheRegistry,this.listeners={},this.currentUiLocale="",this[Ni]=()=>{this.defaultMessages={},this.cache=new e.CacheRegistry,this.listeners={}},this.currentUiLocale=Oi.getState().uiLocale,Oi.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=Oi.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)))))}}Ni=Ui,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new Di((async(t,e)=>(await Ci.await()).getFluidTopicsMessageContext(t,e)))),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new Di((async(t,e)=>(await Ci.await()).getCustomMessageContext(t,e))));const zi=window.FluidTopicsI18nService,Bi=window.FluidTopicsCustomI18nService;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};class Fi 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`
|
|
1084
1100
|
<slot></slot>
|
|
1085
|
-
`}
|
|
1101
|
+
`}update(t){super.update(t),t.has("baseUrl")&&Oi.actions.setBaseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&Oi.actions.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&Oi.actions.setUiLocale(this.uiLocale),t.has("noCustom")&&Oi.actions.setNoCustom(this.noCustom),t.has("editorMode")&&Oi.actions.setEditorMode(this.editorMode),t.has("noCustomComponent")&&Oi.actions.setNoCustomComponent(this.noCustomComponent),t.has("session")&&Oi.actions.setSession(this.session),t.has("availableUiLocales")&&Oi.actions.setAvailableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>zi.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()))))}}Fi.elementDefinitions={},Fi.styles=Ai,Mi([o.property()],Fi.prototype,"baseUrl",void 0),Mi([o.property()],Fi.prototype,"apiIntegrationIdentifier",void 0),Mi([o.property()],Fi.prototype,"uiLocale",void 0),Mi([e.jsonProperty([])],Fi.prototype,"availableUiLocales",void 0),Mi([o.property({type:Boolean})],Fi.prototype,"editorMode",void 0),Mi([o.property({type:Boolean})],Fi.prototype,"noCustom",void 0),Mi([o.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],Fi.prototype,"noCustomComponent",void 0),Mi([o.property({type:Boolean})],Fi.prototype,"withManualResources",void 0),Mi([e.jsonProperty([])],Fi.prototype,"messageContexts",void 0),Mi([e.jsonProperty(void 0)],Fi.prototype,"session",void 0),Mi([o.property({type:Object})],Fi.prototype,"apiProvider",void 0);class Li{async listMySearches(){var t;return(null===(t=Oi.getState().session)||void 0===t?void 0:t.sessionAuthenticated)?(await Ci.await()).listMySearches(Oi.getState().session.profile.userId):[]}}const Pi=new e.CacheRegistry;class ji{async listMyBookmarks(){return Pi.get("bookmarks",(async()=>(await Ci.await()).listMyBookmarks(Oi.getState().session.profile.userId)))}clearCache(){Pi.clear("bookmarks")}}const Hi=e.FtReduxStore.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});new class{constructor(){this.currentSession=Oi.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new ji,Oi.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:i}=Oi.getState();e.deepEqual(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==i?void 0:i.profile)||(this.currentSession=i,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){Hi.actions.savedSearches(void 0)}clearMyBookmarks(){Hi.actions.bookmarks(void 0)}async reloadMySearches(){const t=new Li,e=await t.listMySearches();Hi.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;Hi.actions.bookmarks(e)}}},e.customElement("ft-app-context")(Fi);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};const Ki=Symbol("i18nProperties"),Vi=Symbol("i18nUnsubs");function Gi(t){var e;class i extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map}get i18nService(){return this.useCustomMessageContexts?Bi:zi}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[Ki])||void 0===e||e.forEach(((e,i)=>{e.context.toLowerCase()===t.toLowerCase()&&(this[i]=this.i18n(e))})),setTimeout((()=>this.requestUpdate()),0)}update(t){var e;super.update(t),null===(e=this[Ki])||void 0===e||e.forEach(((t,e)=>{null!=t.argsProvider&&(this[e]=this.i18n(t))}))}connectedCallback(){super.connectedCallback(),null!=this[Ki]&&new Set([...this[Ki].values()].map((t=>t.context))).forEach((t=>this.addI18nMessages(t)))}addI18nMessages(t,e){t=t.toLowerCase(),this[Vi].has(t)||this[Vi].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[Vi].forEach((t=>t())),this[Vi].clear()}}return e=Vi,Zi([o.property({type:Boolean})],i.prototype,"useCustomMessageContexts",void 0),i}class Wi extends(Gi(e.FtLitElement)){}class Xi extends(Gi(e.FtLitElementRedux)){}var Yi=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 qi extends Xi{constructor(){super(),this.editorMode=!1,this.addStore(Oi)}render(){return this.key&&this.context?i.html`
|
|
1086
1102
|
<span class="ft-i18n">
|
|
1087
1103
|
${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}
|
|
1088
1104
|
</span>
|
|
1089
|
-
`:this.editorMode?"Select a context and a label key.":
|
|
1105
|
+
`: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})}}qi.elementDefinitions={},qi.styles=Ri,Yi([e.redux()],qi.prototype,"editorMode",void 0),Yi([o.property()],qi.prototype,"context",void 0),Yi([o.property()],qi.prototype,"key",void 0),Yi([e.jsonProperty([])],qi.prototype,"args",void 0),Yi([o.property()],qi.prototype,"defaultMessage",void 0);class Ji{static build(t){return new Ji(t)}static fromGwt(t){return new Ji(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)=>zi.resolveMessage(this.name,e,...t)})}}const Qi=(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[Ki]=null!==(n=i[Ki])&&void 0!==n?n:new Map,i[Ki].set(o,r)};e.customElement("ft-i18n")(qi);const to=Ji.build("integratedFeedbackComponent"),eo={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"},io=Ji.build("inDesignerFeedbackComponent"),oo={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."},so={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")},no=i.css`
|
|
1090
1106
|
*:focus {
|
|
1091
1107
|
outline: none;
|
|
1092
1108
|
}
|
|
@@ -1099,10 +1115,10 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
1099
1115
|
}
|
|
1100
1116
|
|
|
1101
1117
|
ft-input-label {
|
|
1102
|
-
${
|
|
1103
|
-
${
|
|
1104
|
-
${
|
|
1105
|
-
${
|
|
1118
|
+
${e.setVariable(xi.fontSize,so.fontSize)};
|
|
1119
|
+
${e.setVariable(xi.raisedFontSize,so.labelSize)};
|
|
1120
|
+
${e.setVariable(xi.verticalSpacing,so.verticalSpacing)};
|
|
1121
|
+
${e.setVariable(xi.horizontalSpacing,so.horizontalSpacing)};
|
|
1106
1122
|
}
|
|
1107
1123
|
|
|
1108
1124
|
.ft-text-field--main-panel {
|
|
@@ -1119,13 +1135,13 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
1119
1135
|
overflow: hidden;
|
|
1120
1136
|
padding: 0 ${so.horizontalSpacing};
|
|
1121
1137
|
|
|
1122
|
-
${
|
|
1123
|
-
${
|
|
1138
|
+
${e.setVariable(B.fontSize,so.fontSize)};
|
|
1139
|
+
${e.setVariable(B.lineHeight,so.fontSize)};
|
|
1124
1140
|
}
|
|
1125
1141
|
|
|
1126
1142
|
.ft-text-field--input-panel ft-ripple {
|
|
1127
|
-
${
|
|
1128
|
-
${
|
|
1143
|
+
${e.setVariable(c.opacityContentOnSurfaceHover,"0.08")};
|
|
1144
|
+
${e.setVariable(c.opacityContentOnSurfacePressed,"0.04")};
|
|
1129
1145
|
}
|
|
1130
1146
|
|
|
1131
1147
|
.ft-text-field--filled.ft-text-field--with-label .ft-text-field--input-panel {
|
|
@@ -1174,8 +1190,8 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
1174
1190
|
}
|
|
1175
1191
|
|
|
1176
1192
|
.ft-text-field:not(.ft-text-field--disabled):focus-within ft-input-label {
|
|
1177
|
-
${
|
|
1178
|
-
${
|
|
1193
|
+
${e.setVariable(xi.borderColor,so.colorPrimary)};
|
|
1194
|
+
${e.setVariable(xi.textColor,so.colorPrimary)};
|
|
1179
1195
|
}
|
|
1180
1196
|
|
|
1181
1197
|
.ft-text-field--filled .ft-text-field--input-panel {
|
|
@@ -1236,13 +1252,13 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
1236
1252
|
}
|
|
1237
1253
|
|
|
1238
1254
|
.ft-text-field--with-icon {
|
|
1239
|
-
${
|
|
1255
|
+
${e.setVariable(xi.labelMaxWidth,`calc(100% - ${gt.size} - ${xi.horizontalSpacing})`)};
|
|
1240
1256
|
}
|
|
1241
1257
|
|
|
1242
1258
|
.ft-text-field--with-password ft-icon:hover {
|
|
1243
1259
|
cursor: pointer;
|
|
1244
1260
|
}
|
|
1245
|
-
`;var ro=function(t,i,
|
|
1261
|
+
`;var ro=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 ao extends e.FtLitElement{constructor(){super(...arguments),this._value="",this.dispatchedValue="",this.outlined=!1,this.disabled=!1,this.error=!1,this.prefix=null,this.passwordHiddenIcon=Fe.EYE_SLASH,this.passwordRevealedIcon=Fe.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.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 i.html`
|
|
1246
1262
|
<div class="${n.classMap(t)}">
|
|
1247
1263
|
<div class="ft-text-field--main-panel"
|
|
1248
1264
|
@keydown=${this.handleKeyboardNavigation}
|
|
@@ -1253,16 +1269,16 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
1253
1269
|
?raised=${this.focused||""!=this.value}
|
|
1254
1270
|
?error=${this.error}></ft-input-label>
|
|
1255
1271
|
<div class="ft-text-field--input-panel">
|
|
1256
|
-
${this.outlined?
|
|
1272
|
+
${this.outlined?i.nothing:i.html`
|
|
1257
1273
|
<ft-ripple ?disabled=${this.disabled} activated></ft-ripple>
|
|
1258
1274
|
`}
|
|
1259
|
-
${this.prefix?
|
|
1275
|
+
${this.prefix?i.html`
|
|
1260
1276
|
<ft-typography class="ft-text-field--prefix" vaiant="body1">
|
|
1261
1277
|
${this.prefix}
|
|
1262
1278
|
</ft-typography>
|
|
1263
|
-
`:
|
|
1279
|
+
`:i.nothing}
|
|
1264
1280
|
<input type=${this.password&&this.hidePassword?"password":"text"}
|
|
1265
|
-
maxlength=${(t=>null!=t?t:
|
|
1281
|
+
maxlength=${(t=>null!=t?t:xe)(this.maxLength||void 0)}
|
|
1266
1282
|
aria-label="${this.label}"
|
|
1267
1283
|
class="ft-typography--body1 ft-text-field--input"
|
|
1268
1284
|
?disabled=${this.disabled}
|
|
@@ -1277,23 +1293,23 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
1277
1293
|
<slot @slotchange=${()=>this.filterSuggestionsIfNeeded()}></slot>
|
|
1278
1294
|
</div>
|
|
1279
1295
|
</div>
|
|
1280
|
-
${this.helper?
|
|
1296
|
+
${this.helper?i.html`
|
|
1281
1297
|
<ft-typography class="ft-text-field--helper-text" variant="caption">
|
|
1282
1298
|
${this.helper}
|
|
1283
1299
|
</ft-typography>
|
|
1284
|
-
`:
|
|
1300
|
+
`:i.nothing}
|
|
1285
1301
|
</div>
|
|
1286
|
-
`}renderPasswordIcon(){return
|
|
1302
|
+
`}renderPasswordIcon(){return i.html`
|
|
1287
1303
|
<ft-icon class="ft-text-field--icon"
|
|
1288
1304
|
.variant=${this.iconVariant}
|
|
1289
1305
|
.value=${this.hidePassword?this.passwordHiddenIcon:this.passwordRevealedIcon}
|
|
1290
1306
|
@click=${()=>this.togglePasswordVisibility()}></ft-icon>
|
|
1291
|
-
`}renderIcon(){return this.password?this.renderPasswordIcon():this.icon?
|
|
1307
|
+
`}renderIcon(){return this.password?this.renderPasswordIcon():this.icon?i.html`
|
|
1292
1308
|
<ft-icon class="ft-text-field--icon"
|
|
1293
1309
|
.variant=${this.iconVariant}
|
|
1294
1310
|
.value=${this.icon}
|
|
1295
1311
|
@click=${()=>{var t;return null===(t=this.input)||void 0===t?void 0:t.focus()}}></ft-icon>
|
|
1296
|
-
`:
|
|
1312
|
+
`:i.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,i;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(),o=null===(i=this.suggestionsContainer)||void 0===i?void 0:i.getBoundingClientRect();t&&o&&(this.suggestionsOnTop=t.bottom+o.height>window.innerHeight&&t.top-o.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 i=(null===(e=this.input)||void 0===e?void 0:e.value)||"";this.setValue(i,"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 i=this.visibleSuggestions.findIndex((t=>t.matches(":focus-within")));let o;o="ArrowDown"===t.key?i<this.visibleSuggestions.length-1?i+1:0:i>0?i-1:this.visibleSuggestions.length-1,null===(e=this.visibleSuggestions[o])||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}}ao.elementDefinitions={"ft-input-label":$i,"ft-ripple":ii,"ft-typography":He,"ft-icon":Ke},ao.styles=[lt,no],ro([o.property()],ao.prototype,"label",void 0),ro([o.property({noAccessor:!0})],ao.prototype,"value",null),ro([o.state()],ao.prototype,"dispatchedValue",void 0),ro([o.property()],ao.prototype,"helper",void 0),ro([o.property({type:Boolean})],ao.prototype,"outlined",void 0),ro([o.property({type:Boolean})],ao.prototype,"disabled",void 0),ro([o.property({type:Boolean})],ao.prototype,"error",void 0),ro([o.property()],ao.prototype,"prefix",void 0),ro([o.property()],ao.prototype,"icon",void 0),ro([o.property()],ao.prototype,"passwordHiddenIcon",void 0),ro([o.property()],ao.prototype,"passwordRevealedIcon",void 0),ro([o.property()],ao.prototype,"iconVariant",void 0),ro([o.property({type:Boolean})],ao.prototype,"filterSuggestions",void 0),ro([o.property({type:Number})],ao.prototype,"maxLength",void 0),ro([o.property({type:Boolean})],ao.prototype,"password",void 0),ro([o.state()],ao.prototype,"focused",void 0),ro([o.state()],ao.prototype,"hidePassword",void 0),ro([o.state()],ao.prototype,"suggestionsOnTop",void 0),ro([o.state()],ao.prototype,"hideSuggestions",void 0),ro([o.state()],ao.prototype,"visibleSuggestions",void 0),ro([o.query(".ft-text-field--main-panel")],ao.prototype,"mainPanel",void 0),ro([o.query(".ft-text-field--input")],ao.prototype,"input",void 0),ro([o.query(".ft-text-field--suggestions")],ao.prototype,"suggestionsContainer",void 0),ro([o.queryAssignedElements({selector:"ft-text-field-suggestion"})],ao.prototype,"suggestions",void 0);const lo=i.css`
|
|
1297
1313
|
.ft-text-field-suggestion {
|
|
1298
1314
|
position: relative;
|
|
1299
1315
|
padding: 8px 16px;
|
|
@@ -1318,7 +1334,7 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
1318
1334
|
slot {
|
|
1319
1335
|
pointer-events: none;
|
|
1320
1336
|
}
|
|
1321
|
-
`;var ho,fo=function(t,i,
|
|
1337
|
+
`;var ho,fo=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 co extends CustomEvent{constructor(t){super("suggestion-selected",{detail:t,bubbles:!0,composed:!0})}}class po extends e.FtLitElement{render(){return i.html`
|
|
1322
1338
|
<div class="ft-text-field-suggestion"
|
|
1323
1339
|
tabindex="-1"
|
|
1324
1340
|
@keydown=${this.onKeyDown}
|
|
@@ -1330,9 +1346,9 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
1330
1346
|
<slot></slot>
|
|
1331
1347
|
</ft-typography>
|
|
1332
1348
|
</div>
|
|
1333
|
-
`}focus(t){var
|
|
1349
|
+
`}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 co(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())}}po.elementDefinitions={"ft-ripple":ii,"ft-typography":He,"ft-icon":Ke},po.styles=lo,fo([o.property()],po.prototype,"value",void 0),fo([o.query(".ft-text-field-suggestion")],po.prototype,"container",void 0),fo([o.queryAssignedNodes()],po.prototype,"assignedNodes",void 0),e.customElement("ft-text-field")(ao),e.customElement("ft-text-field-suggestion")(po),function(t){t.FEEDBACK="FEEDBACK",t.RATING="RATING",t.PRINT="PRINT",t.BOOKMARK="BOOKMARK",t.COLLECTIONS="COLLECTIONS"}(ho||(ho={}));var uo=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 vo extends(Gi(d)){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(to,eo),this.addI18nContext(io,oo)}get canAccessFeedback(){var t;return this.user&&Xt(this.user.roles,"FEEDBACK_USER")&&(null===(t=this.service)||void 0===t?void 0:t.isFeatureAccessible(ho.FEEDBACK))}get canAccessRating(){var t;return this.userHasRatingRole&&"NO_RATING"!==this.configuredRatingType&&(null===(t=this.service)||void 0===t?void 0:t.isFeatureAccessible(ho.RATING))}get userHasRatingRole(){return this.user&&Xt(this.user.roles,"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`
|
|
1334
1350
|
<div class="ft-reader-feedback">
|
|
1335
|
-
${this.hideTitle?
|
|
1351
|
+
${this.hideTitle?i.nothing:i.html`
|
|
1336
1352
|
<ft-typography variant="title" part="main-title">
|
|
1337
1353
|
${this.i18n(this.i18nProperties.feedbackMainTitle)}
|
|
1338
1354
|
</ft-typography>
|
|
@@ -1340,7 +1356,7 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
1340
1356
|
${this.renderRatingSection()}
|
|
1341
1357
|
${this.renderFeedbackSection()}
|
|
1342
1358
|
</div>
|
|
1343
|
-
`:
|
|
1359
|
+
`:i.nothing}renderRatingSection(){return this.canAccessRating?i.html`
|
|
1344
1360
|
<div class="ft-reader-feedback--rating" part="rating-container">
|
|
1345
1361
|
<ft-typography variant="title-dense" part="section-title" class="ft-reader-feedback--section-title">
|
|
1346
1362
|
${this.i18n("DICHOTOMOUS"===this.ratingSummary.type?this.i18nProperties.dichotomousRatingSectionTitle:this.i18nProperties.ratingSectionTitle)}
|
|
@@ -1350,9 +1366,9 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
1350
1366
|
${this.renderRatingDate()}
|
|
1351
1367
|
</ft-typography>
|
|
1352
1368
|
</div>
|
|
1353
|
-
`:this.placeholderInEditor(this.userHasRatingRole?
|
|
1369
|
+
`:this.placeholderInEditor(this.userHasRatingRole?io.messages.ratingNotConfigured():io.messages.missingRatingRole())}renderRatingDate(){const t=this.ratingDate;if(null==t)return to.messages.notRated();if(t.getTime()>(new Date).getTime()-6e4)return to.messages.ratedNow();return(new Date).toLocaleDateString()===t.toLocaleDateString()?to.messages.ratedToday():to.messages.ratedOn(t)}renderRating(){switch(this.configuredRatingType){case"STARS":return i.html`
|
|
1354
1370
|
<div class="ft-reader-feedback--stars" part="rating rating-stars">
|
|
1355
|
-
${r.repeat(new Array(5),((t,
|
|
1371
|
+
${r.repeat(new Array(5),((t,e)=>e),((t,e)=>{let o="STARS"===this.ratingType&&this.ratingValue>e;const s=e+1;return i.html`
|
|
1356
1372
|
<ft-button round part="rating-stars-${s}"
|
|
1357
1373
|
label="${to.messages.starsRating(s)}"
|
|
1358
1374
|
tooltipPosition="top"
|
|
@@ -1363,14 +1379,14 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
1363
1379
|
></ft-button>
|
|
1364
1380
|
`}))}
|
|
1365
1381
|
</div>
|
|
1366
|
-
`;case"LIKE":const t="LIKE"===this.ratingType&&0===this.ratingValue,
|
|
1382
|
+
`;case"LIKE":const t="LIKE"===this.ratingType&&0===this.ratingValue,e="LIKE"===this.ratingType&&1===this.ratingValue;return i.html`
|
|
1367
1383
|
<ft-switch unselectable
|
|
1368
1384
|
@change=${t=>this.rate(t.detail)}
|
|
1369
1385
|
part="rating rating-like">
|
|
1370
1386
|
<ft-switch-option .value=${1}
|
|
1371
|
-
?selected=${
|
|
1387
|
+
?selected=${e}
|
|
1372
1388
|
.iconVariant=${this.iconVariant}
|
|
1373
|
-
icon="${
|
|
1389
|
+
icon="${e?this.filledLikeIcon:this.emptyLikeIcon}">
|
|
1374
1390
|
${to.messages.like()}
|
|
1375
1391
|
</ft-switch-option>
|
|
1376
1392
|
<ft-switch-option .value=${0}
|
|
@@ -1380,7 +1396,7 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
1380
1396
|
${to.messages.dislike()}
|
|
1381
1397
|
</ft-switch-option>
|
|
1382
1398
|
</ft-switch>
|
|
1383
|
-
`;case"DICHOTOMOUS":const o="DICHOTOMOUS"===this.ratingType&&0===this.ratingValue,s="DICHOTOMOUS"===this.ratingType&&1===this.ratingValue;return
|
|
1399
|
+
`;case"DICHOTOMOUS":const o="DICHOTOMOUS"===this.ratingType&&0===this.ratingValue,s="DICHOTOMOUS"===this.ratingType&&1===this.ratingValue;return i.html`
|
|
1384
1400
|
<ft-switch unselectable
|
|
1385
1401
|
@change=${t=>this.rate(t.detail)}
|
|
1386
1402
|
part="rating rating-dichotomous">
|
|
@@ -1393,7 +1409,7 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
1393
1409
|
${to.messages.dichotomousNo()}
|
|
1394
1410
|
</ft-switch-option>
|
|
1395
1411
|
</ft-switch>
|
|
1396
|
-
`}return
|
|
1412
|
+
`}return i.nothing}rate(t){(null!=t?t:-1)!==this.ratingValue&&this.dispatchEvent(new CustomEvent("rate",{detail:t}))}renderFeedbackSection(){var t,e;if(this.canAccessFeedback){const o=this.feedbackMailLinkBuilder(this.feedbackMessage);let s=i.html`
|
|
1397
1413
|
<ft-button primary
|
|
1398
1414
|
class="ft-reader-feedback--send-feedback"
|
|
1399
1415
|
?disabled=${!this.feedbackMessage||!this.validFromEmail()}
|
|
@@ -1401,24 +1417,24 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
1401
1417
|
part="send-feedback">
|
|
1402
1418
|
${to.messages.okButton()}
|
|
1403
1419
|
</ft-button>
|
|
1404
|
-
`;return o&&(s=
|
|
1420
|
+
`;return o&&(s=i.html`
|
|
1405
1421
|
<a class="ft-reader-feedback--feedback-link" href="${o}">
|
|
1406
1422
|
${s}
|
|
1407
1423
|
</a>
|
|
1408
|
-
`),
|
|
1424
|
+
`),i.html`
|
|
1409
1425
|
<div class="ft-reader-feedback--feedback" part="feedback-container">
|
|
1410
1426
|
<ft-typography variant="title-dense" part="section-title" class="ft-reader-feedback--section-title">
|
|
1411
1427
|
${this.i18n(this.i18nProperties.feedbackSectionTitle)}
|
|
1412
1428
|
</ft-typography>
|
|
1413
|
-
${null==(null===(t=this.user)||void 0===t?void 0:t.userId)&&(null===(
|
|
1414
|
-
<ft-text-field
|
|
1429
|
+
${null==(null===(t=this.user)||void 0===t?void 0:t.userId)&&(null===(e=this.configuration)||void 0===e?void 0:e.mailsSentByFluidTopicsForUnauthenticatedUsers)?i.html`
|
|
1430
|
+
<ft-text-field outlined
|
|
1415
1431
|
class="ft-reader-feedback--from-input"
|
|
1416
1432
|
label=${to.messages.feedbackfromEmail()}
|
|
1417
1433
|
@live-change=${t=>this.from=t.detail.trim()}
|
|
1418
1434
|
?error=${this.from&&!this.validFromEmail()}
|
|
1419
1435
|
helper=${this.from&&!this.validFromEmail()?to.messages.feedbackfromEmailInvalid():""}
|
|
1420
1436
|
/>
|
|
1421
|
-
`:
|
|
1437
|
+
`:i.nothing}
|
|
1422
1438
|
<ft-text-area outlined
|
|
1423
1439
|
class="ft-reader-feedback--feedback-input" part="feedback-input"
|
|
1424
1440
|
label="${to.messages.feedbackInputLabel()}"
|
|
@@ -1426,15 +1442,15 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
1426
1442
|
></ft-text-area>
|
|
1427
1443
|
${s}
|
|
1428
1444
|
</div>
|
|
1429
|
-
`}return this.placeholderInEditor(
|
|
1445
|
+
`}return this.placeholderInEditor(io.messages.missingFeedbackRole())}validFromEmail(){var t,e;return!(null==(null===(t=this.user)||void 0===t?void 0:t.userId)&&(null===(e=this.configuration)||void 0===e?void 0:e.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?i.html`
|
|
1430
1446
|
<div class="ft-reader-feedback--placeholder">
|
|
1431
1447
|
<ft-typography variant="caption">${t}</ft-typography>
|
|
1432
1448
|
<ft-tooltip position="left"
|
|
1433
|
-
text="${
|
|
1449
|
+
text="${io.messages.inDesignerOnlyNotice()}">
|
|
1434
1450
|
<ft-icon>INFO</ft-icon>
|
|
1435
1451
|
</ft-tooltip>
|
|
1436
1452
|
</div>
|
|
1437
|
-
`:
|
|
1453
|
+
`:i.nothing}onMailerFeedbackSent(){this.dispatchEvent(new CustomEvent("mailer-feedback"))}clearFeedbackInput(){setTimeout((()=>this.feedbackInput.value=""),0)}}vo.elementDefinitions={"ft-button":Ti,"ft-typography":He,"ft-icon":Ke,"ft-tooltip":ti,"ft-switch":fi,"ft-switch-option":li,"ft-text-area":_i,"ft-text-field":ao},vo.styles=At,uo([o.property({type:Boolean})],vo.prototype,"editorMode",void 0),uo([o.property({type:Boolean})],vo.prototype,"hideTitle",void 0),uo([o.property({type:Boolean})],vo.prototype,"ratingAllowed",void 0),uo([o.property({attribute:!1})],vo.prototype,"i18nProperties",void 0),uo([o.property({attribute:!1})],vo.prototype,"ratingSummary",void 0),uo([o.property({attribute:!1})],vo.prototype,"user",void 0),uo([o.query(".ft-reader-feedback--feedback-input")],vo.prototype,"feedbackInput",void 0),uo([o.state()],vo.prototype,"from",void 0),uo([o.state()],vo.prototype,"feedbackMessage",void 0),uo([o.property()],vo.prototype,"iconVariant",void 0),uo([o.property()],vo.prototype,"emptyStarIcon",void 0),uo([o.property()],vo.prototype,"filledStarIcon",void 0),uo([o.property()],vo.prototype,"emptyLikeIcon",void 0),uo([o.property()],vo.prototype,"filledLikeIcon",void 0),uo([o.property()],vo.prototype,"emptyDislikeIcon",void 0),uo([o.property()],vo.prototype,"filledDislikeIcon",void 0),uo([e.redux({store:"reader",selector:t=>{var e;return null===(e=t.configuration)||void 0===e?void 0:e.feedback}})],vo.prototype,"configuration",void 0),uo([o.property()],vo.prototype,"feedbackMailLinkBuilder",void 0);const bo=Ji.fromGwt("server");class go{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,o;if(0===t.length||this.isAuthenticated&&(null==this.configuration||(null===(e=this.configuration)||void 0===e?void 0:e.mailsSentByFluidTopics))||(null===(i=this.configuration)||void 0===i?void 0:i.mailsSentByFluidTopicsForUnauthenticatedUsers))return;const s=encodeURIComponent(this.subject+" "+this.subjectMetadata),n=encodeURIComponent(`\n${this.bodyMetadata}\n${this.url}\n_________________________________________________________________\n\n${t}\n\n_________________________________________________________________\n${bo.messages["mail.feedback.disclaimer"]()}`);return`mailto:${null===(o=this.configuration)||void 0===o?void 0:o.recipients.join(",")}?subject=${s}&body=${n}`}}var xo=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 yo extends(Gi(d)){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.iconVariant=Pe.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 go,this.i18nProperties={feedbackMainTitle:to.properties.mapFeedbackMainTitle(),ratingSectionTitle:to.properties.mapRatingSectionTitle(),dichotomousRatingSectionTitle:to.properties.mapDichotomousRatingSectionTitle(),feedbackSectionTitle:to.properties.mapFeedbackSectionTitle()},this.updateDebouncer=new e.Debouncer(100),this.sendRatingDebouncer=new e.Debouncer(500),this.addStore(Oi)}render(){return this.map&&(this.editorMode||this.componentVisible)?i.html`
|
|
1438
1454
|
<ft-reader-feedback
|
|
1439
1455
|
ratingAllowed
|
|
1440
1456
|
.i18nProperties=${this.i18nProperties}
|
|
@@ -1454,13 +1470,13 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
1454
1470
|
@send-feedback=${this.sendFeedback}
|
|
1455
1471
|
@mailer-feedback=${this.onMailerFeedbackSent}
|
|
1456
1472
|
></ft-reader-feedback>
|
|
1457
|
-
`:
|
|
1473
|
+
`:i.html`
|
|
1458
1474
|
<style>
|
|
1459
1475
|
:host {
|
|
1460
1476
|
display: none !important;
|
|
1461
1477
|
}
|
|
1462
1478
|
</style>
|
|
1463
|
-
`}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)}
|
|
1479
|
+
`}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)}update(t){var e,i,o;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!==(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:to.messages.ratingFailure()}))}this.updateData()}else this.editorMode&&this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:io.messages.feedbackAndRatingDisabledInEditor()}))}async sendFeedback(t){var i;try{this.editorMode?this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:io.messages.feedbackAndRatingDisabledInEditor()})):(await(null===(i=this.service)||void 0===i?void 0:i.sendMapFeedback(t.detail.message,t.detail.from)),this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:to.messages.feedbackSuccess()}))),this.readerFeedback.clearFeedbackInput()}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:to.messages.feedbackFailure()}))}}onMailerFeedbackSent(){this.dispatchEvent(new CustomEvent("ft-reader-mailer-map-feedback",{composed:!0,bubbles:!0}))}}yo.elementDefinitions={"ft-reader-feedback":vo},xo([e.redux({store:Oi.name,selector:t=>{var e;return null===(e=t.session)||void 0===e?void 0:e.profile}})],yo.prototype,"user",void 0),xo([e.redux({store:"reader"})],yo.prototype,"map",void 0),xo([e.redux({store:Oi.name})],yo.prototype,"editorMode",void 0),xo([e.redux({store:"reader",selector:t=>{var e;return null===(e=t.configuration)||void 0===e?void 0:e.feedback}})],yo.prototype,"configuration",void 0),xo([o.state()],yo.prototype,"ratingSummary",void 0),xo([o.property({type:Boolean})],yo.prototype,"hideTitle",void 0),xo([o.property()],yo.prototype,"iconVariant",void 0),xo([o.property()],yo.prototype,"emptyStarIcon",void 0),xo([o.property()],yo.prototype,"filledStarIcon",void 0),xo([o.property()],yo.prototype,"emptyLikeIcon",void 0),xo([o.property()],yo.prototype,"filledLikeIcon",void 0),xo([o.property()],yo.prototype,"emptyDislikeIcon",void 0),xo([o.property()],yo.prototype,"filledDislikeIcon",void 0),xo([o.query("ft-reader-feedback")],yo.prototype,"readerFeedback",void 0),xo([Qi(bo.properties["mail.map_feedback.subject"]((t=>{var e;return[null===(e=t.map)||void 0===e?void 0:e.title]})))],yo.prototype,"mailSubject",void 0);var mo=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 $o extends Event{constructor(){super("register-ft-reader-topic-component",{bubbles:!0,composed:!0})}}const wo=Symbol("registerInterval");class ko extends(function(t){var e;class i extends t{constructor(){super(...arguments),this.disableContextInteractions=!1,this[e]=0}connectedCallback(){super.connectedCallback(),this[wo]=window.setInterval((()=>this.tryToRegisterToTopicContext()),50)}tryToRegisterToTopicContext(){null!=this.tocNode?window.clearInterval(this[wo]):this.dispatchEvent(new $o)}disconnectedCallback(){super.disconnectedCallback(),this.tocNode=void 0}}return e=wo,mo([o.state()],i.prototype,"tocNode",void 0),mo([o.state()],i.prototype,"disableContextInteractions",void 0),i}(d)){}var So=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 _o extends(Gi(ko)){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.iconVariant=Pe.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 go,this.i18nProperties={feedbackMainTitle:to.properties.topicFeedbackMainTitle(),ratingSectionTitle:to.properties.topicRatingSectionTitle(),dichotomousRatingSectionTitle:to.properties.topicDichotomousRatingSectionTitle(),feedbackSectionTitle:to.properties.topicFeedbackSectionTitle()},this.updateDebouncer=new e.Debouncer(100),this.sendRatingDebouncer=new e.Debouncer(500),this.addStore(Oi)}render(){return this.map&&this.tocNode&&(this.editorMode||this.componentVisible)?i.html`
|
|
1464
1480
|
<ft-reader-feedback
|
|
1465
1481
|
.i18nProperties=${this.i18nProperties}
|
|
1466
1482
|
?ratingAllowed=${this.tocNode.hasRating}
|
|
@@ -1480,10 +1496,10 @@ const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void
|
|
|
1480
1496
|
@send-feedback=${this.sendFeedback}
|
|
1481
1497
|
@mailer-feedback=${this.onMailerFeedbackSent}
|
|
1482
1498
|
></ft-reader-feedback>
|
|
1483
|
-
`:
|
|
1499
|
+
`:i.html`
|
|
1484
1500
|
<style>
|
|
1485
1501
|
:host {
|
|
1486
1502
|
display: none !important;
|
|
1487
1503
|
}
|
|
1488
1504
|
</style>
|
|
1489
|
-
`}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)}
|
|
1505
|
+
`}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)}update(t){var e,i,o;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!==(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:to.messages.ratingFailure()}))}this.updateData()}else this.editorMode&&this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:io.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.message,t.detail.from)),this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:to.messages.feedbackSuccess()})),this.readerFeedback.clearFeedbackInput()):this.editorMode&&this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:io.messages.feedbackAndRatingDisabledInEditor()}))}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:to.messages.feedbackFailure()}))}}onMailerFeedbackSent(){const t=this.tocNode;this.dispatchEvent(new CustomEvent("ft-reader-mailer-topic-feedback",{detail:{topic:t},composed:!0,bubbles:!0}))}}_o.elementDefinitions={"ft-reader-feedback":vo},So([e.redux({store:Oi.name,selector:t=>{var e;return null===(e=t.session)||void 0===e?void 0:e.profile}})],_o.prototype,"user",void 0),So([e.redux({store:"reader"})],_o.prototype,"map",void 0),So([e.redux({store:Oi.name})],_o.prototype,"editorMode",void 0),So([e.redux({store:"reader",selector:t=>{var e;return null===(e=t.configuration)||void 0===e?void 0:e.feedback}})],_o.prototype,"configuration",void 0),So([o.state()],_o.prototype,"ratingSummary",void 0),So([o.property({type:Boolean})],_o.prototype,"hideTitle",void 0),So([o.property()],_o.prototype,"iconVariant",void 0),So([o.property()],_o.prototype,"emptyStarIcon",void 0),So([o.property()],_o.prototype,"filledStarIcon",void 0),So([o.property()],_o.prototype,"emptyLikeIcon",void 0),So([o.property()],_o.prototype,"filledLikeIcon",void 0),So([o.property()],_o.prototype,"emptyDislikeIcon",void 0),So([o.property()],_o.prototype,"filledDislikeIcon",void 0),So([o.query("ft-reader-feedback")],_o.prototype,"readerFeedback",void 0),So([Qi(bo.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]})))],_o.prototype,"mailSubject",void 0),e.customElement("ft-reader-map-feedback")(yo),e.customElement("ft-reader-topic-feedback")(_o),t.FtReaderFeedbackCssVariables=Rt,t.FtReaderMapFeedback=yo,t.FtReaderTopicFeedback=_o,t.styles=At}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litUnsafeHTML,ftGlobals.litClassMap,ftGlobals.litRepeat);
|