<?php
/**
 * PS_Label_Terms — kanoniczny tekst regulaminu + wersja + md5.
 *
 * Polityka: SPEC/11_CONSENT_AND_TERMS.md sekcja 6 (kanoniczny tekst v1.0).
 * Single Responsibility: TYLKO przechowuje tekst + version + md5. Brak innej logiki.
 *
 * @package ParcelSelectorFree
 */

defined( 'ABSPATH' ) || exit;

final class Parcselect_Label_Terms {

	const TERMS_VERSION = '1.0';

	public static function init() {}

	/**
	 * Kanoniczny tekst Mini-Regulaminu Etykietownika v1.0.
	 * Każda zmiana wymaga bumpa TERMS_VERSION i wymusza re-akceptację.
	 *
	 * @return string
	 */
	public static function canonical_text() {
		ob_start();
		?>
Mini Terms of Service of the Label Tool (Parcel Selector / WP Plugin)

1. Nature of the service

The label tool is a utility that allows a shipping label to be generated based on
the data provided by the user. The service consists solely of generating the label —
it does not constitute a transport service or a guarantee of parcel delivery.

2. Data processing

The user data (including sender data, recipient data, parcel parameters) is processed
solely for the purpose of generating the label and processing the payment. The data is
transferred to an external system: ParcelSelector.com only after the explicit consent of
the user has been obtained. The data is not sent or processed before the consent checkbox
is selected. Processing is carried out in line with the data minimization principle.

3. User consent requirement

Sending any data to the API and starting the label generation process is only possible
after:
- selecting the "I accept" checkbox,
- confirming that the terms have been read,
- granting consent to transfer the data to an external system.

4. Payments and refunds

The user accepts that:
- the fee for generating a label is non-refundable, regardless of whether it is used,
- a refund is not available in the case of incorrect data being provided,
- the fee covers generating the label, not carrying out the delivery.

5. Liability

ParcelSelector.com is a software (SaaS) provider and is not a logistics operator.
ParcelSelector.com is not responsible for:
- delivery of the parcel,
- delays, loss or damage of the parcel,
- the actions of logistics operators.

ParcelSelector.com does not act as an arbiter in disputes regarding parcels.

6. Compliance with carrier terms

The user declares that:
- they have read the terms of the carrier InPost,
- the parcel complies with the applicable rules and restrictions,
- they are responsible for the contents and correctness of the parcel data.

7. Required acceptance (checkbox)

Before a label is generated, the user must confirm:
- acceptance of these terms,
- consent to the processing of the data and its transfer to ParcelSelector.com,
- that they have read the terms of:
  - ParcelSelector Terms: https://parcelselector.com/en/parcelselector-konstytucja
  - InPost Terms: https://inpost.pl/regulaminy

8. Final provisions

Lack of acceptance of the terms makes it impossible to use the label tool functionality.
		<?php
		return trim( ob_get_clean() );
	}

	/**
	 * @return string md5 kanonicznego tekstu (do version-track)
	 */
	public static function canonical_md5() {
		return md5( self::canonical_text() );
	}

	/**
	 * @return string aktualna wersja regulaminu
	 */
	public static function version() {
		return self::TERMS_VERSION;
	}

	/**
	 * Linki do pełnych regulaminów (dla stage 1 render).
	 *
	 * @return array
	 */
	public static function links() {
		return array(
			'parcelselector' => 'https://parcelselector.com/en/parcelselector-konstytucja',
			'inpost'         => 'https://inpost.pl/regulaminy',
		);
	}
}
