@mrfylke/contact-form 0.1.33 → 0.1.34

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.
Files changed (103) hide show
  1. package/README.md +0 -22
  2. package/lib/commoneEvents.d.ts +1 -1
  3. package/lib/commoneEvents.d.ts.map +1 -1
  4. package/lib/components/form/date-selector.d.ts +4 -1
  5. package/lib/components/form/date-selector.d.ts.map +1 -1
  6. package/lib/components/form/date-selector.js +2 -2
  7. package/lib/components/form/form.module.css +0 -74
  8. package/lib/components/form/input.d.ts +2 -6
  9. package/lib/components/form/input.d.ts.map +1 -1
  10. package/lib/components/form/input.js +7 -22
  11. package/lib/components/form/time-selector.d.ts.map +1 -1
  12. package/lib/components/form/time-selector.js +1 -1
  13. package/lib/components/icon/generated-icons.js +8 -8
  14. package/lib/index.d.ts +1 -1
  15. package/lib/index.d.ts.map +1 -1
  16. package/lib/journey-info/journeyInfoStateMachine.d.ts +2 -2
  17. package/lib/layouts/contact-pages.d.ts.map +1 -1
  18. package/lib/layouts/contact-pages.js +7 -2
  19. package/lib/lines/use-lines.d.ts +1 -0
  20. package/lib/lines/use-lines.d.ts.map +1 -1
  21. package/lib/lines/use-lines.js +1 -0
  22. package/lib/lost-property/LostPropertyForm.d.ts +6 -0
  23. package/lib/lost-property/LostPropertyForm.d.ts.map +1 -1
  24. package/lib/lost-property/LostPropertyForm.js +54 -12
  25. package/lib/lost-property/LostPropertyMachine.d.ts +5 -4
  26. package/lib/lost-property/LostPropertyMachine.d.ts.map +1 -1
  27. package/lib/lost-property/LostPropertyMachine.js +5 -1
  28. package/lib/lost-property/index.d.ts.map +1 -1
  29. package/lib/lost-property/index.js +40 -3
  30. package/lib/means-of-transport/means-of-transport-form-machine.d.ts +2 -2
  31. package/lib/modules/api-browser/index.d.ts +1 -1
  32. package/lib/modules/api-browser/index.d.ts.map +1 -1
  33. package/lib/modules/api-browser/index.js +5 -1
  34. package/lib/modules/config/context.d.ts.map +1 -1
  35. package/lib/modules/config/context.js +1 -4
  36. package/lib/modules/config/theme-adapter.d.ts.map +1 -1
  37. package/lib/modules/config/theme-adapter.js +2 -0
  38. package/lib/modules/config/types.d.ts +33 -4
  39. package/lib/modules/config/types.d.ts.map +1 -1
  40. package/lib/modules/transport-mode/utils.d.ts +2 -2
  41. package/lib/modules/transport-mode/utils.d.ts.map +1 -1
  42. package/lib/refund/events.d.ts +3 -3
  43. package/lib/refund/events.d.ts.map +1 -1
  44. package/lib/refund/forms/refund-and-travel-guarantee/index.d.ts.map +1 -1
  45. package/lib/refund/forms/refund-and-travel-guarantee/index.js +9 -2
  46. package/lib/refund/forms/refund-and-travel-guarantee/pre-purchased-ticket-refund-form/index.d.ts +11 -0
  47. package/lib/refund/forms/refund-and-travel-guarantee/pre-purchased-ticket-refund-form/index.d.ts.map +1 -0
  48. package/lib/refund/forms/refund-and-travel-guarantee/pre-purchased-ticket-refund-form/index.js +159 -0
  49. package/lib/refund/forms/refund-and-travel-guarantee/pre-purchased-ticket-refund-form/pre-purchased-ticket-refund-form.module.css +73 -0
  50. package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.d.ts.map +1 -1
  51. package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.js +2 -2
  52. package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.d.ts.map +1 -1
  53. package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.js +2 -2
  54. package/lib/refund/forms/refund-ticket/appTicketRefund.d.ts.map +1 -1
  55. package/lib/refund/forms/refund-ticket/appTicketRefund.js +2 -7
  56. package/lib/refund/forms/refund-ticket/otherTicketRefund.d.ts.map +1 -1
  57. package/lib/refund/forms/refund-ticket/otherTicketRefund.js +4 -10
  58. package/lib/refund/refundFormMachine.d.ts +38 -7
  59. package/lib/refund/refundFormMachine.d.ts.map +1 -1
  60. package/lib/refund/refundFormMachine.js +46 -0
  61. package/lib/server/journey-planner/entur-client.d.ts +2 -1
  62. package/lib/server/journey-planner/entur-client.d.ts.map +1 -1
  63. package/lib/ticket-control/forms/feeComplaintForm.js +4 -10
  64. package/lib/ticket-control/forms/postponePayment.d.ts.map +1 -1
  65. package/lib/ticket-control/forms/postponePayment.js +2 -6
  66. package/lib/ticket-control/ticket-control-form-machine.d.ts +2 -2
  67. package/lib/ticketing/forms/app/appAccountForm.d.ts.map +1 -1
  68. package/lib/ticketing/forms/app/appAccountForm.js +1 -3
  69. package/lib/ticketing/forms/app/appTicketingForm.d.ts.map +1 -1
  70. package/lib/ticketing/forms/app/appTicketingForm.js +2 -8
  71. package/lib/ticketing/forms/travel-card/travelCardQuestionForm.d.ts.map +1 -1
  72. package/lib/ticketing/forms/travel-card/travelCardQuestionForm.js +5 -8
  73. package/lib/ticketing/forms/webshop/webshopAccountForm.d.ts.map +1 -1
  74. package/lib/ticketing/forms/webshop/webshopAccountForm.js +1 -3
  75. package/lib/ticketing/forms/webshop/webshopTicketingForm.d.ts.map +1 -1
  76. package/lib/ticketing/forms/webshop/webshopTicketingForm.js +2 -7
  77. package/lib/ticketing/ticketingStateMachine.d.ts +2 -2
  78. package/lib/translations/commons.d.ts +1 -1
  79. package/lib/translations/commons.d.ts.map +1 -1
  80. package/lib/translations/commons.js +3 -1
  81. package/lib/translations/language-context.js +1 -1
  82. package/lib/translations/pages/contact.d.ts +31 -9
  83. package/lib/translations/pages/contact.d.ts.map +1 -1
  84. package/lib/translations/pages/contact.js +36 -18
  85. package/lib/translations/translations-context.d.ts +11 -4
  86. package/lib/translations/translations-context.d.ts.map +1 -1
  87. package/lib/translations/translations-context.js +18 -11
  88. package/lib/types/submit-payloads.d.ts +12 -0
  89. package/lib/types/submit-payloads.d.ts.map +1 -1
  90. package/lib/utils/rich-text.d.ts +2 -2
  91. package/lib/utils/rich-text.js +8 -3
  92. package/lib/utils.d.ts +56 -3
  93. package/lib/utils.d.ts.map +1 -1
  94. package/lib/validation/commonInputValidator.d.ts +1 -1
  95. package/lib/validation/commonInputValidator.d.ts.map +1 -1
  96. package/lib/validation/commonInputValidator.js +3 -3
  97. package/lib/validation/validationRules.d.ts +2 -0
  98. package/lib/validation/validationRules.d.ts.map +1 -1
  99. package/lib/validation/validationRules.js +26 -1
  100. package/package.json +12 -6
  101. package/lib/components/form/description-modal.d.ts +0 -13
  102. package/lib/components/form/description-modal.d.ts.map +0 -1
  103. package/lib/components/form/description-modal.js +0 -44
@@ -3,18 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TravelCardQuestionForm = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const translations_1 = require("../../../translations");
6
- const typography_1 = require("../../../components/typography");
7
6
  const components_1 = require("../../../components");
8
7
  const TravelCardQuestionForm = ({ state, send, }) => {
9
8
  const PageText = (0, translations_1.usePageText)();
10
9
  const { t } = (0, translations_1.useTranslation)();
11
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.ticketing.travelCard.travelCardQuestion.label), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.input.travelCardNumber.info) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "travelCardNumber", label: t(PageText.Contact.input.travelCardNumber.label), type: "text", name: "travelCardNumber", value: state.context.travelCardNumber || '', modalContent: {
12
- description: t(PageText.Contact.input.travelCardNumber.info),
13
- }, isRequired: true, errorMessage: state.context?.errorMessages['travelCardNumber']?.[0], onChange: (e) => send({
14
- type: 'ON_INPUT_CHANGE',
15
- inputName: 'travelCardNumber',
16
- value: e.target.value,
17
- }) })] }), (0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.input.question.title), isRequired: true, children: (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "question", description: t(PageText.Contact.input.question.info), value: state.context.question || '', onChange: (e) => send({
10
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.ticketing.travelCard.travelCardQuestion.label), children: (0, jsx_runtime_1.jsx)(components_1.Input, { id: "travelCardNumber", label: t(PageText.Contact.input.travelCardNumber.label), type: "text", name: "travelCardNumber", value: state.context.travelCardNumber || '', description: t(PageText.Contact.input.travelCardNumber.info), isRequired: true, errorMessage: state.context?.errorMessages['travelCardNumber']?.[0], onChange: (e) => send({
11
+ type: 'ON_INPUT_CHANGE',
12
+ inputName: 'travelCardNumber',
13
+ value: e.target.value,
14
+ }) }) }), (0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.input.question.title), isRequired: true, children: (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "question", description: t(PageText.Contact.input.question.info), value: state.context.question || '', onChange: (e) => send({
18
15
  type: 'ON_INPUT_CHANGE',
19
16
  inputName: 'question',
20
17
  value: e.target.value,
@@ -1 +1 @@
1
- {"version":3,"file":"webshopAccountForm.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/webshop/webshopAccountForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGnE,KAAK,uBAAuB,GAAG;IAC7B,KAAK,EAAE;QAAE,OAAO,EAAE,oBAAoB,CAAA;KAAE,CAAC;IACzC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,mBAAmB,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,kBAGhC,uBAAuB,gCAgIzB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"webshopAccountForm.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/webshop/webshopAccountForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGnE,KAAK,uBAAuB,GAAG;IAC7B,KAAK,EAAE;QAAE,OAAO,EAAE,oBAAoB,CAAA;KAAE,CAAC;IACzC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,mBAAmB,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,kBAGhC,uBAAuB,gCA8HzB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -28,9 +28,7 @@ const WebshopAccountForm = ({ state, send, }) => {
28
28
  type: 'ON_INPUT_CHANGE',
29
29
  inputName: 'customerNumber',
30
30
  value: e.target.value,
31
- }), modalContent: {
32
- description: t(PageText.Contact.input.customerNumber.description),
33
- } }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "firstName", label: t(PageText.Contact.input.firstName.label), type: "text", autoComplete: "given-name additional-name", name: "firstName", value: state.context.firstName || '', isRequired: true, errorMessage: state.context?.errorMessages['firstName']?.[0], onChange: (e) => send({
31
+ }), description: t(PageText.Contact.input.customerNumber.description) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "firstName", label: t(PageText.Contact.input.firstName.label), type: "text", autoComplete: "given-name additional-name", name: "firstName", value: state.context.firstName || '', isRequired: true, errorMessage: state.context?.errorMessages['firstName']?.[0], onChange: (e) => send({
34
32
  type: 'ON_INPUT_CHANGE',
35
33
  inputName: 'firstName',
36
34
  value: e.target.value,
@@ -1 +1 @@
1
- {"version":3,"file":"webshopTicketingForm.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/webshop/webshopTicketingForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGnE,KAAK,yBAAyB,GAAG;IAC/B,KAAK,EAAE;QAAE,OAAO,EAAE,oBAAoB,CAAA;KAAE,CAAC;IACzC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,mBAAmB,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,kBAGlC,yBAAyB,gCA4J3B,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"webshopTicketingForm.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/webshop/webshopTicketingForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGnE,KAAK,yBAAyB,GAAG;IAC/B,KAAK,EAAE;QAAE,OAAO,EAAE,oBAAoB,CAAA;KAAE,CAAC;IACzC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,mBAAmB,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,kBAGlC,yBAAyB,gCAoJ3B,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -7,10 +7,7 @@ const components_1 = require("../../../components");
7
7
  const WebshopTicketingForm = ({ state, send, }) => {
8
8
  const PageText = (0, translations_1.usePageText)();
9
9
  const { t } = (0, translations_1.useTranslation)();
10
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.ticketing.webshop.webshopTicketing.title), children: (0, jsx_runtime_1.jsx)(components_1.Input, { id: "orderId", label: t(PageText.Contact.input.orderId.label(false)), type: "text", name: "orderId", value: state.context.orderId || '', isRequired: true, modalContent: {
11
- description: t(PageText.Contact.input.orderId.description),
12
- bulletPoints: PageText.Contact.input.orderId.descriptionBulletPoints.map((bulletPoint) => t(bulletPoint)),
13
- }, errorMessage: state.context?.errorMessages['orderId']?.[0], onChange: (e) => send({
10
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.ticketing.webshop.webshopTicketing.title), children: (0, jsx_runtime_1.jsx)(components_1.Input, { id: "orderId", label: t(PageText.Contact.input.orderId.label(false)), type: "text", name: "orderId", value: state.context.orderId || '', isRequired: true, description: t(PageText.Contact.input.orderId.description), errorMessage: state.context?.errorMessages['orderId']?.[0], onChange: (e) => send({
14
11
  type: 'ON_INPUT_CHANGE',
15
12
  inputName: 'orderId',
16
13
  value: e.target.value,
@@ -35,9 +32,7 @@ const WebshopTicketingForm = ({ state, send, }) => {
35
32
  type: 'ON_INPUT_CHANGE',
36
33
  inputName: 'customerNumber',
37
34
  value: e.target.value,
38
- }), modalContent: {
39
- description: t(PageText.Contact.input.customerNumber.description),
40
- } }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "firstName", label: t(PageText.Contact.input.firstName.label), type: "text", autoComplete: "given-name additional-name", name: "firstName", isRequired: true, value: state.context.firstName || '', errorMessage: state.context?.errorMessages['firstName']?.[0], onChange: (e) => send({
35
+ }), description: t(PageText.Contact.input.customerNumber.description) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "firstName", label: t(PageText.Contact.input.firstName.label), type: "text", autoComplete: "given-name additional-name", name: "firstName", isRequired: true, value: state.context.firstName || '', errorMessage: state.context?.errorMessages['firstName']?.[0], onChange: (e) => send({
41
36
  type: 'ON_INPUT_CHANGE',
42
37
  inputName: 'firstName',
43
38
  value: e.target.value,
@@ -75,7 +75,7 @@ export declare function createTicketingStateMachine(onSubmit: (slug: FormSlug, s
75
75
  } | {
76
76
  type: "ON_INPUT_CHANGE";
77
77
  inputName: "address" | "attachments" | "bankAccountNumber" | "city" | "date" | "email" | "firstName" | "feedback" | "IBAN" | "lastName" | "phoneNumber" | "postalCode" | "SWIFT" | "toStop" | "fromStop" | "plannedDepartureTime" | "tripId";
78
- value: any;
78
+ value: unknown;
79
79
  } | {
80
80
  type: "ON_TRANSPORTMODE_CHANGE";
81
81
  value: import("../types").TransportModeType;
@@ -258,7 +258,7 @@ export declare const ticketingStateMachine: import("xstate").StateMachine<Ticket
258
258
  } | {
259
259
  type: "ON_INPUT_CHANGE";
260
260
  inputName: "address" | "attachments" | "bankAccountNumber" | "city" | "date" | "email" | "firstName" | "feedback" | "IBAN" | "lastName" | "phoneNumber" | "postalCode" | "SWIFT" | "toStop" | "fromStop" | "plannedDepartureTime" | "tripId";
261
- value: any;
261
+ value: unknown;
262
262
  } | {
263
263
  type: "ON_TRANSPORTMODE_CHANGE";
264
264
  value: import("../types").TransportModeType;
@@ -19,7 +19,7 @@ export type RichTranslatedString = TranslatedString & {
19
19
  export declare function translation(invariant: string): TranslatedString;
20
20
  export declare function translation(norwegian: string, english: string, nynorsk: string): TranslatedString;
21
21
  export declare function richTranslation(norwegian: string, english: string, nynorsk: string): RichTranslatedString;
22
- export declare function isTranslatedString(a: any): a is TranslatedString;
22
+ export declare function isTranslatedString(a: unknown): a is TranslatedString;
23
23
  export type LocalizedString = {
24
24
  lang: 'nob' | 'eng' | 'nno';
25
25
  value: string;
@@ -1 +1 @@
1
- {"version":3,"file":"commons.d.ts","sourceRoot":"","sources":["../../src/translations/commons.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,oBAAY,QAAQ;IAClB,SAAS,OAAO;IAChB,OAAO,UAAU;IACjB,OAAO,OAAO;CACf;AAED,eAAO,MAAM,YAAY,EAAE,SAAS,QAAQ,EAIlC,CAAC;AAEX,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AACnD,eAAO,MAAM,uBAAuB,OAAO,CAAC;AAC5C,eAAO,MAAM,iBAAiB,mBAAmB,CAAC;AAClD,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,OAAO,QAAQ,EAAE,MAAM,CAAC,CAAC;AAErE,MAAM,MAAM,iBAAiB,GAAG,CAC9B,IAAI,EAAE,gBAAgB,GAAG;IAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,CAAA;CAAE,KACjD,MAAM,CAAC;AAEZ,oEAAoE;AACp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GAAG;IAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,CAAA;CAAE,KACjD,MAAM,CAAC;AAEZ,oEAAoE;AACpE,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,GAAG;IACpD,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC;CACvB,CAAC;AAEF,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAAC;AACjE,wBAAgB,WAAW,CACzB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,gBAAgB,CAAC;AAapB,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,oBAAoB,CAEtB;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,gBAAgB,CAMpE;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,eAAe,EAAE,GAClC,MAAM,GAAG,SAAS,CASpB"}
@@ -30,7 +30,9 @@ function richTranslation(norwegian, english, nynorsk) {
30
30
  return translation(norwegian, english, nynorsk);
31
31
  }
32
32
  function isTranslatedString(a) {
33
- return typeof a[Language.Norwegian] !== 'undefined';
33
+ return (typeof a === 'object' &&
34
+ a !== null &&
35
+ typeof a[Language.Norwegian] !== 'undefined');
34
36
  }
35
37
  function convertLocalizedString(language, localizedStrings) {
36
38
  const messageLanguages = {
@@ -15,7 +15,7 @@ const translations_context_1 = require("./translations-context");
15
15
  function useTranslation() {
16
16
  const { t: rawT, language } = lobot_1.lobot.useTranslation();
17
17
  const fillTerms = (0, translations_context_1.useFillTerms)();
18
- const translateWithTerms = (text) => fillTerms(rawT(text));
18
+ const translateWithTerms = (text) => rawT(fillTerms(text));
19
19
  const t = translateWithTerms;
20
20
  const tRich = (text) => ((0, jsx_runtime_1.jsx)(rich_text_1.RichText, { children: translateWithTerms(text) }));
21
21
  return { t, tRich, language };
@@ -57,6 +57,9 @@ export declare const Contact: {
57
57
  refundCar: {
58
58
  label: import("../../translations/commons").TranslatedString;
59
59
  };
60
+ prePurchasedTicketRefund: {
61
+ label: import("../../translations/commons").TranslatedString;
62
+ };
60
63
  feedbackAttachmentLabel: import("../../translations/commons").TranslatedString;
61
64
  };
62
65
  ticketBoughtOnBus: {
@@ -118,6 +121,30 @@ export declare const Contact: {
118
121
  title: import("../../translations/commons").TranslatedString;
119
122
  };
120
123
  };
124
+ prePurchasedTicketRefund: {
125
+ info: import("../../translations/commons").TranslatedString;
126
+ aboutYourTicket: {
127
+ title: import("../../translations/commons").TranslatedString;
128
+ };
129
+ delayedDepartures: {
130
+ title: import("../../translations/commons").TranslatedString;
131
+ info: import("../../translations/commons").TranslatedString;
132
+ add: import("../../translations/commons").TranslatedString;
133
+ remove: import("../../translations/commons").TranslatedString;
134
+ removeLabel: import("../../translations/commons").TranslatedString;
135
+ columns: {
136
+ line: import("../../translations/commons").TranslatedString;
137
+ date: import("../../translations/commons").TranslatedString;
138
+ time: import("../../translations/commons").TranslatedString;
139
+ fromStop: import("../../translations/commons").TranslatedString;
140
+ toStop: import("../../translations/commons").TranslatedString;
141
+ };
142
+ errorMessages: {
143
+ tooFew: import("../../translations/commons").TranslatedString;
144
+ notWithinOneMonth: import("../../translations/commons").TranslatedString;
145
+ };
146
+ };
147
+ };
121
148
  refundOtherPublicTransport: {
122
149
  description: import("../../translations/commons").TranslatedString;
123
150
  };
@@ -279,12 +306,13 @@ export declare const Contact: {
279
306
  };
280
307
  lostAndFound: {
281
308
  title: import("../../translations/commons").TranslatedString;
282
- info: import("../../translations/commons").TranslatedString;
309
+ info: import("../../translations/commons").RichTranslatedString;
283
310
  about: {
284
311
  title: import("../../translations/commons").TranslatedString;
285
312
  };
286
313
  itemDescription: {
287
314
  title: import("../../translations/commons").TranslatedString;
315
+ description: import("../../translations/commons").TranslatedString;
288
316
  };
289
317
  contactInfo: {
290
318
  title: import("../../translations/commons").TranslatedString;
@@ -360,12 +388,14 @@ export declare const Contact: {
360
388
  };
361
389
  IBAN: {
362
390
  label: import("../../translations/commons").TranslatedString;
391
+ description: import("../../translations/commons").TranslatedString;
363
392
  errorMessages: {
364
393
  empty: import("../../translations/commons").TranslatedString;
365
394
  };
366
395
  };
367
396
  SWIFT: {
368
397
  label: import("../../translations/commons").TranslatedString;
398
+ description: import("../../translations/commons").TranslatedString;
369
399
  errorMessages: {
370
400
  empty: import("../../translations/commons").TranslatedString;
371
401
  };
@@ -494,7 +524,6 @@ export declare const Contact: {
494
524
  feeNumber: {
495
525
  label: import("../../translations/commons").TranslatedString;
496
526
  description: import("../../translations/commons").TranslatedString;
497
- instruction: import("../../translations/commons").TranslatedString;
498
527
  errorMessages: {
499
528
  empty: import("../../translations/commons").TranslatedString;
500
529
  invalidFormat: import("../../translations/commons").TranslatedString;
@@ -503,7 +532,6 @@ export declare const Contact: {
503
532
  invoiceNumber: {
504
533
  label: import("../../translations/commons").TranslatedString;
505
534
  description: import("../../translations/commons").TranslatedString;
506
- instruction: import("../../translations/commons").TranslatedString;
507
535
  errorMessages: {
508
536
  empty: import("../../translations/commons").TranslatedString;
509
537
  };
@@ -565,8 +593,6 @@ export declare const Contact: {
565
593
  orderId: {
566
594
  label: (expectsSingleOrderId: boolean) => import("../../translations/commons").TranslatedString;
567
595
  description: import("../../translations/commons").TranslatedString;
568
- descriptionBulletPoints: import("../../translations/commons").TranslatedString[];
569
- instruction: import("../../translations/commons").TranslatedString;
570
596
  errorMessages: {
571
597
  empty: import("../../translations/commons").TranslatedString;
572
598
  invalidFormat: {
@@ -633,10 +659,6 @@ export declare const Contact: {
633
659
  tooLarge: (fileName: string) => import("../../translations/commons").TranslatedString;
634
660
  };
635
661
  };
636
- modal: {
637
- moreInformation: (inputName: string) => import("../../translations/commons").TranslatedString;
638
- close: () => import("../../translations/commons").TranslatedString;
639
- };
640
662
  };
641
663
  };
642
664
  //# sourceMappingURL=contact.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"contact.d.ts","sourceRoot":"","sources":["../../../src/translations/pages/contact.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,IAAI,CAAC,EAEjB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,yBAAyB,EACzB,UAAU,EAEX,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAiwBG,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA8dlC,yBAAyB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0CAwPF,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAsHhC,UAAU,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCA2EM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71
71
  label: (0, commons_1.translation)('Jeg ønsker refusjon for bil', 'I would like refund for car', 'Eg ønsker refusjon for bil'),
72
72
  },
73
+ prePurchasedTicketRefund: {
74
+ label: (0, commons_1.translation)('Jeg ønsker refusjon av forhåndskjøpt hurtigbåtbillett', 'I would like a refund of a prepaid express boat ticket', 'Eg ønsker refusjon av forhåndskjøpt hurtigbåtbillett'),
75
+ },
73
76
  feedbackAttachmentLabel: (0, commons_1.translation)('Last opp vedlegg', 'Upload attachments', 'Last opp vedlegg'),
74
77
  },
75
78
  ticketBoughtOnBus: {
@@ -153,6 +156,30 @@ Restverdien blir betalt ut i slutten av kvar månad (med atterhald). Viss du har
153
156
  title: (0, commons_1.translation)('Om den planlagte reisen din', 'About your planned trip', 'Om den planagde reisa di'),
154
157
  },
155
158
  },
159
+ prePurchasedTicketRefund: {
160
+ info: (0, commons_1.translation)('Gjelder kun hurtigbåt. Har du periodebillett og har kommet forsinket frem fire eller flere ganger i løpet av én måned, kan du søke om delvis refusjon av billetten. Kun kompensasjon over 50 kroner blir utbetalt.', 'Applies to express boat only. If you have a period ticket and have arrived late four or more times within one month, you can apply for a partial refund of the ticket. Only compensation above NOK 50 is paid out.', 'Gjeld berre hurtigbåt. Har du periodebillett og har kome forseinka fram fire eller fleire gonger i løpet av éin månad, kan du søkje om delvis refusjon av billetten. Berre kompensasjon over 50 kroner blir utbetalt.'),
161
+ aboutYourTicket: {
162
+ title: (0, commons_1.translation)('Om billetten', 'About the ticket', 'Om billetten'),
163
+ },
164
+ delayedDepartures: {
165
+ title: (0, commons_1.translation)('Forsinkede avganger', 'Delayed departures', 'Forseinka avgangar'),
166
+ info: (0, commons_1.translation)('Legg til minst fire avganger der du kom forsinket frem. Alle avgangene må være innenfor én måned.', 'Add at least four departures where you arrived late. All departures must be within one month.', 'Legg til minst fire avgangar der du kom forseinka fram. Alle avgangane må vere innanfor éin månad.'),
167
+ add: (0, commons_1.translation)('Legg til avgang', 'Add departure', 'Legg til avgang'),
168
+ remove: (0, commons_1.translation)('Fjern avgang', 'Remove departure', 'Fjern avgang'),
169
+ removeLabel: (0, commons_1.translation)('Fjern', 'Remove', 'Fjern'),
170
+ columns: {
171
+ line: (0, commons_1.translation)('Linje', 'Line', 'Linje'),
172
+ date: (0, commons_1.translation)('Dato', 'Date', 'Dato'),
173
+ time: (0, commons_1.translation)('Avgang', 'Departure', 'Avgang'),
174
+ fromStop: (0, commons_1.translation)('Fra', 'From', 'Frå'),
175
+ toStop: (0, commons_1.translation)('Til', 'To', 'Til'),
176
+ },
177
+ errorMessages: {
178
+ tooFew: (0, commons_1.translation)('Du må legge til minst fire forsinkede avganger', 'You must add at least four delayed departures', 'Du må leggje til minst fire forseinka avgangar'),
179
+ notWithinOneMonth: (0, commons_1.translation)('Alle avgangene må være innenfor én måned', 'All departures must be within one month', 'Alle avgangane må vere innanfor éin månad'),
180
+ },
181
+ },
182
+ },
156
183
  refundOtherPublicTransport: {
157
184
  description: (0, commons_1.translation)('Jeg ønsker refusjon for annen kollektivtransport', 'I would like a refund for other public transport', 'Eg ønsker refusjon for annan kollektivtransport'),
158
185
  },
@@ -330,12 +357,13 @@ Restverdien blir betalt ut i slutten av kvar månad (med atterhald). Viss du har
330
357
  },
331
358
  lostAndFound: {
332
359
  title: (0, commons_1.translation)('Hittegods', 'Lost and found', 'Hittegods'),
333
- info: (0, commons_1.translation)('Vi har ikke et eget hittegods, men vi formidler gjerne din henvendelse videre til reisepersonalet og selskapet som var ansvarlig for reisen din. Fyll ut skjemaet, så tar de kontakt med deg direkte.', 'We do not have our own lost and found service, but we are happy to pass your enquiry on to the travel staff and company responsible for your journey. Fill in the form and they will contact you directly.', 'Vi har ikkje eit eige hittegods, men vi formidlar gjerne førespurnaden din vidare til reisepersonalet og selskapet som var ansvarleg for reisa di. Fyll ut skjemaet, så tek dei kontakt med deg direkte.'),
360
+ info: (0, commons_1.richTranslation)('Vi har ikke et eget hittegods, men vi formidler gjerne din henvendelse videre til reisepersonalet og selskapet som var ansvarlig for reisen din. Fyll ut skjemaet, så tar de kontakt med deg direkte.', 'We do not have our own lost and found service, but we are happy to pass your enquiry on to the travel staff and company responsible for your journey. Fill in the form and they will contact you directly.', 'Vi har ikkje eit eige hittegods, men vi formidlar gjerne førespurnaden din vidare til reisepersonalet og selskapet som var ansvarleg for reisa di. Fyll ut skjemaet, så tek dei kontakt med deg direkte.'),
334
361
  about: {
335
362
  title: (0, commons_1.translation)('Om reisen', 'About the journey', 'Om reisa'),
336
363
  },
337
364
  itemDescription: {
338
365
  title: (0, commons_1.translation)('Beskriv gjenstanden(e) du har mistet', 'Describe the item(s) you have lost', 'Beskriv gjenstanden(e) du har mist'),
366
+ description: (0, commons_1.translation)('Legg gjerne ved bilde, det gjør det lettere å finne og identifisere det du har mistet.', 'Feel free to attach a photo, it makes it easier to find and identify what you have lost.', 'Legg gjerne ved bilete, det gjer det lettare å finne og identifisere det du har mista.'),
339
367
  },
340
368
  contactInfo: {
341
369
  title: (0, commons_1.translation)('Kontaktinformasjon', 'Contact information', 'Kontaktinformasjon'),
@@ -411,12 +439,14 @@ Restverdien blir betalt ut i slutten av kvar månad (med atterhald). Viss du har
411
439
  },
412
440
  IBAN: {
413
441
  label: (0, commons_1.translation)('IBAN', 'IBAN', 'IBAN'),
442
+ description: (0, commons_1.translation)('Står i nettbanken og på kontoutskriften, eller spør banken din.', 'Shown in your online bank and on your bank statement, or ask your bank.', 'Står i nettbanken og på kontoutskrifta, eller spør banken din.'),
414
443
  errorMessages: {
415
444
  empty: (0, commons_1.translation)('Vennligst fyll ut ditt IBAN-nummer', 'Please provide your bank IBAN number', 'Vennligst fyll ut ditt IBAN-nummer'),
416
445
  },
417
446
  },
418
447
  SWIFT: {
419
448
  label: (0, commons_1.translation)('SWIFT ', 'SWIFT ', 'SWIFT '),
449
+ description: (0, commons_1.translation)('Bankens internasjonale kode (BIC), som står i nettbanken eller på bankens nettsider.', "Your bank's international code (BIC), shown in your online bank or on your bank's website.", 'Den internasjonale koden til banken (BIC), som står i nettbanken eller på nettsidene til banken.'),
420
450
  errorMessages: {
421
451
  empty: (0, commons_1.translation)('Vennligst fyll ut ditt SWIFT-nummer', 'Please provide your SWIFT number', 'Vennligst fyll ut ditt SWIFT-nummer'),
422
452
  },
@@ -555,8 +585,7 @@ Restverdien blir betalt ut i slutten av kvar månad (med atterhald). Viss du har
555
585
  },
556
586
  feeNumber: {
557
587
  label: (0, commons_1.translation)('Gebyrnummer', 'Fee number', 'Gebyrnummer'),
558
- description: (0, commons_1.translation)('Gebyrnummeret har 4 siffer. Du finner det øverst i høyre hjørne på gebyret', 'The fee number has 4 digits. You can find it in the top right corner of the fee', 'Gebyrnummert har 4 siffer. Du finn det øvst i høgre hjørne på gebyret'),
559
- instruction: (0, commons_1.translation)('Fyll ut gebyrnummeret ditt', 'Enter your fee number', 'Fyll ut gebyrnummeret ditt'),
588
+ description: (0, commons_1.translation)('Består av 4 siffer og står øverst i høyre hjørne på gebyret.', 'Consists of 4 digits and is in the top right corner of the fee.', 'Består av 4 siffer og står øvst i høgre hjørne på gebyret.'),
560
589
  errorMessages: {
561
590
  empty: (0, commons_1.translation)('Fyll ut gebyrnummeret ditt', 'Enter your fee number', 'Fyll ut gebyrnummeret ditt'),
562
591
  invalidFormat: (0, commons_1.translation)('Ugyldig gebyrnummer. Gebyrnummeret består av 4 siffer', 'Invalid fee number. The fee number consists of 4 digits', 'Ugyldig gebyrnummer. Gebyrnummeret består av 4 siffer'),
@@ -564,8 +593,7 @@ Restverdien blir betalt ut i slutten av kvar månad (med atterhald). Viss du har
564
593
  },
565
594
  invoiceNumber: {
566
595
  label: (0, commons_1.translation)('Fakturanummer', 'Invoice number', 'Fakturanummer'),
567
- description: (0, commons_1.translation)('Fakturanummeret finner du øverst i høyre hjørne på fakturaen.', 'The invoice number is found in the top right corner of the invoice.', 'Fakturanummeret finn du øvst i høgre hjørne på fakturaen.'),
568
- instruction: (0, commons_1.translation)('Fyll ut fakturanummeret ditt', 'Enter your invoice number', 'Fyll ut fakturanummeret ditt'),
596
+ description: (0, commons_1.translation)('Står øverst i høyre hjørne på fakturaen.', 'Shown in the top right corner of the invoice.', 'Står øvst i høgre hjørne på fakturaen.'),
569
597
  errorMessages: {
570
598
  empty: (0, commons_1.translation)('Fyll ut fakturanummeret ditt', 'Enter your invoice number', 'Fyll ut fakturanummeret ditt'),
571
599
  },
@@ -591,7 +619,7 @@ Restverdien blir betalt ut i slutten av kvar månad (med atterhald). Viss du har
591
619
  customerNumber: {
592
620
  label: (0, commons_1.translation)('Kundenummer', 'Customer number', 'Kundenummer'),
593
621
  labelOptional: (0, commons_1.translation)('Kundenummer - (valgfritt)', 'Customer number - (optional)', 'Kundenummer - (valfritt)'),
594
- description: (0, commons_1.translation)(`Kundenummeret består av 7 siffer og du finner det under Min bruker i ${terms_1.T.orgApp.definite}, eller i nettbutikken.`, `The customer number consists of 7 digits and can be found under My user in ${terms_1.T.orgApp.definite}, or in the webshop`, `Kundenummeret består av 7 siffer og du finn det under Min bruker i ${terms_1.T.orgApp.definite}, eller i nettbutikken.`),
622
+ description: (0, commons_1.translation)(`Består av 7 siffer og står under Min bruker i ${terms_1.T.orgApp.definite} eller i nettbutikken.`, `Consists of 7 digits and is shown under My user in ${terms_1.T.orgApp.definite} or in the webshop.`, `Består av 7 siffer og står under Min bruker i ${terms_1.T.orgApp.definite} eller i nettbutikken.`),
595
623
  errorMessages: {
596
624
  empty: (0, commons_1.translation)('Fyll inn kundenummer', 'Enter customer number', 'Fyll inn kundenummer'),
597
625
  invalidFormat: (0, commons_1.translation)('Ugyldig kundenummer. Skriv inn et gyldig kundenummer med 7 eller 8 siffer.', 'Invalid customer number. Please enter a valid 7 or 8-digit number.', 'Ugyldig kundenummer. Skriv inn eit gyldig kundenummer med 7 eller 8 siffer.'),
@@ -600,7 +628,7 @@ Restverdien blir betalt ut i slutten av kvar månad (med atterhald). Viss du har
600
628
  travelCardNumber: {
601
629
  labelRadioButton: (0, commons_1.translation)(terms_1.T.travelCard.Base, terms_1.T.travelCard.Base, terms_1.T.travelCard.Base),
602
630
  label: (0, commons_1.translation)(terms_1.T.travelCardNumber.Base, terms_1.T.travelCardNumber.Base, terms_1.T.travelCardNumber.Base),
603
- info: (0, commons_1.translation)(`Legg inn ${terms_1.T.travelCardNumber.definite} her hvis du allerede har ${terms_1.T.travelCard.indefinite}. ${terms_1.T.travelCardNumber.Definite} består av 9 siffer og du finner det på baksiden av ${terms_1.T.travelCard.definite} ditt`, `Enter ${terms_1.T.travelCardNumber.definite} here if you already have ${terms_1.T.travelCard.indefinite}. ${terms_1.T.travelCardNumber.Definite} consists of 9 digits and can be found on the back of your ${terms_1.T.travelCard.base}`, `Legg inn ${terms_1.T.travelCardNumber.definite} her viss du allereie har ${terms_1.T.travelCard.indefinite}. ${terms_1.T.travelCardNumber.Definite} består av 9 siffer, og du finn det bak på ${terms_1.T.travelCard.definite} ditt.`),
631
+ info: (0, commons_1.translation)(`Består av 9 siffer og står på baksiden av ${terms_1.T.travelCard.definite} ditt.`, `Consists of 9 digits and is on the back of your ${terms_1.T.travelCard.base}.`, `Består av 9 siffer og står bak på ${terms_1.T.travelCard.definite} ditt.`),
604
632
  errorMessages: {
605
633
  empty: (0, commons_1.translation)(`Legg til ${terms_1.T.travelCardNumber.base}`, `Enter ${terms_1.T.travelCardNumber.base}`, `Legg til ${terms_1.T.travelCardNumber.base}`),
606
634
  invalidFormat: (0, commons_1.translation)(`Ugyldig ${terms_1.T.travelCardNumber.base}. Skriv inn et gyldig ${terms_1.T.travelCardNumber.base} med 9 siffer.`, `Invalid ${terms_1.T.travelCardNumber.base}. Please enter a valid 9-digit number.`, `Ugyldig ${terms_1.T.travelCardNumber.base}. Skriv inn eit gyldig ${terms_1.T.travelCardNumber.base} med 9 siffer.`),
@@ -628,13 +656,7 @@ Restverdien blir betalt ut i slutten av kvar månad (med atterhald). Viss du har
628
656
  label: (expectsSingleOrderId) => expectsSingleOrderId
629
657
  ? (0, commons_1.translation)('Ordre-id', 'Order ID', 'Ordre-id')
630
658
  : (0, commons_1.translation)('Ordre-id(er)', 'Order ID(s)', 'Ordre-id(er)'),
631
- description: (0, commons_1.translation)('Hvis du vil ha hjelp med en billett du allerede har kjøpt, trenger vi å vite ordre-id. Ordre-id finner du følgende steder:', 'If you want help with a ticket you have already bought, we need to know the order ID. You can find the order ID in the following places:', 'Viss du vil ha hjelp med ein billett du allereie har kjøpt, treng vi å vite ordre-id. Ordre-id finn du følgende stadar:'),
632
- descriptionBulletPoints: [
633
- (0, commons_1.translation)(`På billetten i ${terms_1.T.orgApp.definite}.`, `On the ticket in ${terms_1.T.orgApp.definite}.`, `På billetten i ${terms_1.T.orgApp.definite}.`),
634
- (0, commons_1.translation)('På kvitteringen din.', 'On your receipt.', 'På kvitteringa di.'),
635
- (0, commons_1.translation)('Du finner også ordre-id på utgåtte billetter.', 'You can also find the order ID on expired tickets.', 'Du finn også ordre-id på utgåtte billettar.'),
636
- ],
637
- instruction: (0, commons_1.translation)(`Gjelder forespørselen flere billetter, send ordre-id for alle billettene, separert med komma (' , ').`, `If the request applies to several tickets, send the order ID for all the tickets, separated by commas (' , ').`, `Gjeld førespurnaden flere billettar, send ordre-id for alle billettane, separert med komma (' , ').`),
659
+ description: (0, commons_1.translation)(`Står på billetten i ${terms_1.T.orgApp.definite} og på kvitteringen, også for utgåtte billetter. Gjelder det flere billetter, skriv alle separert med komma.`, `Shown on the ticket in ${terms_1.T.orgApp.definite} and on your receipt, also for expired tickets. For several tickets, enter all of them separated by commas.`, `Står på billetten i ${terms_1.T.orgApp.definite} og på kvitteringa, også for utgåtte billettar. Gjeld det fleire billettar, skriv alle separert med komma.`),
638
660
  errorMessages: {
639
661
  empty: (0, commons_1.translation)('Ordre-id mangler', 'Order-id is missing', 'Ordre-id manglar'),
640
662
  invalidFormat: {
@@ -710,9 +732,5 @@ Restverdien blir betalt ut i slutten av kvar månad (med atterhald). Viss du har
710
732
  tooLarge: (fileName) => (0, commons_1.translation)(`Filen "${fileName}" er for stor. Maks 5 MB`, `The file "${fileName}" is too large. Max 5 MB`, `Fila "${fileName}" er for stor. Maks 5 MB`),
711
733
  },
712
734
  },
713
- modal: {
714
- moreInformation: (inputName) => (0, commons_1.translation)(`Mer informasjon om ${inputName}`, `More information about ${inputName}`, `Meir informasjon om ${inputName}`),
715
- close: () => (0, commons_1.translation)(`Klikk for å lukke informasjonsboksen`, `Click to close the information box`, `Klikk for å lukke informasjonsboksen`),
716
- },
717
735
  },
718
736
  };
@@ -1,6 +1,8 @@
1
1
  import type { ContactFormTranslationsOverride } from './types';
2
2
  import { mergeTranslationOverrides } from './merge-overrides';
3
3
  import * as PageText from './pages';
4
+ import { type TranslatedString } from './commons';
5
+ import { type Terms } from './terms';
4
6
  type MergedTranslations = ReturnType<typeof mergeTranslationOverrides>;
5
7
  export declare function TranslationsProvider({ overrides, children, }: {
6
8
  overrides: ContactFormTranslationsOverride;
@@ -9,10 +11,15 @@ export declare function TranslationsProvider({ overrides, children, }: {
9
11
  export declare function useMergedTranslations(): MergedTranslations;
10
12
  export declare function usePageText(): typeof PageText;
11
13
  /**
12
- * Returns a function that fills `{group.form}` term placeholders in translated
13
- * text. A capitalized form (`Definite`) uses the org's `capitalized` value, or
14
- * else upper-cases the first letter. Unknown placeholders are kept.
14
+ * Fills `{group.form}` term placeholders in every language of `text`. A
15
+ * capitalized form (`Definite`) uses the org's `capitalized` value, or else
16
+ * upper-cases the first letter. Unknown placeholders are kept.
15
17
  */
16
- export declare function useFillTerms(): (text: string) => string;
18
+ export declare function fillTerms(text: TranslatedString, terms: Terms): TranslatedString;
19
+ /**
20
+ * `fillTerms` bound to the org's terms, or the defaults outside a
21
+ * `TranslationsProvider`.
22
+ */
23
+ export declare function useFillTerms(): (text: TranslatedString) => TranslatedString;
17
24
  export {};
18
25
  //# sourceMappingURL=translations-context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"translations-context.d.ts","sourceRoot":"","sources":["../../src/translations/translations-context.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,+BAA+B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gB,EACtB,KAAK,EAAE,KAAK,GACX,gBAAgB,CAqBlB;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,CAAC,IAAI,EAAE,gBAAgB,KAAK,gBAAgB,CAI3E"}
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.TranslationsProvider = TranslationsProvider;
37
37
  exports.useMergedTranslations = useMergedTranslations;
38
38
  exports.usePageText = usePageText;
39
+ exports.fillTerms = fillTerms;
39
40
  exports.useFillTerms = useFillTerms;
40
41
  const jsx_runtime_1 = require("react/jsx-runtime");
41
42
  const react_1 = require("react");
@@ -43,7 +44,6 @@ const merge_overrides_1 = require("./merge-overrides");
43
44
  const PageText = __importStar(require("./pages"));
44
45
  const commons_1 = require("./commons");
45
46
  const terms_1 = require("./terms");
46
- const lobot_1 = require("./lobot");
47
47
  const TranslationsContext = (0, react_1.createContext)(null);
48
48
  function TranslationsProvider({ overrides, children, }) {
49
49
  const merged = (0, react_1.useMemo)(() => (0, merge_overrides_1.mergeTranslationOverrides)(overrides), [overrides]);
@@ -62,23 +62,30 @@ function usePageText() {
62
62
  return context ? context.PageText : PageText;
63
63
  }
64
64
  /**
65
- * Returns a function that fills `{group.form}` term placeholders in translated
66
- * text. A capitalized form (`Definite`) uses the org's `capitalized` value, or
67
- * else upper-cases the first letter. Unknown placeholders are kept.
65
+ * Fills `{group.form}` term placeholders in every language of `text`. A
66
+ * capitalized form (`Definite`) uses the org's `capitalized` value, or else
67
+ * upper-cases the first letter. Unknown placeholders are kept.
68
68
  */
69
- function useFillTerms() {
70
- const context = (0, react_1.useContext)(TranslationsContext);
71
- const { t } = lobot_1.lobot.useTranslation();
72
- const terms = context ? context.terms : terms_1.defaultTerms;
73
- return (text) => text.replace(terms_1.TERM_PLACEHOLDER, (match, group, form) => {
69
+ function fillTerms(text, terms) {
70
+ const fill = (lang) => text[lang].replace(terms_1.TERM_PLACEHOLDER, (match, group, form) => {
74
71
  const forms = terms[group];
75
72
  const lowerForm = form.charAt(0).toLowerCase() + form.slice(1);
76
73
  const value = forms?.[lowerForm];
77
74
  if (!forms || !value || !(0, commons_1.isTranslatedString)(value))
78
75
  return match;
79
76
  if (form === lowerForm)
80
- return t(value);
77
+ return value[lang];
81
78
  const capitalized = forms.capitalized?.[lowerForm];
82
- return capitalized ? t(capitalized) : (0, terms_1.capitalize)(t(value));
79
+ return capitalized ? capitalized[lang] : (0, terms_1.capitalize)(value[lang]);
83
80
  });
81
+ return (0, commons_1.translation)(fill(commons_1.Language.Norwegian), fill(commons_1.Language.English), fill(commons_1.Language.Nynorsk));
82
+ }
83
+ /**
84
+ * `fillTerms` bound to the org's terms, or the defaults outside a
85
+ * `TranslationsProvider`.
86
+ */
87
+ function useFillTerms() {
88
+ const context = (0, react_1.useContext)(TranslationsContext);
89
+ const terms = context ? context.terms : terms_1.defaultTerms;
90
+ return (text) => fillTerms(text, terms);
84
91
  }
@@ -70,6 +70,14 @@ export interface RefundSubmitPayload {
70
70
  travelCardNumber?: string;
71
71
  refundReason?: string;
72
72
  purchasePlatform?: string;
73
+ delayedDepartures?: {
74
+ line?: string;
75
+ fromStop: string;
76
+ toStop: string;
77
+ date: string;
78
+ plannedDepartureTime: string;
79
+ tripId?: string;
80
+ }[];
73
81
  attachments?: {
74
82
  filename: string;
75
83
  body: string;
@@ -147,5 +155,9 @@ export interface LostPropertySubmitPayload {
147
155
  lastName?: string;
148
156
  email?: string;
149
157
  phoneNumber?: string;
158
+ attachments?: {
159
+ filename: string;
160
+ body: string;
161
+ }[];
150
162
  }
151
163
  //# sourceMappingURL=submit-payloads.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"submit-payloads.d.ts","sourceRoot":"","sources":["../../src/types/submit-payloads.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,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AAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACpD"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Renders a translated string with `[text](href)` as links opening in a new
3
- * tab and `**text**` as bold. A blank line (`\n\n`) starts a new paragraph,
4
- * a single `\n` is a line break.
3
+ * tab (except `mailto:`/`tel:`) and `**text**` as bold. A blank line (`\n\n`)
4
+ * starts a new paragraph, a single `\n` is a line break.
5
5
  */
6
6
  export declare function RichText({ children }: {
7
7
  children: string;
@@ -10,8 +10,8 @@ const typography_1 = require("../components/typography");
10
10
  const rich_text_module_css_1 = __importDefault(require("./rich-text.module.css"));
11
11
  /**
12
12
  * Renders a translated string with `[text](href)` as links opening in a new
13
- * tab and `**text**` as bold. A blank line (`\n\n`) starts a new paragraph,
14
- * a single `\n` is a line break.
13
+ * tab (except `mailto:`/`tel:`) and `**text**` as bold. A blank line (`\n\n`)
14
+ * starts a new paragraph, a single `\n` is a line break.
15
15
  */
16
16
  function RichText({ children }) {
17
17
  return ((0, jsx_runtime_1.jsx)("div", { className: rich_text_module_css_1.default.richText, children: children
@@ -19,13 +19,18 @@ function RichText({ children }) {
19
19
  .filter((paragraph) => paragraph.trim())
20
20
  .map((paragraph, index) => ((0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: paragraph.split('\n').map((line, lineIndex) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [lineIndex > 0 && (0, jsx_runtime_1.jsx)("br", {}), renderInline(line)] }, lineIndex))) }, index))) }));
21
21
  }
22
+ // mailto:/tel: links open an app, not a page, so they skip the new tab.
23
+ const PROTOCOL_LINK = /^(mailto|tel):/;
22
24
  const MARKDOWN = /\[([^\]]+)]\(([^)\s]+)\)|\*\*(.+?)\*\*/g;
23
25
  function renderInline(text) {
24
26
  const nodes = [];
25
27
  let textStart = 0;
26
28
  for (const match of text.matchAll(MARKDOWN)) {
27
29
  const [markdown, linkText, href, boldText] = match;
28
- nodes.push(text.slice(textStart, match.index), boldText !== undefined ? ((0, jsx_runtime_1.jsx)(typography_1.Typo.span, { textType: "body__m__strong", children: boldText }, match.index)) : ((0, jsx_runtime_1.jsx)("a", { href: href, target: "_blank", rel: "noopener noreferrer", children: linkText }, match.index)));
30
+ nodes.push(text.slice(textStart, match.index), boldText !== undefined ? ((0, jsx_runtime_1.jsx)(typography_1.Typo.span, { textType: "body__m__strong", children: boldText }, match.index)) : ((0, jsx_runtime_1.jsx)("a", { href: href, ...(!PROTOCOL_LINK.test(href) && {
31
+ target: '_blank',
32
+ rel: 'noopener noreferrer',
33
+ }), children: linkText }, match.index)));
29
34
  textStart = match.index + markdown.length;
30
35
  }
31
36
  nodes.push(text.slice(textStart));