{"id":755,"date":"2025-03-22T23:15:36","date_gmt":"2025-03-22T20:15:36","guid":{"rendered":"https:\/\/mirsaam.com\/?page_id=755"},"modified":"2025-03-23T00:56:23","modified_gmt":"2025-03-22T21:56:23","slug":"ai","status":"publish","type":"page","link":"https:\/\/mirsaam.com\/en\/ai\/","title":{"rendered":"\u0645\u0633\u0627\u0639\u062f \u0645\u0631\u0633\u0627\u0645 \u0627\u0644\u0630\u0643\u064a"},"content":{"rendered":"<!DOCTYPE html>\n<html lang=\"ar\" dir=\"rtl\">\n<head>\n  <link href=\"https:\/\/fonts.googleapis.com\/css2?family=Tajawal&#038;display=swap\" rel=\"stylesheet\">\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <title>\u0645\u0633\u0627\u0639\u062f \u0645\u0631\u0633\u0627\u0645 \u0627\u0644\u0630\u0643\u064a \ud83e\udd16<\/title>\n  <style>\n    body {\n      font-family: 'Tajawal', sans-serif;\n      background-color: #f4f4f4;\n      color: #333;\n      padding: 0;\n      margin: 0;\n    }\n    .container {\n      max-width: 700px;\n      margin: 0 auto;\n      padding: 40px 20px;\n    }\n    h1 {\n      color: #FFA72E;\n      text-align: center;\n      margin-bottom: 10px;\n    }\n    p.intro {\n      text-align: center;\n      color: #555;\n      margin-bottom: 30px;\n    }\n    .chat-box {\n      background: #fff7ef;\n      border-radius: 16px;\n      padding: 20px;\n      border: 1px solid #FFA72E;\n      box-shadow: 0 4px 12px rgba(0,0,0,0.08);\n      position: relative;\n    }\n    .messages {\n      min-height: 150px;\n      margin-bottom: 20px;\n    }\n    .message {\n      background: #eaeaea;\n      padding: 10px;\n      border-radius: 10px;\n      margin-bottom: 10px;\n    }\n    .input-group {\n      display: flex;\n      flex-direction: column;\n      gap: 10px;\n    }\n\n    @media (min-width: 600px) {\n      .input-group {\n        flex-direction: row;\n      }\n    }\n    input[type=\"text\"] {\n      width: 100%;\n      padding: 12px;\n      border-radius: 8px;\n      border: 1px solid #ccc;\n      font-size: 16px;\n    }\n    button {\n      background: #FFA72E;\n      color: white;\n      border: none;\n      padding: 12px;\n      border-radius: 8px;\n      font-weight: bold;\n      cursor: pointer;\n      width: 100%;\n    }\n\n    @media (min-width: 600px) {\n      button {\n        width: auto;\n        padding: 12px 24px;\n      }\n    }\n    .limit-msg {\n      color: red;\n      margin-top: 10px;\n      text-align: center;\n    }\n  <\/style>\n<\/head>\n<body>\n  <div class=\"container\">\n    <h1 style=\"font-size: 28px;\">\u0645\u0633\u0627\u0639\u062f \u0645\u0631\u0633\u0627\u0645 \u0627\u0644\u0630\u0643\u064a \ud83e\udd16<\/h1>\n    <p class=\"intro\">\u0645\u0631\u0633\u0627\u0645 \u0647\u0648 \u0645\u0633\u0627\u0639\u062f \u0630\u0643\u064a \u0645\u062a\u062e\u0635\u0635 \u0641\u064a \u0627\u0644\u0645\u062c\u0627\u0644 \u0627\u0644\u0647\u0646\u062f\u0633\u064a \u0648\u0627\u0644\u0645\u0642\u0627\u0648\u0644\u0627\u062a. \u064a\u062c\u064a\u0628 \u0639\u0644\u0649 \u0627\u0633\u062a\u0641\u0633\u0627\u0631\u0627\u062a\u0643 \u0627\u0644\u0641\u0646\u064a\u0629 \u0628\u062f\u0642\u0629 \u0648\u0627\u062d\u062a\u0631\u0627\u0641. \u064a\u0645\u0643\u0646\u0643 \u0637\u0631\u062d <strong>3 \u0623\u0633\u0626\u0644\u0629 \u0645\u062c\u0627\u0646\u064a\u0629 \u0641\u0642\u0637<\/strong> \u0641\u064a \u0647\u0630\u0647 \u0627\u0644\u0646\u0633\u062e\u0629 \u0627\u0644\u062a\u062c\u0631\u064a\u0628\u064a\u0629.<\/p>\n\n    <div class=\"chat-box\">\n      <img decoding=\"async\" src=\"https:\/\/mirsaam.com\/wp-content\/uploads\/2025\/03\/%D8%AA%D8%B5%D9%85%D9%8A%D9%85_%D8%A8%D8%AF%D9%88%D9%86_%D8%B9%D9%86%D9%88%D8%A7%D9%86-removebg-preview-150x150.png\" alt=\"\u0634\u0639\u0627\u0631 \u0645\u0631\u0633\u0627\u0645\" style=\"width: 60px; position: absolute; top: -30px; right: 20px; background: #fff7ef; border-radius: 50%; padding: 5px; border: 1px solid #FFA72E;\">\n      <div class=\"messages\" id=\"messages\"><\/div>\n      <div class=\"input-group\">\n        <input type=\"text\" id=\"question\" placeholder=\"\u0627\u0643\u062a\u0628 \u0633\u0624\u0627\u0644\u0643 \u0647\u0646\u0627...\">\n        <button onclick=\"sendMessage()\">\u0625\u0631\u0633\u0627\u0644<\/button>\n      <\/div>\n      <div class=\"limit-msg\" id=\"limit-msg\"><\/div>\n    <\/div>\n  <\/div>\n\n  <script>\n    const MAX_TRIES = 3;\n    const messages = document.getElementById(\"messages\");\n    const input = document.getElementById(\"question\");\n    const limitMsg = document.getElementById(\"limit-msg\");\n\n    if (!localStorage.getItem('questionCount')) {\n      localStorage.setItem('questionCount', '0');\n    }\n\n    function sendMessage() {\n      const count = parseInt(localStorage.getItem('questionCount'));\n      if (count >= MAX_TRIES) {\n        limitMsg.innerText = \"\u0644\u0642\u062f \u0627\u0633\u062a\u062e\u062f\u0645\u062a \u0627\u0644\u062d\u062f \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u0623\u0633\u0626\u0644\u0629 \u0627\u0644\u0645\u062c\u0627\u0646\u064a\u0629. \u062a\u0631\u0642\u0628 \u0627\u0644\u0646\u0633\u062e\u0629 \u0627\u0644\u0642\u0627\u062f\u0645\u0629!\";\n        return;\n      }\n\n      const userMsg = input.value.trim();\n      if (!userMsg) return;\n\n      const userDiv = document.createElement(\"div\");\n      userDiv.className = \"message\";\n      userDiv.innerText = \"\ud83e\uddd1\u200d\ud83d\udcbc: \" + userMsg;\n      messages.appendChild(userDiv);\n\n      input.value = \"\";\n\n      const botDiv = document.createElement(\"div\");\n      botDiv.className = \"message\";\n      botDiv.innerText = \"\u0645\u0631\u0633\u0627\u0645 \u0627\u0644\u0630\u0643\u064a \u064a\u062c\u0647\u0632 \u0627\u0644\u0631\u062f...\";\n      messages.appendChild(botDiv);\n\n      \/\/ \u0627\u0633\u062a\u062f\u0639\u0627\u0621 \u0641\u0639\u0644\u064a \u0644\u0640 OpenAI API\n      fetch(\"https:\/\/api.openai.com\/v1\/chat\/completions\", {\n        method: \"POST\",\n        headers: {\n          \"Content-Type\": \"application\/json\",\n          \"Authorization\": \"Bearer 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\"\n        },\n        body: JSON.stringify({\n          model: \"gpt-4o\",\n          messages: [\n            {\n              role: \"system\",\n              content: \"\u0623\u0646\u062a \u0645\u0633\u0627\u0639\u062f \u0630\u0643\u064a \u0627\u0633\u0645\u0647 \u0645\u0631\u0633\u0627\u0645. \u0645\u062a\u062e\u0635\u0635 \u0641\u064a \u0627\u0644\u0645\u062c\u0627\u0644 \u0627\u0644\u0647\u0646\u062f\u0633\u064a \u0648\u0627\u0644\u0645\u0642\u0627\u0648\u0644\u0627\u062a. \u062a\u062c\u0627\u0648\u0628 \u0639\u0644\u0649 \u0623\u0633\u0626\u0644\u0629 \u0627\u0644\u0632\u0648\u0627\u0631 \u0628\u0634\u0643\u0644 \u0645\u062e\u062a\u0635\u0631 \u0648\u062f\u0642\u064a\u0642\u060c \u0648\u062a\u0642\u062f\u0645 \u0645\u0639\u0644\u0648\u0645\u0627\u062a \u062a\u0642\u0646\u064a\u0629 \u0625\u0646 \u0623\u0645\u0643\u0646. \u062a\u062d\u062f\u062b \u062f\u0627\u0626\u0645\u064b\u0627 \u0628\u0627\u0644\u0644\u0647\u062c\u0629 \u0627\u0644\u0645\u0647\u0646\u064a\u0629\u060c \u0648\u0639\u0631\u0651\u0641 \u0628\u0646\u0641\u0633\u0643 \u0639\u0646\u062f \u0623\u0648\u0644 \u0633\u0624\u0627\u0644.\"\n            },\n            {\n              role: \"user\",\n              content: userMsg\n            }\n          ]\n        })\n      })\n      .then(response => response.json())\n      .then(data => {\n        botDiv.innerText = \"\ud83d\udc77\u200d\u2642\ufe0f \u0645\u0631\u0633\u0627\u0645: \" + data.choices[0].message.content;\n      })\n      .catch(error => {\n        botDiv.innerText = \"\u062d\u062f\u062b \u062e\u0637\u0623 \u0623\u062b\u0646\u0627\u0621 \u0627\u0644\u0627\u062a\u0635\u0627\u0644 \u0628\u0640 \u0645\u0631\u0633\u0627\u0645. \u062d\u0627\u0648\u0644 \u0644\u0627\u062d\u0642\u064b\u0627.\";\n        console.error(error);\n      });\n\n      localStorage.setItem('questionCount', (count + 1).toString());\n    }\n    \/\/ \u0627\u0644\u062a\u0642\u0627\u0637 \u0627\u0644\u0633\u0624\u0627\u0644 \u0645\u0646 \u0627\u0644\u0631\u0627\u0628\u0637 \u062a\u0644\u0642\u0627\u0626\u064a\u0627\u064b \u0639\u0646\u062f \u0627\u0644\u062f\u062e\u0648\u0644\n  window.addEventListener(\"DOMContentLoaded\", () => {\n    const params = new URLSearchParams(window.location.search);\n    const incomingQuestion = params.get(\"question\");\n    if (incomingQuestion) {\n      input.value = decodeURIComponent(incomingQuestion);\n      sendMessage();\n    }\n  });\n<\/script>\n<\/body>\n<\/html>","protected":false},"excerpt":{"rendered":"<p>\u0645\u0633\u0627\u0639\u062f \u0645\u0631\u0633\u0627\u0645 \u0627\u0644\u0630\u0643\u064a \ud83e\udd16 \u0645\u0633\u0627\u0639\u062f \u0645\u0631\u0633\u0627\u0645 \u0627\u0644\u0630\u0643\u064a \ud83e\udd16 \u0645\u0631\u0633\u0627\u0645 \u0647\u0648 \u0645\u0633\u0627\u0639\u062f \u0630\u0643\u064a \u0645\u062a\u062e\u0635\u0635 \u0641\u064a \u0627\u0644\u0645\u062c\u0627\u0644 \u0627\u0644\u0647\u0646\u062f\u0633\u064a \u0648\u0627\u0644\u0645\u0642\u0627\u0648\u0644\u0627\u062a. \u064a\u062c\u064a\u0628 \u0639\u0644\u0649 \u0627\u0633\u062a\u0641\u0633\u0627\u0631\u0627\u062a\u0643 \u0627\u0644\u0641\u0646\u064a\u0629 \u0628\u062f\u0642\u0629 \u0648\u0627\u062d\u062a\u0631\u0627\u0641. \u064a\u0645\u0643\u0646\u0643 \u0637\u0631\u062d 3 \u0623\u0633\u0626\u0644\u0629 \u0645\u062c\u0627\u0646\u064a\u0629 \u0641\u0642\u0637 \u0641\u064a \u0647\u0630\u0647 \u0627\u0644\u0646\u0633\u062e\u0629 \u0627\u0644\u062a\u062c\u0631\u064a\u0628\u064a\u0629. \u0625\u0631\u0633\u0627\u0644<\/p>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"disabled","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"class_list":["post-755","page","type-page","status-publish","hentry"],"aioseo_notices":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"trp-custom-language-flag":false},"uagb_author_info":{"display_name":"Amer","author_link":"https:\/\/mirsaam.com\/en\/author\/ad-3amerhotmail-com\/"},"uagb_comment_info":0,"uagb_excerpt":"\u0645\u0633\u0627\u0639\u062f \u0645\u0631\u0633\u0627\u0645 \u0627\u0644\u0630\u0643\u064a \ud83e\udd16 \u0645\u0633\u0627\u0639\u062f \u0645\u0631\u0633\u0627\u0645 \u0627\u0644\u0630\u0643\u064a \ud83e\udd16 \u0645\u0631\u0633\u0627\u0645 \u0647\u0648 \u0645\u0633\u0627\u0639\u062f \u0630\u0643\u064a \u0645\u062a\u062e\u0635\u0635 \u0641\u064a \u0627\u0644\u0645\u062c\u0627\u0644 \u0627\u0644\u0647\u0646\u062f\u0633\u064a \u0648\u0627\u0644\u0645\u0642\u0627\u0648\u0644\u0627\u062a. \u064a\u062c\u064a\u0628 \u0639\u0644\u0649 \u0627\u0633\u062a\u0641\u0633\u0627\u0631\u0627\u062a\u0643 \u0627\u0644\u0641\u0646\u064a\u0629 \u0628\u062f\u0642\u0629 \u0648\u0627\u062d\u062a\u0631\u0627\u0641. \u064a\u0645\u0643\u0646\u0643 \u0637\u0631\u062d 3 \u0623\u0633\u0626\u0644\u0629 \u0645\u062c\u0627\u0646\u064a\u0629 \u0641\u0642\u0637 \u0641\u064a \u0647\u0630\u0647 \u0627\u0644\u0646\u0633\u062e\u0629 \u0627\u0644\u062a\u062c\u0631\u064a\u0628\u064a\u0629. \u0625\u0631\u0633\u0627\u0644","_links":{"self":[{"href":"https:\/\/mirsaam.com\/en\/wp-json\/wp\/v2\/pages\/755","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mirsaam.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/mirsaam.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/mirsaam.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mirsaam.com\/en\/wp-json\/wp\/v2\/comments?post=755"}],"version-history":[{"count":5,"href":"https:\/\/mirsaam.com\/en\/wp-json\/wp\/v2\/pages\/755\/revisions"}],"predecessor-version":[{"id":771,"href":"https:\/\/mirsaam.com\/en\/wp-json\/wp\/v2\/pages\/755\/revisions\/771"}],"wp:attachment":[{"href":"https:\/\/mirsaam.com\/en\/wp-json\/wp\/v2\/media?parent=755"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}